sds011 problem with sleep timer

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
till90
New user
Posts: 1
Joined: 14 Jun 2018, 08:26

sds011 problem with sleep timer

#1 Post by till90 » 14 Jun 2018, 09:27

Hello everybody,

i try to set up a sds011 dust sensor with a measure interval of 3 minutes to save battery life (at the moment it is on power plug supply). I habe the Problem that i dont understand the connection/interaction between the different methods of sleep time, deepsleep, sensor sleep.....

My target is that the nodemcu v3.0 (esp8266) with espeasy_mega firmware and the sds011 dust sensor should run every 3 minutes for a measure cycle and after meassure send the data to thingspeak api and than go to sleep for another 3 minutes.
I dont know which of the parameters i have to set?!

1. There is the sleep time of the sensor itself on the device page.
2. There is the Data Acquisition interval time also on the device page.
3. There is the Sleep Mode section in the Config menue
3.1 With Sleep awake time
3.2 With Sleep time

What is the most power saving config?
Thank you for answers! Best regards Till

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: sds011 problem with sleep timer

#2 Post by TD-er » 15 Jun 2018, 00:16

The timer interval of the SDS011 is written to the flash of the sensor itself (when changed).
This means the sensor will wake up by itself, run for 30 seconds and go to sleep again.
This sensor uses a fan and a laser. Both consume quite something and I would think twice before powering them from a battery.
The minimal run time of this sensor is 30 seconds.

At this moment it is not (yet) possible to trigger the sensor to take a sample and send it to sleep again in software. There is however a request for that and it is on my to-do list. (long list)

Without this "software wake" feature, I advice not to use deep sleep with this sensor.
Using the deep sleep feature, it is quite hard to make it wake up at the right moment. These will get out of sync, since the SDS011 will run on its own timer and the deep-sleep of the ESP depends on a lot of variable timings like the time it takes to connect to WiFi.

It may be possible to let the ESP collect the reading and then use some rules to set it to sleep again. That would make it keep sync at least.
But still power consumption is too much for long-time battery runs.

danbates
New user
Posts: 2
Joined: 24 Jul 2018, 00:45

Re: sds011 problem with sleep timer

#3 Post by danbates » 24 Jul 2018, 10:40

There's definitely a problem with the sleep timer and sending data to controller..

I set sleep time to 2 minutes (2*60s)-30s. I set the data acquisition interval to 120 seconds to correspond.. The data is grabbed from the device at the moment the fan powers up.. not after the 30s work time.
When I choose a different simpler sleep time of 1 minute and interval of 60 seconds.. The data is grabbed from the device after the 30s fan run time.. however the HTTP action to post the data happens before the data is updated from the device, meaning a different kind of inaccuracy.
I've attached the 1 minute typical settings.

What are the correct settings for the following to occur..
Sleep SDS011 for 90 seconds, work for 30 seconds, get data from device, send to controller, sleep SDS011 for 90 seconds etc..
?

How can rules work as a temporary workaround?

Build
20102 - Mega
Libraries
ESP82xx Core 2_4_1, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3
GIT version
mega-20180723
Plugins
73 [Normal] [Testing] [Development]
Build time
Jul 23 2018 02:16:08
Binary filename
ESP_Easy_mega-20180723_dev_ESP8266_4096.bin
Attachments
Screen Shot 2018-07-24 at 10.36.15.png
Screen Shot 2018-07-24 at 10.36.15.png (56.64 KiB) Viewed 9901 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: sds011 problem with sleep timer

#4 Post by TD-er » 25 Jul 2018, 00:24

It isn't (yet) perfect, I know.

The 30 second run time is just a constant value we cannot change (for now). So you're actually setting the measurement interval and sleep-time at once.
For example when you set it to "5", this means every 5 minutes it will wake and run for 30 seconds and start to sleep again.

