Close
0%
0%

Cheap and simple air quality monitor

Cheap and easy to replicate internet connected PM2.5/PM10 monitor allowing you to check air quality inside and around your house.

kk
Similar projects worth following
Air quality monitoring is a big topic recently, with government regulations and monitoring programmes. While official monitoring stations are very accurate, they are also very expensive so there is not to many of them around us and they are mainly located in big cities.

When reading are high, we are advised not to reduce time spent outside. But is air in my house/office better than the one outside? How much better is it? Maybe I should live the city and go to some forest nearby every now and then to breath with fresh air? But how far do I have to go for the air to be good? If I live in an apartment on a 6th floor, is air on my balcony any better? Or maybe it's worse? To answer those questions we need personal air quality monitor

The goal of this project is to build relatively cheap (yet accurate enough) and easy to replicate PM2.5/PM10 monitor so that everybody can have one. It should be Internet connected so that readings from all the sensors could be collected and compared


Design considerations

The pm2.5/pm10 sensor

Of course we can't easily make pm2.5/pm10 sensor ourselves but fortunately there are some existing ones on the market. We are looking for a sensor that is easy to buy and reasonably cheap but its measurements can actually be trust. Here's the list of sensors that were considered:

  • Samyong DSM501 / Shinyei PPD42NS ( ~4-5 USD)
  • Plantower PMS1003/PMS3003 (~17 USD)
  • Novafitness SDS011 (~23 USD)

I didn't want to buy all of them so I had to choose one. Based on few Internet reviews, from which http://aqicn.org/sensor/ is the most convincing, I've chosen the last one for following reasons:

  • The price is still reasonable
  • It definitely has the best reviews on the Internet, even though it's not as popular as cheaper ones
  • The communication is done using UART, with both automatic sensing and on demand sensing. It also supports sleep mode (but this could be easily simulated by cutting of power to the device).

I bought it and first tests show quite good correlation between results obtained and expected.

Microcontroller

I would like make this project work on two platforms - normal atmega328p based Arduino (if uploading is not needed and reading current values from LCD is good enough) and ESP8266 for full featured version. In both cases, Arduino environment will be used for programming as this not only makes prototyping easy but also makes it much easier for others to contribute to the project.

