Throughout most of human history, humans went to bed shortly after the sun went down and woke up in the morning as it rose. There were candles and later oil lamps, but the light was not very bright so people still went to bed early.

Then came Thomas Edison and the incandescent light bulb and everything changed, including our sleeping habits. So, if you have problems getting to sleep at night or are a miserable person to be around in the morning, blame him.

Scientists at the University of Colorado Boulder found that if you live by the sun's schedule, you are more likely to go to bed at least an hour earlier, wake up an hour earlier, and be less groggy, because your internal clock and external reality are more in sync. The sun adjusts your clock to what may be its natural state, undoing the influence of light bulbs.

The disconnect between the outside environment and sleep is one reason why even native Alaskans have problems sleeping in the almost endless days of the Arctic summers, and get depressed during the long nights of winters.

The subjects in the Colorado study lived more normal lives.

"We weren’t studying people who had sleep difficulties," said Kenneth Wright, an integrative psychologist at Boulder. "The amount of sleep they got did not change. What changed was the timing of their sleep and the timing of their [internal] clock relative to when they slept."

The researchers took eight adults, average age around 30, and followed them around the normal course of their lives for a week. The subjects spent most of their time indoors while working, studying, eating, and sleeping. Most of the light they encountered was artificial. Then, they sent the same people out camping.

Sleep and light were measured daily and the hormone melatonin every hour across 24 hours, once after the week of living at home, going to work, school, and then after a week of camping.

Melatonin is the "hormone of darkness," said Namni Goel, a psychologist and sleep researcher at the University of Pennsylvania in Philadelphia. Scientists use the hormone to measure photoperiods, or the physiological response that organisms have to cycles of daylight and darkness.

"It rises at night naturally, and falls during the day, suppressed by light," said Goel.

Melatonin also drops the body’s core temperature, making it easier to sleep. People often take melatonin pills to help them fall asleep, she said.

After the week’s study indoors, the Colorado subjects went camping in the Rockies. Instead of artificial lighting, they had only sunshine during the day and campfires at night. Wright estimates the light from the sun was four times as intense as what they experienced indoors. The nature of the light also changed during the day. Think of the bright white light of midday and the golden glow that often precedes sunset.

After their week of camping, researchers measured the subjects' melatonin levels again.

The researchers found that the onset of melatonin shifted two hours earlier, and the subjects’ actual sleep shifted more than an hour earlier. Their bodies were recalibrating themselves, Wright explained.

When they woke in the morning in their normal lives, the melatonin and the external time were in conflict. They were waking up, but the melatonin in their bodies was telling them they should still be asleep. That might account for their still feeling sleepy, Wright said.

When they were out in the outdoors, the melatonin levels and the sun cycle were more aligned--the levels went down as the sun rose and before they woke up. They were subject to more light -- sunlight -- for the majority of the day.

The relationship between light and sleep and how much sleep a person needs has been the subject of several classic experiments.

Some involving putting subjects in deep, totally dark caves for weeks at a time have discovered that the 24-hour-day is almost exactly right for our bodies. The average amount of time our bodies consider a day comes to 24.3 hours, Goel said.

Goel and other Colorado scientists agree that the experiment was small, with only eight subjects, which limits what can be concluded. Nonetheless, the findings justify more experiments like it.