Loading...
Pages: [1] 2 3   Go Down
Author Topic: Multiple LEDs powering?  (Read 1267 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everyone,

I'm new to arduino and electronics (though, have read some theory about some components). I ordered an Arduino Mega 2560 Rev3 a few days ago, also a breadboard, wires, and 100 LEDs (together with resistors).

I think what I'll start with will be playing around with them, later maybe buying some more stuff.

I have a few questions (couldn't find clear answers anywhere);

I want to control as many LEDs as possible individually as possible. I've heard of charlieplexing, looks too complicated for me.
LEDs I ordered:
http://www.ebay.co.uk/itm/110483310378?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649


I can power it either through USB, or through the barrel plug from a 9V battery.
I think I can just wire them like:
Arduino Digital (OUT) -----> resistor ------>LED-------->Arduino GND
(correct me if wrong)
With a resistor, single LED would drain 20mA.
I've heard every pin outputs up to 40mA. Is there any total max? Some weird forums mentioned the max is 200mA, if true, that would mean my limit would be 10 LEDs on 10 pins... smiley-sad

How much current can the 5V out provide? If I understand it right (saw this answer somewhere), it can provide 400mA when USB and even more from 9V plug? Then maybe its possible to wire up like:


              -----------> resistor ---------> LED1 --------> Digital (IN) at low/high (which one to use to turn it on?)
5V out ---|
              -----------> resistor ---------> LED2 --------> Digital (IN) (other one)

(please correct if wrong)

Also, I have a portable 20000mAH battery with 2 usb ports (1A and 2.1A). Is it suitable to power arduino somehow?

Any other suggestions? What I'm trying to do is controlling as many LEDs as possible individually, also with ability to have them all turned on at the same time.
Any help is appreciated!!

Thanks in advance,
Robert
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 96
Posts: 6335
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The cumulative maximum is spelled out in the datasheet.  200.0 mA going in (Vcc) or out (Gnd).

If you want to control the maximum number of LEDs you will want to power them separately.

Do you want to control the brightness of each LED or just on/off?

Do you have to have all the LEDs on at the same time or would it be sufficient for the LEDs to appear to be on at the same time?  You can use multiplexing to control more LEDs with less maximum power draw.

Is it OK to use components other than resistors and LEDs?  There are driver chips for controlling 16 (with brightness) or 64 (on/off) LEDs.
Logged

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

I need only on/off. I don't want to buy anything more if possible... Any help?
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 96
Posts: 6335
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, without additional hardware you shouldn't draw more than 200 mA.  You could run your LEDs at lower power and light 20 of them at 10 mA.  Just adjust the resistor to lower the current flow.  You can try different current levels to see how much current is 'enough'.  If 5 mA is enough you can run 40 LEDs.
Logged

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

What about the 5v out? Doesn't it give 400mA? If it does, how to wire to it so I control the leds through digital individually?
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 96
Posts: 6335
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What about the 5v out? Doesn't it give 400mA? If it does, how to wire to it so I control the leds through digital individually?

You can draw about 400 mA from the +5V pin (using USB power) but if you are grounding it through Arduino pins the total can still only be 200.0 mA.  The 200.0 mA limit is for current THROUGH the chip.  That means current sourced (from Vcc) or sunk (to Gnd).
Logged

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

I'm confused... What do I need then, transistors? (Looking for the cheapest solution)
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 96
Posts: 6335
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm confused... What do I need then, transistors? (Looking for the cheapest solution)

If you had transistors you could use 8 pins to source power and use transistors to sink up to 8 LEDs at a time.  By multiplexing you can light 8 LEDs per transistor for as many pins as you can spare.  The Arduino MEGA has 54 digital output pins so you can have, in theory, 46 rows of 8 LEDs. I don't know if you can switch between rows fast enough to refresh all 46 rows in under 1/30th of a second.
Logged

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

How do I multiplex? Can you give me the scheme? Also what transistors to use? And how to program then, for example, a program that fills up a row of leds (fills by showing a row out of lit-up leds which is getting longer) 1 led a second?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 269
Posts: 25392
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
How do I multiplex?
I would not do that as a first project but this is what it is all about.
http://www.thebox.myzen.co.uk/Workshop/LED_Matrix.html
It is generally used with a matrix of LEDs and involves flashing the LEDs on and off so quickly it looks like they are on all the time all be it dimmer. Multiplexing is similar to charlyplexing which you say is too complex for you at this time.
Logged

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

Idk, I get the idea of the charlieplexing, the complicated thing is the wiring when there are more leds. What about dim? Why would they be dimmer?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 269
Posts: 25392
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Why would they be dimmer?
Because they are only on part of the time. If they spend only 10% of the time on they are only going to be 10% of the brightness. Subject to the eye's brightness perception law.
Logged

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

Which gives better results; charlieplexing or multiplexing? So as I understand there is no way I could control more than 20 led 10mA each without multiplexing?
Logged

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

Also: if the matrix is 10 rows and 20 columns, by scanning columns, I would fit in the maximum (10 leds 20mA each) which could be on at a time and would not require additional hardware parts. Right?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 269
Posts: 25392
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Which gives better results; charlieplexing or multiplexing?
What do you mean by better? It is just different. Basically you can control more LEDs with less hardware using chalyplexing but the software is a bit more complex.

Quote
which could be on at a time and would not require additional hardware parts. Right?
Wrong.
With a 10 by 20 matrix being multiplexed you would arrange things so that a whole row or column is on at any one time so you need some current drivers. If you only had one LED on at a time each LED would only be on for 1/200 th of the time or 0.5% and so would be very dim indeed.
Logged

Pages: [1] 2 3   Go Up
Print
 
Jump to: