Sleep, melatonin & circadian rhythm

Why sleep is the brain's maintenance window, how the 24 hour clock is set, why melatonin is a timing signal rather than a sedative, and what the trials on the common sleep aids actually show.
  • Concept, neuroscience
  • Mechanics track, 7 of 41
  • 9 min read
  • 14 sources

Sleep is not downtime. It is an actively generated brain state with its own architecture, its own chemistry and its own jobs: consolidating memory, clearing metabolic waste, and doing much of the body's repair. Governing when it happens is the circadian rhythm, a roughly 24 hour oscillation that runs in nearly every cell of the body and is coordinated by a master clock in the hypothalamus.

Melatonin, the hormone everyone reaches for, is widely misunderstood. It is far more a timing signal, an internal announcement that the sun has set, than a sedative. That distinction is not pedantry; it changes the dose, the timing and the expectations, and it explains why the usual approach of taking a large amount at bedtime is close to the least effective way to use it.

The other thing worth setting up front: sleep is decided by two independent systems, not one. Wanting to sleep and being able to sleep at a given hour are separate variables, and almost every practical sleep problem is a mismatch between them rather than a deficiency of anything.

The internal clock, and what sets it

The master clock is the suprachiasmatic nucleus (SCN), a pair of small nuclei in the hypothalamus sitting directly above the optic chiasm. It keeps time, and it distributes that time to the rest of the brain and body1. Left in constant conditions it keeps running, which is what makes it a genuine clock rather than a response to daylight.

Its period is not exactly 24 hours, and the figure was misreported for decades. Older estimates put the human period anywhere from 13 to 65 hours, but those studies let participants control their own lighting, which unknowingly resets the clock being measured. Under controlled dim light, the intrinsic period averages 24.18 hours, tightly distributed, with no meaningful difference between young and older adults3. Being slightly over 24 hours means the clock must be nudged earlier every day, which is what morning light does.

The light input is more specific than it sounds. Rods and cones are not required for it. A small population of retinal ganglion cells contains its own photopigment, melanopsin, and depolarises in response to light even with all rod and cone input pharmacologically blocked; the sensitivity, spectral tuning and slow kinetics of that response match the properties of circadian entrainment4. These cells are most sensitive to short-wavelength blue light, they integrate over minutes rather than milliseconds, and they project directly to the SCN. This is why light is the dominant sleep lever, and why blind people with intact ganglion cells can still entrain.

Inside every clock cell is a transcription-translation feedback loop: a set of clock genes whose protein products shut off their own transcription, taking about a day to complete a cycle5. Because those loops exist in liver, muscle, fat and immune cells too, the SCN's job is largely coordination, and the practical consequence is internal misalignment: eating, light and activity can pull peripheral clocks in a different direction from the central one, which is the mechanism behind shift work and jet lag doing damage beyond simple sleep loss.

Pressure and timing, the two systems that decide when you sleep

Sleep is governed by two processes that are worth separating because interventions act on one or the other and almost never both.

Process S is homeostatic sleep pressure. It builds monotonically the longer you are awake and dissipates during sleep. Its best-characterized chemical correlate is extracellular adenosine, a byproduct of the brain's energy use that accumulates across the waking day and promotes sleep by acting at adenosine receptors on wake-promoting neurons. Caffeine works by blocking those receptors, which is why it opposes sleepiness without addressing the underlying pressure; see adenosine receptors. The pressure is still there, and it is still accumulating.

Process C is the circadian signal from the SCN. It is not a simple sleep drive: across the ordinary day it acts as a wake-promoting signal that rises through the afternoon and evening to oppose the accumulating pressure, then withdraws at night. The switch itself is a mutually inhibitory flip-flop between wake-promoting monoaminergic and cholinergic nuclei and sleep-promoting neurons in the preoptic area, stabilized by orexin neurons whose loss causes narcolepsy1. Flip-flop circuits change state fast and resist intermediate states, which is why sleep onset is comparatively abrupt.

Almost every common sleep complaint falls out of this. Lying awake at midnight after a 3pm nap is low Process S. Being wide awake at 2am after a flight is Process C in the wrong place. Waking at 5am unable to return to sleep is pressure exhausted before the clock says morning. The two need different fixes: pressure responds to time awake and to activity, timing responds to light and to melatonin, and a sedative addresses neither.

