20 ms·
How to Measure Indoor Air Quality with a Raspberry Pi, RuuviTags and PMS7003
- simulate 7y agoThere was a similar post on HN about four months ago describing an air quality monitor with a slightly different stack: Build an Air Quality Monitor with InfluxDB, Grafana and Docker on a Raspberry Pi https://news.ycombinator.com/item?id=19506983 https://news.ycombinator.com/item?id=19506983
- blaser-waffle 7y agoThank you for sharing that. This particular article & comments read like a collection of referral links to Taobao and Ali-Express.
- amingilani 7y agoWhat is the difference between an indoor air quality monitor and an outdoor one? Can't I just put this one outdoors in an out-of-the-rain-and-sun area and call it an outdoor air quality monitor?
- solstice 7y agoI assume that humidity messes with the detection of particle size. I have a LaserEgg particulate matter detector and they use a laser beam to count the particles in the air that flows through the device (via a small aspirating fan). So if particles are more clumped due to higher humidity, then I assume that would give you faulty/misleading readings?
- tyingq 7y agoAlso likely not made to deal with high and low temps, probably components that rust, etc.
- leggomylibro 7y agoMaybe add another sensor? Humidity and temperature seem like useful readings for these sorts of monitors, and a lot of those sensors include barometric pressure for free. Although there is an old joke about their accuracy: "how do you use a cheap pressure sensor to determine altitude? Drop it out the window and count how long it takes to hit the ground." There are also affordable gas concentration sensors which can be useful for this sort of thing. Some are even marketed as 'air quality sensors' because they exhibit sensitivity to several different types of gases, but they aren't always useful because the output is usually just the sum of the sensor's response to each individual gas. Still, if you want a project to probably depress you in 10 years, get a CO2 sensor like the MH-Z19B and make yourself a datalogger. (Keep in mind that it's a little power-hungry, up to 150mA @5V = 0.75W)
- joshefin 7y agoThe CO2 sensor would be a nice addition to my project. Do you have experience with the MH-Z19B, is it accurate enough for indoor use?
- leggomylibro 7y agoI've only used it briefly, but I have also seen it used in DIY building management projects. The biggest issue I saw with it was power consumption: up to 150mA @5V is 0.75W, and I think it can take a bit of time to 'warm up' so you can't just turn it on for a few milliseconds every hour. But that should be fine if it's plugged into the wall. It's also fairly expensive, on the order of $10 rather than $1 last I checked.
- igor47 7y agoHumidity is the biggest confounding variable for pm measurement. A bme280 is recommended to be able to compensate
- joshefin 7y agoPMS7003, and most probably all other low-cost PM sensors with the same working principle, is not made to be used outdoors. Although used in many DIY projects for outdoor air quality monitoring, researches show that high humidity badly affects the PM measurements. Some have tried to heat the air before entering the sensor or to derive a correction factor, but mostly unsuccessfully. These sensors are not as accurate as more expensive professional devices but are good enough to give an idea of the pollution in the air. From my experience so far, PMS7003 measurements are comparable to official government air quality measurements available for my neighborhood.
- ShakataGaNai 7y agoI love the idea, but why in the name of the Flying Spaghetti Monster, would you use Java on an RPi? There are at least half a dozen python libs for the PMS7003.
- joshefin 7y agoPython is great for prototyping, but my grand plan with this project is to add more sensors, integrate with some "smart home" devices and create a web UI - and I'm more comfortable coding all that in Java.
- JudgeWapner 7y agojust be sure to allocate enough swap space for the gigabytes of bloat.
- fouc 7y agoShould be possible to compile Java such that it runs very efficiently. Java is commonly used for Android after all.
- JudgeWapner 7y agoMy Android device that runs slower after each "update"?
- SeanDav 7y ago> My Android device that runs slower after each "update"? This is not only an Android problem, Apple is equally guilty of this. Arguably, more so. Nor is it a Java problem. Some extremely speed-sensitive high perfomance code used by high speed trading algorithms use Java. This is in an environment where micro-seconds count.
- JudgeWapner 7y ago
- heyoni 7y agoIs there a spec sheet on how accurate/precise the specific recommended sensor is? I'm not even sure exactly how to describe a particle sensor but the aliexpress page is full of typos and I'm just wondering if it'll at least be able to measure the effectiveness of my indoor air purifier.
- joshefin 7y agoIf your air purifier has a screen and shows the air quality, it's most probably using a PM sensor like the one I write about here. How accurate is PMS7003? If for example, you need to know the precise and exact concentration of particulate matter in the air - then currently available low-cost PM sensors are not to be considered accurate. But, if you need to know if the air quality in your home is good, fair, moderate, poor or very poor, then it's good enough.
- tehlike 7y agoThese sensors also need calibration every week or so, which basically involves opening the windows to feed fresh air.
- AceJohnny2 7y agoTangentially, for nearly a decade I've been looking for consumer-oriented wireless thermometers. Something that I can either query over the network (any protocol), or that uploads to some cloud service that I can inspect. This was the original selling point of ZigBee, but it sounds like it only exists for industrial applications. Does anyone know of a $10-$30 network-capable thermometer? I know they're relatively easy to hack together, as the OP project (and so many others like it) shows, but I'm specifically looking for a turnkey consumer solution, not something I'll have to spend a couple hours and multi-sourced parts to put together.
- joshefin 7y agoI used RuuviTags (https://ruuvi.com/ https://ruuvi.com/). They use a battery and send data over Bluetooth to your mobile phone.
- glogla 7y agoYou only get data from those when the phone is in bluetooth range. That's not very useful for long-term measurements. Unless you buy cheap android phone as a basestation I guess.
- lemming 7y agoI have a bunch of SensorPushes at home which do the same, but they store the data for up to 20 days iirc, so it's effectively continuous data unless both my wife and I go away for a month or so.
- throwaway9d0291 7y agoIt's popular to set up a Raspberry Pi or similar to act as a bridge between Bluetooth and wifi.
- tehlike 7y agoI use xiaomi to measure temperature, and send it to homeassistant.
- 7y ago
- softgrow 7y agoI’ve looked at building one of these, but what new actionable information do you get? I’ve been wondering if it might say the room is dusty and then I could run the HEPA vacuum cleaner to bring it down. Or is this just for measurement geeks?
- joshefin 7y agoYou can use the PM measurement that the sensor outputs to calculate the Air Quality Index (for Europe: http://airindex.eea.europa.eu/ http://airindex.eea.europa.eu/) and for example, make it send you a notification when the pollution level goes up, so you can turn on the air purifier or vacuum or open the windows.
- sumoboy 7y agoIn the end, you'll still need an air purifier unit to clean a room(s), or the entire house. Indoor air quality is a much bigger issue than most realize.
- chrisbolt 7y agowhy?
- rofo1 7y agoThat depends on your location. I've built something similar to this tool that is discussed here and I've tested in multiple locations. For example, Vienna air was so clean (<= 10 pm10 ug/m^3), that you don't need any purifiers or anything like that.
- MartinMond 7y agoIf you think Vienna's air is clean, you didn't measure during winter and/or during an inversion. You absolutely need air purifiers.
- agent008t 7y agoAre there stand-alone air purifier units that are worth the hassle?
- magoon 7y agoYes look at the Coway AP-1512HH. I have one in each bedroom. It also has a good air quality sensor and “auto” mode that’s driven by it. Among the competition, it cleans better than most and has a low TCO. Very quiet on “low”
- tareqak 7y agoI have one too. I got it based off of the recommendation from the Wirecutter: https://thewirecutter.com/reviews/best-air-purifier/ https://thewirecutter.com/reviews/best-air-purifier/ .
- paulgerhardt 7y agoFor this task I absolutely love my Xiaomi Mijia indoor air quality sensor[1]. Under $50, nice touch screen, WiFi, TVOC, PM2.5, CO2, temp, humidity. Have one by a laser cutter (particulate), one in a paint booth(TVOC), and one in the office conference room (when the CO2 is higher than 1200 its time for a fresh air). A+ product and so much better than what I could build myself at that price point. If you find yourself in mainland China do yourself a favor and drop into a Xiaomi store. [1]https://m.mi.com/commodity/detail/1184500007 https://m.mi.com/commodity/detail/1184500007
- gwilkes 7y agoCouldn't tell from the link, is there an English language option on the device?
- paulgerhardt 7y agoYes as well as Fahrenheit temperature if you prefer. Importing outside of China is a fairly highly mark up - $80 on BangGood: https://www.banggood.com/Xiaomi-Mijia-Air-Quality-Tester-High-precision-Sensing-3_97-inch-Screen-Resolution-800480-USB-Inter-p-1381312.html https://www.banggood.com/Xiaomi-Mijia-Air-Quality-Tester-Hig...
- tobtoh 7y agoAlthough on the link you supplied, it does state "Note: Currently only supports Chinese interface display"
- bentpins 7y ago$64 on AliExpress. Pandacheck is a good tool for price comparison although it doesn't help deal with listings with multiple prices https://www.aliexpress.com/item/32970668564.html https://www.aliexpress.com/item/32970668564.html https://en.pandacheck.com https://en.pandacheck.com
- throwaway9d0291 7y agoYou can skip Banggood and save a bit. It's $52 from Xiaomi's official store [0] and $8 shipping from a forwarder [1], so $60 total. [0]: https://detail.tmall.com/item.htm?id=582112668204 https://detail.tmall.com/item.htm?id=582112668204 [1]: https://www.superbuy.com/en/page/query/freight/#areaId%3D3%26weight%3D400%26volume%3D15*10*8%26arrType%3DElectrical%26warehouse%3D1%26area%3DUSA%20%E7%BE%8E%E5%9B%BD https://www.superbuy.com/en/page/query/freight/#areaId%3D3%2...
- throwaway9d0291 7y agoI think this is the main way to go if you care about air quality because unfortunately most consumer air quality monitors can be wildly inaccurate (i.e. detect nothing at all) even in day-to-day scenarios like making toast [0]. It's not limited to particulate matter either. You can get devices with reasonably accurate basics like temperature and humidity but as soon as you get into the actual air quality stuff like CO2, things start to fall apart. There are tons of devices that use wildly inaccurate TVOC sensors or fake their CO2 measurements (they estimate it based on H2 instead). If you want anything remotely close to accuracy, I strongly recommend buying something that actually tells you which sensors it has inside it. Get datasheets for the sensors and check that their specs are reasonable for what you want. For example make sure that if you want to actually measure CO2 to buy something with an NDIR sensor like the Senseair S8 inside. I wanted something I could plug into my home Prometheus/InfluxDB/Grafana setup so I bought [1] from Taobao. It lists all the sensors it uses, which are fairly good for the price. The device has a pretty simple TCP API that gives you JSON. Everything is Chinese but the measurements themselves are labelled in English and Google Translate works pretty well on the documentation. 0: https://www.sciencedaily.com/releases/2018/08/180822091022.htm https://www.sciencedaily.com/releases/2018/08/180822091022.h... 1: https://item.taobao.com/item.htm?id=550317428831 https://item.taobao.com/item.htm?id=550317428831
- auslander 7y ago[1] on Aliexpress, in English, $150 : https://www.aliexpress.com/item/32759169154.html https://www.aliexpress.com/item/32759169154.html
- throwaway9d0291 7y agoIt does have English but it's not the same thing at all: It doesn't tell you which sensors are inside it (only the CO2 sensor) and it doesn't have any kind of machine-readable interface.
- auslander 7y ago"S8 is short for S8-0053 model" from description. It seems like its using sensor you mentioned.
- sippeangelo 7y agoWhat's the RuuviTag for? I can't see it mentioned in the article.
- joshefin 7y agoRuuviTag is a sensor capable of measuring the temperature, relative air humidity, and atmospheric pressure and sending the data over Bluetooth. I wrote about it in a linked article - https://joshefin.xyz/temperature-humidity-pressure-with-ruuvitag-raspberry-pi-and-java/ https://joshefin.xyz/temperature-humidity-pressure-with-ruuv...
- _def 7y agoJust yesterday I thought of building something similar. I often get tired from being in my small flat and I'm curious if CO2 could have anything to do with it.
- tareqak 7y agoDoes anyone know how accurate this set up would be be in comparison with the NetAtmo Indoor Air Quality monitor [0]? [0] https://www.netatmo.com/en-us/aircare/homecoach https://www.netatmo.com/en-us/aircare/homecoach
- wil421 7y agoIf you could find out what sensor the NetAtmo is using you could do an apples to apples comparison. I bought a cheap soil sensor from microcenter that is absolute garbage. According to a few YouTubers it would corrode in a couple weeks. They recommended some higher quality sensors.
- joshefin 7y agoNetatmo only measures CO2 and depending on your location it would be more useful to know about particulate matter in the air.
- Havoc 7y agoI've got a rasp + air sensor. Quickly turned it off. It has a tiny fan that goes bzzzz. No thanks - my peace & quiet trumps my need to know air particle count
- joshefin 7y agoThe fan inside the PMS7003 sensor is very quiet.
- klausjensen 7y agoI love the way this blog displays code. Just beautiful.
- alexghooper 7y agoYou had me up until 'java'.
- 693471 7y agoThe only thing worse than no data is bad data. I wouldn't trust these cheap sensors people keep hawking.