Hacker News new | past | comments | ask | show | jobs | submit login
Blog series on building an air sensor with Arduino (airdeets.com)
86 points by groundcoffee on Jan 2, 2023 | hide | past | favorite | 21 comments



Good choice with the PMS5003 which is in our experience one of the best sensors from Plantower. It is bigger than the PMS7003 or PMSA003 but in our experience more accurate and has a longer life span.

A few things you can consider in the follow up blog post:

a) When you add the temperature and humidity sensor, one of the key aspects is to shield it from heating up inside the enclosure by the ESP (and also the PMS sensors create heat).

b) If you live in area or high humidity, the PM values will be overstated but there are compensation algorithms. We use for example the Di Antonio algorithm [1].

[1] https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6164928/


Any recommendation for CO2 sensors?


The grandparent ships out the SenseAir S8 for CO2 so presumably they're still happy with it. I have no complaints myself but I haven't compared it to any reference standard. He's the founder behind AirGradient. https://www.airgradient.com/open-airgradient/ They have a DIY version that's an open source design and you can either source components yourself or just skip trying to track down everything on the BOM and buy a kit from them that comes with a sleek injection molded housing as well.


The main thing you need to know about a CO2 sensor is that you also need a pressure sensor for its readings to mean anything.

Expect to pay ~$50 for an actual CO2 sensor. The cheap "organic gas" VOC sensors don't qualify. But you probably should add on one of those anyway.


Also the need for periodic outdoor calibration.


scd30 does the trick


Do you have a reference on the PMS5003 being better? Any thoughts on Plantower's newer sensors (e.g. PMS9003)?


The first 2 parts are out! It's currently focused on a particulate matter sensor (the pms5003) for taking pm2.5 measurements. If you have any feedback or if there are any other features/sensor integrations you'd like to see please let me know.

Some ideas I have floating in mind: a temperature/humidity sensor, CO2 sensor, VOC sensor, and MQTT integration.


Good exercise but FYI ESPHome is probably the way to go for most people.

All the sensors you mentioned are likely already supported and just need to be added to a yaml file.


Also look at the failure time and make sure you are sleeping correctly when not reading. esphome has this implemented and it is really great, it wakes up 10 seconds early, starts the fan/airflow, then takes the reading, then sleeps (for 50 seconds) in my case where I want to sample every 1 minute. Without this the lifetime of the sensor is around 1 or 1.5 years of continuous use if I recall correctly.


Even as an experiment with the sole purpose of learning stuff and having fun I find Arduino libs tend to hide all the fun stuff effectively diminishing the learning experience. Sometimes it's good to reinvent the wheel (like writing the driver yourself with the sdk) if your goal is to understand how why it works.


I didn't know about this. I'll definitely check it out. Thanks!


I love it! Great roadmap too. In a previous discussion of DIY indoor air quality sensors[1] MQTT+Zigbee was brought up as a good standard interface.

1. https://news.ycombinator.com/item?id=33773786#33775308


Maybe it's a stupid question but for the verification bytes you're adding the different constants, commands and options. For the sleep that comes out to 0x173 (as you also wrote down). Why is the higher verification byte then 0x73 and not 0x173? Or is it a typo?


[Note: I'm not the author]

0x173 doesn't fit in a byte. As the text explains, there are two validation bytes; the first one gets the high 8 bits ("the high byte") of 0x173 (which is 0x01) and the second one gets the low eight bits (0x73).


Ah! Ok got it. Thought it meant some kind of lower and upper "limits". But that makes more sense. Thank you! Just getting into embedded / MC stuff.


Somewhat related: I had trouble with reliability of Adafruit's CircuitPython and MicroPython on various microcontrollers. I couldn't get them to reliably send their data to an MQTT queue over wifi.

So I gave up and bought a couple of AirThings air sensors.

Lucky I did. Our furnace air intake pipe had been blocked by multiple birds nests, and the secondary pipe for the water heater was incorrectly connected. Our indoor CO2 levels were higher than 4,000ppm! The levels would also jump when the furnace kicked on, even with windows open.

Thankfully apartment complex maintenance was able to fix it immediately and levels are much lower now, especially when the furnace is running. (About 500ppm with windows open, 700 with them closed and furnace running, 1,100ppm if the windows haven't been open and the furnace hasn't run for a while.) It's possible our health has improved because of the sensors.

I got 2 AirThings View Plus. I'm not affiliated with the company other than having bought their products.


You're not really `building` a sensor. More like "Blog series on interfacing an air sensor with Arduino".


Great write up.

I have been eyeing pms5003 earlier. Since there seems to be a fan in the sensor, I wonder is it noisy?


Nope, it's hardly audible. The only way for my to tell if the fan is on or off is by looking at it to see if it's spinning.


i have the pms7003 and can't hear a thing. It's maybe a half inch centrifugal fan




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: