Pages: [1] 2   Go Down
Author Topic: Pin 13 LED always on  (Read 5050 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: March 15, 2012, 06:36:33 pm by blablatros » Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 485
Posts: 18806
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9627
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

WV
Offline Offline
Full Member
***
Karma: 0
Posts: 160
Arduino, Helps With the ADD
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 485
Posts: 18806
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Just this is all that's required:

Code:
digitalWrite(13,LOW);

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


Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Code:
digitalWrite(13, LOW)
in the loop without
Code:
pinMode(13, OUTPUT)
in the setup does not change anything - the LED stays lit.

However, putting just
Code:
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).

Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 485
Posts: 18806
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

@Nick - putting
Code:
digitalWrite(13, LOW)
in the loop without
Code:
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.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, I realize now that I haven't specified in my first post that I also put
Code:
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...
Logged

San Diego
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 485
Posts: 18806
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


San Diego
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: July 31, 2013, 06:11:16 pm by retrolefty » Logged

San Diego
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. 
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 485
Posts: 18806
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Pages: [1] 2   Go Up
Jump to: