The circadian rhythm (sleep-wake cycle) is regulated by the tiny pineal gland in the brain that reacts to ambient light levels. It will translate these signals and control the production of melatonin, a hormone that makes you feel sleepy. It functions as well to control levels of serotonin and dopamine. When light is brighter, it will produce more dopamine and reduce melatonin levels.
Dopamine keeps you awake. Drugs that increase dopamine levels, such as cocaine, nicotine, caffeine and amphetamines increase alertness. Serotonin has a more complex role in the circadian cycle. While it induces drowsiness, it can also stop you from falling asleep or cause restless and unsatisfactory sleep. The main difference comes from where in the brain it comes from and the type of receptor it binds to.