Pages: [1]   Go Down
Author Topic: How many LED's on Pin 13 that already powers the on-board Green L-LED?  (Read 467 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

The max pin output current on an Arduino is 40 mA.
So I can put in 2 LED's (with appropriate resistors) on a single pin.
(Each LED will source upto 20 mA)

However pin-13 is already connected to the on-board L - LED (green).
Does this mean I cannot connect 2 normal LED's on Pin 13?

Thank you.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 144
Posts: 5345
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

The max pin output current on an Arduino is 40 mA.
So I can put in 2 LED's (with appropriate resistors) on a single pin.
(Each LED will source upto 20 mA)

However pin-13 is already connected to the on-board L - LED (green).
Does this mean I cannot connect 2 normal LED's on Pin 13?

Yes.

PS: Aiming for exactly 20mA with resistors is a BAD idea. This forum has a loooong history of the reasons why.

Short version:
a) At the "20mA" point on an LED output curve (see datasheet) even a tiny error in voltage can produce a large error in current.
b) The variation in voltage between individual LEDs is enough to make sure that the error in part (a) will happen.

Solution: Either aim for 15mA (which won't be much dimmer) or use a constant-current circuit (eg. LED driver chip)

Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26467
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"Does this mean I cannot connect 2 normal LED's on Pin 13?"
Better answer is Maybe.
Recent Uno's have a buffer (LM358) on D13 that drives the onboard LED.  Older Unos have a 1K resistor to the LED, which consumes ~3mA of current when driving High.
Both early and later have recommended Absolute Max of 40mA both high & low.  However, high voltage drops down as current exceeds 20mA, and low voltage rises up as current exceeds 20mA.
There is also a limit on how much current a port will support, and an overall limit on how much current the Vcc/Avcc & Gnd pins can support. (200mA/pin)  See Section 29 of the datasheet, excerpted below.
Depending on Vf of your LEDs, you might be able to run them at 20mA by putting both in series with a single resistor.

ATmega328P:
DC Current per I/O Pin ................................................ 40.0mA
DC Current VCC and GND Pins................................. 200.0mA

3. Although each I/O port can source more than the test conditions (20mA at VCC = 5V, 10mA at VCC = 3V) under steady state
conditions (non-transient), the following must be observed:
1] The sum of all IOH, for ports C0 - C5, D0- D4, ADC7, RESET should not exceed 150mA.
2] The sum of all IOH, for ports B0 - B5, D5 - D7, ADC6, XTAL1, XTAL2 should not exceed 150mA.
If IIOH exceeds the test condition, VOH may exceed the related specification. Pins are not guaranteed to source current greater than the listed test condition.

4. Although each I/O port can sink more than the test conditions (20 mA at VCC = 5V, 10 mA at VCC = 3V) under steady state
conditions (non-transient), the following must be observed:
1] The sum of all IOL, for ports C0 - C5, ADC7, ADC6 should not exceed 100 mA.
2] The sum of all IOL, for ports B0 - B5, D5 - D7, XTAL1, XTAL2 should not exceed 100 mA.
3] The sum of all IOL, for ports D0 - D4, RESET should not exceed 100 mA.
If IOL exceeds the test condition, VOL may exceed the related specification. Pins are not guaranteed to sink current greater than the listed test condition.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

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

Nothing magic about running standard leds at 20ma, run them at 10 to 15ma and you will be fine. I have some 3mm red leds that at even at 3 ma are bright as heck, too bright for just a always on power indicator.

Lefty

Logged

Pages: [1]   Go Up
Jump to: