Results 1 to 10 of 10

Thread: Air Quality sensor for $30 (Raspberry Pi)

  1. #1
    Join Date
    Jun 2010
    Location
    Leawood, KS
    Posts
    42

    Air Quality sensor for $30 (Raspberry Pi)

    A while back I posted on a temperature/humidity sensor and logging solution I built using a Raspberry Pi.

    Since then, I've added a air quality sensor for particulate matter (sawdust) in the shop. Every 3 minutes a sample is taken and is charted. Logging and visualization of the data is here.

    The sensor was $30. I was skeptical about the accuracy of something so cheap. The research indicates there is some variation from more expensive air quality monitors, but is good enough for non-scientific use.

    On my original temperature/humidity post, a couple folks asked for step-by-steps on getting it configured. My linux skills are pretty basic. I have to go through about 10 trial and errors to get something to work, not really sure of the exact combination of what was necessary. As a result, I won't be able to give step-by-steps, but am happy to answer questions in a bit more detail about what/how I did things.

    The sensor is rated for 1 year of active measurement taking. I have it taking measurements once every 3 minutes. It takes about 10 seconds to turn on, measure, and turn-off. With the sensor sleeping the other 170 seconds, my math suggests this will give 18 years of life for the sensor. If I get even 1/10th of that, it will be $30 well spent.


    A few of the resources I used:



    The basics of the solution:
    • The sensor is plugged in via USB directly to the Raspberry Pi
    • pmtwofive library to grab the data. Scheduled & executed using shell commands (startup or cron jobs)
    • python - see sample/starting script above
    • Data is dumped into MQTT (I was already running a local MQTT --> NodeRed instance locally from the temp/humidity project. The NodeRed does de-deplication and publishes to Thingspeak for visualization)
    • Thinkspeak for logging, visualization, and access-from-anywhere


    Biggest issue I ran into was incompatibility between Python version and the libraries being used due expected data types. I had to be explicit about invoking the right Python version. I think I was accidentally calling python2 when it needed python3.

    Again, I'm FAR from being proficient in linux. If you have basic skills, or want to learn, this might be a good project to take on. A raspberry pi runs ~$35-50 if you need to buy one for this. All said, I'm extremely pleased with what I was able to do for < $100, plus some time learning something new (technology).

  2. #2
    Join Date
    Nov 2007
    Location
    NW Indiana
    Posts
    3,078
    I have the cheap sensor and use it at times in my shop. It would be great if someone sold the logging part. I am glad you were able to do this but you completely lost me with the raspberry pi.

  3. #3
    That's really cool! I had no idea such sensors were available, but what a great idea!

  4. #4
    Join Date
    Feb 2013
    Location
    Tippecanoe County, IN
    Posts
    836
    Another sensor that is often used is the Plantower PMSx003 series. Larry's unit uses the PMS5003. They're readily available from ebay, Aliexpress, Bangood, etc. The sensor send three channels of PM data and six channels of particle counts. It's accuracy has also been well studied and is good. I have a big collection of sensor reports if anyone is interested. Here's one that looks at both the PMS7003 and SDS011.

    There's a newer version of Larry's unit that appears to have data logging capability but I don't know much about it.

    I have the PMS7003 connected to a NodeMCU which sends data via WiFi.

    Breakout1.jpg

    I really need to put that in a box!
    Last edited by David L Morse; 06-30-2020 at 4:42 AM.
    Beranek's Law:

    It has been remarked that if one selects his own components, builds his own enclosure, and is convinced he has made a wise choice of design, then his own loudspeaker sounds better to him than does anyone else's loudspeaker. In this case, the frequency response of the loudspeaker seems to play only a minor part in forming a person's opinion.
    L.L. Beranek, Acoustics (McGraw-Hill, New York, 1954), p.208.

  5. #5
    Join Date
    Jun 2010
    Location
    Leawood, KS
    Posts
    42
    David - What do you currently do with the data via Wifi?

    I'm considering some different/additional options. One thing I'm leaning towards is after I build/buy an air filter, have it automatically controlled on/off based on air quality readings.

    Curious what other people are doing with the data they are pulling...

  6. #6
    Join Date
    Mar 2009
    Location
    central tx
    Posts
    589
    This is pretty awesome. I think I'll jump into this later this summer. One my daughters has been wanting a programming project to work on with me and this would do it. I'm happy to share code on this if anyone else would be interested.

  7. #7
    Join Date
    Feb 2013
    Location
    Tippecanoe County, IN
    Posts
    836
    Quote Originally Posted by Bryce Walter View Post
    David - What do you currently do with the data via Wifi?

    I'm considering some different/additional options. One thing I'm leaning towards is after I build/buy an air filter, have it automatically controlled on/off based on air quality readings.

    Curious what other people are doing with the data they are pulling...
    With the NodeMCU controller all I'm doing now is sending the data to a tablet using the Virtuino app. Mostly I just use it as a real time monitor, although the app has primitive data logging capability. I have another version that uses a Particle Photon controller. That one sends data to a Google spreadsheet via the Particle cloud. I don't use that very much right now. When (if?) I come up with a project that needs lots of data stored I'll do some more work with the NodeMCU and send the data to a web server, probably using a GET request.

    Controlling an air cleaner would be easy. It certainly wouldn't need the power of a pi. A low end Arduino clone would do fine.

    The Virtuino display:

    ShopClean030920.jpg
    Beranek's Law:

    It has been remarked that if one selects his own components, builds his own enclosure, and is convinced he has made a wise choice of design, then his own loudspeaker sounds better to him than does anyone else's loudspeaker. In this case, the frequency response of the loudspeaker seems to play only a minor part in forming a person's opinion.
    L.L. Beranek, Acoustics (McGraw-Hill, New York, 1954), p.208.

  8. #8
    Join Date
    Apr 2013
    Location
    Okotoks AB
    Posts
    3,495
    Blog Entries
    1
    So, pardon my stupidness, but will that Zeast sensor you linked to work as a standalone air quality meter with just adding a USB power supply?

  9. #9
    Join Date
    Feb 2013
    Location
    Tippecanoe County, IN
    Posts
    836
    Yes, sorry for the confusion. That link is for a complete unit (less power supply). Larry has posted about his nearly identical one several times. You are correct about it only needing a USB power supply for standalone operation.

    Other than that though, the rest of the thread is about the sensors only, so, yes, it's a bit more interesting trying to make use of those.

    Here's a link to the bare sensor.
    Beranek's Law:

    It has been remarked that if one selects his own components, builds his own enclosure, and is convinced he has made a wise choice of design, then his own loudspeaker sounds better to him than does anyone else's loudspeaker. In this case, the frequency response of the loudspeaker seems to play only a minor part in forming a person's opinion.
    L.L. Beranek, Acoustics (McGraw-Hill, New York, 1954), p.208.

  10. #10
    Join Date
    Apr 2013
    Location
    Okotoks AB
    Posts
    3,495
    Blog Entries
    1
    Quote Originally Posted by David L Morse View Post
    Yes, sorry for the confusion. That link is for a complete unit (less power supply). Larry has posted about his nearly identical one several times. You are correct about it only needing a USB power supply for standalone operation.

    Other than that though, the rest of the thread is about the sensors only, so, yes, it's a bit more interesting trying to make use of those.

    Here's a link to the bare sensor.
    Thanks for the info David. It sure is an attractive alternative to the Dylos.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •