Scientists have built an app that gives a smartphone the ability to detect an opioid overdose and alert others for help. The app, called Second Chances, is still in development, but the researchers hope to have it approved by the US Food and Drug Administration and eventually sell the technology.

With over 110 Americans dying each day from opioid overdoses, the opioid epidemic is the deadliest drug overdose crisis in US history. “It’s a huge public health problem and also one where the diagnostic signs and mechanisms of how people die is really well-established,” says Jacob Sunshine, an anesthesiologist at the University of Washington and co-author of the Second Chances study, which was published this week in the journal Science Translational Medicine. In other words, when people overdose, their breathing changes in a specific and predictable pattern. Second Chances uses sonar technology to detect these changes and alert a friend, relative, or doctor who can then provide overdose-reversal drugs like Naloxone.

“We don’t use cameras or identifying markers or reflect speech. We’re only using the reflection of sounds.”

The app works by sending silent sound waves to people’s chests from up to three feet away, explains Rajalakshmi Nandakumar, a doctoral candidate in computer science at the University of Washington and the first author on the paper. It then monitors the signals that get reflected back because they change when breathing patterns do.

The tricky part was teaching the algorithm to recognize which patterns corresponded to an overdose. To do that, the team tested Second Chances with 194 participants at a safe injection site in Vancouver and also on simulated overdoses in an operating room. At the Vancouver clinic, participants injected opioids under staff supervision and were resuscitated if they overdosed. Second Chances, installed on a Galaxy S4, correctly identified about 96 percent of overdoses where the breathing stopped for 10 seconds or less and about 87 percent of cases where breathing significantly slowed. It also correctly predicted 19 out of 20 simulated overdoses.

To be clear, the app is not supposed to be running all the time in the background. Rather, the idea is that people using opioids turn it on in the minutes before injection and turn it off once it’s clear that they’re safe. It’s built for privacy, with an encrypted backend that is compliant with health privacy law. “People liked that we don’t use cameras or identifying markers or reflect speech,” says Nandakumar. “We’re only using the reflection of sounds,”

Peter Chai, a professor of emergency medicine at Harvard Medical School’s Brigham and Women’s Hospital, notes that this is an early study but believes there’s exciting potential for the technology. (Chai was not involved with the research.) “We’ve been in a world of wearable devices and new biosensors for detecting disease, but the cool part is that we are emerging into this post-sensor world,” he says. “Everybody knows that when you give someone a Fitbit the adoption rate is very low, but these are contactless sensors and essentially no-touch monitoring technology.” It’s possible the same method could be used to track other physiological signals like heart rate and rhythm, he adds.

Now, the Second Chances team is working on improving the user interface and making the algorithm more sensitive. False positives are a big concern. Not only are they alarming, but they could be a problem from a resource standpoint if a false positive triggered emergency medical services. The hope, says Sunshine, is that the app will help keep people safe until they can find more long-term support.

Update Jan. 10th, 2019 4:20PM: This article has been updated to include quotes from Peter Chai.