This a state-of-the-art sustainable home system prototyped with Arduino using Embedded C. The system is able to capitalize exterior nature lighting and temperature to optimize the interior lighting and HVAC systems through the communication between two microcontrollers using MQTT, a messaging protocol for the Internet of Things (IoT). In this project, the lighting system is simulated with LED lights, and the HVAC system is simulated with the motor and wheels. This project is completed for my Embedded System class where my partner and I were tasked to create a system using IoT.

How does the system work?

The system consists of two Arduino microcontrollers, one installed inside the house controlling the actuators (lights, ventilation motors), and the other installed outside the house processing the information retrieved from light and temperature sensors. Communications are made using the open-source Mosquitto broker (MQTT) with the application of the publisher and subscriber model.

In the publisher and subscriber model, the exterior Arduino connected to the sensors is the publisher, sending information to the server and the interior Arduino connected to the lighting and motors is the subscriber, receiving information from the server.  Our original plan was to use Adafruit.io broker as it could also display data for public view with existing dashboard templates. However, we encountered limitations in connecting the server to both devices, as well as receiving and pushing data simultaneously. Therefore, we switched to Mosquitto MQTT broker, a lightweight protocol that connects two Arduinos with the same publish/subscribe model. This protocol allows fast and seamless communications of devices assigned to the same unique topics defined by the programmers. 

Why did we choose the Mosquitto MQTT broker?

Optimize the natural light resources

The system takes the voltage readings from the light sensors that detect exterior natural lights and converts the readings to integers using ADC. This reading is sent to the Mosquitto server in string messages and received by the microcontroller that controls the lights. 

This subsystem is especially useful for buildings with large window areas as it optimizes the energy efficiency used in lighting by taking advantage of natural lights.

Capitalize the outdoor temperature

This subsystem follows a similar concept as the lighting subsystem. We used the DC motor to simulate a cooling system of fans so that when the ADC value taken from the temperature sensor rises to a set threshold, the motor (running hypothetical fans) starts running with the increase of PWM duty cycles. Its speed is dependent on how hot it gets outside. In other words, the higher the temperature (the hotter it is outside) the higher the speed at which the fans are spinning. This subsystem is especially useful for buildings situated in regions with great temperature differences throughout the day (such as New Hampshire) It could help save energy on the hot summer nights!

This project exposed me to topics such as the Internet of Things and the publisher and subscribe models. It is very fun to combine our knowledge of embedded systems with these new topics to create systems of our choice. There were a lot of trials and errors such as finding the right broker and figuring out what worked and what did not. Through these experiments, we also discovered the limitations of the publish/subscribe models with different brokers and learned to avoid them as we were working on the project. 

While working on this project, I was also working on my senior project on building energy in horticultural facilities (read it here). Lighting and HVAC systems are important in maintaining a stable and controlled growing environment. Therefore, controlling indoor temperature to a precise value is critical for optimal cultivation. However, this normally means inefficiency and excessive energy consumption. This embedded system project allows me to think about this topic outside of modeling and number crunching by approaching it from a more hands-on perspective.