What Started as an AQI Monitor Became a Tiny Observability Platform

How an ESP32 air-quality monitor grew into a multi-sensor observability platform with persistent history, dashboards, Telegram alerts, and SRE lessons.

I did not set out to build an environmental monitoring system. I just wanted to know what the air inside my room actually looked like. (thanks to my allergies). Not how it felt. Not whether it seemed dusty. Not whether the room felt stuffy. I wanted numbers.

I have a small kid at home and will have guests in times and I want to understand the readings in the room when I'm playing with the kid or during the chats with folks, consider it as an experiment mostly to improve the mood in the room.

So I started with a Sensirion SPS30 particulate matter sensor and an ESP32-S3. That first version could measure PM1.0, PM2.5, PM4 and PM10, show the readings on a display, and serve a small webpage over Wi-Fi. It was supposed to be a simple AQI project. It did not stay simple for long.

The first ESP32-S3 air-quality monitor showing particulate-matter readings from the SPS30 sensor

First version with AQI detail alone

The completed air-quality monitor rotating through environmental readings on its local display

Final version of the project with data from sensors in different screens

The moment you make an invisible thing measurable, you start noticing everything your measurement cannot explain.

That is how this project grew from a dust monitor into a small environmental observability system with CO2, temperature, humidity, VOC, NOx, historical storage, web dashboards, Telegram integration and alerting.

And somewhere along the way, I realized I was approaching my room almost exactly the way I would approach a production system as an SRE.

The First Version: Can I See the Dust?

The first sensor was the Sensirion SPS30. It measures airborne particulate matter using laser scattering and reports several particle-size categories.

For this project, the most visible metrics were:

  • PM1.0
  • PM2.5
  • PM4
  • PM10
  • Particle counts across different size ranges

The first few days were fun because particulate matter is easy to correlate with real life.

  • Cooking? - The graph moved.
  • Dusting? - The graph moved.
  • Opening the balcony door? - Sometimes the graph moved dramatically.

What had previously been "the room feels dusty" now had a timeline.

That alone made the project worthwhile. But I eventually hit an obvious limitation. There were times when PM2.5 looked perfectly normal and the room still felt stale. The SPS30 was not wrong. I was simply asking one sensor to explain something it was never designed to measure.

That led to CO2.

Adding CO2 Changed the Meaning of the Project

The second major sensor was from the Sensirion SCD4X family, connected through a 7Semi breakout board. The job of this sensor was simple: measure carbon dioxide. That added a completely different dimension.

  • The SPS30 answered: What particles are suspended in the air?
  • The SCD4X answered: How well is the room being ventilated?

Those are not the same thing.

A closed bedroom can have excellent particulate readings while CO2 steadily climbs as people remain inside. The air can feel uncomfortable even though there is almost no dust or smoke.

Once CO2 was visible, the limitations of treating "air quality" as a single number became obvious. There was no single magic AQI value that could describe everything happening in the room. There were multiple signals.

That was the first point where the project started feeling familiar from an SRE perspective. A production system is not healthy because one dashboard is green. A room is not healthy because one sensor looks good.

Then I Wanted Better Atmospheric Context

CO2 was useful, but I still wanted reliable temperature and humidity data. So I added a 7Semi SHT45 + SGP41 module.

The SHT45 became the primary source for:

  • Temperature
  • Relative humidity

At this point I deliberately separated responsibilities between sensors. The SCD4X could concentrate on CO2. The SHT45 could provide accurate atmospheric measurements.

That may sound like a small implementation detail, but I prefer systems where each component has a clear job. The same thinking applies in software.

Components that do one thing clearly are easier to reason about than components that are responsible for everything.

The final prototype with the ESP32-S3, particulate, CO2, temperature, humidity, VOC, and NOx sensors connected

Final working version with all sensors connected

With those three sensors, the monitor could now tell me:

  • How much particulate matter was present
  • Whether ventilation was adequate
  • How warm the room was
  • How humid the room was

That already felt fairly complete. Then I started looking at the SGP41.

VOC and NOx Made the Project Much More Interesting

The SGP41 adds two gas-related signals:

  • VOC
  • NOx

VOC stands for volatile organic compounds. These can come from things such as cleaning agents, perfumes, paints, solvents, cooking and many other household sources.

NOx refers to nitrogen oxides, which are associated more closely with combustion and pollution sources.

At first, I expected these to behave like every other measurement. Read the sensor -> Show the value -> Done.

That was not the case.

A temperature of 28°C is immediately understandable. A CO2 value of 900 ppm is at least easy to reason about.

But what exactly should someone do when the screen says: VOC Index: 145

