Offline
Sr. Member
Karma: 0
Posts: 266
|
 |
« on: May 26, 2011, 12:48:12 am » |
I have 19 LEDs and 1 servo and 1 bluetooth module which I need to attach to an arduino duemilanove I powered the servo of a seperate 5 V power supply (And I connected the grounds together(And the Servo works just fine)) But I just wanted to know if my arduino duemilanove can handle 19 (at least 15) LEDs when I connect the arduino to a 9V battery as it communicated wirelessly with the computer with a bluetooth module that needs 5 V power which will be powered of the arduino. I will connect 3 LEDs to pin13 and 3 LEDs to pin12 and 3 LEDs to pin11 and 3 LEDs to pin10 and 4 LEDs to pin9 and 1 LED to pin8 and 2 LEDs to pin7 and a servo to pin6 and the bluetooth module to RX and TX. Please reply
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 138
Posts: 19066
I don't think you connected the grounds, Dave.
|
 |
« Reply #1 on: May 26, 2011, 01:41:11 am » |
Assuming you're not using external drivers (you didn't mention any), and as long as you don't approach the absolute maximum per port current of 150mA and the package limit of 200mA, and you can accept that some LEDs will be dimmer than others, I don't see any problems.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 277
Posts: 25501
Solder is electric glue
|
 |
« Reply #2 on: May 26, 2011, 02:40:37 am » |
Plus the individual pin limit of 40mA
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 0
Posts: 266
|
 |
« Reply #3 on: May 27, 2011, 11:31:14 am » |
So everything would be just fine but maybe some will be dimmer
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 247
Posts: 16535
Available for Design & Build services
|
 |
« Reply #4 on: May 27, 2011, 01:04:13 pm » |
With that many LEDs and a 9V source available, you should connect the LEDs in series with a current limit resistor from the 9V supply, with an NPN transistor (2N2222 for example) on the bottom cathode that the arduino will control. Then you can get full brightness by having the same 20mA current flow thru a 'string' of diodes and have longer battery life, versus having the LEDs powered from 5V and having to split the arduino's 20mA/pin among the three LEDs and their seperate current limit resistors.
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 277
Posts: 25501
Solder is electric glue
|
 |
« Reply #5 on: May 27, 2011, 02:34:46 pm » |
So everything would be just fine but maybe some will be dimmer No if you exceed the maximum ratings you don't get less current out so it's dim but fine. You get the current out you asked for and your arduino is damaged and perhaps bricked.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 0
Posts: 266
|
 |
« Reply #6 on: May 28, 2011, 12:24:03 am » |
Thanks CrossRoads Could you give me some more detail on how to do what you are saying because I cannot understand what you mean , as you know I'm still sort of a beginner in arduino so please help.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 247
Posts: 16535
Available for Design & Build services
|
 |
« Reply #7 on: May 28, 2011, 02:38:45 am » |
Sure, I'll draw you a picture tomorrow. PM me if I forget, I have a few other things to take care of first tomorrow. Basically the 2 pictures on the right tho: 
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 0
Posts: 266
|
 |
« Reply #8 on: May 28, 2011, 08:50:55 am » |
But how will adding a transistor help the LEDs and the +5 V is it from the arduino
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 138
Posts: 19066
I don't think you connected the grounds, Dave.
|
 |
« Reply #9 on: May 28, 2011, 10:06:09 am » |
But how will adding a transistor help the LEDs It won't help them at all, but it will help prevent damage to your AVR.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 247
Posts: 16535
Available for Design & Build services
|
 |
« Reply #10 on: May 28, 2011, 10:27:49 am » |
If you have many LEDs in parallel, each drawing 20mA to be nice & bright, that can be driven from the 5V you have for the servo and not damage the 20mA recommended max current sink of the ATMega chip. 3 LEDs could draw 60mA.
If you have the LEDs in a string, they could all share the same 20mA to turn on; however you need a higher voltage as each LED will have ~2V across it. So you need a transistor that can handle the higher voltage when the LEDs are off and not conducting; the ATMega is not recommeded to go past 5.5V.
You might be able to put 2 LEDs in a string from 5V, depends on the forward voltage of each LED. Blue LEDs need higher voltage, while Red LEDs need less.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 0
Posts: 266
|
 |
« Reply #11 on: May 28, 2011, 11:19:47 am » |
There are 4 sets of 3 LEDs and the rest are single LEDs The LEDs in the sets are white coloured LEDs and the there are 4 other independant red LEDs and 1 independant orange LED and 1 independant blue LED.
So do I need to use a transistor for the sets of white LEDs If I do, then do I need to use 4 transistors, 1 for each set(NPN transistors)
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 0
Posts: 266
|
 |
« Reply #12 on: May 28, 2011, 11:21:38 am » |
And does each and every LED in the set need to have a resistor or is it okay if you use 1 resistor for 1 set( the set of white LEDs(3 white LEDs))
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 277
Posts: 25501
Solder is electric glue
|
 |
« Reply #13 on: May 28, 2011, 01:08:52 pm » |
And does each and every LED in the set need to have a resistor Unless the LEDs are in series (in line) then yes they do.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 247
Posts: 16535
Available for Design & Build services
|
 |
« Reply #14 on: May 28, 2011, 10:40:30 pm » |
Yes, transistor (or an open collector driver like ULN2003, ULN2803, provide same functionality but all nicely packaged up) for the sets of 3. One-LEDs can be driven directly from Arduino. String of LEDs needs a current limit resistor. Single LEDs need a current limit resistor.
|
|
|
|
|
Logged
|
|
|
|
|
|