What actually happens during sleep

Sleep is not uniform. It cycles roughly every 90 minutes between NREM stages, including deep slow-wave sleep, and REM, with slow-wave sleep concentrated in the first half of the night and REM in the second. That distribution matters practically: cutting sleep short at either end removes different things.

Memory consolidation is the best-documented job. The modern account is active rather than passive: recently encoded representations are reactivated during slow-wave sleep and redistributed from temporary hippocampal storage into long-term cortical networks, with subsequent REM apparently stabilizing the transformed memory. Slow-wave sleep in particular has moved from a supporting role to the center of this account, and the waking brain is now understood as optimized for encoding while the sleeping brain is optimized for consolidation6.

Clearance is the newer and more contested finding. In live mice, natural sleep and anesthesia were both associated with a roughly 60% increase in the volume of interstitial space between cells, sharply raising convective exchange between cerebrospinal and interstitial fluid and roughly doubling the clearance of injected beta-amyloid7. That is the source of the popular claim that sleep washes the brain. The caveat belongs with it: magnitude and mechanism have both been challenged by later work using different methods, and this is an active argument rather than settled fact.

Sleep also anchors endocrine rhythms, which is why sleep debt shows up in blood. Six nights at four hours in bed raised evening cortisol, lowered glucose tolerance and thyrotropin, and increased sympathetic activity in healthy young men14; see the HPA axis and cortisol.

The practical upshot for anything sedating: unconsciousness is not sleep. Alcohol and older sedative hypnotics reliably shorten sleep onset while suppressing slow-wave sleep, REM, or both, which is how a full night can leave a person unrefreshed.

StageSignatureWhen it dominatesWhat it is for
N1transition, drifting, hypnic jerksat onset and after arousalsLittle in itself; a marker of fragmentation when there is much of it
N2sleep spindles and K-complexesthe largest share of the nightSpindles track memory consolidation and sensory gating
N3 (slow-wave)large slow delta wavesconcentrated in the first half of the nightSystems consolidation of hippocampal memory6, growth hormone release, the state where interstitial clearance was measured7
REMfast desynchronised EEG, muscle atonia, dreamingconcentrated in the second halfEmotional processing and apparent stabilisation of memories transformed in NREM6

The stages, and what each is thought to be doing

What melatonin really does

Melatonin is secreted by the pineal gland under SCN control, rising in the evening darkness and suppressed acutely by light. Its job is to tell the body's tissues what time the clock thinks it is. Exogenous melatonin can act as a mild soporific, as a chronohypnotic that opposes the circadian wake drive, and as a chronobiotic that shifts the phase of the clock itself, and the third of those is where it is genuinely strong2.

Shifting the clock is done by timing, not amount. A phase response curve maps how much and in which direction a dose moves the clock depending on when it is taken. For 0.5 mg, the largest phase advances came from taking it in the afternoon, roughly 2 to 4 hours before the dim light melatonin onset, which is about 9 to 11 hours before the midpoint of sleep; delays peaked soon after wake time. The optimal administration time is later for the lower dose than for 3.0 mg, and critically, when each dose is given at its own optimal time, both produce advances and delays of similar size8. More is not more. A large dose at bedtime is close to the least useful point on the curve for shifting a delayed schedule.

As a sleep aid in ordinary insomnia, the honest number is small. A meta-analysis of 19 trials in 1,683 participants found melatonin reduced sleep onset latency by about 7 minutes, increased total sleep time by about 8 minutes, and modestly improved subjective sleep quality. All were statistically significant; all are much smaller than prescription hypnotics; and the effect did not appear to fade with continued use9. The reviewers' framing is worth keeping: the absolute benefit is smaller than pharmacological alternatives, and the case for it rests on a benign side effect profile.

There is a supply problem worth knowing about. Analysis of 31 commercial melatonin supplements found actual content ranging from 83% below to 478% above the label, with lot-to-lot variation within one product as high as 465%, and no relationship to manufacturer or product type. Eight of the products also contained serotonin, at 1 to 75 micrograms10. A person carefully titrating a 0.3 mg dose from a product with that error range is not doing what they think they are doing.

