Comments (12)
Hi,
it is definitely not known issue.
Do you use an unmodified version of https://github.com/lewapek/sds-dust-sensors-arduino-library/blob/master/examples/hardwareSerial/hardwareSerial.ino ?
I'm sure I've tested all examples at the time they were implemented - however, I've used regular Arduino Leonardo as far as I remember (not "The Things Uno board which is a Leonardo with integrated LoRaWAN").
Also, could you paste here a few lines from the serial monitor? The example sketch mentioned above (hardwareSerial.ino) uses sleep/awake command too - do they work as expected?
PS
If anyone using this library with HardwareSerial is reading my comment - it would be great if you could test https://github.com/lewapek/sds-dust-sensors-arduino-library/blob/master/examples/hardwareSerial/hardwareSerial.ino sketch if it is working properly and give us a note here.
from sds-dust-sensors-arduino-library.
Thanks for your fast and kind reply! I use the unmodified sketch as you mention and I know it sleeps according to the settings , I can hear the fan stop and run as expected. Below you see the output of the serial monitor. Hope to hear from you again.
PM2.5 = 3.30, PM10 = 6.00
pm25: 3.30, pm10: 6.00
Sensor is sleeping
PM2.5 = 0.00, PM10 = 0.00
pm25: 0.00, pm10: 0.00
Sensor is sleeping
PM2.5 = 0.00, PM10 = 0.00
pm25: 0.00, pm10: 0.00
Sensor is sleeping
PM2.5 = 0.00, PM10 = 0.00
pm25: 0.00, pm10: 0.00
Sensor is sleeping
PM2.5 = 0.00, PM10 = 0.00
pm25: 0.00, pm10: 0.00
Sensor is sleeping
from sds-dust-sensors-arduino-library.
It seems that the query status is Ok - otherwise, there would be an error printed.
You can also try to use this library with sources and "#define DEBUG_SDS_DUST_SENSOR" in SdsDustSensor.h file - then all raw bytes send/received to/from a sensor will be printed in serial monitor as well as all intermediate failures (in case of automatic retries).
I also hope someone else will test this and inform us here about the results.
from sds-dust-sensors-arduino-library.
I tried to use #define DEBUG_SDS_DUST_SENSOR in hardwareSerial sketch but this does (as expected ?) not show any information. The SdsDustSensor sketch as mentioned does not use hardware serial and I don't know how to use and wire the I/O without hardware serial, as far as I know this differs from an Arduino Uno.
Maybe intereresting to mention the FW version is not shown at all when using the hardware serial sketch and the mode is reported as "query" (see below).
Mode: query
PM2.5 = 10.90, PM10 = 12.90
pm25: 10.90, pm10: 12.90
Sensor is sleeping
PM2.5 = 0.00, PM10 = 0.00
pm25: 0.00, pm10: 0.00
Sensor is sleeping
from sds-dust-sensors-arduino-library.
from sds-dust-sensors-arduino-library.
Thanks for your suggestion. When I use the sensor with Lewapek's library demo's on an Arduino Uno the FW date is shown as expected. So I do no think it is a sensor issue.
from sds-dust-sensors-arduino-library.
from sds-dust-sensors-arduino-library.
@misan
thanks for your response
@HaViGit
#define DEBUG_SDS_DUST_SENSOR
is resolved at compile time so you need to download and compile this library sources with debug enabled. Then you should see more output in serial monitor
from sds-dust-sensors-arduino-library.
Sorry for the misunderstanding, now I have added the line to the SdsDustSensor.h file as follows:
#ifndef SDS_DUST_SENSOR_H
#define SDS_DUST_SENSOR_H
#define DEBUG_SDS_DUST_SENSOR
After recompiling and uploading the unmodified hardwareSerial sketch there is no debug info shown in serial monitor. I suppose I'm doing something wrong?
from sds-dust-sensors-arduino-library.
After adding some delays (not sure if they are all needed) and removing the lines printing the firmware version and modus (mostly dit not work correct in my setup) the sketch below now runs about 2 hours without missing a measurement so far.
#include "SdsDustSensor.h"
SdsDustSensor sds(Serial1);
long interval = 300000;
void setup() {
delay(2000);
Serial.begin(115200);
delay(1000);
Serial.println("Start using SdsDustSensor.h");
sds.begin();
delay(1000);
}
void loop() {
sds.wakeup();
delay(1000);
Serial.println("Fan ON for 30 seconds");
delay(30000);
PmResult pm = sds.queryPm();
delay(1000);
if (pm.isOk()) {
Serial.print("PM2.5 = ");
Serial.print(pm.pm25);
Serial.print(", PM10 = ");
Serial.println(pm.pm10);
} else {
Serial.print("Could not read values from sensor, reason: ");
Serial.println(pm.statusToString());
}
WorkingStateResult state = sds.sleep();
delay(1000);
if (state.isWorking()) {
Serial.println("Problem with sleeping the sensor.");
} else {
Serial.print("Sensor sleeps for ");
Serial.print(interval / 1000);
Serial.println(" seconds");
delay(interval);
}
}
from sds-dust-sensors-arduino-library.
Maybe this is somehow connected with firmware version - I'm not sure. As far as I remember I've tested sensors with firmware from 2017 and 2018.
This library is implementation of "Laser Dust Sensor Control Protocol V1.3" - maybe older firmware uses another version of the protocol
from sds-dust-sensors-arduino-library.
Thanks again!
from sds-dust-sensors-arduino-library.
Related Issues (20)
- Invalid firmware version HOT 4
- Compiling error HOT 1
- SoftwareSerial library api change HOT 1
- Incompatibility with SD.h HOT 6
- Query mode example missing evry other reading HOT 2
- Output values unit HOT 2
- Query reporting mode HOT 1
- Consistent high readings using this code HOT 5
- Add esp32 to the SoftwareSerial.h #ifdef
- Compilation fails with SoftwareSerial.h not found. Library.json version doesn't match tag 1.4.0? HOT 4
- Examples have reversed arguments HOT 1
- Compilation fails on Arduino Nano 33 BLE (Sense) HOT 3
- ESP32 hardware serial UART2 HOT 1
- Could you tell me why this did not work with board MKR WIFI 1010? HOT 1
- WakingUp HOT 1
- sds011 stuck in custom mode HOT 1
- Using hardwareserial crashing in sds.begin() on arduino-espressif32 framework HOT 2
- invalid initialization of non-const reference of type 'HardwareSerial&' , sds(rxPin, txPin); HOT 2
- Error on linking: undefined reference to `vtable for Serials::AbstractSerial' HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sds-dust-sensors-arduino-library.