Pin 13 (on board) LED for a heartbeat on an UNO?

I would like to use the on board LED (marked 'L' on the UNO) for a heartbeat. I've written code to turn it on and off which works for a few minutes and then the LED fades and no longer turns off. It's not actually very bright to begin with. I have connected an external LED to Pin 13 in series with a 330 ohm resistor and it lights up so the output seems to be working. I'm turning it on for 100 msec every 1000 msec. I've also tried longer duty cycles (like 500/1000) with no apparent change.

Is there something I need to do to use the internal LED on an ongoing basis? If I power the UNO down long enough, I can see the 'L' LED turn on again.

thanks,
hank

Sounds like a faulty LED to me.

:frowning:

I made a little sketch if anyone wishes to test this with their UNO R3 board to see if they get similar results.

static const int heartbeat = 13;

void setup() {
  pinMode( heartbeat, OUTPUT );
  }

void loop() {
  digitalWrite( heartbeat, HIGH);
  delay(300);
  digitalWrite( heartbeat, LOW);
  delay(700);
}

No external H/W needed unless you want to connect an external LED to the pin 13 output.

thanks,
hank

HankB:
I've written code to turn it on and off which works for a few minutes and then the LED fades and no longer turns off.

No longer turns off?

Sketch works fine for me - of course. Then again, this is a Pro Mini (clone) and on another sketch or two it has been - and is now - happily flashing on an off for weeks. As of course are others at home.

Is yours a genuine UNO?

Check the on-board resistor value.

Paul__B:

HankB:
... no longer turns off.

No longer turns off?

I meant to type on. (Sort of like 'the other left.' :wink: )

Check the on-board resistor value.

As far as I know, it is a genuine UNO R3. The resistor checks out at 1K and the diode check (?) function on my DMM shows about 1.2V in one polarity and about 1.4V reversed. I'm not sure if that means the LED is good or not. I wonder if the buffer has gone bad on my R3. Either side of the resistor reads about 0.08V with the LED on.

Thanks for confirming that the LED works continuously on your board.

thanks,
hank

Grumpy_Mike:
Sounds like a faulty LED to me.

Yes, and/or the op-amp stage driving the led.

Either side of the resistor reads about 0.08V with the LED on.

No way!

The resistor is in the top of the LED so measurement from ground to the resistor / LED junction should read about 2V the forward volts drop of the LED and from ground to the other end of the resistor should measure 5V.

If by that statement you mean you measured across the resistor, ( that is not what you said but it could be what you meant ) then that would imply you have 80uA through the LED which is unlikely.

HankB:
The resistor checks out at 1K and the diode check (?) function on my DMM shows about 1.2V in one polarity and about 1.4V reversed. I'm not sure if that means the LED is good or not.

That suggests that there is something else connected across the LED - such as the op-amp.

HankB:
I wonder if the buffer has gone bad on my R3.

Of course, on the UNO it is driven by a buffer. Clearly either the buffer of the LED is bad and as you say, you verified that the actual ATmega output is fine.

Well, (checks schematic) if you can hold a 330 ohm resistor between Vcc and the LED for long enough to see whether it fades under that condition, you might get an idea as to whether it is faulty - in which case you need to do some deft soldering.

Grumpy_Mike:

Either side of the resistor reads about 0.08V with the LED on.

No way!

The resistor is in the top of the LED so measurement from ground to the resistor / LED junction should read about 2V the forward volts drop of the LED and from ground to the other end of the resistor should measure 5V.

If by that statement you mean you measured across the resistor, ( that is not what you said but it could be what you meant ) then that would imply you have 80uA through the LED which is unlikely.

It's been too long and I can't recall exactly what I was measuring. Nor can I rule out operator error.

Interesting thing. I had a sketch running on it that just drove pin 13 to flash the LED at about 5 Hz. For no good reason (other than I like blinky things as much as the next guy :roll_eyes: ) I left it plugged in. After it ran a couple weeks, I noticed that the on board LED was now flashing in unison with the external LED. Whatever it was, it got better.

Resolder both resistor and red.
The changes you have observed may be due to heat.