Group project completed with Dylan & Marc at Portland State University Winter term 2025
The control of heating and ventilation in indoor environments is vital for establishing a comfortable atmosphere that maximizes productivity and supports health. However, heating and ventilation consume a lot of energy in a building. Building consumes approximately 38% of the energy used in the U.S. (Department of Energy United States of America). We have developed a low-cost microcontroller control algorithm to resolve this issue by optimizing energy consumption. This control algorithm is designed to enable user-defined control and direct control ventilation of the heating and ventilation operation of a mock building. This algorithm helps control 1) heating off, 2) heating on with two electric heating pads, 3) ventilation off, and 4) ventilation on with fan speed increasing. With this algorithm's successful implementation, heating and ventilation management can become fully autonomous based on factors such as carbon dioxide levels and temperature inside a mock building. An example of this on a larger scale can be seen with artificial intelligence, which uses its user data to decrease power consumption and increase comfort (Chow).
Building heating is usually maintained at uncomfortable temperatures; therefore, humans need thermal comfort to perform better at work or at home. Heating is generally controlled by a switch and/or sensors that include a deadband, meaning the heater turns on at a specific temperature. Once a certain maximum temperature is reached, the heater will turn off. Then, the heater will only turn back on until the specific lowest temperature is reached. Ventilation is essential because indoor air is more polluted than outside air (United States Environmental Protection Agency). Ventilation in buildings is usually poor, primarily in outdated buildings. Ventilation in buildings is controlled using a switch, such as ceiling fans or outdoor exhaust in bathrooms. Humans are a main source of CO2 levels inside a building, emitting carbon dioxide (CO2). Within these two units (heating and ventilation), our group set out to create a mock building that can operate autonomously to keep the temperature within a set deadband via heat from two resistive heaters and a mixing fan, and have adequate ventilation from an output fan dispersing the polluted air inside the room. Our group successfully implemented these features in our mock building and gathered data about the changing temperature and CO2 levels inside the box.
The materials used are a clear plastic shoe box to simulate a home, low-cost Arduino-based sensors, including an SGP30 for CO2 emissions via ethanol concentration and a DHT11 sensor for the inside temperature and relative humidity of the box, heating mats to simulate inside heating systems, a fan to mix the air inside the enclosure, and a bigger PWM enabled fan to simulate outdoor ventilation.
SGP30
DHT 11
PWM fan
Heating Pads
This is all connected to an Arduino uno that runs code on Arduino IDE, which is connected to a breadboard with a high and low power rail to prevent damage to essential electronics. The heating mats are connected to a cascade control system, enabling safe control from the Arduino Uno. The cascade control system consists of a relay, a transistor, a flyback diode, and an indicator LED. The transistor’s base is connected to the Arduino Uno for control, while the collector and emitter are connected to the relay, which goes through the high-power rail. The relay’s contact side also goes through the high-power rail, which powers the heating mats and mixing fan, fully separating the relay circuit from the Arduino Uno. There is also an added flyback diode connected backward to the coil contacts on the relay, preventing a high voltage spike when power is cut from the transistor. The PWM fan is powered by the high-power rail and is controlled directly by Arduino Uno. The sensors are also powered by the high-power rail, and all analog and digital outputs are connected to the Arduino Uno for data.
Demonstrates the heating system working, with a 20℃ setpoint and a deadband of 0.2℃. When the temperature dips below 19.9℃, the heating kicks on and shuts off when the heat reaches 20.1℃. This allows the system to save energy by heating the space just enough to achieve the desired temperature.
CO2 was introduced into the system to simulate a high building occupancy. When the system detected that the CO2 levels were above 800 ppm (parts per million), the ventilation fan started ramping up to 100% speed at 1500 ppm. To save energy, when the CO2 levels are just below 1500 ppm, the fan slows down until it reaches its baseline low speed at 800 ppm. As Figure 2 shows, it is very efficient at clearing air out of the enclosure in a short amount of time, demonstrating that ventilation control is key in saving energy costs.
Tracking energy consumption through our mock building, it was found that when the enclosure's temperature and CO2 levels were at the desired range, the energy consumption of the heating and ventilation system was very small. Only when the temperature needed to be adjusted or the ventilation needed to be turned on due to air pollution did the energy consumption ramp up. This demonstrates that an autonomous heating and ventilation system can save energy, but more testing is needed to conclude the same results in a full-scale test. Future work should test the energy consumption of all heating and ventilation components at a more proportional scale and modify the code to minimize energy consumption for a whole day. This can be done by using the deadband feature to heat up at a specific time using data from the user data, e.g., time to wake up to determine when to start up to heat the house.
Controlling lighting in indoor environments is vital for establishing a comfortable atmosphere that maximizes productivity and supports health. It is a fact that lighting constitutes a substantial portion of energy consumption in buildings, which collectively account for about 38% of energy use in the U.S. (Department of Energy, United States of America). To tackle this issue, we have developed a robust control algorithm using a low-cost microcontroller that allows users to customize lighting operations in a physical room model. This sophisticated algorithm operates in four distinct modes: 1) off, 2) constantly on, 3) activated by activity detected through an ultrasonic sensor, and 4) triggered by input from a photoresistor. With the successful implementation of this algorithm, users can effectively manage lighting in their spaces. An example of this on a larger scale in commercial buildings can be seen by using AI to control lighting and ventilation, which has been proven to reduce power consumption (Chow). Our voltage drop measurements and current readings from the Neopixel confirm it consumes 2 W at full brightness when displaying blue light continuously for 24 hours
Indoor lighting is important because every building requires lighting, which requires energy. Energy is drawn by commercial buildings, totaling 4.35% of energy consumption (Department of Energy, United States of America). A light switch typically manages indoor lighting in residential buildings. Currently, sensors and artificial intelligence are being implemented to manage lighting systems in commercial buildings (Siemens). This technology can help reduce energy consumption by depending less on human mistakes, such as forgetting to switch off the lights when rooms are not in use. Automating systems to control lighting is essential because it can minimize power consumption, which can lead to a lower energy bill, and minimize light pollution and unnecessary use of power. This can result in a cheap process because most of the hardware is already in place, and most software is needed (Chow).
This project aims to develop a model of a light control system for a physical model of a room. The physical model of the system was constructed using an acrylic shoe box as the room, breadboard, Elego uno microcontroller, jumper wires, ultrasonic sensor, photoresistor, Adafruit, jumper wires, and 12V power source were used to assemble. 3D printed parts were used to mount the photoresistor, ultrasonic sensor, and the microcontroller. Both zip ties and screws were used to mount the 3D-printed parts to the acrylic shoe box. Holes were drilled both on top and the side of the shoe box to be able to use the screws and zip ties and pass the jumper wires inside the acrylic box. Figure 1 shows the primary components of the system: a photoresistor, an 8-LED strip Neopixel, an ultrasonic sensor, a button, jumper wires, a 12V power supply, an Elegoo Uno, and a pull-down resistor.
Ultrasonic Sensor
Button
Photoresistor
8 Strip LED
Arduino IDE control algorithm was used to accomplish four different lighting modes for a hypothetical living situation using boolean, count, millis, if statements, and user-defined functions. The ultrasonic sensor SR04.h, NewPing.h, and Adafruit_NeoPixel.h libraries were used for this code. The code used to control the system can be found in the uploaded ME121WinterModuleOne.ino file. The current draw and voltage were measured with a multimeter. The probes need to be connected to the COM and the voltage on the multimeter to measure the voltage. Then, COM must touch where the circuit is going back to the ground, and the voltage probe needs to feel a wire receiving a positive charge at any location, since this circuit is in series. Meanwhile, keeping the probes connected in the same place on the multimeter to measure the current draw, breaking the circuit is needed at the pull-down resistor, with COM connected to the ground source and the other probes connected where the circuit is broken, connecting back the circuit in a loop. This will make sure the circuit is in series and not in parallel
Mode 1
Lighting turned off
Mode 2
Lighting turn on
Mode 3
Lighting turns on by motion detection
Mode 4
Lighting intensity with photoresistor
The control algorithm developed operated the lighting of the physical model across four modes.. Each mode can be switched with a click of a button. The button function was used with count and millis functions to minimize the delay of each button press and debounce the button to reduce interference. Implementing the LED, photoresistor, and ultrasonic sensor worked as intended. For example, for the ultrasonic sensor, the LED will be turned off until it detects movements if it is less than 15 inches. If movement is detected, then the LED will turn on. After 5 seconds, it stops detecting movement, and then the LED turns off. A similar function can be seen in Mode 4, but this time, the LED brightness will depend on the light intensity of the room. For example, if the room is very dark, the light intensity will increase, therefore making the room brighter.
Measuring the current and voltage drop of our Neopixel light for Mode 2: it was calculated at 16.17mA and 5 volts, and for Mode 3, it was estimated at 23.2mA and 5 volts while detecting motion, and 3.2mA and 5 volts when no motion is detected/off. We compare the energy usage from the operation of lighting mode 3 and lighting mode 2. We assume that the box operates for 1 continuous day under the following assumptions: Mode 2 is on for 24 hours, and mode 3 detects motion for 16 hours and 8 hours where it detects no motion. We calculate the expected use of the power of Mode 2 to be around 1.9W. For Mode 3, the amount of power consumed is 2.1W(all calculations were made using a five-LED Neopixel in the same modes).
The lighting control circuit worked as designed. Implementing an occupancy control algorithm via an ultrasonic sensor is expected to save lighting energy if no movement detection is recorded. This also includes Mode 4, which is expected to save energy by decreasing or increasing the power required to brighten the LED depending on the light intensity. For Mode 1, this is expected to save the most energy due to not using any at all since it is off at all times, meanwhile, for Mode 2, it showed that this would use the second-highest amount of energy since it is on at all times. Meanwhile, Mode 3 would require the most power because it needs to power the ultrasonic sensor, which requires energy to look for movement constantly, but also uses energy while the LED is on. Future work should test lighting control systems at full scale and analyze data of high power consumption throughout the day to modify the code better and optimize the modes based on analyzing power consumption and consumer needs. The ultrasonic sensor may need a little more, especially optimizing the amount of time it sends a signal to check if there's movement, to reduce power consumption.
Works Cited
Chow, Andrew R. “How AI Is Making Buildings More Energy-Efficient.” Time, 11 December 2024, https://time.com/7201501/ai-buildings-energy-efficiency/. Accessed 16 March 2025.
Department of Energy United States of America. “Chapter 5: Increasing Efficiency of Building Systems and Technologies.” Department of Energy, September 2015, https://www.energy.gov/sites/prod/files/2017/03/f34/qtr-2015-chapter5.pdf. Accessed 16 March 2025.
iea. “Buildings.” Tracking Buildings, 11 July 2023, https://www.iea.org/energy-system/buildings. Accessed 16 March 2025.
United States Environmental Protection Agency. “Exposure Assessment Tools by Media - Air.” EPA United States Environmental Protection Agency, 31 January 2025, https://www.epa.gov/expobox/exposure-assessment-tools-media-air. Accessed 16 March 2025.
Siemens. “Smart Buildings.” Siemens, https://www.siemens.com/global/en/products/buildings/smart-buildings.html. Accessed 3 February 2025.