A series of findings over the past decade has begun to identify the brain circuitry and neurotransmitters that regulate our daily cycles of sleep and wakefulness. The latter depends on a network of cell groups that activate the thalamus and the cerebral cortex. A key switch in the hypothalamus shuts off this arousal system during sleep. Other hypothalamic neurons stabilize the switch, and their absence results in inappropriate switching of behavioural states, such as occurs in narcolepsy. These findings explain how various drugs affect sleep and wakefulness, and provide the basis for a wide range of environmental influences to shape wake-sleep cycles into the optimal pattern for survival.