Cutting VIN power

So, I’m using these sensors that we ordered in from china. They supposedly have standby modes, but… I can’t get that to work no matter what I do.

What I really want to do is just turn off the power to the sensor.

My code currently does this

  • Wait 3 seconds (for sensor to give reliable result)
  • Get value from sensor
  • Send value via network
  • Wait 10 seconds (network can be slow)
  • Deep sleep for 10 minutes.

Right before deep sleep, I want to turn off the sensor’s power. At the start of the code, I want to make sure the sensor has power.

The sensor pulls 5V so is connected to VIN+GND, then the data connections are on RX and TX.

Is there a way for me to do this? If not, does anyone have a suggestion on what circuity I could use to make this happen?

Thanks all!

You could provide some data about these sensors
or
you could use external circuitry to switch the power for the sensors via a GPIO
or
you could use 3.3V sensors that draw less than 20mA and supply them via a GPIO

1 Like

@ScruffR Hi!

We’re using the Plantower PMS3003
http://aqicn.org/sensor/pms3003/ has some technical data

Changing sensors isn’t an option, but using external circuitry is, and so is just figuring out how to do it properly is I guess.

Thanks
Tom

And where have you got PIN3 connected to and how are you controlling that pin?
You'd need to tie PIN3 down to GND via a pull-down resistor to keep the sensor in standby while your device sleeps and pull it high via a GPIO when you want to switch it on.