A signature from Gov. Charlie Baker is all that remains required before drivers will be told to put down their cellphones or any other electronic devices while behind the wheel.

The Senate took the final vote necessary to pass the compromise distracted driving bill (H 4203) Wednesday, and as in the House, only one member voted in opposition, saying the bill's provisions around data collection and racial profiling do not go far enough. The Senate voted 38-1 with Sen. Becca Rausch of Needham casting the lone dissenting vote.

"These deaths are preventable. Too many on our roadways have already perished at the hands of distracted drivers. Too many parents have lost children and too many children have lost parents," Transportation Committee Co-chairman Sen. Joseph Boncore, the Senate's lead negotiator, said. "The phone does not need to be nor should it ever be in your hands when you're operating a motor vehicle."

Sen. Mark Montigny, who has filed legislation related to device use while driving in each session for more than a decade, said the conference report is not perfect but is "a damn good product."

"Today is cause for, not celebration, but relief perhaps," he said as he recalled victims of distracted driving crashes and their families that have lobbied on behalf of distracted driving legislation. "We agreed on the substance of the hands-free issue and that doing anything less than taking the device out of the hands of the driver is not only deadly but it shirks our responsibility in this body."

The bill, which mirrors laws in place in many other states, took years to come together after the state imposed a texting-while-driving ban that many have decried as unenforceable and ineffective.

"Nine years ago we banned texting while driving in an effort to curb dangerous and deadly behavior on the road. But we didn't go far enough and today we rectify that," Sen. Cindy Creem said.

The bill is now before the governor, who in late 2017 shifted his position to support a handheld device use ban after a rise in fatal accidents caused by distracted driving and advances in technology.

Before November 2017, Baker said he believed texting presented a greater danger than talking and he worried that a ban would disproportionately impact lower-income drivers who could not afford hands-free devices.

"I don't want to get out of the business of making it possible for people to talk to other people when they're driving. Because I think the texting thing is a big problem. I'm not sure I believe that the talking thing is," he said earlier in 2017.

But later that year, he pressed the Legislature to send him a bill outlawing the use of cellphones by drivers.

"The technology has moved dramatically over the course of the last several years. You don't need a Bluetooth in your car anymore to be able to drive on a hands-free basis and still be able to do some of the things that people need to do, and we think it's time for us to weigh the circumstances and the difficulties and in some cases the dangers associated with distracted driving up against the benefits and the opportunities associated with hands free," he said.

Earlier this year, Baker filed a sweeping road safety bill requiring hands-free cellphone use while driving.

"Keeping the Commonwealth's network of roads as safe as possible for everyone using them is one of our administration's top public safety priorities," Baker said in a statement when he filed his bill, calling the legislation a "common sense" proposal to reduce distracted driving.

After the Senate voted Wednesday, Rausch explained that she cast the lone dissenting vote because she "could not get to yes because of the data provisions." The conference bill updates data collection requirements to mandate state agencies track the age, gender and race of every motorist issued a citation or warning. The original Senate bill called for agencies to collect data on all stops, even if they do not result in a citation.

She also said she is wary about how the data that is collected will be handled by the state and whether outside watchdog groups will be able to conduct their own meaningful analyses of it.

"Given my experience in our state government working specifically with data, I have serious concerns about the path the data will take pursuant to this bill and the absence of checks on that data," Rausch said.

Three other senators -- Sens. Sonia Chang-Diaz of Boston, Adam Hinds of Pittsfield and Jo Comerford of Northampton -- rose to tell their colleagues that they voted in favor of the conference report despite having serious issues with the data collection and racial profiling aspects of it.

Once it is signed, the law would take effect 90 days later, though motorists would only receive warnings for violating any of the new provisions through March 31, 2020. After that, fines are scheduled to start at $100 for a first offense, $250 for a second offense, and $500 for third and subsequent offenses. Third and subsequent offenses would also draw auto insurance surcharges.