Make One PM2.5/air Quality Monitor With Arduino UNO





Introduction: Make One PM2.5/air Quality Monitor With Arduino UNO

Make one PM2.5 monitor with Arduino UNO

use Arduino unoR3 board and one arduino compatible 4-digital tube to collect and display the PM2.5 value.

one laser PM2.5 sensor SDS011( is used for the PM2.5 detect.

Step 1: Download Arduino IDE

Arduino IDE: the version of 1.0.6 is used. goto http:// www. arduino. cc to download.

Step 2: Hardware Connect:

SDS011----this sensor has 7 pins. 3&5 are the power pins, and 6&7 are the ttl-5V com port pins.







7---- arduino-rx

4-digital tube connect:

1— ser--connect-to----arduino8

2— clk—connect-to----arduino9

3— st—connect-to----arduino10

4— gnd—connect-to----gnd

5— vcc—5V--connect-to----5V

Step 3: Open and Upload the Firmware

open the "ArduinoSDS011Demo.ino" file, and upload. the file would be automatically compiled and uploaded to arduino board.

code explain:

function Setup:the display and com init.

function Loop: function ProcessSerialData read the PM2.5 data,function Display display the data.

Step 4: DONE

the PM2.5 value is about 80 without smoke. It reach up to 999 within 5 seconds when the smoke is generated.

That's all.



    • Epilog Challenge 9

      Epilog Challenge 9
    • Paper Contest 2018

      Paper Contest 2018
    • Science of Cooking

      Science of Cooking

    We have a be nice policy.
    Please be positive and constructive.




    Please help me! Max7219 LED display does not work. No light. What should I change my code? Display wiring is OK, working with another program.

    Thank you very much

    Hi! That's a wonderful project. I'm still a student and have no programming experience. I'm also curious about whether it is possible to further program the chip so that the detected value of PM can control a motor. For example, the motor can be turned on only if the detected value exceeds a certain standard. Thanks a lot!

    Sorry to say, but I believe there is a bug in your code!

    If you look in the sensor datasheet, you do not construct an int out of the low and high bytes of PM10 and PM2.5 like in the code you posted. The datasheet says to do this instead:

    PM2.5 value: PM2.5 (μg /m3) = ((PM2.5 High byte *256) + PM2.5 low byte)/10

    PM10 value: PM10 (μg /m3) = ((PM10 High byte *256) + PM10 low byte)/10

    datasheet link:

    the datasheet says value is calculated in 2 steps:
    1 tmp=high*256+low;
    2 value=tmp/10;
    for the first step, tmp=high*256+low. is exactly the same as tmp=(high<<8)+low;

    for the second step, you are right, I have not done the second step in ProcessSerialData function.
    This is because I do not know how anduino deal with floating point number.
    But I have done the second step in display function. so the display should be right.

    Thank you for your attention, and your comment.

    Ahh, I see. Arduino handles floats like any other C++ microcontroller. When you divide by 10, just write it as 10.0 and make sure the variable the value is being stored in is type "float"

    I'm trying to make it but having trouble reading the PM values. The connections:

    SDS011 --- Arduino Uno

    TX RX

    RX TX


    5V 5V

    I don't have LCD so I comment the line //Display(); and replace it by 2 LEDs (they will be on if the value is 0)

    I always receive 0 for both PM 10 & PM 2.5.
    Do you have any hint what can go wrong?

    Hi, thanks for making this! I am a newbie and recently looked for SDS011 tutorials but couldn't find much. Btw I planned to use a 1602 LCD instead of the 4-digital tube for display, could you tell which part of the code should be changed?

    their are one function you should change.
    the function do 3 things:
    1 clear the display buffer;
    2 DisPm25data function for pm2.5 display;
    3 DisPm10data function for pm10 display;

    I made it! Thanks for sharing!

    I have managed to have an SDS011 working well with an Arduino Mega, but the sensor has now failed. I think this may be because sensor uses 3.3V serial whereas the Mega runs its at 5V. However you suggest that the TTL level for the SDS011 is 5v. Can you confirm please.SDS011