Media playback is unsupported on your device Media caption The parents of restless toddler Elise try out a new bedtime routine

Hospital attendances in England for children under 14 with sleep disorders have tripled in 10 years, according to NHS data analysed by BBC Panorama.

Ten times more prescriptions of common sleep medication melatonin have also been written for children and adults under 55 over the same period.

Poor sleep in children has been linked to a greater risk of obesity, lower immunity, and mental health issues.

It is also linked to lack of emotional control and poor school performance.

Are you getting enough sleep?

How to handle older children's sleep problems

Sleep deprivation 'costs UK £40bn a year'

Many aspects of how we live today are thought to interfere with children's sleep:

Blue light emitted by smartphones and tablets is known to reduce the natural production of melatonin, the hormone that makes us feel sleepy

Households where both parents work can be busier in the evenings, pushing bedtimes later

Fizzy drinks high in sugar and caffeine have also made it harder for children to switch off at night

Image caption Ellie Keady has trouble sleeping

Ellie Keady, 13, recently spent the night under observation at Sheffield Children's Hospital's sleep service, which has seen a tenfold increase in referrals over the past decade.

Ellie goes to bed at 2100, but usually lies awake until at least 0230.

"Sometimes I'll go to school and I'll have had only two and a half hours' sleep," she says.

Sleep deprivation has affected her education. She is often off sick due to exhaustion and viral infections.

"If you sneeze in her room, Ellie will catch the flu," says her mother, Joanne.

Ellie has suffered sleep problems since she broke her foot in 2011.

She was unable to walk for months and started to put on weight.

She recently lost 2st 7lb (16kg) in six months on a strict diet and exercise regime, but has found dieting a challenge.

Research suggests a strong link between sleep deprivation in teenagers and weight gain.

Poor sleep is thought to upset the balance of the hormones that tell our brains we are full or hungry, making it harder to control appetite.

When tired, we are more likely to crave foods high in sugar and fat.

When a nurse at Sheffield Children's Hospital explained this link to Ellie, it made sense.

"If I've had a bad night, the diet is hard to stick to," Ellie says.

"I don't want chicken, I don't want vegetables, I just want a packet of crisps.

"I never knew that was from being tired."

Overnight investigation showed no medical explanation for Ellie's sleep problem.

The staff suspect she may just need a better sleep routine: she has a smartphone, two tablets and a television in her bedroom, and uses them just before bed.

Staying off her devices an hour before bedtime might help both her sleep and her weight loss.

The Children's Sleep Charity has found 92% of the families using their specialist clinics had solved their child's sleep problems within six months by changing their bedtime routine.

The charity says sleep problems are costing the NHS unnecessary millions in needless GP and paediatrician appointments and prescriptions.

Image caption Dr Hill warns that sleep problems are putting a strain on the NHS

"We know there's a cost burden to the NHS here and now from childhood sleep difficulties," says Dr Catherine Hill, associate professor at the University of Southampton and consultant at Southampton Children's Hospital.

"If we continue to ignore emerging research evidence about the importance of sleep to health, we're potentially storing up problems for the NHS in future.

"We desperately need to get children's sleep on the public health agenda.

"We've done it with nutrition: people are starting to understand the perils of sugar, the dangers of childhood obesity.

"We now need to wake up to the importance of sleep."

Figures show the number of prescriptions in England for melatonin rose to nearly 600,000 in 2015.

Melatonin is licensed as a treatment only for people over 55, but it is commonly prescribed to younger people, even though it has not officially been licensed for that purpose.

Graphics produced by Will Dahlgreen.