Wondering if you’re too drunk to drive? Your phone might soon be able to tell you.

In a preliminary study at the University of Pittsburgh School of Medicine, researchers determined your smartphone’s accelerometer sensors can tell if you’re intoxicated by the way you walk.

“Accelerometers handle axis-based motion sensing and can be found in fitness trackers as well as phones —they’re the reason why your smartphone can track your steps even if you haven’t bought a separate wearable,” according to Gizmodo.

Brian Suffoletto — now with the department of emergency medicine at Stanford University — and his then-colleagues in Pittsburgh wanted to see if those sensors could determine intoxication levels simply by measuring a person’s gait.

“I lost a close friend to a drinking and driving crash in college,” Suffoletto said in a press release. “And as an emergency physician, I have taken care of scores of adults with injuries related to acute alcohol intoxication.

“Because of this, I have dedicated the past 10 years to testing digital interventions to prevent deaths and injury related to excessive alcohol consumption,” he added. “This controlled lab study shows that our phones can be useful to identify ‘signatures’ of functional impairments related to alcohol.”

The researchers recruited 22 volunteers for the test. The participants walked 10 steps in a straight line, turned and walk 10 steps back before drinking enough alcohol to reach a breath alcohol concentration greater than the legal limit of 0.08%. Smartphones were placed on their lower backs to record a series of tasks (walk forward, walk backward, etc.).

By comparing the participants’ gaits before and after drinking alcohol, the researchers were able to predict with 92.5% accuracy whether the person’s breath alcohol concentration was 0.08% or higher.

Although this was a limited study, the researchers said, “this proof-of-concept study provides a foundation for future research on using smartphones to remotely detect alcohol-related impairments.”