PMSx003 sleep mode not working

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
G4nd41f
New user
Posts: 1
Joined: 04 Jun 2023, 19:35

PMSx003 sleep mode not working

#1 Post by G4nd41f » 04 Jun 2023, 19:49

Hi,

I am using a PMS5003 on an ESP32 board and want to use the sleep mode. I am using the code example from https://espeasy.readthedocs.io/en/lates ... light=dust :

Code: Select all

On System#Boot do    //When the ESP boots, do
  looptimerset,1,300  // Start loop timer 1, 300 sec interval
  timerSet,2,30 // Set timer 2 to put the sensor to sleep again
endon

On Rules#Timer=1 do
  timerSet,2,30 // Set timer 2 to put the sensor to sleep again
  pmsx003,wake
endon

On Rules#Timer=2 do
  pmsx003,sleep
endon
I would expect the sensor now to run for 30s seconds and then sleep for 270s and then do so again. However, the values of the dust sensor are updated/changing every 10s and the sensor does not seem to sleep at all. Did I do sth wrong?

My sensor is connected only through the RX and TX with ESP32. SET and RST are not connected. Did I understand the Wiki correctly that the sleep/wake command is performed thorugh the serial interface?
pmsx003,sleep Either pulls the PWR_SET pin low, or writes sleep command to the sensor.
I attatched the settings of my sensor.
Attachments
2023-06-04 19_48_07-Wohnzimmer_Supersensor – Mozilla Firefox.png
2023-06-04 19_48_07-Wohnzimmer_Supersensor – Mozilla Firefox.png (134.84 KiB) Viewed 806 times

User avatar
Ath
Normal user
Posts: 3415
Joined: 10 Jun 2018, 12:06
Location: NL

Re: PMSx003 sleep mode not working

#2 Post by Ath » 04 Jun 2023, 20:14

What is the Interval you have set for that task? Also on 10 seconds? (it's not in the screenshot).
The example has it set to 60 seconds, though that may still be too short, and may need to be set to ~260 sec. (270 sec. minus 10 sec. init time).
/Ton (PayPal.me)

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

Re: PMSx003 sleep mode not working

#3 Post by TD-er » 04 Jun 2023, 20:50

I have it connected to an ESP32 board here and purely based on the power consumption, I can only conclude it is putting the sensor to sleep.

On this board the RST and Set are also not configured, so the plugin does nothing to them.

The power drop is roughly 0.2 - 0.25 Watt, but that's measured from the 12V input of that board so the DC/DC converter inefficieny may offset these readings a bit.

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

Re: PMSx003 sleep mode not working

#4 Post by TD-er » 05 Jun 2023, 16:30

I am currently looking into this behavior, along with the sleep mode for the GPS.
At least for the GPS there is something funky going on.
It seems as if sending any command while the unit is asleep may wake it.
Thus calling a sleep command twice will effectively turn it on again.

Maybe there is something similar going on with the PMSx003 sensor.

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests