Although there are many hormones and neurotransmitters (or chemical messengers in the brain) involved in regulating sleep and wakefulness, melatonin is one of the most common hormones involved in the sleep-wake cycle.
Melatonin is produced in a part of the brain called the pineal gland, a small structure located in the centre of the brain, and thought to be shaped like a pine cone which is where its name derives.
The synthesis and subsequent secretion of melatonin is highly regulated by the daily alternation of light and darkness, with levels of melatonin high at night, and low or undetectable during light or day-time hours. The way in which this works is that the suprachiasmatic nucleus receives information from the retina of the eye about the light-dark cycle and relays this information to the pineal gland so that it knows when to produce and secrete melatonin. In addition to this external cue, melatonin is also endogenously controlled as in the absence of light and external cues our internal body clock persists.