Air quality measurement sensor with ESPhome

After seeing all kinds of air purifiers in the market. I got interested in the topic air quality. First, I needed to learn more about how and what to measure, followed by actually measuring the air quality in my home.

I’ve written this walkthrough of how you can build a Particulate Matter Air Quality meter that integrates with your Home Assistant for under 20$, without any soldering or coding skills needed.

It’s build using a PMS5003 particle matter sensor, an ESP board and ESPHome. I’ve found multiple posts covering pieces of this, but no end-to-end tutorial. This tutorial included the use of measurement intervals to extend the lifetime of the laser.

Read the full walkthrough: Build a cheap air quality meter using ESPhome, Home Assistant and a particulate matter sensor

Hope it helps.


You have problems if you have 10mm (millimetre) particles floating in the air!

I think your particle sizes should be in μm (micrometer).

1 Like

That is very good point :crazy_face:. If I had 1 mm particles I would be walking on a layer of dust.

I’ve updated the lovelace code in the article.

Not updating the screenshot :stuck_out_tongue:

1 Like

This is what I’ve been looking for! Wonderful job, I’ve just ordered the sensor (already have the other parts at home) and can’t wait to do this. We have a ventilation system D in our house and our neighbour next door has a stove, and if the wind outside blows in a certain direction then we get all the dirty air from her stove sucked up through the ventilation unit. With this I can hopefully measure when her stove is burning and turn off the ventilation unit with an automation, instead of having to smell the stove while inside. Thank you!

1 Like

good work, already adapted it …my approach was a bit hacky and unstable

1 Like

Just wanted to say I followed your tutorial and thanks to you, I now have a much better working ventilation system. :slight_smile: The sensor is inside the tube that provides the air, and if it reaches a certain treshold then it triggers an automation that will turn off the unit for an hour. After an hour it will turn on the unit again, and then it can check if the air is good again or not.
Sometimes, depending on the wind, air from our neighbor her chimney gets sucked up by our ventilation unit (even though there’s more than enough distance between the intake on our roof and her chimney!), which makes our house smell like smoke and the dirt of the smoke builds up in our vents and on the walls around the fittings, and the filters of our unit turn black as well and need more frequent replacing, thanks to this sensor we’ll no longer have any of those problems!
I didn’t have the housing you suggested though, I used an old gameboy cartridge case, you know the small rectangular transparent ones that were the perfect size for one cartridge. Works just as good. :smiley: