Secondary insomnia is a result of an underlying disease, condition or medication. These may include Depression, anxiety, post-traumatic stress disorder (PTSD), Pain, Illness, such as some heart and lung diseases, Medications, Caffeine, tobacco, alcohol, Another sleep disorder, such as sleep apnea or restless leg syndrome, Changes in sleep routine or shift work or Poor sleep environment.