Pineal Gland The pineal gland is a small, pea-sized endocrine gland located deep in the center of the brain. Despite its small size, it plays a major role in regulating your internal biological clock. Its primary function is the production of melatonin , a hormone that helps coordinate your sleep-wake cycle and supports circadian rhythm balance. How the Pineal Gland Regulates Sleep The pineal gland responds to light signals detected by the eyes. When light enters the retina,