GithubHelp home page GithubHelp logo

Comments (12)

lewapek avatar lewapek commented on May 29, 2024

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.

HaViGit avatar HaViGit commented on May 29, 2024

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.

lewapek avatar lewapek commented on May 29, 2024

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.

HaViGit avatar HaViGit commented on May 29, 2024

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.

misan avatar misan commented on May 29, 2024

from sds-dust-sensors-arduino-library.

HaViGit avatar HaViGit commented on May 29, 2024

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.

misan avatar misan commented on May 29, 2024

from sds-dust-sensors-arduino-library.

lewapek avatar lewapek commented on May 29, 2024

@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.

HaViGit avatar HaViGit commented on May 29, 2024

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.

HaViGit avatar HaViGit commented on May 29, 2024

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.

lewapek avatar lewapek commented on May 29, 2024

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.

HaViGit avatar HaViGit commented on May 29, 2024

Thanks again!

from sds-dust-sensors-arduino-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.