3 Replies Latest reply on Aug 2, 2020 10:32 PM by yoyojacky

    Raspberry Pi gpio output doesn't work


      I am trying to create a simple blinking led application using Pi 3 model A+.



      After some experiments it turns out that for some reason I not able to bring any gpio pin to High state.


      I have tried both C, Python and gpio script to turn pin to High, but it doesn't work. I have tested both with the led and with "gpio readall", but all output are always 0.


      What I did managed to change is to change the mode of the pins from Input to Output. It always worked without any problem.


      Any idea what can be a reason for the problems with outputs? I just started experimenting with gpio, so  I don't think I could burn it already and I did only resistance + led tests. Also constant 3v and 5v pins work properly, so I still hope that it gpio is functional.


      Any ideas are very welcome,


        • Re: Raspberry Pi gpio output doesn't work

          Hi Lev,


          There's not enough information to be sure (and a photo and code can help!), but if I had to guess, if you think the code is fine, then there's a chance it could be one of these things:

          * Incorrect pin is being connected to the LED (the GPIO numbering doesn't map 1:1 with the physical connector numbering)

          * If you're using jumper wires there's a possibility the wire could be faulty (some have been known to have the conductor cut and just hanging on by the plastic insulation being crimped).

          * Incorrect orientation of the LED (can be tested first by trying to connect it to the 3.3V output on the connector, via a resistor).


          There's a photo how to connect an LED and test the output, here:

          Raspberry Pi GPIO Explained

          2 of 2 people found this helpful
            • Re: Raspberry Pi gpio output doesn't work

              Thanks a lot Shabaz,


              Right, the wiring is not trivial and for this reason I have mainly used output of gpio in hope to see that output will turn to 1. But while I was able to see it changing from Input to Output, I couldn't make Output to change to 1.


              Unfortunately, now the pi doesn't boot anymore. Only power led is on when I power it. I have tried to reformat the memory card, but it doesn't help


              Not sure how it could happen as I used only led with a 300om resistance and played a bit with gpio setup.

            • Re: Raspberry Pi gpio output doesn't work

              Did you try to use wiringPi  liberary to drive GPIO on Raspberry Pi?

              You may need to remove the wiringPi package and reinstall the latest one.

              # remove the old one.

              sudo apt -y purge wiringpi
              hash -r

              # Download new one and install it.

              cd /tmp
              wget https://project-downloads.drogon.net/wiringpi-latest.deb
              sudo dpkg -i wiringpi-latest.deb

              # check it out.

              gpio readall
              gpio -v

              if you see this. means it works properly.

              • Re: Raspberry Pi gpio output doesn't work

                seems like your Pi is dead... if you reflash the TF card and it still not working, you may check the PMIC and the Pi may dead.