0

Getting PMSA003I to sleep
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Getting PMSA003I to sleep

by mikenel on Sun Aug 01, 2021 4:54 pm

I recently got a PMSA003i (on Stemma QT breakout board) and hooked it up to a Heltec ESP32 board. I'd like to put the fan to sleep periodically to extend its lifetime. I modified the Adafruit library to let me send sleep/wakeup commands (based on official documentation and looking at what a couple of other libraries are doing) but it hasn't had an effect. Has anyone else been successful in getting the PMSA003I to sleep using other libraries?

The summarized code is:

static constexpr int PMSx003_COMMAND_LENGTH = 7;
[Sleep] = { 0x42, 0x4d, 0xe4, 0x00, 0x00, 0x01, 0x73 },
i2c_dev->write(commandData[PMSx003Command::Sleep], PMSx003_COMMAND_LENGTH, true);

I enabled I2C library serial debugging and it claims to be sending the command listed above.

mikenel
 
Posts: 3
Joined: Sun Aug 01, 2021 2:56 am

Re: Getting PMSA003I to sleep

by mikeysklar on Mon Aug 02, 2021 9:28 pm

You can pull the SET pin low (not over i2c).

SET - Set pin. High when working status, low level is sleeping mode.


https://learn.adafruit.com/pmsa003i/pinouts

I've not seen a successful i2c sleep, but it is pretty cool that you are trying to mod the library for it. Are you watching the current draw to verify that the command you are sending is not going through?

mikeysklar
 
Posts: 5577
Joined: Mon Aug 01, 2016 8:10 pm

Re: Getting PMSA003I to sleep

by mikenel on Tue Aug 03, 2021 10:34 pm

I can see the fan still spinning which is the part I really want to go to sleep :-). Thanks for the tip about the SET pin. I'll also try to hook up a meter or scope and see if anything is changing after the command.

Thanks,
-mike

mikenel
 
Posts: 3
Joined: Sun Aug 01, 2021 2:56 am

Re: Getting PMSA003I to sleep

by mikeysklar on Thu Aug 05, 2021 12:04 pm

mike,

The set pin should give you the fan sleep you are looking for. There is a offsite example here:

https://cassiopeia.hk/laserdust/

mikeysklar
 
Posts: 5577
Joined: Mon Aug 01, 2016 8:10 pm

Re: Getting PMSA003I to sleep

by mikenel on Tue Aug 10, 2021 4:27 pm

Just to follow up... I soldered a wire to the SET pin on the breakout board and hooked it up to an output capable GPIO pin on the ESP32. Setting the pin to LOW shut down the fan as expected.

Code: Select all | TOGGLE FULL SIZE
// Set output mode
pinMode(sleepPin, OUTPUT);

[...]

// Turn off fan
digitalWrite(sleepPin, LOW);

[...]

// Turn on fan
digitalWrite(sleepPin, HIGH);

mikenel
 
Posts: 3
Joined: Sun Aug 01, 2021 2:56 am

Re: Getting PMSA003I to sleep

by mikeysklar on Tue Aug 10, 2021 5:18 pm

Perfect. Thank you for the confirmation and code.

mikeysklar
 
Posts: 5577
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.