Pin 13 LED always on

Hello everybody,

I just received my UNO yesterday. I tried the blink example and it works without any problems. I then tried the fade example - the LED on pin 9 fades as it should, but the on-board LED (pin 13) is always on. It is the same with other examples as well (AnalogReadSerial, even BareMinimum).

Is this normal behavior? Shouldn't the on-board LED be turned off?

I am able to switch it off by adding the DigitalWrite(13, LOW) in the example sketch.

Mine seems to do that too. I can't offhand see where in the initialization code it is turned off. It is turned on during the bootloading process.

Looks like the pin isn't set to output, so they have left the weak pull-up on it seems. I am measuring 0.7V on pin 13, and even then, plugging in the meter draws enough current to extinguish the LED.

If the pin 13 LED is somewhat dim when lit then it is probably in a timing circuit. When using an ethernet shield, the LED is dim as it is being used as the timing pin for the shield.

Could always throw in the code for setup of pinMode(13, OUTPUT);
and then use digitalWrite(13,LOW); from loop if you didn't want to see it on :slight_smile:
But im not sure if thats what you were looking for :slight_smile:

Just this is all that's required:

digitalWrite(13,LOW);

It's already input. What you are seeing is the internal pull-ups putting a weak current on the pin.

Thanks for replies.

@Nick - I too am measuring around 0.7V on pin 13.

@Woody - That is exactly what I did, and it does work. I just assumed that the LED would be turned off unless explicitly set to HIGH.

@Nick - putting digitalWrite(13, LOW) in the loop without pinMode(13, OUTPUT) in the setup does not change anything - the LED stays lit.

However, putting just pinMode(13, OUTPUT) in the setup, and nothing else in the loop works - LED is turned off.

So, it seems that it is normal for pin 13 LED to be dimly lit. I just did not perceive it as dim - it is almost as bright as ON, TX or RX LEDs. I do not see any difference when lighting it with 5V (pin 13 set as OUTPUT and set to HIGH) or 0.7V (pin 13 in its default INPUT state).

blablatros:
I am able to switch it off by adding the DigitalWrite(13, LOW) in the example sketch.

blablatros:
@Nick - putting digitalWrite(13, LOW) in the loop without pinMode(13, OUTPUT) in the setup does not change anything - the LED stays lit.

Your earlier post suggested that doing the digitalWrite(13, LOW) was all that was needed.

Sorry, I realize now that I haven't specified in my first post that I also put pinMode(13, OUTPUT) in the setup.


I measured the voltage at pin 13 again, and now I am getting around 1.4V instead of previously measured 0.7V. Plugging the meter does not extinguish the LED as it did earlier, it just make it dimmer. Now I am puzzled...

I know this is an old topic but just encase anyone else is experiencing similar problems(This just happened on my uno last night). I found that the UNO and other boards have an internal pull-up resistor that is disconnected by default. If you take your finger, place it on the solder joints(on bottom of board obviously) and try to bridge the joint of pin13 and ground(may have to rub your finger around), you should begin to see some reaction from the LED if it doesn't just turn off completely. This is where things get strange.... After observing this problem I decided to place some solder to try and permanently bridge the pin to ground. The LED then became totally unresponsive. I then un soldered the junction and believe it or not, after removing the solder I just put on, the board now seems to be working totally fine(which is very strange to me because I assumed it had to do with the pull up resistor being engaged, but it appears the solder could have just fallen out?????!!?!?!?!?! Not sure) Anyways that is how I was able to fix the problem. Or at least it that is how it appears to be. I haven't droped an meter on it yet but I will shortly and report my findings.

On newer Unos the LED is driven by an op-amp (LM358) which may turn on if the output is left floating.

Do you know what would cause that? I generally only use pin13 as the clk line on my SD card. Hope I didn't short something out. Does this mean that the op-amp is compromised and is the clock going to be out of sync when I do SPI?

blablatros:
Hello everybody,

I just received my UNO yesterday. I tried the blink example and it works without any problems. I then tried the fade example - the LED on pin 9 fades as it should, but the on-board LED (pin 13) is always on. It is the same with other examples as well (AnalogReadSerial, even BareMinimum).

Fade uses a analogWrite() statement that requires it to be used onlywith a digital pins that have PWM output capabilities, pin 13 does not have PWM capabilities. A UNO has PWM only on pins 3, 5, 6, 9, 10, and 11.

Is this normal behavior? Shouldn't the on-board LED be turned off?

I am able to switch it off by adding the DigitalWrite(13, LOW) in the example sketch.

Due to the changes made on Rev3 Uno and mega boards the on board pin13 LED is not longer directly driven by the AVR output pin but rather 'buffered' via a spare op-amp stage. This results in a floating input pin condition for the op-amp which can result in the led being on when it shouldn't be, but it's a rather random thing as the offset input value of the op-amp plays a role. The only way to be absolutly sure that the pin 13 led remains off is to do both a pinMode(13,OUTPUT) and a digitalWrite(13,LOW), best placed in your setup function.

Lefty

BradBouton:
Do you know what would cause that? I generally only use pin13 as the clk line on my SD card. Hope I didn't short something out. Does this mean that the op-amp is compromised and is the clock going to be out of sync when I do SPI?

I would not worry about it, the 'problem' is with the op-amp input. It will not effect anything else you do or wire to pin 13. If you wired a say 10k ohm resistor from pin 13 to ground the problem would go away, or set the pin to output mode and output LOW in your setup function

Lefty

So now I'm way confused. I made a simple external circuit with a resistor and led, to test. With a blank sketch uploaded, pin13 and gnd output around 0.8V and if I were to switch the wire from pin 13 to another pin I get around 0.6 V. Is that standard? I was expecting to see 0 voltage across the circuit. Of course when I set the output to HIGH I get right around 5V.

With a blank sketch the pin is floating. How about if you write LOW to it?

Ahhh I didn't understand what you meant by floating, but now I see. Well thanks a lot for your assistance I really appreciate it. This is going sound weird but I think, I remember looking through the arduino forum (could have been on another page about the same topic maybe, I don't know.) But I think you answered someone else's question, and it had to do with the person putting !!! in a comment or something and you said "time to learn source control". Was that you? and I ended up doing a search on the subject and couldn't find any good learning material. Could you possibly point me in the right direction? I really want to know what that is and have no idea what that is. lol

Here's something to get you started:

Basically with source control you know what you changed, when. And if you add a whole lot of changes and things get worse rather than better, you can go back or find what, exactly, you changed.

Sweet! And thanks again!!!

I have the same problem...when i connect arduino to pc, Led13 is always on.
When upload scetch, get error "avrdude: stk500_getsync(): not in sync: resp=0x00"
and when i use other programmer and when i use AVRisp mkii and press shift when uploading gets this-> avrdude: usbdev_open(): did not find any USB device "usb".
I tried reset button, i checked ports(i use com8)boards(those are ok) and still nothing... Maybe it's bootloader but i don't know what to do, i'm new to this

Anyone can help me?

Thank you!

retrolefty:
If you wired a say 10k ohm resistor from pin 13 to ground the problem would go away, or set the pin to output mode and output LOW in your setup function

Regarding power consumption, is it still better to set the pin to output mode and output LOW than keep it in input mode and let the LED lit?