Melatonin is a hormone that is produced by the pineal gland and regulates sleep and wakefulness.
Light affects how much melatonin your body produces, its level begins to rise in the mid-to-late evening, remain high for most of the night, and then drop in the early morning hours. With the use of electronic devices producing light (such as smartphones, tablets, and computers), the process of producing melatonin can be disrupted and lead to symptoms like seasonal affective disorder (SAD) or depression