The straightforward uses are jet lag, delayed sleep phase and shift work, in small doses at a computed time. The misuse is a large bedtime dose taken indefinitely for general insomnia, where the expected effect is minutes and the timing is wrong for shifting phase.

Supporting sleep, and what the evidence supports

The foundation is behavioral and it genuinely outperforms the pharmacology. Consistent wake time anchors the clock better than a consistent bedtime does, because wake time controls the light exposure that entrains it. Morning outdoor light is orders of magnitude brighter than indoor lighting. A dark, cool room helps, since core temperature has to fall for sleep onset. Cognitive behavioral therapy for insomnia outperforms hypnotics on durable outcomes and is the first-line recommendation in every major guideline.

Two specific behavioral findings are worth quoting because people underestimate both. Caffeine at 400 mg disrupted sleep significantly relative to placebo even when taken six hours before bed, in a study measuring sleep objectively as well as by report; the authors' conclusion was that the six hour buffer is the empirical minimum, not a comfortable margin12. And reading on a light-emitting screen in the hours before bed, compared to a printed book, lengthened sleep onset, reduced evening sleepiness, suppressed melatonin, delayed circadian phase and reduced next-morning alertness11. Both effects are larger than anything most supplements achieve.

On the compound side the evidence is thinner than the shelf space suggests, and the honest summary is in the table. Melatonin for timing. Glycine at 3 g before bed reduced next-day fatigue and improved psychomotor vigilance in sleep-restricted volunteers, in a small industry study13. L-Theanine is calming without sedation and its sleep data is mostly indirect. Magnesium matters if intake is low and is unremarkable if it is not. Apigenin, the chamomile flavonoid, has plausible benzodiazepine-site activity and almost no controlled human sleep data.

The stronger drugs trade sleep quality for quantity. Diphenhydramine builds tolerance to its sedative effect within days and carries anticholinergic load. GABAergic hypnotics such as zolpidem work but carry the tolerance and dependence profile of that whole class. Ethanol shortens onset then fragments the second half of the night. Orexin antagonists such as suvorexant are a newer mechanism, blocking the wake-stabilizing signal rather than adding sedation.

What is not known deserves saying. There is no established optimal amount of slow-wave sleep to aim for, and no consumer wearable is validated against polysomnography for staging it, so most "deep sleep" numbers are estimates from movement and heart rate. Whether improving sleep in a healthy person changes long-term disease risk has been shown by association, not by randomisation. And the glymphatic mechanism, the most-quoted reason to sleep, is real in its original measurements and still argued about in magnitude7. Not medical advice.

AidWhat it doesEvidence and caveats
Light timing and fixed wake timeentrains the clock through melanopsin cells4The largest lever available, and free. Evening screen light measurably delays phase and suppresses melatonin11
Melatoninchronobiotic; shifts clock phase, mildly opposes wake driveStrong for phase shifting at the right hour8. As a hypnotic: about 7 minutes faster onset, 8 minutes more sleep9. Label content is unreliable10
Glycineinhibitory amino acid; lowers core temperature3 g before bed reduced fatigue and improved vigilance after sleep restriction; small study, industry authors13
L-Theaninecalming without sedationGood tolerability, mostly indirect sleep evidence. Does not shorten onset the way a hypnotic does
Magnesiumcofactor with NMDA and GABA-A interactionsPlausible where intake is low. Trials are small and inconsistent in adequately fed people
Avoiding late caffeinestops adenosine blockade during the sleep window400 mg disrupted sleep even six hours before bed12. Six hours is a floor, not a margin
Zolpidem and relativespositive modulation at GABA-AEffective on onset; tolerance, rebound and next-day impairment the cost1
Suvorexantblocks orexin, removing the wake-stabilizing signalDifferent mechanism from the GABAergics, targeting the stabiliser of the sleep switch itself1

Common sleep aids, mechanism, and how far the evidence goes

Worth knowing

