Millennia ago, when humans lived in caves, light was virtually the only way we knew the time of day. Our brains evolved to associate sleep with sunlight (or lack thereof), making us sleepy as the day got darker and waking us back up again with the sunrise. We still work this way today, but the advent of light-emitting devices such as smartphones, tablets, and computer screens puts this mechanism out of whack.
Newly discovered sensors in our eyes, known as intrinsically photosensitive retinal ganglion cells, or ipRGCs, gather information about light levels just like our rods and cones do, but instead of sending it to the visual system, they send it to the body's master clock in the brain. This clock controls the production of melatonin, which is essentially the hormone that makes you sleepy. Here's the problem: the ipRGCs are particularly sensitive to blue light, which electronic devices emit in large doses. This light tells your brain's master clock that it's daylight outside, not time for bed, so it suppresses melatonin production to keep you awake longer. Teenagers are particularly susceptible to this problem. So how do you avoid it? Free smartphone and computer apps are available to tone down the blue wavelengths coming from your screen as the hour gets later, and experts say that turning down the brightness setting and holding the screen further from your eyes can also help.