I am trying to power (not at the same time) a pir sensor, and a relay board, via pico's gpio pins. The project is a camera that is turned on when the sensor is triggered. I am using the relay board to power a pi zero w with a camera. Because pico only has one 3.3 v pin, I'm trying to use regular pins. So my program will turn on the power the PIR sensor, and when motion is sensed, turn off power to the PIR, and power the relay board (3.3v). It seems to work, until the relay board part, and I can see the light going on, but not enough power is supplied to switch the circuit. I'm using a battery pack to power the pi, so I just need the pico to switch power on. Should this be possible?

I finally gave up and set my pi zero to the normally open state, and pir to normally closed, and connected the external power source to the pir, and it works fine. But, I'd like to get it working through the pins, or at least know if it's possible.

  • 1
    Rather than this alphabet soup post a circuit of what you propose. You are unlikely to power anything with a GPIO which can only provide a maximum of 16mA.
    – Milliways
    Commented Mar 15, 2022 at 6:11
  • which pir sensor are you using?
    – tlfong01
    Commented Mar 15, 2022 at 6:50
  • 1
    Ditto that you can't power anything beyond an LED with a GPIO pin -- unless you actually mean one of the 5/3.3V power pins (which aren't really GPIOs, and can't be switched on and off). Note that you risk damage to the Pi by trying to draw excessive current from them.
    – goldilocks
    Commented Mar 15, 2022 at 15:28
  • OK, that makes sense .. thanks. Ya, I need to work on my presentation, sorry folks, but thanks for taking a look :thumbsup Also, using this one amazon.com/gp/product/B012ZZ4LPM Commented Mar 16, 2022 at 6:25
  • "pico only has one 3.3 v pin" -> But it can be used to power more than one thing. Boards with multiple power pins do not necessarily have more power -- all the pins of a specific voltage will be connected together. It's just a minor convenience, like more wall outlets would save you the trouble of using a power bar.
    – goldilocks
    Commented Mar 20, 2022 at 13:47

2 Answers 2


my feeling is that there are no relays that work with 3.3v, you may use an optocoupler if the current to be switched is not too high. otherwise you need additional circuitry to just use the pico to switch the power that switches the relay.


Not knowing what you have, I will take a swag. From what you stated, the external devices can be switched on and off by turning on or off the power to them. I used my favorite search engine and entered "arduino 3v3 relays" and got just under 2 million hits so apparently they are very popular. Most of these relays allow for independent power source for the relay coils, generally there are some jumpers to it set up. You can power them with a separate power source, this can be independent from the contacts, the coil voltage will now have to match the external power source. The Pi output only has to turn on the LED in the coupler. Solid state DC switches are also available.

I would highly recommend that you power your external hardware devices from a power supply, not the terminals on the Pi. Never use the GPIOs to power anything beyond a few mills. If these external devices supply a signal to your Pi GPIO, be sure they are not sourcing or sinking current into your input when you switch them off. The GPIOs that control the relays or switches will probably not be a problem as these devices are isolated from the load with some sort of optical device.

A simple note: A power supply the Raspberry Pi is NOT!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.