How to build your own air quality monitor with ESP32

Last update: August 21th, 2026

Father and children playing in a modern and bright living room, representing the home environment where air quality is measured.

These days, we spend most of our time indoors, and the truth is that indoor air can be much more polluted than outdoor air. Whether it's from wood-burning stoves, cooking, or simply poor ventilation, breathing air laden with invisible particles eventually takes its toll. Fortunately, thanks to open-source electronics, we no longer need to spend a fortune on industrial equipment to know exactly what we're breathing in our living rooms.

Using an ESP32 as the project's brain , we can build a super-powerful monitoring station that not only tells us if the air is "bad," but also breaks down the mass of particles and harmful gases. From minimalist projects to touchscreens that look like they're straight out of a science fiction movie, the possibilities are enormous for anyone who wants to take control of their environmental health without excessive complications , similar to how other programmable robots are created with the ESP32.

Young hands assembling a programmable robot with electronic circuits and wheels
Related articles:
Complete guide to programmable robots with ESP32

Reference projects: Aura and AirGradient ONE

Close-up of an ESP32 microcontroller on a work surface, the electronic brain of the monitoring project.

If you're looking for inspiration, there are two very clear paths. On the one hand, there's Project Aura, a DIY powerhouse that uses an ESP32-S3 with a 4,3-inch IPS touchscreen . The most amazing thing about Aura is that it uses the Sensirion SEN66 sensor, capable of measuring everything from PM1 to PM10, CO2, and volatile organic compounds (VOCs). It even allows you to add an SFA30 formaldehyde sensor, something almost no one else does, making it a near-professional tool for educational settings or very demanding homes.

On the other side of the spectrum is the AirGradient ONE, which is arguably the gold standard of open source . It's much more compact and uses an ESP32-C3 alongside highly reliable sensors like the PMS5000 for particles and the Senseair S8 for CO2. While Aura focuses on massive local visualization, AirGradient prioritizes modular precision and simplicity , making it the ideal choice for those who prefer to integrate everything into a Home Assistant dashboard using ESPHome or even turn an old Kindle into a smart dashboard.

  Plex vs Jellyfin: Complete Comparison of Media Servers

The heart of measurement: Laser sensors vs. cheap sensors

Electronic prototype on a breadboard with the microcontroller and an LED lit, illustrating the assembly phase.

This is where many people go wrong. There are inexpensive dust sensors (like the DSM501A) that basically measure how much a beam of light is obscured. These tell you "I'm dirty," but they don't give you any real data. In contrast, laser sensors like the Sensirion SPS30 or the PMS5003 use light scattering to count individual particles and calculate their mass in micrograms per cubic meter (µg/m³).

Having a laser sensor allows you to distinguish between stove smoke (many ultrafine particles) and construction dust (few but very heavy particles). This difference is vital because PM2.5, which are the most dangerous particles when they reach the alveoli of the lungs, are measured much more accurately using this size-based counting system.

Kindle as a dashboard
Related articles:
How to turn an old Kindle into a smart dashboard

Technical assembly and energy management

Person soldering electronic components on a workbench, representing the manual construction of the device.

If you decide to build one, be very careful with the power supply. A common mistake is powering the sensor from the ESP32's 3,3V pin. The SPS30's fan, for example, has a startup current peak of around 800mA, which can cause the microcontroller to constantly restart . Ideally, you should use a 5V boost converter to power the ESP32's VIN pin and the sensor directly, ensuring a proper power supply for the device.

To prevent the device from entering a brownout loop, it's highly recommended to schedule a staggered boot . This involves first turning on the screen, waiting a few seconds, activating the sensor, and only then turning on Wi-Fi. Additionally, reducing the Wi-Fi transmission power to 15dBm helps prevent sudden voltage drops in the 18650 battery that could compromise system stability.

  What is Telnet? How it Works, Uses, Security, and Alternatives

Software, Cloud and Smart Alerts

Smartphone displaying an air quality monitoring app with PM2.5 and CO2 indicators in a modern living room.

At the code level, the most practical approach is to use MQTT to send the data to a broker. If you don't want to deal with your own servers, platforms like CircuitDigest Cloud allow you to create quick dashboards and, best of all, configure automatic alerts via WhatsApp . Imagine the air quality index exceeds a critical threshold and you receive a message on your phone warning you that it's time to open the windows.

It's essential to adapt the Air Quality Index (AQI) to your country's regulations. For example, Chile uses the ICAP, where a value of 100 corresponds to the daily PM2.5 standard. Using an Indian or American scale is pointless if you want to compare your data with official stations in your city. You need to create a mathematical function that translates micrograms to the local index; otherwise, it will be nothing more than a toy. By doing this, you'll transform it into a useful measuring tool.

power sources
Related articles:
Complete Guide to PC Power Supplies

Practical tips for encapsulation

Don't put the sensor in just any enclosed box. The SPS30 needs constant airflow, so the enclosure must have two well-designed openings : one for intake and one for exhaust. If you only use one hole, the air will be recirculated, and the readings will be inaccurate. Also, separate any heat-generating electronics (like the voltage regulator) from the sensor, as hot air alters the relative humidity and can skew the results downwards, similar to how airflow is managed in PC fans.

  What is the Internet and how does it work?

For those looking to optimize battery life, the key is deep sleep mode . Instead of measuring every second, you can program the ESP32 to wake up every fifteen minutes, take a sample, upload it to the cloud, and go back to sleep. With this trick, a battery that would normally last a few hours can last for several weeks without needing a recharge.

Combining an ESP32 with high-end laser sensors allows you to transform a space into a professionally monitored environment. Whether it's with the visual power of Project Aura, the simplicity of AirGradient, or a custom setup with WhatsApp alerts and energy optimization, the key is to transform invisible data into concrete actions to improve respiratory health at home.

PC fan configuration
Related articles:
PC Fan Configuration: A Complete Guide to Curves and Airflow