1

I am using an arduino mega clone called the Funduino.

I am developing a python based, tkinter application that will receive the serial data that arduino sends.

However, i am witnessing some behavior that i cannot explain and i am trying to debug. I won't say anything more, because this is an arduino forum, not a python forum.

But, in the arduino, there are some leds. One of them is power, which is constantly ON, when the arduino is powered.

There is another led that is named 'L'. When i open a serial connection this is lighted up and it stays ON.

However sometimes, when i send a string to the arduino, in order to trigger some data exchange, this button is switched off.

So what does this 'L' led is, and what it means when it is turned off?

asked Apr 19, 2021 at 13:43
2
  • "L" is the user LED that is connected to pin 13. It's controlled by your software installed in the Arduino, whatever that might be. Commented Apr 19, 2021 at 13:44
  • @Majenko -- if unconfigured, the LED pin is tristate, and could be controlled by signals external to the Arduino. Commented Jan 21, 2022 at 16:42

2 Answers 2

3

If you do not configure the pins, they are initialized as pinMode(xx,INPUT) which is a floating high impedance state. Per the Arduino Uno R3 schematic, that pin is on PB5/SCK/13 which is run through the op-amp (top center in the schematic) to drive the LED. Per the Arduino Mega schematic, that pin is on PB7/OC0A/OC1C/13 which isn't run through the op amp. I left mine unconfigured on a Mega clone and measured a 1.5V on 13 and had the LED on. On an Uno clone, the light was on while unconfigured, and I measured 0.9v (but my DMM seemed to draw down the voltage).

If the pin is left floating in an unknown state, it could drive the LED into an unknown state.

Arduino Uno Schematic Arduino Mega2560 R3 Schematic detail

You can control it's state with:

pinMode(LED_BUILTIN,OUTPUT); // LED is forced off (0.01V)
digitalWrite(LED_BUILTIN,1); // force LED on (4.97)

or

pinMode(LED_BUILTIN,INPUT_PULLUP); // On, but with the internal pullup resistor, not logic gates. Pin 13 can be shorted to ground.

or set it back to the default tri-state:

pinMode(LED_BUILTIN,INPUT); // Tri-state, undefined. 
// You could control the LED from an external signal on the pin.

Measure the voltage at pin 13 and see what you get.

Personally, I purpose it as a status indicator light. E.g. https://github.com/drf5n/foxyPulseInduction_Discrimination/blob/discrimination/StatusCodeLED/StatusCodeLED.ino

Because of the tri-state/op-amp LED driver on "L", you can use the light as as a logic probe--you could leave it unconfigured and jumper it to other inputs or outputs for troubleshooting and diagnostics. If you have a project monitoring one important input, rather than putting it on a different input pin and explicitly echoing it to the LED like digitalWrite(LED_BUILTIN,digitalRead(sensorPin)); you could hook it to pin 13 to visually see the input status and just digitalRead(sensorPin).

====

Note that there are two revisions of the Arduino Mega schematic.

After testing this behavior, I noticed that the my Mega clone did not match the Arduino Mega schematic at https://www.arduino.cc/en/uploads/Main/arduino-mega2560-schematic.pdf . Tracing it out, it does use the op-amp like the Uno. (Pin 1&2 of the opamp attach to the "L" LED through the third resistor in the resistor array next to the LED.)

answered Jan 21, 2022 at 16:21
0
2

This buildin LED is connected to an IO pin of the microcontroller on the Mega (most commonly pin 13, but might be different depending on the board). So the meaning depends on what the code on the Mega does with it.

When the board is reset (which happens on opening of serial connection), first the bootloader will run. It gives you a short blink on the buildin LED. After the bootloader finishes, your own code is in charge. Whatever you do in your code with pin 13 will be reflected on the LED. Here the meaning depends on you.

answered Apr 19, 2021 at 13:55

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.