Melatonin is actually released by your brain on its own when the sun starts to set. It is in constant production while the sun is up. Another reason why heavy smokers find it hard to quit, they usually don't get out in the sun during the day, therefore their brain doesn't produce any melatonin, so they can't sleep at night after.