People who abuse alcohol sometimes try to fake the hand tremors caused by withdrawal to get a prescription for sedatives.

But the Valium used to treat withdrawal is often abused and can be dangerous. "If you give large doses of Valium to people who are intoxicated, bad things happen," says Dr. Bjug Borgundvaag, an emergency room doctor and researcher at Mount Sinai Hospital in Toronto. "They stop breathing."

Borgundvaag has been working the ER for 19 years, and he's gotten pretty good at knowing when someone is really in alcohol withdrawal. But less experienced colleagues often struggle to assess a collection of subjective symptoms that include headache, nausea and anxiety. So a fast, objective way to measure tremor would help. And what could be simpler or faster than the accelerometer in a smartphone?

It took almost two years, but Borgundvaag and compadres have created an app that measures the amount of tremor in a person who appears to be in withdrawal. They simply hand the person a smartphone and wait 20 seconds.

"We enrolled another patient in our study this morning," Borgundvaag says. "The guy came in and said he was trying to stop drinking, he'd had his last drink, tremulous and anxious and feeling sick."

The app tracked that man's tremors at a 1.8, relatively mild on a scale of 0 to 7; the doctor took a quick look at a video of the test and said that looked about right.

The app should also help figure out if a tremor is real or pretend.

It turns out that an involuntary tremor has a peak frequency of more than 7 cycles a second. When nurses tried to fake a withdrawal tremor, they had a hard time hitting that frequency. They also couldn't maintain the tremor; their hands got tired.

The Toronto doctor and his colleagues have joined the growing ranks of medical professionals inventing smartphone apps. Those apps increasingly are morphing from ones focused on taming vast amounts of information to tools that can be used to diagnose and treat patients.

So far the tremor app has been tested in about 80 patients; it needs more testing and validation before it can be used for diagnosis in patients who haven't agreed to be part of a research project. The preliminary results were presented Friday at the International Conference of the IEEE Engineering in Medicine and Biology Society in Chicago.

The project has a nice startup vibe, with Simon Bromberg, an engineering student who is the son of one of Borgundvaag's colleagues, building the app for free; a computer science professor and a grad student at the University of Toronto designing the system that analyzes the signals; and staff at emergency rooms in hospitals around Toronto helping with the testing.

Parham Aarabi, the professor of electrical and computer engineering who worked on the app, says as sensors and algorithms improve, they'll become increasingly useful for medical diagnostics like this. He's already working on another smartphone tool — an app that would let dermatologists objectively measure the redness of a patient's face, and calculate if a rash has grown or faded since the last visit.