That scenario may become a thing of the past, if a few sleep-deprived students at Brown University have anything to say about it.

They invented a new kind of alarm clock. It’s called the SleepSmart. It comes with a wireless headband fitted with electrodes. And monitors your brain waves during each phase of your sleep cycle. During a normal night, you have 4 to 5 complete cycles, each one lasting about an hour-and-a-half.  And each cycle is composed of light sleep, and deep sleep.

So, you simply set your alarm for the latest time you want to wake up. Then, the clock figures out, based on your brain waves, when you’re in the very last “light sleep” mode before your wakeup time, and the alarm goes off. Right when you’re most likely to wake up feeling perky and well-rested.

New Scientist magazine says they’re still testing the Smart Sleep alarm clock. But they hope to have it on the market sometime next year. And we’ll definitely keep you posted.