Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. PM10 + PM2.5 + UV + Temperature + Humidity + Pressure + Weather Forecast + Light Sensor

PM10 + PM2.5 + UV + Temperature + Humidity + Pressure + Weather Forecast + Light Sensor

Scheduled Pinned Locked Moved My Project
4 Posts 2 Posters 1.6k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    user2684
    Contest Winner
    wrote on last edited by
    #1

    Despite the long name, it is a pretty simple sensor to build and program.

    0_1546189322015_1.png

    BOM is:

    • 1: @sundberg84 EasyPCB fro RFM69
    • 2: BME280 for Temperature + Humidity + Pressure + Weather Forecast (https://www.aliexpress.com/item/BME280-Digital-Sensor-Temperature-Humidity-Barometric-Pressure-Sensor-Module-I2C-SPI-1-8-5V-GY-BME280/32849462236.html)
    • 3: LDR sensor for light level (https://www.aliexpress.com/item/KY-018-3pin-Optical-Sensitive-Resistance-Light-Detection-Photosensitive-Sensor-Module-for-arduino-DIY-Kit-KY018/32820189174.html)
    • 4: ML8511 for UV rays (https://www.aliexpress.com/item/Analog-output-module-GY-ML8511-UV-UV-sensor-Sensor-Breakout/32533518448.html)
    • 5: DSM501A dust sensor for PM10 and PM2.5 (https://www.aliexpress.com/item/DSM501A-Dust-Sensor-Module-PM2-5-Detection-Dector-Allergic-Smoke-Particles-Sensor-Module-For-Arduino-For/32880813740.html)
    • 5a: two pair of 1K/400R resistors as a voltage divider for allowing the 3.3V arduino to read the two 4.8V outputs of the DSM501A
    • 6: USB TTL to power both the board with the 3.3v output and the DSM501A with the 5V output (https://www.aliexpress.com/item/1pcs-USB-to-TTL-converter-UART-module-CH340G-CH340-3-3V-5V-switch/32668180966.html)

    Of course this cannot run on batteries since the DSM501A requires at least 90mA to work.
    Wiring is pretty simple, with BME280 connect to A4-A5 for I2C communication, the LDR to an analog pin, ML8511 to another analog pin, DSM501A connected to two digital pins through the voltage resistor 5a.

    0_1546189567141_2.png

    All those sensors are supported by NodeManager so the code is super-simple, with the board reporting battery and signal level periodically as well. All sensors reporting every 5 minutes but the DSM501A reporting every 10 minutes (since for a measure it take 1-2 minutes):

    /**********************************
     * MySensors node configuration
     */
    
    // General settings
    #define SKETCH_NAME "DustTemp"
    #define SKETCH_VERSION "1.0"
    #define MY_NODE_ID 13
    
    // RFM69 radio settings
    #define MY_RADIO_RFM69
    #define MY_IS_RFM69HW
    #define MY_RFM69_NEW_DRIVER
    
    // Advanced settings
    #define MY_BAUD_RATE 9600
    #define MY_SPLASH_SCREEN_DISABLED
    
    /***********************************
     * NodeManager configuration
     */
    
    #define NODEMANAGER_DEBUG OFF
    #define NODEMANAGER_INTERRUPTS OFF
    #define NODEMANAGER_SLEEP OFF
    #define NODEMANAGER_RECEIVE OFF
    #define NODEMANAGER_DEBUG_VERBOSE OFF
    #define NODEMANAGER_POWER_MANAGER OFF
    #define NODEMANAGER_CONDITIONAL_REPORT OFF
    #define NODEMANAGER_EEPROM OFF
    #define NODEMANAGER_TIME OFF
    #define NODEMANAGER_RTC OFF
    #define NODEMANAGER_SD OFF
    #define NODEMANAGER_HOOKING OFF
    #define NODEMANAGER_OTA_CONFIGURATION OFF
    #define NODEMANAGER_SERIAL_INPUT OFF
    
    // import NodeManager library (a nodeManager object will be then made available)
    #include <MySensors_NodeManager.h>
    
    /***********************************
     * Add your sensors
     */
     
    #include <sensors/SensorBattery.h>
    SensorBattery battery;
    
    #include <sensors/SensorSignal.h>
    SensorSignal signal;
    
    #include <sensors/SensorLDR.h>
    SensorLDR ldr(A1);
    
    #include <sensors/SensorML8511.h>
    SensorML8511 ml8511(A0);
    
    #include <sensors/SensorBME280.h>
    SensorBME280 bme280;
    
    #include <sensors/SensorDSM501A.h>
    SensorDSM501A DSM501A(6,5);
    
    /***********************************
     * Main Sketch
     */
    
    // before
    void before() {
    	
      /***********************************
       * Configure your sensors
       */
    
      // DSM501A sensor
      DSM501A.setReportIntervalMinutes(10);
       
      // node configuration
      nodeManager.setReportIntervalMinutes(5);
       
      // call NodeManager before routine
      nodeManager.before();
    }
    
    // presentation
    void presentation() {
      // call NodeManager presentation routine
      nodeManager.presentation();
    }
    
    // setup
    void setup() {
      // call NodeManager setup routine
      nodeManager.setup();
    }
    
    // loop
    void loop() {
      // call NodeManager loop routine
      nodeManager.loop();
    }
    
    #if NODEMANAGER_RECEIVE == ON
    // receive
    void receive(const MyMessage &message) {
      // call NodeManager receive routine
      nodeManager.receive(message);
    }
    #endif
    
    #if NODEMANAGER_TIME == ON
    // receiveTime
    void receiveTime(unsigned long ts) {
      // call NodeManager receiveTime routine
      nodeManager.receiveTime(ts);
    }
    #endif
    

    And this is the final result (yes the box doesn't look really great):

    0_1546189773866_3.png

    Overall everything works fine even if I'm not that satisfied of the DSM501A sensor since most of the times it doesn't return a valid read (negative value which is then ignored) and when it does the value looks to me a bit too high (I should be already dead if this level of pollution would be real :P).

    0_1546190106354_4.png

    Hope it can help

    1 Reply Last reply
    2
    • Nca78N Offline
      Nca78N Offline
      Nca78
      Hardware Contributor
      wrote on last edited by
      #2

      Hello,

      interesting range of sensors, but you should not use the DSM501. It can't produce a constant airflow, so it can't give you any valid result. It's cheap, but completely useless.
      Chose a sensor with integrated fan, like Plantower PMS7003 or PMS5003, they do a good job for a reasonable price.

      U 1 Reply Last reply
      0
      • Nca78N Nca78

        Hello,

        interesting range of sensors, but you should not use the DSM501. It can't produce a constant airflow, so it can't give you any valid result. It's cheap, but completely useless.
        Chose a sensor with integrated fan, like Plantower PMS7003 or PMS5003, they do a good job for a reasonable price.

        U Offline
        U Offline
        user2684
        Contest Winner
        wrote on last edited by
        #3

        @nca78 thanks a lot for the hit, I'll buy what you recommended and try it out! And yes the DSM501 seems pretty useless right now, I thought was because of the power supply but doesn't look like the case. Thanks again

        Nca78N 1 Reply Last reply
        0
        • U user2684

          @nca78 thanks a lot for the hit, I'll buy what you recommended and try it out! And yes the DSM501 seems pretty useless right now, I thought was because of the power supply but doesn't look like the case. Thanks again

          Nca78N Offline
          Nca78N Offline
          Nca78
          Hardware Contributor
          wrote on last edited by
          #4

          @user2684 I forgot to tell you to buy one with a cable. They use a connector with 1.25mm spacing and it is not possible to connect anything else. You can make the cable breadboard friendly by soldering the ends to a 2.54mm header.
          0_1546224741950_IMG_20181231_095020~2.jpg

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          18

          Online

          11.7k

          Users

          11.2k

          Topics

          113.1k

          Posts


          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • MySensors
          • OpenHardware.io
          • Categories
          • Recent
          • Tags
          • Popular