Sleep has become the Shangri-La of modern times. Amid deadlines, demands and distractions, getting eight hours is akin to finding a mythical paradise. But a good night’s sleep may not be as elusive as it seems. All you need to do is swap your smartphone for a tent.

A new study by US scientists has found that camping can help us sleep better and reset our body clock. A group of five people were sent into the mountains for six days with no gadgets, not even torches. The campers racked up nearly 10 hours sleep each night, almost three hours longer than they were used to getting at home.

This result does not surprise me because spending time outdoors saved me from insomnia. For a mind-churning six months a few years ago I lived in a waking dream – or rather a nightmare. I spent my days trying to stay awake after a woeful night of restlessness. As evening drew on I became obsessed with making everything perfect for sleep. I would stock up on herbal sleep aids before bed. Despite this, my mind refused to switch off and I would wake up groggy. When sleep didn’t come I became frustrated, tired and emotional.

Then something amazing happened. I went trekking in Slovakia’s High Tatra mountains, staying in small basic cabins every night. For the first time in months, sleep came to me like a warm, welcome hug. I had decided to make the trip because I hadn’t done anything like it since I was a teenager. I would spend the days walking and chatting, breaking only for food. When night came and we were thrust into pitch darkness my body relaxed and I was out for the count.

When I came back home I was desperate for the good sleep to continue, but after a week the insomnia returned. I decided to go for a walk after work each day in the park and spend my weekends being active outdoors. After a few weeks I noticed my sleep improving again. I went further still, shutting artificial lights out of my room and ditching my smartphone and laptop before bed.

Our bodies keep time using our internal clock, releasing the “sleep hormone” melatonin when it’s time to rest and cortisol when it’s time to wake. Traditionally, the sun has controlled our waking and sleeping system – as the sun rises melatonin production drops off and cortisol production goes up. But less natural light and more computer light confuses the body’s circadian rhythm (our biological clock) and messes up sleep.

It was next to impossible to get wifi in the mountains, so with no way of going online, I switched off. This meant no artificial lights (apart from my torch). Like the campers in the US study I didn’t use my gadgets.

But it’s not just getting more natural light that makes being outdoors beneficial. The biophilia hypothesis suggests humans have an innate tendency to seek connections with nature and other forms of life. It’s believed that the deep affiliations we have with other life forms and nature as a whole are in our biology.

Other studies have shown that taking part in nature-based activities can reduce stress and anxiety. Last year research conducted by the University of Essex found that green care initiatives (such as care farming, or the therapeutic use of farming practices, environmental conservation and social and therapeutic horticulture) can help people with mental health problems. It has also been found that having a view of trees and nature from a hospital window can decrease recovery time from surgery.

I believe the therapeutic powers of nature come from the fact that being outdoors helps us feel connected to something greater than ourselves. We spend our lives obsessing over trivial problems but the natural world is indifferent to these daily struggles. The world keeps spinning whether I sleep or not.

So for those who struggle to sleep, my advice is simple – if not a little cheesy. Go outdoors and find your Shangri-La.