Arduino built in LED half ON

Hi. I was wondering under which circunstances the built in LED (pin13) of the Arduino Mega would remain like half ON. If I run a small program it remains off, but if I load a large program it lights but not too much. I'm not using this pin tho. I tried setting it up as an INPUT but it still half lights. What am I missing? thanks.

The usual cause for the LED on pin 13 looking dim is that it is being turned on and off rapidly

Please post example sketches that illustrate what you are seeing

Hello
Check the coding pinMode() for the LED_BUILTIN.

1 Like

The root cause is the circuit on original Megas and faithfull clones.

image

If you do not actively control pin 13, it's a floating input on IC7A which picks up noise that the one moment is considered HIGH and the NEXT moment considered LOW.

To prevent this, either set the pinMode for pin 13 to INPUT_PULLUP or to OUTPUT.

2 Likes

That is of course, the default, so that does nothing at all.

It is because the LED itself is buffered, so as the pin randomly floats, so the LED can light to varying intensity.

It doesn't even need to pick up noise and change. The op-amp is an analog buffer, so it faithfully reproduces the voltage on the pin, whether HIGH, LOW, or any point in between. Same of course, for the UNO.

The size of the code loaded is irrelevant, it is a matter of whether the program sets the pinMode or not.

Except ...

It is possible that activity on adjacent pin 12 - or perhaps others - will be coupled to the otherwise unconnected pin.

2 Likes

What is the purpose of IC7A?

Hi,
I'm not sure, but it seems that the purpose of IC 7A is to allow lighting the builtin LED, drawing little current from pin 13 (it works as a driver).

1 Like

There is no doubt at all.

The purpose is to ensure that there is no load whatsoever on pin 13 when used as an input.

Earlier Arduinos, such as the Duemilanove and still the Nano and Pro Mini - had the indicator LED directly connected to pin 13, so that they pulled the pin down to the threshold voltage of the LED, about 2 V which is effectively a logic LOW. This prevents INPUT_PULLUP from being used; the input source must be able to provide a relatively strong drive to provide a logic HIGH as it lights the LED.

The op-amp buffer completely removes this restriction and the LED faithfully indicates the voltage on pin 13, even if it is randomly floating.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.