Nathg64
Posts: 2
Joined: Wed May 01, 2019 8:22 pm

GPIO pins not outputting

Wed May 01, 2019 9:36 pm

Hello all,

I am new to this so many apologies if I may have made a silly mistake here. However I was trying to drive an LED from the GPIO pins of the Pi ( I have a model 3 B+). I did the usual import RPi.GPIO and set the pin type to BOARD. When I go to activate pin 33 or pin 35 for example using GPIO.out and GPIO.high the LED does not light up and using a multimeter I can see that there is no voltage present at the pin 33. When I look at ‘readall’ in terminal to see what the state of the pins are, I can see that they are all in the input state initially. However when I set them to GPIO.output, they do seem to go to output state however only then revert back to input state once I set the pins to GPIO.high. Pins 3 and 5 seem to be the only pins that behave themselves and work without issue according to the code, none of the others produce any voltage when they are set to GPIO.output and GPIO.high. Except the dedicated 5V pins and the dedicated 3v3 pins. Any ideas on this issue would be greatly appreciated as I have tried every option and nothing seems to work (my Pi is also only a week old so don’t think it could be broken).

Thanks for the help peeps.

LTolledo
Posts: 1519
Joined: Sat Mar 17, 2018 7:29 am

Re: GPIO pins not outputting

Thu May 02, 2019 7:52 am

Mind letting us peek at your code?

after pasting the code here (if you don't mind, that is), highlight from start of code to the end then click the {Code} on the tab above (between the {Quote} and {List} ), that way the formatting is preserved and "pleasing to see"

An image of your RPi-breadboard setup would also be helpful.....
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

Nathg64
Posts: 2
Joined: Wed May 01, 2019 8:22 pm

Re: GPIO pins not outputting

Sun May 19, 2019 1:08 pm

Hi, sorry for the delayed response

Here is my code that I am using to drive the LED, its only a simple code meant to light the LED for a few seconds and then turn off again:

import RPi.GPIO as GPIO
import time as time
GPIO.setmode(GPIO.BOARD)
GPIO.setup(33, GPIO.OUT)
GPIO.setup(33, GPIO.HIGH)

time.sleep(10)

GPIO.setup(33, GPIO.LOW)

time.sleep(10)

GPIO.cleanup()

However when I run this exact code I get no voltage on pin 33, this is the same if i swap the code to activate any of the other GPIO pins. Pins 3 and 5 the only pins that work as outputs on the board so far...

I cant seem to add any photos of the breadboard however as for some reason the file is too large.

Cheers for the help, sorry for the delayed response also, been trying to work around this :lol:

gordon77
Posts: 3998
Joined: Sun Aug 05, 2012 3:12 pm

Re: GPIO pins not outputting

Sun May 19, 2019 2:13 pm

Reduce your photos to less than 60kB.

User avatar
B.Goode
Posts: 7857
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: GPIO pins not outputting

Sun May 19, 2019 2:58 pm

Code: Select all

import RPi.GPIO as GPIO
import time as time
GPIO.setmode(GPIO.BOARD)
GPIO.setup(33, GPIO.OUT)
GPIO.setup(33, GPIO.HIGH)

time.sleep(10)

GPIO.setup(33, GPIO.LOW)

time.sleep(10)

GPIO.cleanup()


Maybe there isn't only one true way, but my use of RPi.GPIO would employ GPIO.setup() to set your chosen pin as an Output, and subsequently use GPIO.output() to control the desired status of the pin.

Supporting documentation here: https://sourceforge.net/p/raspberry-gpi ... asicUsage/

User avatar
Paeryn
Posts: 2561
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: GPIO pins not outputting

Sun May 19, 2019 4:32 pm

As B.Goode said, you use

Code: Select all

GPIO.output(pin, value)
To set the level of an output. By using

Code: Select all

GPIO.setup(33, GPIO.HIGH)
you are effectively setting pin 33 back to being an input, when using

Code: Select all

GPIO.setup(33, GPIO.LOW)
you are setting it back to being an output, and at no point are you setting the logic level.

GPIO.HIGH = GPIO.IN = 1
GPIO.LOW = GPIO.OUT = 0
She who travels light — forgot something.

Return to “Troubleshooting”