Pages: [1]   Go Down
Author Topic: Multiple LED strings  (Read 1674 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, I'm fairly new to this and I have what I think is a rather basic question.
I have about 20 LED strings and I want to control each string separately. Only 4 strings will be on at the same time. Is this possible with Arduino? Is there maybe something else that might be more suitable for this?
Thanks.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 547
Posts: 27363
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

Sure, is possible.
Supply power to each string from 12V or whatever source they need.
Use an NPN transistor, such as 2N2222, to control the ground of each strip.
The arduino then controls the transistor.

You need a 150 ohm resistor between arduino and transistor base.
Transistor emitter goes to ground.
Transistor collector goes to the "negative" of the LED string.
"Positive" of the string goes to +12V or whatever power source it needs.
May need a current limit resistor in series with the LED String, or it may be built in.
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.

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

So, if I understand you correctly, I need an NPN transistor for each LED string. That's 20 transistors. How would the arduino control that many transistors? (Or did I get you wrong and I only need 1 for all?)
Logged

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

Quote
I need an NPN transistor for each LED string.
Yes.

Quote
How would the arduino control that many transistors?
If there are not enough outputs then use a mega or some form of port expander. Shift registers are a beginners favorite.
Logged

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

Thank you for your answers.
I looked into shift registers and it seems that's what I need. They also seem pretty simple to use.
I couldn't find any 2N2222 transistors, only 2N2222A ones. Would these work as well?

So, if I got it all right, it's going to look like this:
Arduino connected to 4 shift registers that are connected to 20+ transistors (base). Between the registers and the transistors are resistors.
Transistors are connected to LED strings (collector to negative).
12V power source goes to LED string (positive), shift registers and arduino.
Ground goes to transistors (emitter), shift registers and arduino.

Few more newbie questions (sorry I'm a software engineer with a limited knowledge in electronics and electricity)
Why do I need transistors?
Does it matter how many LEDs I have in each string?
What are my 12V power source options?
Logged

Santa Fe
Offline Offline
Full Member
***
Karma: 1
Posts: 214
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

the 2N2222A transistors should work fine. You need them to supply enough current to drive all them lights! If you tried to drive them just with the pin outs of the Arduino, then you wouldn't have enough current.
Logged

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

Quote
Why do I need transistors?
Because the shift registers can't delver the current you need at the voltage you need.

Quote
I couldn't find any 2N2222 transistors, only 2N2222A ones. Would these work as well
Yes.

Quote
Between the registers and the transistors are resistors.
Yes the wiring sounds right.

Quote
Does it matter how many LEDs I have in each string?
The more LEDs the more current you need. Make sure this is less than 80% of the current rating of your transistor.
Logged

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

the 2n2222 transistors are really hard to get the a version is easy to come by  the metal can 2n2222 are a collectors piece now, i have alll of them as i collect
Logged

SydneyAust.
Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You could multiplex the 20 strings through a (4x5) grid of 20 transistors.

Then you only need 9 pins, but you can only cycle one string at a time, so they would be slightly dimmer if more than one string was 'on'.

But, I would get a second opinion because I'm new here!

Logged

Pages: [1]   Go Up
Jump to: