Getting PMSA003I to sleep

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
mikenel
 
Posts: 3
Joined: Sun Aug 01, 2021 2:56 am

Getting PMSA003I to sleep

Post by mikenel »

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.

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Getting PMSA003I to sleep

Post by mikeysklar »

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?

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

Re: Getting PMSA003I to sleep

Post by mikenel »

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

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Getting PMSA003I to sleep

Post by mikeysklar »

mike,

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

https://cassiopeia.hk/laserdust/

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

Re: Getting PMSA003I to sleep

Post by mikenel »

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

// Set output mode
pinMode(sleepPin, OUTPUT);

[...]

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

[...]

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

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Getting PMSA003I to sleep

Post by mikeysklar »

Perfect. Thank you for the confirmation and code.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”