You might sleep better at night if your smartphones, tablets and other digital toys had their own bedroom.

Jupiterimages, ThinkStock

A recent poll by the National Sleep Foundation revealed that 89 percent of parents have at least one electronic device in their bedroom while they are sleeping, and 75 percent of children ages 6 to 17 have the same.

Even more troubling, many parents and children are using the devices long after the lights should be out.  One in four parents are still sending emails or texts in the bedroom late in the evening, and one in six of their kids are doing the same, according to the poll.

"Parents serve as role models for their children, so if their children know they're doing it, then the children themselves are more likely to do this as well and will have disturbed sleep as a result," said Kristen Knutson, a sleep researcher at the University of Chicago and author of the poll.

The devices are wreaking havoc on the quality of sleep people are getting, especially children, even when those devices aren't being used.

Knutson said light and sound, two components of phones and computers, can be the body's worst enemy when trying to relax prior to sleep.

Teens who leave electronic devices on get about 30 minutes less of sleep a night than those who turn their devices off.

Parents need to set limits for their children on the use of electronic devices in the bedroom. Knutson said powering devices down an hour before sleep is a good start to achieving a better night's sleep.

"We hope that the parents will set a whole family-level sleep environment that helps improve sleep for everybody in the home," she said.

The poll also revealed that children of parents who set and enforce sleep rules get 1.1 hours more of sleep per night than children of parents who don't set and enforce rules.  Overall, 62 percent of parents said they enforce at least one sleep-related rule.

The NSF recommends that children ages 6 to 10 get 10 to 11 hours of sleep per night.  Children ages 11 to 17 need between 8.5 to 9.5 hours of sleep per night.  Recommendations for adults vary.