Even before Florence Nightingale advised that hospitals be designed to let daylight in, people observed that sunshine helps keep you healthy. But there was not much research to explain why that's the case, especially inside buildings.

Researchers at the University of Oregon set up a study of dusty, dollhouse-size rooms to compare what happens in rooms exposed to daylight through regular glass, rooms exposed to only ultraviolet light and those kept dark. They used a mix of dust collected from actual homes in the Portland area and let the miniature rooms sit outdoors while keeping the insides at a normal room temperature.

After 90 days (because that's how long dust can hang around, even if you vacuumed), they sampled the dust and analyzed the types of bacteria present.

What they found surprised them and confirmed what your grandmother already knew: Rooms exposed to daylight have fewer germs. In fact, the study showed that the lit rooms had about half the viable bacteria (those that are able to grow), compared with dark rooms. Rooms that were exposed only to UV light had just slightly less viable bacteria than ones exposed to daylight. Their research was published Wednesday in the journal Microbiome.

Since we spend so much time indoors, the new research could give insights into the relationship between air quality and light. "I think it's a novel study because they looked at the effect of visible light, and they were also looking at real bacterial communities and real household dust," says Linsey Marr, a professor of civil and environmental engineering at Virginia Tech who specializes in indoor air quality and was not involved with this study.

The study's lead author, Ashkaan Fahimipour, a postdoctoral researcher at the University of Oregon's Biology and the Built Environment Center, says he was surprised that the visible light and the UV light performed so similarly to keep bacteria down.

The researchers looked at both types of light because UV is known to be a good disinfectant and is used to clean drinking water. Yet typical window glass filters out most UV light.

Another surprising thing was the amount of microbes that were viable in dust. Earlier studies didn't suggest it would be as much, says co-author Kevin Van Den Wymelenberg, co-director of the Biology and the Built Environment Center at the University of Oregon. That's because indoor dust is like a desert — it's too dry for most bacteria or other things to grow. This study found 12 percent of bacteria in dark rooms were viable compared to 6.8 percent in rooms with daylight and 6.1 percent in rooms exposed to UV light only.

While it may not sound like much, "6 percent of millions of cells is still a lot of microbes," Van Den Wymelenberg says. "Until now, daylighting [illuminating a building with natural light] has been about visual comfort or broad health. But now we can say daylighting influences air quality."

The daylit rooms in the study also had less of the types of bacteria associated with human skin, which people shed as they move around indoors, and more closely resembled outdoor bacterial communities. Some of the human-associated bacteria species that didn't survive in the lighted rooms are from a family of bacteria known to cause respiratory disease.

In their future work, the researchers said they'd like to design studies to determine how much light is necessary to kill microbes so architects can begin to design buildings with that in mind.

Also, researchers have learned from trying to eradicate all germs in hospital and laboratory clean rooms that it's really hard to get rid of microbes wholesale. "Sanitizing isn't the best approach," Fahimipour says. And some microbes are actually good for us, like the ones in yogurt. Someday, he says, "it may be better to enrich an indoor setting with microbes that are not harmful or even [with those that are] beneficial."

Kathleen O'Neil is a freelance science writer who lives in the Washington, D.C., area.

