Alatec
Posts: 3
Joined: Tue Mar 31, 2015 11:14 pm

Pin 7 Always on

Tue Mar 31, 2015 11:30 pm

I have an led hooked up to pin 7 (GPIO4) on the raspberry pi 1 B. The led works just fine, but is only barely on. Also it is on all of the time, regardless of what I set the pin to. Also, when I run

Code: Select all

GPIO read 7
it always returns 0. I am not sure if the other pins are the same way.

Is there any hope for my Raspberry or will I need to get a new one?

Any advice is greatly appreciated.

Delipunch
Posts: 10
Joined: Tue Mar 31, 2015 11:21 pm

Re: Pin 7 Always on

Tue Mar 31, 2015 11:51 pm

A few things to remember; LEDs are polarized, include a resistor when using LEDs, double/triple check connections.
Are you going 3v3->led+resistor->gpio(active low) OR gpio->led+resistor->gnd(active high)? A circuit diagram or textual explanation would be nice.

Alatec
Posts: 3
Joined: Tue Mar 31, 2015 11:14 pm

Re: Pin 7 Always on

Tue Mar 31, 2015 11:56 pm

I know the led is in the correct way (I tried both ways), and this exact circuit worked perfectly the other day. I don't know why it suddenly began acting up.

Delipunch
Posts: 10
Joined: Tue Mar 31, 2015 11:21 pm

Re: Pin 7 Always on

Tue Mar 31, 2015 11:59 pm

We can't really help you if you don't show or tell (preferably show) how you're hooking it all up. Are you sure the pin is configured to be an output?

EDIT: Perhaps the pin is set a PWM (Pulse Width Modulation) with a low duty cycle. That would explain it.
Last edited by Delipunch on Wed Apr 01, 2015 12:03 am, edited 1 time in total.

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: Pin 7 Always on

Wed Apr 01, 2015 12:02 am

I know the led is in the correct way (I tried both ways), and this exact circuit worked perfectly the other day. I don't know why it suddenly began acting up.
The quote above is nonsense.

If you want help, diagram what you have, and we'll help you figure out what is wrong. But, from the looks of that quote, I'm not sure you want help.

:roll:
marcus
:ugeek:

Alatec
Posts: 3
Joined: Tue Mar 31, 2015 11:14 pm

Re: Pin 7 Always on

Wed Apr 01, 2015 5:53 am

Delipunch wrote: Are you sure the pin is configured to be an output?
Thanks for pointing that out. That was exactly what the problem was. I was just running the pi from ssh and forgot to reconfigure the pin when I rebooted.

I still want to know why the pin wasn't just on or off. Why would the Pi halfway turn on a pin? Does this have anything to do with the way the pins are wired internally?
RaspberryImage.png
RaspberryImage.png (41.33 KiB) Viewed 720 times

User avatar
rpdom
Posts: 15362
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Pin 7 Always on

Wed Apr 01, 2015 6:24 am

The Pi didn't "halfway turn on the pin". It can't do that. The Pi only turns an output pin fully on (3.3V) or off (0V).

But, if the pin is set to Input, then the Pi is not making it go on or off, it is just reading whatever happens to be on it. If you don't have anything connected that is setting the pin to a certain level, then the voltage will be something random depending on electrical interference and other factors.

Return to “Troubleshooting”