That is where the project stopped being about collecting numbers. It became about interpreting signals.

VOC and NOx indices are useful when viewed relative to their normal baseline and especially when watched over time. A single reading is not nearly as useful as the behavior around it.

  • Was there a sudden spike?
  • Did it stay elevated?
  • Did something else change at the same time?
  • Was someone cooking?
  • Was a cleaning product used?
  • Was a window opened?
  • Did outdoor pollution enter the room?

Context suddenly mattered much more.

A Sensor Reading Without History Is Half a Story

The early versions of the project stored recent history in memory. That worked well until the ESP32 restarted. Then the history disappeared.

For PM2.5 that was annoying.

For VOC and NOx it was much more limiting.

If I saw a VOC value of 160, I wanted to know whether it had been 160 for five minutes or whether it had jumped from 70 to 160 seconds ago. So I added persistent storage. Now historical measurements survive restarts and the device can reconstruct useful trends.

This created another set of questions that had very little to do with sensors.

  • How frequently should measurements be stored?
  • How much history should be retained?
  • How much flash writing is reasonable?
  • Should every reading be stored?
  • What happens if the device restarts during a write?
  • At what point does high-resolution history stop being useful?

That is when the project started resembling a tiny time-series monitoring system.

Historical charts for particulate matter, CO2, temperature, humidity, VOC, and NOx readings

History information from the sensors

The similarities with production observability were becoming difficult to ignore.

Sensors generate telemetry. The ESP32 collects it. Storage keeps history. Graphs provide context. Alerts decide when something deserves attention.

The scale is completely different. The engineering questions are surprisingly similar.

The Web Dashboard

The TFT display gives me immediate local visibility. But I did not want to walk over to the device every time I wanted to see the readings. So the ESP32 also runs a small HTTP server. From any device on the same network, I can open the monitor in a browser and see the current state of the room.

The dashboard includes measurements such as:

  • PM1.0
  • PM2.5
  • PM4
  • PM10
  • CO2
  • Temperature
  • Humidity
  • VOC
  • NOx

More importantly, it includes history.

The current number answers:

What is happening now?

The graph answers:

How did we get here?

That distinction is fundamental in monitoring. Imagine seeing CPU utilization at 95%. That number alone is useful. But it matters enormously whether CPU usage jumped from 20% to 95% thirty seconds ago or gradually increased over six hours. Environmental data behaves the same way. A graph can explain a number.

The Local TFT Still Matters

Even with the web interface, I wanted the monitor itself to remain useful. A 2.8-inch ILI9341 TFT became the local display. The device rotates through screens containing the most useful measurements. That means I can glance at the unit and understand the room without opening another device.

That architecture is now stable enough that the next hardware step could be a proper PCB. For me, that is a good sign that the prototype has matured.

A Dashboard Still Requires Someone to Look at It

The next problem was obvious. A dashboard is passive. It only tells me something if I remember to check it. Real monitoring systems should surface important changes themselves.

So I added Telegram integration. The ESP32 can now send environmental information directly to Telegram, that allows two useful workflows. I can query the current status remotely (adjusted the polling due to resource constraints at ESP32). And the device can alert me when something crosses a configured threshold.

The architecture now looked like this:

Sensors
   ↓
ESP32
   ↓
Measurements
   ↓
Persistent history
   ↓
Web dashboard
   ↓
Alert evaluation
   ↓
Telegram

Or in SRE language:

Instrumentation
   ↓
Collection
   ↓
Storage
   ↓
Visualization
   ↓
Detection
   ↓
Notification

At that point it was difficult not to smile. I had accidentally built a miniature monitoring stack for my bedroom.

Alerting Was the Part That Felt Most Like SRE

The simplest possible alert is easy.

IF CO2 > threshold
    SEND MESSAGE

The difficult part begins five minutes later.

  • What happens when CO2 falls just below the threshold?
  • Then rises slightly above it?
  • Then falls again?
  • Should the device send a message every time?

Definitely not.

This immediately leads to familiar alerting concepts:

  • Threshold duration
  • Recovery thresholds
  • Cool-down periods
  • Severity
  • Repeated notification suppression
  • Trend awareness

A technically correct alert that fires constantly is still a bad alert. That is one of the strongest lessons from production operations. Alert fatigue is not caused by monitoring too much. It is caused by failing to distinguish interesting signals from actionable ones. Even in a home air-quality monitor, the same principle applies.

What the Final System Measures

The completed monitor now collects:

Particulate matter

From the Sensirion SPS30:

  • PM1.0
  • PM2.5
  • PM4
  • PM10
  • Particle counts

CO2

