Melatonin has got the name vampire hormone, not because it is sinister but simply because is released at night. Melatonin is the chemical through the suprachiasmatic nucleus (a part of the brain which receives the light input) and communicates to the body.
One might expect to have highly synchronous brain waves while wakefulness, matching the ordered pattern of your (mostly) logical thought during waking consciousness. But this is not true as seen in the wave pattern. This chaotic waveform is explained by the different functioning of the different brain parts at different times in different ways.