ESP8266 comes in many surface mountable models. ESP-12F seems to be the best of them as it has all the usable pins broken on the edge. ESP-07 has mostly the same footprint (short of flash pins which probably won't be used in this project) but also has connector for external antenna so I would like the main board to also be compatible with this one.

Power source

The main power source should be A/C power as I hope those modules to run 24h a day, reporting all the measurements for further analysis. All the sensors uses fan for air ventilation using quite a lot of power so lasting on battery for weeks is not really possible. Still, I would like it to be portable enough to take it with me and do some measurements outside. At the same time I want to be cheap.

The sensor (sds011) requires 5V (with 3.3V UART). While Arduino can run on both 3.3V and 5V, ESP8266 is 3.3V only. So we need 5V and a voltage regulator.

For those reasons, microusb will be used for providing power. Cheap 1117 linear regulator will be used for 3.3V (at least in first revisions) to ESP8266. Microusb connector makes it easy for everyone to find spare power adapter and also makes it very easy (and cheap) to use battery by using cheap power banks.

SDS011 module takes ~100 mA when in active mode and around 3mA when sleeping. ESP8266 requires ~100mA when uploading data, ~70mA when idling with WiFi connected, ~15mA when WiFi is disabled (so called modem sleep) and <1mA when in deep sleep.

LCD

I would like current values to be displayed somehow. While ultra low power consumption is not a priority right now, I would still like this module to be portable so it has to be usable on batteries with LCD constantly displaying values. Also, since ESP8266 is planned as a main platform, it has to be usable with low amount of pins. And again, it has to be cheap and easy to buy.

Few LCDs were considered:

  • standard 16x2 HD44780 based LCD with i2c adapter (~2 USD)
  • OLED 0.96" SSD1306 displays (~4-5 USD)
  • PCD8544 Nokia LCD (~2 USD)

OLED displays may be operated using both SPI and I2C but they are smallest and most expensive from the three. They also use quite a lot of power (~20mA). HD44780 uses ~2-3 mA and are cheap so they could be used but they have quite limited display area. PCD8544 based displays use least power ~0.2mA, has ~1.5" diagonal and can easily provide 12x6 of very readable text area. They can be driven by only 3 pins which is good enough. Nokia LCD seems to be the best candidate for this project.

Usability

I assume most of the users of this module won't necessarily be programmers,...

Read more »

  • 1 × ESP-12F Main controller
  • 1 × DHT22 Temerature and humidity sensor (optional)
  • 1 × SDS011 PM2.5 and PM10 sensor
  • 1 × Nokia 5110 (PCD8544) LCD Monochrome low power LCD

  • Software updates

    k12/28/2016 at 17:19 0 comments

    From software side all the basic functionality works now:

    • SDS011/LCD/DHT22 drivers are functional
    • OTA flashing is working
    • Wifi AP mode for configuration
    • simple HTTP configuration panel allowing changing WIFI configuration, ThingSpeak API key, etc.
    • ThinkSpeak data upload

    Things left to be done:

    • Setting configuration for multiple wifis
    • Scanning available WIFI networks in settings panel
    • firmware upload using HTTP panel
    • sensor data aggregation in case of network failure
    • code cleanups

  • Some updates

    k12/25/2016 at 23:29 0 comments

    So there's another winter and another wave of terrible air quality in my city. This got me some motivation to find some time and move this project forward. I ordered another bunch of PCBs, this time with ground plane fixed, soldered testing board and done some testing. All the basic functionality seems to be working.

    My friend asked me if I could make him a copy of this project which motivated me to actually put everything together, including enclosure. Here's how it looked:

    The placement of the holes on a plexi has to be changed a little bit so that it would be possible to fit a powerbank. Then I want to order lasercut plexi sheets with proper holes so I don't have to drill them manually any more. But overall, this is much more handy to carry around now :)

    PCB

    Here's the list of things I have to change for next revision of the PCB:

    • LCD reset works OK from PCF8574 so P4 connector can be removed
    • DHT can't be driven from PCF8574 because of the tight timing constrains, P6 can be removed
    • Interrupt line of the PCF8574 should not be connected to GPIO2 since this pin should not be pulled low while booting. I guess I could use GPIO14 instead and connect DHT22 to GPIO2 (since it's working with a pullup)
    • DHT22 footprint is wrong, I have to fix it. Pin spacing is not right. Fortunately it's possible to solder it anyway with some bending

    Software

    In order to flash the board it is required to disconnect SDS011 sensor (it shares the same UART). This is problematic once it's in enclosure. To overcome that I've added basic support for flashing the board over WIFI. To enter this mode, SET button has to be pressed and hold just after restarting the device (but since it pulls GPIO2 down it CAN'T be hold while resetting the device). I've also added simple DHT22 library and some code to display humidity and temperature on the display. 2 most important things left to be done now are:

    • configuration mode (using AP mode)
    • data push (so that I can actually use wifi of the chip which is the main purpose of this project actually)

    Further actions

    I borrowed SDS011 from my friend so now, having two of them, I will be able to test if different sensors will produce similar results. In order to do that I first have to solder another unit and prepare another case. I would also like to order another SDS011 for me so that I could finally put one in constant operation leaving other one for development.

  • PCBs arrived

    k04/20/2016 at 07:59 0 comments

    After exactly a month of waiting, first version of PCBs arrived. For the first time I used "new site" from dirtypcb service. It's experimental and they say it's still buggy but it did work fine for me. 11 PCBs, 5cm x 5cc for 11.95 USD including shipping to Poland. Here's how they look:

    Now those boards are broken. I knew this in the morning, next day I ordered them but I couldn't fix this as they were already send for manufacturing 3h after I uploaded project files. Turns out it's not best idea to do last changes just before submitting the files for fab in the middle of the night. Now I will have to do some patching to connect grounds together. Other than that I just tested my footprint for DHT22 and somehow the spacing between its legs is a little too small. Fortunately this can be fixed by bending the legs a little bit. I'm very busy recently so I may not have enough time to solder them for some time.

  • Enclosure prototype

    k03/30/2016 at 07:18 0 comments

    I ordered some laser cut 2mm plexi with the holes on the corners (no holes for the components yet as I'm not sure about the alignment yet). Using some screws instead of spacers and drilling some more holes by hand gives rough picture of how this is going to look like when finished:

    I'm happy about how it looks. The whole thing is 13cm x 13 cm x 3cm but as can be seen it may probably be reduced a little. We'll see when PCB is done.

View all 4 project logs

Enjoy this project?

Share

Discussions

Stefano C wrote 12/29/2016 at 22:23 point

Hello, i would like to use the sds011 sensor with Arduino mega 2560 and a LCD shield, but unfortunately i didn't find any code.

If you have any idea about how to modify your nice project/code to let it work with Arduino mega and a normal LCD shield, please let me know.

Thanks for any reply.

Cheers.

Stefano

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates