kylemanna / sniffer

ESP32 Air Quality Sensor with PMSA003 + BME680 and 1.14" LCD
Other
121 stars 15 forks source link

Sleep PMSA003 via SET pin #6

Open mckochan opened 2 years ago

mckochan commented 2 years ago

I want to preserve the life of my PMS sensor by letting it sleep and getting a measurement every 5 min or so.

Blog post mentions: "some high side P channel MOSFET that would allow me to turn off the various sensors if I wanted to make this battery powered and needed more power management."

My understanding is the TTGo T-display does NOT have any GPIO's with built in 10k pullup like the D1 mini has.

Do I need to add a high side P channel MOSFET or a 10k pull up resistor somewhere in order to accomplish this?

Ralphy140 commented 2 years ago

If you get the hardware design done i have re-wrtiiten the ESPHome YAML to to enable deepsleep and run on battery, but the sensors consume too much power even with the ESP is in deepsleep to make this work. I will publish the code into the main branch as a new subset code

kylemanna commented 2 years ago

The hardware design has support for a high side P-channel MOSFET to completely remove power to the PMSA003. I've never tested it, but I suspect it'd work and I can help answer questions if anyone wants to try it out!

Here's the relevant portion: schematic

To use it you'd need to do the following steps:

  1. Order parts for Q2 and R2 (recommend quantities of 10x for price breaks):
    1. Si2371EDS or similar MOSFET
    2. 0805 100k resistor
  2. Cut the JP8 trace with a knife, currently this is the path the current takes to power the PMSA003. This is how it's constantly powered.
  3. Populate R2 and Q2, they should be pretty reasonable to solder as far as surface mount components go.
  4. Update the software to drive PMS_PWR / GPIO12 low to turn on the PMSA003

Note: to prevent leakage you may need to put PMS_RESET, PMS_RX, PMS_TX and PMS_SET into high impedance mode or drive them high or low.

kylemanna commented 2 years ago

Also it's worth noting that the PMS_SET pin will put the PMSA003 in to a sleep/sleep mode if it is driven low with no hardware modifications.

Data sheet says that active current is < 100 mA and that the standby current is < 200 μA.

There's also CMD=0xe4 which allows you to command sleep mode via the UART, but I figure that driving the PMS_SET pin is considerably easier.

mckochan commented 2 years ago

Which t display I/O is the PMS set pin connected to on the circuit board?

Sent from my iPhone

On Oct 18, 2021, at 9:38 AM, Kyle Manna @.***> wrote:

 Also it's worth noting that the PMS_SET pin will put the PMSA003 in to a sleep/sleep mode if it is driven low with no hardware modifications.

Data sheet says that active current is < 100 mA and that the standby current is < 200 μA.

There's also CMD=0xe4 which allows you to command sleep mode via the UART, but I figure that driving the PMS_SET pin is considerably easier.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

thecheatah commented 1 year ago

Also it's worth noting that the PMS_SET pin will put the PMSA003 in to a sleep/sleep mode if it is driven low with no hardware modifications.

Data sheet says that active current is < 100 mA and that the standby current is < 200 μA.

There's also CMD=0xe4 which allows you to command sleep mode via the UART, but I figure that driving the PMS_SET pin is considerably easier.

How exactly do you turn on sleep mode? You mention there is no hardware modification, is there an esp configuration?

mckochan commented 8 months ago

There is now a way to set the wake interval via the TX pin on the PMSX003 sensor. This might not save as much power as cutting power completely, but it will save some and also wear on the fan/laser.

for the sniffer project, all I had to do was add: tx_pin: GPIO26 under the UART section and update_interval: 120s under the PMS sensor

see here for sample config: https://esphome.io/components/sensor/pmsx003.html