question: how does our body know when to wake up?
comment: There are two functions that govern sleep rythym. What's commonly described as 'sleep pressure', and our circadian rhythm. Sleep pressure is a chemical that builds up throughout the day. The more we sleep, the more the pressure is lifted. If we don't sleep enough, the sleep pressure carries over to the next day, which is why it often takes multiple days to recover from a night of poor sleep. Caffeine is effective because it partially blocks the production of this chemical for about 8 hours. Circadian rythym is your body's clock. Even when scientists went and lived in a cave for a few weeks with no sunlight or clocks, they would go to sleep around 10 and wake up around 6. In healthy sleep, your sleep pressure is fully relieved when your circadian rythym wants you to wake up, but sometimes, just enough sleep pressure has been relieved that once morning comes around, your circadian rythym presses on the gas and wakes you up, even though you don't feel necessarily rested
passages: It is not, however, clear precisely what signal (or signals) enacts principal entrainment to the many biochemical clocks contained in tissues throughout the body. See section "regulation of circadian oscillators" below for more details.
  
  Section::::Transcriptional and non-transcriptional control.
   Section::::In mammals.:Biological markers and effects.
  
  The classic phase markers for measuring the timing of a mammal's circadian rhythm are:
  
  BULLET::::- melatonin secretion by the pineal gland,
  
  BULLET::::- core body temperature minimum, and
  
  BULLET::::- plasma level of cortisol.
   Circadian clock
  
  A circadian clock, or circadian oscillator, is a biochemical oscillator that cycles with a stable phase and is synchronized with solar time.
  
  Such a clock's "in vivo" period is necessarily almost exactly 24 hours (the earth's current solar day). In most living things, internally synchronized circadian clocks make it possible for the organism to anticipate daily environmental changes corresponding with the day–night cycle and adjust its biology and behavior accordingly.
   Though oscillators in the skin respond to light, a systemic influence has not been proven. In addition, many oscillators, such as liver cells, for example, have been shown to respond to inputs other than light, such as feeding.
  
  Section::::Light and the biological clock.
  
  Light resets the biological clock in accordance with the phase response curve (PRC). Depending on the timing, light can advance or delay the circadian rhythm. Both the PRC and the required illuminance vary from species to species and lower light levels are required to reset the clocks in nocturnal rodents than in humans.
  
  Section::::Enforced longer cycles.
   The clock is reset as an organism senses environmental time cues of which the primary one is light. Circadian oscillators are ubiquitous in tissues of the body where they are synchronized by both endogenous and external signals to regulate transcriptional activity throughout the day in a tissue-specific manner. The circadian clock is intertwined with most cellular metabolic processes and it is affected by organism aging. The basic molecular mechanisms of the biological clock have been defined in vertebrate species, "Drosophila melanogaster", plants, fungi, bacteria, and presumably also in Archaea.
   Sleep timing is controlled by the circadian clock (Process C), sleep–wake homeostasis (Process S), and to some extent by individual will.
  
  Section::::Timing.:Circadian clock.
   Section::::Regulation of circadian oscillators.
   Section::::Background.
  
  The individual's or animal's circadian phase can be known only by the monitoring of some kind of output of the circadian system, the internal "body clock". The researcher can precisely determine, for example, the daily cycles of gene-activity, body temperature, blood pressure, hormone secretion and/or sleep and activity/alertness. Alertness in humans can be determined by many kinds of verbal and non-verbal tests; activity in animals by observation, for example of wheel-running in rodents.
   Circadian literally translates to "about a day" in Latin. This refers to the human 24-hour cycle of sleep and wakefulness. This cycle is driven by light. The human body must photoentrain or synchronize itself with light in order to make this happen. The rod cells are the photoreceptor cells in the retina capable of sensing light. However, they are not what sets the biological clock. The photosensitive retinal ganglion cells contain a pigment called melanopsin. This photopigment is depolarized in the presence of light, unlike the rods which are hyperpolarized. Melanopsin encodes the day-night cycle to the suprachiasmatic nucleus (SCN) via the retinohypothalamic tract. The SCN evokes a response from the spinal cord. Preganglionic neurons in the spinal cord modulate the superior cervical ganglia, which synapses on the pineal gland. The pineal gland synthesizes the neurohormone melatonin from tryptophan. Melatonin is secreted into the bloodstream where it affects neural activity by interacting with melatonin receptors on the SCN. The SCN is then able to influence the sleep wake cycle, acting as the "apex of a hierarchy" that governs physiological timing functions. "Rest and sleep are the best example of self-organized operations within neuronal circuits".
   It is now known that the molecular circadian clock can function within a single cell; i.e., it is cell-autonomous. This was shown by Gene Block in isolated mollusk basal retinal neurons (BRNs). At the same time, different cells may communicate with each other resulting in a synchronised output of electrical signaling. These may interface with endocrine glands of the brain to result in periodic release of hormones. The receptors for these hormones may be located far across the body and synchronise the peripheral clocks of various organs. Thus, the information of the time of the day as relayed by the eyes travels to the clock in the brain, and, through that, clocks in the rest of the body may be synchronised. This is how the timing of, for example, sleep/wake, body temperature, thirst, and appetite are coordinately controlled by the biological clock.
   The earliest recorded account of a circadian process dates from the 4th century BC, when Androsthenes, a ship captain serving under Alexander the Great, described diurnal leaf movements of the tamarind tree. The observation of a circadian or diurnal process in humans is mentioned in Chinese medical texts dated to around the 13th century, including the "Noon and Midnight Manual" and the "Mnemonic Rhyme to Aid in the Selection of Acu-points According to the Diurnal Cycle, the Day of the Month and the Season of the Year".
   Section::::Visualizing the clockwork's "gears": structural biology of clock proteins.
   Humans, like most living organisms, have various biological rhythms. These biological clocks control processes that fluctuate daily (e.g. body temperature, alertness, hormone secretion), generating circadian rhythms. Among these physiological characteristics, our sleep-wake propensity can also be considered one of the daily rhythms regulated by the biological clock system. Our sleeping cycles are tightly regulated by a series of circadian processes working in tandem, which allow us to experience moments of consolidated sleep during the night and a long wakeful moment during the day. Conversely, disruptions to these processes and the communication pathways between them can lead to problems in sleeping patterns, which are collectively referred to as Circadian rhythm sleep disorders.
   Section::::Function and regulation.:Role in circadian rhythms.
   The term circadian derives from the Latin "circa" (about) "diem" (a day), since when taken away from external cues (such as environmental light), they do not run to exactly 24 hours. Clocks in humans in a lab in constant low light, for example, will average about 24.2 hours per day, rather than 24 hours exactly.
  
  The normal body clock oscillates with an endogenous period of exactly 24 hours, it entrains, when it receives sufficient daily corrective signals from the environment, primarily daylight and darkness. Circadian clocks are the central mechanisms that drive circadian rhythms. They consist of three major components:
   The circadian clock exerts constant influence on the body, effecting sinusoidal oscillation of body temperature between roughly 36.2 °C and 37.2 °C. The suprachiasmatic nucleus itself shows conspicuous oscillation activity, which intensifies during subjective day (i.e., the part of the rhythm corresponding with daytime, whether accurately or not) and drops to almost nothing during subjective night. The circadian pacemaker in the suprachiasmatic nucleus has a direct neural connection to the pineal gland, which releases the hormone melatonin at night. Cortisol levels typically rise throughout the night, peak in the awakening hours, and diminish during the day. Circadian prolactin secretion begins in the late afternoon, especially in women, and is subsequently augmented by sleep-induced secretion, to peak in the middle of the night. Circadian rhythm exerts some influence on the nighttime secretion of growth hormone.
   Sleep timing depends greatly on hormonal signals from the circadian clock, or Process C, a complex neurochemical system which uses signals from an organism's environment to recreate an internal day–night rhythm. Process C counteracts the homeostatic drive for sleep during the day (in diurnal animals) and augments it at night. The suprachiasmatic nucleus (SCN), a brain area directly above the optic chiasm, is presently considered the most important nexus for this process; however, secondary clock systems have been found throughout the body.
   An organism whose circadian clock exhibits a regular rhythm corresponding to outside signals is said to be "entrained"; an entrained rhythm persists even if the outside signals suddenly disappear. If an entrained human is isolated in a bunker with constant light or darkness, he or she will continue to experience rhythmic increases and decreases of body temperature and melatonin, on a period which slightly exceeds 24 hours. Scientists refer to such conditions as free-running of the circadian rhythm. Under natural conditions, light signals regularly adjust this period downward, so that it corresponds better with the exact 24 hours of an Earth day.
   The hormones cortisol and melatonin are effected by the signals light sends through the body's nervous system. These hormones help regulate blood sugar to give the body the appropriate amount of energy that is required throughout the day. Cortisol is levels are high upon waking and gradual decrease over the course of the day, melatonin levels are high when the body is entering and exiting a sleeping status and are very low over the course of waking hours. The earth's natural light-dark cycle is the basis for the release of these hormones.
   The SCN maintains control across the body by synchronizing "slave oscillators", which exhibit their own near-24-hour rhythms and control circadian phenomena in local tissue. Through intercellular signalling mechanisms such as vasoactive intestinal peptide, the SCN signals other hypothalamic nuclei and the pineal gland to modulate body temperature and production of hormones such as cortisol and melatonin; these hormones enter the circulatory system, and induce clock-driven effects throughout the organism.
   Since the SCN is responsible for mediating the production of melatonin by the pineal gland, it creates a feedback loop that regulates the production of melatonin according to the master circadian clock. As was discussed previously, the MT receptor is largely thought of as the major player in sleep-promotion and the MT receptor is most strongly linked to phase shifting activity. Both major subtypes of the melatonin receptor are expressed in relatively large amounts in the SCN which allow it to both regulate sleep-wake cycles and induce phase shifting in response to natural light-dark cycles. This functional diversity of melatonin receptors helps give the SCN the ability to not only keep near 24-hour time and entrain to an exactly 24-hour period, but also regulate, among other factors, wakefulness and activity throughout this cycle.
   The secretion of many hormones is affected by sleep-wake cycles. For example, melatonin, a hormonal timekeeper, is considered a strongly circadian hormone, whose secretion increases at dim light and peaks during nocturnal sleep, diminishing with bright light to the eyes. In some organisms melatonin secretion depends on sleep, but in humans it is independent of sleep and depends only on light level. Of course, in humans as well as other animals, such a hormone may facilitate coordination of sleep onset. Similarly, cortisol and thyroid stimulating hormone (TSH) are strongly circadian and diurnal hormones, mostly independent of sleep. In contrast, other hormones like growth hormone (GH) & prolactin are critically sleep-dependent, and are suppressed in the absence of sleep. GH has maximum increase during SWS while prolactin is secreted early after sleep onset and rises through the night. In some hormones whose secretion is controlled by light level, sleep seems to increase secretion. Almost in all cases, sleep deprivation has detrimental effects. For example, cortisol, which is essential for metabolism (it is so important that animals can die within a week of its deficiency) and affects the ability to withstand noxious stimuli, is increased by waking and during REM sleep. Similarly, TSH increases during nocturnal sleep and decreases with prolonged periods of reduced sleep, but increases during total acute sleep deprivation. 
   According to the Hobson & McCarley activation-synthesis hypothesis, proposed in 1975–1977, the alternation between REM and non-REM can be explained in terms of cycling, reciprocally influential neurotransmitter systems. Sleep timing is controlled by the circadian clock, and in humans, to some extent by willed behavior. The term circadian comes from the Latin "circa", meaning "around" (or "approximately"), and "diem" or dies, meaning "day". The circadian clock refers to a biological mechanism that governs multiple biological processes causing them to display an endogenous, entrainable oscillation of about 24 hours. These rhythms have been widely observed in plants, animals, fungi and cyanobacteria.
   In the early morning, light activates the "cry" gene and its protein CRY causes the breakdown of TIM. Thus PER/TIM dimer dissociates, and the unbound PER becomes unstable. PER undergoes progressive phosphorylation and ultimately degradation. Absence of PER and TIM allows activation of "clk" and "cyc" genes. Thus, the clock is reset to start the next circadian cycle.
  
  Section::::In "Drosophila".:PER-TIM Model.
   Section::::Function.
  
  Section::::Function.:Circadian clock.
  