Inside every person is a complex ticking of a clock, carefully calibrated to a person’s specific sleeping, eating, and waking habits. This circadian clock relies on the brain to communicate what waking and sleeping hours to follow, but according to a new study published in the journal Science Translational Medicine, caffeine could undo and throw the entire process off kilter.

"The circadian clock is way beyond 'sleep and wake,'" said the study’s co-author Kenneth Wright, a sleep and circadian physiologist at the University of Colorado, Boulder in an interview with NPR. “The circadian clock is present in cells throughout our entire body. It's in your fat cells; it's in your muscle cells. It's in your liver, for example, as well as in your brain."

Wright and his fellow researchers at the Department of Integrative Physiology at the University of Colorado observed a group of participants for 49 days. The experiment was designed as a sleep study — a highly controlled laboratory setting that allows researchers to manipulate conditions before bedtime and during as they slept throughout the night. The group was given either a caffeinated double espresso, exposure to a bright or dim light, or a placebo.

Each participant’s saliva was tested for their fluctuating melatonin levels. Melatonin is a natural hormone produced by a small gland just above the middle of the brain. During the day, the gland is inactive, but once the body registers there’s less light, it signals the ending of the day and secretes melatonin into the bloodstream. As melatonin levels rise, a person tends to feel less alert for approximately 12 hours, according to the National Sleep Foundation.

It turns out a double espresso of caffeine before bedtime delayed a person’s melatonin release by approximately 40 minutes, making bed less inviting than it should be, given the darkness of night. Once researchers realized caffeine was powerful enough to shift a person’s internal clock, they warned it could be the reason why certain people struggle to get up the next day. Irregularities in the circadian clock have been linked to obesity, poor cognitive skills, gastrointestinal problems, and even cancer.

Any number of things can be going on inside a sleep-deprived or, in this case, caffeinated person's body, but many occur right inside the brain. Our internal clocks, which control sleep and wakefulness, can be traced down to a neurological level right inside the hypothalamus. The hypothalamus is also where the optic nerve connects and communicates to the brain the level of light, or lack thereof, that the eyes are exposed to throughout the day and night.

Located directly above the optic nerve is the suprachiasmatic nucleus (SCN), which is in charge of the body's circadian biological clock. Once the SCN is stimulated by the light transmitted through the eye, the message travels along the optic nerve, ultimately regulating brain and hormone activity based on our personal circadian rhythms. This interwoven system within the brain dictates the level of alertness and sleepiness a person experiences throughout the day, creating a predictable ebb and flow pattern.

"What we're seeing here now is another way that caffeine impacts our physiology that we didn't know about before in humans," Wright said. "Leading a lifestyle where you're consistently not getting enough sleep, or where your body clock is continually out of sync with the natural world, is bad for you."

Source: O’Neill JS, Burke Tm, and Wright KP, et al. Effects of caffeine on the human circadian clock in vivo and in vitro. Science Translational Medicine. 2015.