What causes Insomnia ?
Secondary Insomnia
                
Secondary insomnia is the symptom or side effect of another problem. This type of insomnia often is a symptom of an emotional, neurological, or other medical or sleep disorder.
                
Emotional disorders that can cause insomnia include depression, anxiety, and posttraumatic stress disorder. Alzheimer's disease and Parkinson's disease are examples of neurological disorders that can cause insomnia.
                
Many other disorders or factors also can cause insomnia, such as:
                
Conditions that cause chronic (ongoing) pain, such as arthritis and headache disorders
                
Conditions that make it hard to breathe, such as asthma and heart failure
                
An overactive thyroid
                
Gastrointestinal disorders, such as heartburn
                
Stroke
                
Sleep disorders, such as restless legs syndrome and sleep-related breathing problems
                
Menopause and hot flashes
                
Secondary insomnia also can be a side effect of some medicines. For example, certain asthma medicines, such as theophylline, and some allergy and cold medicines can cause insomnia. Beta blockers also can cause the condition. These medicines are used to treat heart conditions.
                
Commonly used substances also can cause insomnia. Examples include caffeine and other stimulants, tobacco and other nicotine products, and alcohol and other sedatives.
                
Primary Insomnia
                
Primary insomnia isn't a symptom or side effect of another medical condition. It is its own distinct disorder, and its cause isnt well understood. Primary insomnia usually lasts for at least 1 month.
                
Many life changes can trigger primary insomnia. It may be due to major or long-lasting stress or emotional upset. Travel or other factors, such as work schedules that disrupt your sleep routine, also may trigger primary insomnia.
                
Even if these issues are resolved, the insomnia may not go away. Trouble sleeping can persist because of habits formed to deal with the lack of sleep. These habits might include taking naps, worrying about sleep, and going to bed early.
                
Researchers continue to try to find out whether some people are born with an increased risk for primary insomnia.