Maybe you’ve got an exam in the morning, or there’s just one more episode left in this season. Whatever the reason, tonight you ignore your body’s demands and stay up instead. It’s an impressive feat, if you think about it—sleep is essential—and now scientists may be closer to understanding how we do it. They published a report on their findings in the journal Neuron.

There’s a little section of your brainstem called the dorsal raphe nucleus (DRN). This region is responsible for making serotonin and other brain chemicals.

Lead researcher Viviana Gradinaru of Caltech says previous studies have also suggested that the dorsal raphe nucleus plays a role in helping keep us awake.

"People who have damage in this part of their brain have been shown to experience excessive daytime sleepiness,” she said in a statement, “but there was not a good understanding of the exact role of these neurons in the sleep/wake cycle and whether they react to internal or external stimuli to influence arousal."

Within the dorsal raphe nucleus lies a little-understood group of dopamine cells called the dorsal raphe nucleus neurons (DRNDA).

Dorsal raphe nucleus neurons responding to light (green) and chemical (red) signals. Viviana Gradinaru

Gradinaru and her colleagues wanted to know if voluntary wakefulness had anything to do with dopamine activity within these cells. They started by studying mouse brains, which are similar to our own in many ways.

The researchers monitored the rodents’ DRNDA action while the mice were fed, met new potential mates, or experienced sudden unpleasant sensations—all experiences for which the mice would want or need to stay awake. Throughout the experiences, the mice’s DRNDA cells kept very busy, sending bursts of dopamine to other parts of the brain.

Next, the scientists tracked DRNDA cell activity as the mice slept and woke. They found that the cells seemed to sleep when the mice did, and revved up when the mice got up.

So far, the researchers knew that the sleeping mouse/sleeping neurons and waking mouse/waking neurons pairs existed, but they couldn’t tell if the neurons caused the waking or vice versa.

To find out, they engineered DRNDA cells that could be switched on and off by light. They then bred mice with these light-sensitive cells and let them sleep. As the mice snoozed, the researchers switched on the lights and their DRNDA cells using a technique called optogenetics. Sure enough, the mice woke up.

Shutting off DRNDA cells had the opposite effect: Mice with no DRNDA activity couldn’t keep their eyes open, even when faced with danger, loud noises, or the possibility of mating.

The authors note that their experiments included only mice, and that it’s too soon to draw conclusions about what this might mean for people.

“Further work is necessary to establish causation in humans,” Gradinaru said, “and to test the potential of the DRNDA as a therapeutic target for insomnia or oversleeping, and for sleep disturbances that accompany other psychiatric disorders such as depression, bipolar disorder, and schizophrenia."