PM10 + PM2.5 + UV + Temperature + Humidity + Pressure + Weather Forecast + Light Sensor
-
Despite the long name, it is a pretty simple sensor to build and program.
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.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):
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).
Hope it can help
-
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.
-
@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
-
@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.
Suggested Topics
-
Welcome
Announcements • • hek