MrSeb writes "Two doctors at Penn State University have developed Caffeine Zone, a free iOS app that tells you the perfect time to take a coffee break to maintain an optimal amount of caffeine in your blood — and, perhaps more importantly, it also tells you when to stop drinking tea and coffee, so that caffeine doesn’t interrupt your sleep. By reading through lots of peer-reviewed studies, doctors Frank E. Ritter and Kuo-Chuan Yeh found that a caffeine level of between 200 and 400mg in your bloodstream provides optimal mental alertness, and that you should be below 100mg when you try to sleep. Caffeine Zone plots your caffeination level after you consume caffeine, and warns you if that big afternoon coffee will keep you up at night. It also lets you change the 'optimal' and 'sleep' values if you're particularly resistant or weak to caffeine."
Link to Original Source