7 short facts, each tied to the paper it comes from.

  • Mice lacking the astrocyte water channel aquaporin-4 cleared solutes from the brain about 70% less effectively.

    Animal studyIliff et al. · Sci Transl Med · 2012 · PubMed 22896675

  • In mice, natural sleep enlarged the space between brain cells by 60% and sped the clearance of beta-amyloid.

    Animal studyXie et al. · Science · 2013 · PubMed 24136970

  • A 2024 mouse study found brain clearance reduced, not increased, during sleep and anaesthesia, contradicting the idea that sleep speeds waste removal.

    Animal studyMiao et al. · Nat Neurosci · 2024 · PubMed 38741022

  • During non-REM sleep, slow neural waves in humans are followed by waves of blood flow and then of cerebrospinal fluid.

    Imaging studyFultz et al. · Science · 2019 · PubMed 31672896

  • One night without sleep raised beta-amyloid in the right hippocampus and thalamus of 20 healthy adults.

    Imaging studyShokri-Kojori et al. · Proc Natl Acad Sci U S A · 2018 · PubMed 29632177

  • In 7 people kept awake against 17 who slept, one night of total sleep deprivation slowed tracer clearance from most brain regions, and a night of recovery sleep did not make up for it.

    Imaging studyEide et al. · Brain · 2021 · PubMed 33829232

  • Across 66 studies, about 45% of depressed patients responded to acute sleep deprivation in trials with a randomised control group, and 50% in those without one.

    Meta-analysisBoland et al. · J Clin Psychiatry · 2017 · PubMed 28937707

Next in Mechanics: Acetylcholine receptors (nicotinic & muscarinic)

Molecules mentioned

Sources

Meta-analysis
1
Randomised trial
1
Clinical trial
2
Observational
1
Review
4
Unclassified
5
  1. 1

    Hypothalamic regulation of sleep and circadian rhythms

    Saper CB, Scammell TE, Lu J · Nature · 2005

    ReviewPubMedDOI

  2. 2

    Role of melatonin in the regulation of human circadian rhythms and sleep

    Cajochen C, Kräuchi K, Wirz-Justice A · J Neuroendocrinol · 2003

    ReviewPubMedDOI

  3. 3

    Stability, precision, and near-24-hour period of the human circadian pacemaker

    Czeisler CA, Duffy JF, Shanahan TL, et al. · Science · 1999

    ObservationalPubMedDOI

  4. 4

    Phototransduction by retinal ganglion cells that set the circadian clock

    Berson DM, Dunn FA, Takao M · Science · 2002

    PubMedDOI

  5. 5

    Transcriptional architecture of the mammalian circadian clock

    Takahashi JS · Nat Rev Genet · 2017

    ReviewPubMedDOI

  6. 6

    About sleep's role in memory

    Rasch B, Born J · Physiol Rev · 2013

    ReviewPubMedDOI

  7. 7

    Sleep drives metabolite clearance from the adult brain

    Xie L, Kang H, Xu Q, et al. · Science · 2013

    PubMedDOI

  8. 8

    Human phase response curves to three days of daily melatonin: 0.5 mg versus 3.0 mg

    Burgess HJ, Revell VL, Molina TA, et al. · J Clin Endocrinol Metab · 2010

    PubMedDOI

  9. 9

    Meta-analysis: melatonin for the treatment of primary sleep disorders

    Ferracioli-Oda E, Qawasmi A, Bloch MH · PLoS One · 2013

    Meta-analysisPubMedDOI

  10. 10

    Melatonin Natural Health Products and Supplements: Presence of Serotonin and Significant Variability of Melatonin Content

    Erland LA, Saxena PK · J Clin Sleep Med · 2017

    PubMedDOI

  11. 11

    Evening use of light-emitting eReaders negatively affects sleep, circadian timing, and next-morning alertness

    Chang AM, Aeschbach D, Duffy JF, et al. · Proc Natl Acad Sci U S A · 2015

    Clinical trialPubMedDOI

  12. 12

    Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed

    Drake C, Roehrs T, Shambroom J, et al. · J Clin Sleep Med · 2013

    Randomised trialPubMedDOI

  13. 13

    The effects of glycine on subjective daytime performance in partially sleep-restricted healthy volunteers

    Bannai M, Kawai N, Ono K, et al. · Front Neurol · 2012

    PubMedDOI

  14. 14

    Impact of sleep debt on metabolic and endocrine function

    Spiegel K, Leproult R, Van Cauter E · Lancet · 1999

    Clinical trialPubMedDOI