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


  • Contest Winner

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

    0_1546189322015_1.png

    BOM is:

    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


  • Hardware Contributor

    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.


  • Contest Winner

    @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


  • Hardware Contributor

    @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


Log in to reply
 

Suggested Topics

  • 8
  • 90
  • 29
  • 1
  • 1
  • 2

0
Online

11.4k
Users

11.1k
Topics

112.6k
Posts