Blog post

Sometimes You Just Need to Vent

Projects
By Nick Bild
Sometimes You Just Need to Vent

The energy wasted in buildings due to poor monitoring of environmental conditions is a significant and costly issue that has far-reaching environmental and economic implications. Inefficient heating, cooling, and lighting systems, as well as inadequate insulation and ventilation, are common culprits when it comes to energy wastage in buildings. According to statistics from the U.S. Environmental Protection Agency buildings are responsible for about 40% of total energy consumption in the United States, with a substantial portion of that energy going to waste due to suboptimal environmental monitoring and control systems.

One of the primary reasons for this energy inefficiency is the lack of real-time data and control in many traditional buildings. Inefficient HVAC systems, for example, run on preset schedules, regardless of actual occupancy or weather conditions, leading to unnecessary energy consumption.

Smart building technologies offer a promising solution to address these problems. These technologies leverage sensors, data analytics, and automation to optimize energy usage based on real-time environmental conditions and occupancy patterns. By monitoring factors such as temperature, humidity, occupancy, and natural light, smart building systems can make intelligent decisions to minimize energy waste while maintaining comfort and safety.

The smart ventilation system hardware

However, there are challenges associated with the adoption of smart building technologies. One of the most significant obstacles is the initial expense of retrofitting existing buildings with these systems. The cost of sensors, control systems, and integration can be substantial, making it a deterrent for many building owners. Additionally, the complexity of implementing these technologies can be a barrier, requiring specialized expertise and potentially disrupting daily operations during installation.

With all of the incredible advances we have seen in edge machine learning hardware and algorithms in the past several years, engineer Jallson Suryo is convinced that there must be a way to solve these problems. And after seeing the proof of concept smart ventilation system that he just created, we’re inclined to believe him. This system consists of a scale model of a window and blinds, as well as some low-cost microcontroller development boards.

The smart ventilation system leverages two distinct sources of data — sound (to listen for rain or thunder), and a number of environmental parameters, like temperature, humidity, and light levels. A separate machine learning model was trained in Edge Impulse Studio for each of the data sources, and the predictions made by the models were used to open or close the window and blinds. In this way, the window can be opened up on comfortable days, but the window and blinds will both close if it is hot and sunny. And the system is always sure to shut the window before rain gets in.

pastedGraphic_1.png
The proof of concept device

Suryo selected the Arduino Nicla Voice for processing the sound data, because it already has a high-quality microphone built in, and also Syntiant’s powerful NDP120 Neural Decision Processor that makes running local machine learning algorithms a breeze. For similar reasons, the Arduino Nano 33 BLE Sense development board was chosen to analyze the environmental data — the sensors are already onboard, and there is sufficient horsepower to run a machine learning model that has been highly optimized for resource-constrained devices by Edge Impulse. These boards were wired to a trio of servo motors to control opening and closing of the window and blinds, and a rechargeable battery provided the entire system with power.

After setting up the hardware, Suryo got busy collecting the data that would be needed to train the models. First, freely available samples of rain and thunder sounds were acquired from a variety of Internet sources. Next, an air-conditioned room, hot water, a light, and an iron were utilized to simulate a variety of environmental conditions in the immediate vicinity of the sensors. Each dataset was then uploaded to a separate Edge Impulse Studio project with the Data Acquisition tool.

An impulse designed for audio classification

For the audio classification pipeline, an impulse was created to analyze the data. This began with preprocessing steps to split the audio data into approximately one second segments, then extract the most informative features from them. The features were then forwarded into a neural network that was designed to classify audio as rain, thunder or normal background noises. This neural network was specially designed to run on the Nicla Voice’s NDP120 Neural Decision Processor.

The classification accuracy of the model was reported as being 93% after training, and that was backed up by the result of the model testing tool, which reported the average classification accuracy rate as 92%. With such good performance having been achieved right off the bat, Suryo downloaded the impulse and deployed it to the Nicla Voice to run local inferences.

The models proved to be highly accurate classifiers

Next up, a separate impulse was created to interpret data from the environmental sensor.  As with the audio classifier, the sensor measurements were first split into one second segments. After that, only the relevant data types (temperature, humidity, and light level) were selected — the Arduino Nano 33 BLE Sense is capable of measuring many more parameters. The raw data was then passed into a neural network classifier that was constructed to recognize conditions that are comfortable, overcast, sunny and dry, or sunny and humid.

After training this model, the average classification accuracy was reported as being 94%.  It is a good practice to validate such results by using a set of data that was held out of the training process. That was done by using the model testing tool, which reported the classification accuracy as being 100%.

With little room for improvement, Suryo deployed the data analysis pipeline from Edge Impulse Studio as an Arduino library. It was modified to receive data via I2C from the Nicla Voice as it classifies audio, and combine that information with the inferences made from the environmental sensing model. This combined information was then leveraged to control the servos that adjust the window and blinds to put them in an appropriate state given the present conditions.

There is little question that the smart ventilation system created by Suryo is simple to build, but it is even easier to put into use, because it operates completely automatically. When also factoring in the low cost of the hardware, it is easy to imagine a system of this sort being deployed in real-world settings with a little bit of refinement. If you would like to build your own copy of the device, the Edge Impulse Studio projects have been made public (rain and thunder, environmental conditions). You will also want to be sure to check out the project write-up for all the details you need to get going.


Want to see Edge Impulse in action? Schedule a demo today.

Comments

Subscribe

Are you interested in bringing machine learning intelligence to your devices? We're happy to help.

Subscribe to our newsletter