1

I realize I can't put 5V in to an input pin, but I have a pin I'm going to configure as an output, which will be wired to one side of a normally open switch. The switch has 5V across it, so I just realized that when it is manually closed it'll short the 5V (supplied from the Pi) to the pin. I'm assuming this won't be ok, but wanted to check.

I guess I can use a diode to block the voltage, but I'm worried about the voltage drop across the diode, as the switch is supposed to be 5V and is already only getting 3.2V from the GPIO pin. The diode may drop it below the threshold where it will trigger.

My other alternative is the use a transistor to switch 5V from the Pi to the switch.

1

1 Answer 1

4

You should never feed more than 3V3 into a Pi GPIO - that's the official line and that is unlikely to ever change.

However lots of us have done so by mistake and on purpose.

If you do so try to put a large resistor in series (I'd start with 20k ohms and only drop if that didn't work). A 20k resistor should limit the inflow to (5-3.3)/20000 or 0.085 milliamps which hopefully will be shunted away by the GPIO protection circuitry.

2
  • Just curious if you know if the Pi Zero W has less protection circuitry? Also what would be the likely outcome if something did break, just a dead pin, or dead chip? Thanks. Apr 7, 2017 at 18:58
  • 1
    As far as the GPIO are concerned the protection should be identical on all Pi's as any GPIO protection is built into the GPIO peripheral - which is common to all Pi's. As far as power supply protection I don't think the Pi Zero models have any at all, not even a polyfuse.
    – joan
    Apr 7, 2017 at 19:19

Your Answer

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

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