You have to make sure the "Interval" timer is at a shorter interval.
Every "Interval" number of seconds, the plugin is called to do some reading and it will collect the data from the serial buffer.
Note that for reading to the SDS011, you only need a read pin. The write pin to the SDS011 is only needed to change the wake/sleep interval on the SDS011.
In the future I may want to change the means of handling wake/sleep to a more "measurement on demand". Now the timing is handled on the sensor itself.

When you set the "Interval" timer too high, then it will try to read a measurement while a new one has just started. This may lead to corrupt data and thus no output.
When the "interval" timer is set too low, you just do more queries for data than needed. But it will only update the measurement when new (valid) sample data is received.
So setting it too low, may just waste resources. Setting too high may give you lots of invalid samples and thus no output at all.
When a valid output is read, it will be available for other processes like rules, but it is almost impossible to sync the ESP time and the sensor time, since they are operating on their own.

Thus keep in mind:
- Interval should be lower than measurement interval
- Interval shorter than 30 seconds is of no use when using the sleep mode of the sensor.
- Short interval timer may only be useful when performing continuous measurements.

whatsupskip
Normal user
Posts: 125
Joined: 28 Feb 2018, 07:40
Location: Melbourne, Australia

Re: sds011 problem with sleep timer

#5 Post by whatsupskip » 30 Nov 2019, 06:52

I am not seeing the "Sensor - Sleep time" field as seen in the picture above in the firmware I have tried.

I have tried:
ESP_Easy_mega-20191130_dev_ESP8266_4M1M.bin
ESP_Easy_mega-20191130_test_ESP8266_4M_VCC.bin
ESP_Easy_mega-20191003_test_ESP8266_4M_VCC.bin

What am I missing?
Friends with kangaroos and some time koala rescuer.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: sds011 problem with sleep timer

#6 Post by TD-er » 30 Nov 2019, 10:26

Do you have the TX pin defined?

whatsupskip
Normal user
Posts: 125
Joined: 28 Feb 2018, 07:40
Location: Melbourne, Australia

Re: sds011 problem with sleep timer

#7 Post by whatsupskip » 30 Nov 2019, 23:26

TD-er wrote: 30 Nov 2019, 10:26 Do you have the TX pin defined?
I did, but I think I missed the step of "Submit", so it didn't commit the change and show the "Sleep Time"

Thank you for your help.
Friends with kangaroos and some time koala rescuer.

FluffyChicken
Normal user
Posts: 11
Joined: 22 Dec 2019, 17:57

Re: sds011 problem with sleep timer

#8 Post by FluffyChicken » 24 Dec 2019, 16:00

for the record using rules/trigger event and publishing on the PM10 reading* that way you don't need to worry about the interval timer.

It may be possible to uise the SDS itself to bring the device out of deep sleep. When the SDS comes out of its sleep, the 3V3(laser) and 5V line(fan) are turned on (go high). You can easily tap into them using the test points. That could be used on a gpio pin to trigger the device to start up. the timer is damned accurate to.

Just some options




*(or PM25 depending on which way you have it, PM10 is usual the last one)

jahrn
New user
Posts: 1
Joined: 08 Sep 2021, 18:05

Re: sds011 problem with sleep timer

#9 Post by jahrn » 08 Sep 2021, 18:15

Hey, I am playing around with my SDS011 and read on hackair that the sensor has a sleepmode.
This sensor has a native sleep mode activated by sending a command. When using turnOn() and turnOff() with this sensor, instead of switching off power the library will ask the sensor to reduce consumption.

But I cant find any information how to use the commands? And reading the thread it seems there is no real solution to that, so the only way to reduce energy and power it off is using a relay I guess?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: sds011 problem with sleep timer

#10 Post by TD-er » 08 Sep 2021, 19:39

The plugin has a sleeptimer option for it, to turn the sensor into sleep periodically.

A sample takes 30 seconds to take. If you set the period to every 5 minutes, you can thus extend the lifespan of the laser with roughly a factor 10 (typical life span is 8000 hours, which is 1 year)

For this you need to have the sensor's RX connected only once to set this sleep/wake ratio, as it is stored in the sensor's EEPROM.

Post Reply

Who is online

Users browsing this forum: No registered users and 25 guests