From the Sensirion SCD4X:

  • CO2 concentration

Atmospheric conditions

From the SHT45:

  • Temperature
  • Relative humidity

From the SGP41:

  • VOC index
  • NOx index

Together they provide a much more complete picture than any one sensor could.

Correlation Is More Interesting Than Individual Readings

This is probably the part of the project that interests me most now.

Suppose I see:

PM2.5       ↑
VOC         ↑
NOx         ↑
CO2         stable

That suggests one class of events. Cooking would be an obvious possibility.

Now suppose I see:

CO2         ↑
PM2.5       stable
VOC         stable
NOx         stable

That looks much more like poor ventilation.

Or:

VOC         ↑ sharply
PM2.5       stable
CO2         stable

Maybe perfume, a cleaning product or another volatile chemical entered the room. None of these interpretations should be treated as absolute conclusions. But the combination of signals gives far more information than looking at one metric in isolation. That is exactly how troubleshooting works in distributed systems. One metric tells you that something changed. Several correlated signals start telling you why.

The SRE Part Was Never Deliberately Added

I did not start this project thinking: "I should demonstrate SRE principles using an ESP32."

The SRE thinking appeared naturally because the problems were familiar.

  • I had telemetry.
  • Then I wanted history.
  • Once I had history, I wanted better visualization.
  • Once I had visualization, I wanted alerts.
  • Once I had alerts, I had to think about noise.
  • Once I had multiple signals, I started thinking about correlation.
  • Once I persisted data, I started thinking about retention and write behavior.
  • Once the system became useful, reliability started mattering.

The technology changed. The thought process did not.

The Parts Used

The final build consists primarily of:

ESP32-S3

The controller responsible for:

  • Sensor polling
  • Wi-Fi
  • Local web server
  • Persistent storage
  • TFT rendering
  • Telegram integration
  • Alert evaluation

Sensirion SPS30

Used for particulate matter measurement.

Sensirion SCD4X

Used primarily for CO2 measurement.

7Semi SHT45 + SGP41 module

Used for:

  • Temperature
  • Humidity
  • VOC
  • NOx

2.8-inch ILI9341 TFT

Used for the local interface.

Code

The firmware is written in C++ using the Arduino framework for ESP32. Current stable version is 1.7.2 internally. More fixes pending.

It handles:

  • Reading and combining data from all three sensors
  • Maintaining the latest environmental state
  • Recording historical measurements
  • Persisting history to flash storage
  • Serving the web dashboard and JSON APIs
  • Rendering the TFT screens
  • Synchronizing time using NTP
  • Handling Telegram commands
  • Evaluating air-quality alerts and sending notifications

The web interface is served directly from the ESP32, so the monitor does not require a separate server or cloud backend. I will provide the full code after cleanup, right now it is a lot.

Supporting components

The current prototype also includes the normal breadboard/project hardware:

  • Jumper wiring
  • Sensor connectors
  • ESP32 development board
  • Power connections
  • Mounting hardware

The next physical revision will likely replace most of the temporary wiring with a PCB. That's the satisfying part.

Firmware source code for the environmental monitor open on the development workbench

Code from workbench

Telegram messages showing a remote environmental status check and air-quality alert

Alerting and check from mobile

From Prototype to Something I Actually Use

That transition is important to me. There is a point where a hobby project stops being an experiment and becomes infrastructure. I now expect the monitor to run. I expect the history to be there. I expect the webpage to load. I expect the readings to make sense. I expect alerts when something unusual happens.

That expectation changes how you build things. A prototype only needs to work once. A system needs to keep working. That difference is essentially the foundation of reliability engineering.

The Final Architecture

Architecture diagram connecting the air-quality sensors to the ESP32-S3, local display, persistent history, web dashboard, Telegram integration, and alerts

Physically it is still a small collection of sensors around an ESP32. Conceptually it has become much more.

The Most Useful Lesson From the Entire Build

When I started, I wanted an AQI number. By the end, I no longer think there is one number I particularly care about. I care about the relationships.

  • Particulate matter tells me about particles.
  • CO2 tells me about ventilation.
  • Temperature and humidity describe the atmospheric environment.
  • VOC and NOx reveal another class of activity.
  • History tells me whether something is normal.
  • Correlation helps suggest what changed.
  • Alerts tell me when I should pay attention.

That is observability.

Not collecting every metric possible. Not drawing the biggest dashboard. Not sending the most alerts. It is building enough context that a system can explain itself.

In my day job, that system might consist of much more complications.

At home, it happens to be the air around me. And somehow that made this one of the more satisfying electronics projects I have built.

Originally published on LinkedIn on September 3, 2026.