(Fortune Small Business) -- Few of us make money by losing sleep. But three grad students at Brown University in Providence built a company around sleep deprivation.

Jason Donahue, Ben Rubin and Eric Shashoua were working late nights in Brown's business and engineering schools -- and began thinking about ways to sleep better. They discovered they weren't alone in burning the midnight oil. Around 20% of Americans get less than six hours of rest a night. (See our cover story, "Make Sleep Work for You," September 2008.)

The friends imagined a smart alarm clock that could track how much time we spend in the most restorative stages of the sleep cycle: REM and deep sleep. What would it cost to design such a thing?

Answer: five years of research, 20 hires, $14 million in funding and a whole lot of doubting from investors and scientists.

The trio's company, Zeo, based in Newton, Mass., launched its product in June. The Zeo device uses a patent-pending headband with tiny sensors that scan your brain for signs of four sleep states: REM, light, deep and waking sleep (which saps your energy). The smart alarm clock displays a graph of your sleep pattern and wakes you as you're transitioning out of REM sleep (which is when you're least groggy). In the morning you can upload the data to the company's Web site, and so track your sleep over time. The cost, $399, includes six months' access to one of Zeo's online sleep coaches.

Most of the feedback comes in the form of Zeo's ZQ score -- an index of how well the device thinks you've slept.

"Zeo allows people to unlock this mysterious black box of sleep," says Dave Dickinson, a veteran health-care CEO whom the founders brought onboard in 2007 to run the business side.

Whether any of this actually improves sleep is up to the consumer, who will also need to make lifestyle changes like cutting out alcohol before bedtime or caffeine after 3 p.m.

"No one should mistake it for a diagnostic tool," says Darrel Drobnich, chief program officer at the National Sleep Foundation (though he does say Zeo is "a neat product that can educate people").

That Zeo exists at all is remarkable. When the trio first started shopping their idea around, scientists told them no consumer product could match the costly monitoring equipment of professional sleep labs. Their first prototype was made from a headband and an Altoids mints tin, which Shashoua admits turned off investors.

"When we had a better-looking prototype, that changed," he says.

Eventually the startup scored $14 million, mainly from venture capital firms Trident Capital and iD Ventures America. It also won over renowned sleep scientists, such as Harvard Medical School's Charles Czeisler, who now sits on Zeo's advisory board.

For now the company is selling Zeo online only. Dickinson is looking at distribution deals with stores that carry consumer health-care gadgets. He also plans to expand to countries such as Australia, where sleep deprivation approaches U.S. levels.

To write a note to the editor about this article, click here