A smart air conditioning and heating system, with some modification, could help keep the air in your home cleaner, University of Utah engineers say in a new study.

Controlling a home HVAC system based on indoor air quality — not just on temperature, as a regular thermostat does — can reduce indoor air pollution without wasting a lot of additional energy, according to the study released Wednesday. Neal Patwari and Kyeong T. Min, a professor and doctoral graduate in electrical and computer engineering at the U., are the lead authors.

“People don’t really think about pollution in their own homes,” Patwari said Wednesday. “They see it outside when they look at the mountains. But in their home, they can’t see it.”

Patwari and his team bought portable air pollution sensors, available at most hardware stores, and connected them wirelessly to Raspberry Pis, a brand of inexpensive computer used to learn programming. The engineers developed software that would automatically turn on the air conditioning system whenever the particulate count hit a certain number, and shut it off when it dropped below a preset level.

A dozen sensors were installed in four Salt Lake Valley homes in 2017. In each house, two sensors were placed inside, and one was put on a covered porch outside. Beginning at midnight each night, each home would operate randomly in one of three modes: “Normal,” using the thermostat to turn the air on based on temperature; “Always on,” running the fan nonstop all day; and “SmartAir,” turning the air system on based on temperature and pollution measurements.

Data collected over five months showed that the SmartAir setting cleaned the air nearly as much as running the fan all day, but used 58 percent less energy. When the HVAC was run just by temperature, it used less energy than SmartAir, but the air was 31 percent dirtier.

A SmartAir system, Patwari said, could be particularly useful for people with asthma and other respiratory problems. He added that air-quality sensors are getting less expensive, and anyone with some technological know-how could link to a smart thermostat — and the code his team wrote is available for free.

Patwari said his team aims to look at other ways to use smart-home technology to aid people’s health. “What can you do to have your smart home allow you to run experiments on yourself?” he said.

In another announcement Wednesday, a two-year study led by researchers at Salt Lake City’s Intermountain Medical Center found that high-efficiency particulate air, or HEPA, filters significantly reduce fine particulate matter in the air compared with non-HEPA filters.

In that study, researchers monitored air quality for 12 weeks in 52 homes of enrolled patients with respiratory problems — six weeks with HEPA filters, six with non-HEPA filters. The study was done over the winter of 2016-17 in Utah, during the valley’s notorious inversion season.

The study, led by Intermountain pulmonary researcher Denitza Blagev, found the HEPA filters reduced fine particulate matter by 55 percent, and reduced outside pollution coming inside by 23 percent.

“Running a stand-alone in-home HEPA filter and having the windows in the home closed can provide cleaner air inside the home, especially when outdoor air quality is so poor,” Blagev said in a statement.

Intermountain’s study was presented Sept. 16 during the European Respiratory Society’s International Congress in Paris.

The U. team’s findings were published in a paper — “Smart Home Air Filtering System: A Randomized Controlled Trial for Performance Evaluation” — presented Wednesday at an industryConference on Connected Health in Washington, D.C.

Patwari’s engineering team collaborated with other U. scientists, particularly biomedical informatics and clinical asthma researchers. The study was funded as part of a National Institutes of Health program, called Pediatric Research using Integrated Sensor Monitoring Systems (PRISMS).