The brain serves as the command center that tells us when to feel sleepy and when to be alert and awake. Tiny amounts of brain cells are in charge of making us stay awake or fall asleep. Some of them encourage alertness and others encourage sleep; some cells promote stages of wakefulness and others promote levels of sleep (9). The brain cells (neurons) that encourage alertness also work to prevent actions that encourage sleep, and vice versa. Maintaining a balance usually results in either a reasonably constant phase of alertness or a reasonably constant period of sleep. This is how the brain is believed to regulate sleep.
The intricacies regarding exactly how the brain controls sleep is not fully understood. Certain areas of the brain, such as in the hypothalamus, and the brainstem support mental alertness and wakefulness by releasing neurotransmitters, such as acetylcholine (9). These chemicals stimulate the cerebral cortex, which when activated causes us to stay awake. This is what happens when a person takes caffeine. It stimulates the cerebral cortex, which covers the thought process, and it also stimulates the medulla (9). The latter results in decidedly negative effects, such as an increase in heart/respiratory rate and poor muscular coordination (9).