I have no problem turning on and off pins on my rpi4 (using both gpio on the terminal and Gpiozero with python3) however when I connect a wire (which is connected to a switch) to the pin... it turns the pin output to 0. When I disconnect, it goes back to 1.

What is the deal here? When I take the connection and attach it to an always on 5V pin - the switch turns on!

Any thoughts?

  • 1
    "When I take the connection and attach it to an always on 5V pin" it is likely to blow up! – Milliways Sep 5 '19 at 3:41
  • @Milliways no flames yet. Do you think the pin turns off because I am shorting out the board? – S1r-Lanzelot Sep 5 '19 at 3:42
  • Sooner or later it will! The substrate diodes provide limited protection, but are NOT designed to carry any significant current. – Milliways Sep 5 '19 at 3:49
  • You are likely overloading the pin, but it's impossible to tell for sure without knowing what exactly you connected and how. – Dmitry Grigoryev Sep 5 '19 at 6:43
  • 1
    THE GPIO ARE 3V3 SAFE ONLY – joan Sep 5 '19 at 8:09



(1) Rpi4B terminal command Gpio and Python GpioZero can set GPIO pin output High or Low level.

(2) GPIO pin if connected to a (push button or toggle) switch can set Gpio pin output to Low.

(3) If switch in (2) is disconnected, GPIO pin output goes High level again.

(4) If GPIO pin connected to Rpi 40 pin connector's 5V power output (Pins 2, 4) GPIO pin output becomes High level again.


(a) High (logical) level means Rpi finds GPIO pin (physical, electrical) voltage ~= 3.3V (or ~= 5.0V)

(b) Low (logical) level means Rpi finds GPIO pin voltage ~= 0.0V

(c) High = 1 = 'turn on', Low = 0 = 'Turn Off'


What is the deal here? When I take the connection and attach it to an always on 5V pin - the turns on! Any thoughts?


There is no big deal. If Rpi GPIO pin is connected to 5V, it is getting warmer and warmer (should not seeing smoke or flame, or hearing a pop or a bang), just dying slowing frying (geek talk = "silicon up latching").


Latching Up Forum Discussions

(1) DHT11 sensor and the wrong voltage may have fried my RPi3

(2) Circuit wiring issue

(3) https://www.raspberrypi.org/forums/viewtopic.php?f=56&t=232411&p=1426931&hilit=latching+up#p1426931

(4) https://www.raspberrypi.org/forums/viewtopic.php?f=56&t=232411&p=1424642&hilit=latching+up#p1424642


  • I thought a GPIO pin could output 5V, why would it not be safe to connect a switch (that is expecting 5v input) to the pin? I am still confused as to the pin suddenly switching to low output when the pin is attached. Thank you. – S1r-Lanzelot Sep 5 '19 at 3:51
  • 1
    Well (1) Rpi is a small, weak 3V3 guy, not like its strong big brother 5V Arduino. Rpi thinks and talks only 3V3. (2) If the other end of your switch is connected to 5V, then the poor Rpi guy gets crazy, and before going to hell, would yell something like "Oh Bloody Hell, My stupid master wants me to go to hell, let me sing my last song, anyway, Low, Low, Low, ,... Rpi RIP. :) – tlfong01 Sep 5 '19 at 4:11
  • And I am singing this for the short lived boy - youtube.com/watch?v=6ppdB6JX99Q – tlfong01 Sep 5 '19 at 4:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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