thejasonballinger
Posts: 6
Joined: Fri Oct 27, 2017 8:55 pm

GPIO LED not Working

Wed Jul 11, 2018 5:19 pm

Hi,

I am using a LED on my Raspberry Pi 3. I am trying to simply get it to toggle because it is not working properly. I have tried different pins and different resistance strengths, but I cannot get it to work at all. I believe it is a hardware issue so if anybody can help me with that that would be great. However, I want to give you my code in case it is a software issue.

Please keep in mind that I am on the latest version of Python 3 (Python 3.5.3).

Here is my code:

Code: Select all

from gpiozero import LED
from time import sleep

led = LED(26)
while True:
	led.toggle()
	sleep(1)
Please get back to me as soon as possible, I need this for a project that I am working on.

Thanks!

DirkS
Posts: 9941
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: GPIO LED not Working

Wed Jul 11, 2018 5:24 pm

Did you connect the LED the right way around?
Did you connect the LED to the correct pin? gpiozero uses BCM numbering by default, so GPIO26 is on physical pin 37 (see https://pinout.xyz/pinout/pin37_gpio26)

User avatar
rpiMike
Posts: 908
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: GPIO LED not Working

Wed Jul 11, 2018 5:30 pm

Post a photo of your wiring.

thejasonballinger
Posts: 6
Joined: Fri Oct 27, 2017 8:55 pm

Re: GPIO LED not Working

Wed Jul 11, 2018 5:36 pm

rpiMike wrote:
Wed Jul 11, 2018 5:30 pm
Post a photo of your wiring.
Here's a link to the pictures: [url]https://photos.app.goo.gl/FYD7qChhRnqPoMjy8[url]

thejasonballinger
Posts: 6
Joined: Fri Oct 27, 2017 8:55 pm

Re: GPIO LED not Working

Wed Jul 11, 2018 5:37 pm

thejasonballinger wrote:
Wed Jul 11, 2018 5:36 pm
rpiMike wrote:
Wed Jul 11, 2018 5:30 pm
Post a photo of your wiring.
Here's a link to the pictures: [url]https://photos.app.goo.gl/FYD7qChhRnqPoMjy8[url]
Oops, here: https://photos.app.goo.gl/FYD7qChhRnqPoMjy8

DirkS
Posts: 9941
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: GPIO LED not Working

Wed Jul 11, 2018 5:42 pm

thejasonballinger wrote:
Wed Jul 11, 2018 5:37 pm
thejasonballinger wrote:
Wed Jul 11, 2018 5:36 pm
rpiMike wrote:
Wed Jul 11, 2018 5:30 pm
Post a photo of your wiring.
Here's a link to the pictures: [url]https://photos.app.goo.gl/FYD7qChhRnqPoMjy8[url]
Oops, here: https://photos.app.goo.gl/FYD7qChhRnqPoMjy8
Blacking out most of the images doesn't make it any clearer...
Doesn't really seem to be any need to do that, I can see you have a Pitop anyway ;)

User avatar
rpiMike
Posts: 908
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: GPIO LED not Working

Wed Jul 11, 2018 6:59 pm

Can't tell from your photos how its wired. That led looks huge - what specification is it.

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: GPIO LED not Working

Wed Jul 11, 2018 9:57 pm

thejasonballinger wrote:
Wed Jul 11, 2018 5:19 pm
I am using a LED on my Raspberry Pi 3. I am trying to simply get it to toggle because it is not working properly. I have tried different pins and different resistance strengths, but I cannot get it to work at all. I believe it is a hardware issue so if anybody can help me with that that would be great.
It's easy to find out whether the LED works: connect it (with resistor) between the 3.3V and 0V on the GPIO. It should then light up. If it doesn't light up, there is no way it will light up when you connect it to a GPIO output. Simples.

Beginners Guide to Wiring Things to the GPIO
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

thejasonballinger
Posts: 6
Joined: Fri Oct 27, 2017 8:55 pm

Re: GPIO LED not Working

Thu Jul 12, 2018 4:39 pm

ok. thank you for the link.

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: GPIO LED not Working

Thu Jul 12, 2018 5:23 pm

rpiMike wrote:
Wed Jul 11, 2018 6:59 pm
Can't tell from your photos how its wired. That led looks huge - what specification is it.
It's just an ordinary LED in an 8 or 10mm package. Nothing to worry about (probably). The resistor might be 330 ohms, not too clear. Dunno how the switches are wired up though!
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

Return to “Python”