Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

powering 100 LEDs at once in a standard microcontroller setup

Status
Not open for further replies.

mik3ca

Member
Let's say I have a microcontroller in which an output pin controls 100 LEDs through an NPN transistor (with usual circuit setup of NPN emitter grounded, NPN base to GPIO pin through 1K resistor, and NPN collector to LED arrangement cathode and LED arrangement anode to +5V), but all 100 of them must be either on at full brightness or off at the same time. I plan to power the whole circuit with a 5V voltage regulator so that I can connect a 9V battery to it and not have it blow up.

The LED in particular I plan to power is: https://www.futurlec.com/LED/Green_8mm_LED.shtml

I used a wizard at URL **broken link removed** and used the maximum values possible (30ma) since I don't want the LED's to blink at a high speed and I want bright output.

I then go for solution 2 because a beginner will help me with part of my project and the LED's will be scattered all over the place physically.

So the wizard reports the following:

The wizard says: In solution 2:
each 120 ohm resistor dissipates 108 mW
the wizard says the color code for 120 is brown red brown
the wizard thinks 1/4W resistors are fine for your application
together, all resistors dissipate 10908 mW
together, the diodes dissipate 4545 mW
total power dissipated by the array is 15453 mW
the array draws current of 3030 mA from the source.

Given all this, do I need any transistor better than a 2N2222 at the output of the micro? and what low-priced 5V voltage regulator should I use as the middle man between the 9V battery and the circuit? I just think the standard 7805 won't work because its rated for 1A and the wizard says the LED arrangement needs 3A.

Also, due to pricing and need for more full colour for the application, I'm omitting the ultra-bright LEDs.
 
I added a quick circuit here:
circuit.png


Ignore the 7806 label. its actually a voltage regulator for 5V but I need to figure out the perfect one. R1 is 1K and the other resistors are roughly 120 ohms each. All LEDs are the same: https://www.futurlec.com/LED/Green_8mm_LED.shtml. I'm considering the 2N2222 for the transistor but I don't know if it will work. and in the schematic, only 3 LED's are shown but there will be 100 in total setup the same way as the three shown.
 
One hundred LEDs is a lot.
That NPN will have to handle 100*.03=1 amp, requiring 40mA (for beta=25) of base-current.
This might require a few more output pins and transistors or pre-drivers or....
 
Thanks for the picture that helps!

You say 3A. Not from a 9V battery. The little 2N2222 can not do that. The 7805 can not do that. There are too many problems but lets try to fix them.

You are powering the LEDs from a regulated 5V. Another idea is to series two LEDs. (LED+LED+resistor)*50 And power them from the 9V. This will drop the current to 1/2. total=1.5A Problem; the brightness will drop as the battery gets old. The LEDs will make light down to about 5 volts.

You could series three LEDs but then they will dim-out at about 7 volts. So a week battery will show more. BUT the current will be 1/3 as much. (LED+LED+LED+resistor)*33

There are bigger transistors or we can use a handful of transistors.
 
You need a much higher power transistor to fed the LED's (and might need a driver for it as well), you also need a regulator able to easily supply 3A (and dissipate 12W or so, large heatsink required). Plus you need a battery able to supply high power.

Ignoring the battery requirement, for a start use a regulator to feed the micro-controller ONLY (that cures the regulator problem), and feed the LED's directly from the battery - this will allow you to put the LED's in series (rows of three perhaps?),reducing the waste heat considerably, and reducing the current required as well.

But first job is to sort out a sensible battery, how long do you want it to last?.
 
A 2N2222a or MPS2222A probably should be used at 100mA to 200mA.
At 150mA collector current you should drive the base with 3mA. (gain of 50)
So 5 LEDs per transistor. (30mA * 5 = 150mA)
I would use a "logic level" mosfet.
 
Example of using a MOSFET transistor.
Using 3 LEDs in series to reduce current.
Directly powering the LEDs from a battery.
Using a 12V battery capable of 1A draw.
upload_2017-7-8_11-4-13.png

Probably should have a 100k resistor from BASE to ground on the MOSFET.
 
Last edited:
Thanks for the picture that helps!

You say 3A. Not from a 9V battery.
Ok since these 100 LEDs can be located at a fixed position in my project, I'll go with a DC power adapter. Since I need about 3 amps, could I get away with a adapter with 18V/1A rating and have it automatically convert to 6V/3A or is there some special math I need to know? I ask because I won't be able to find a 6V/3A adapter that I can buy, however I own a 6V/900ma adapter.

...The little 2N2222 can not do that. The 7805 can not do that....
I kinda thought those parts wouldn't exactly work but I wanted to be sure.

Another idea is to series two LEDs. (LED+LED+resistor)*50 And power them from the 9V. This will drop the current to 1/2. total=1.5A Problem; the brightness will drop as the battery gets old. The LEDs will make light down to about 5 volts.
I want to avoid LEDs in series because in my project each LED and resistor pair will be on its own circuit board and the microcontroller and regulator will also be on one circuit board separate from the LED boards. The whole layout will look scattered at first since I'm making a large lit design.

There are bigger transistors or we can use a handful of transistors....

You need a much higher power transistor to fed the LED's (and might need a driver for it as well),

So I could get away with a 2n2222 for every say 20 LEDs where the NPN's bases and NPN's emitters are connected together? Since two people say higher power transistors, I suppose a TIP31 will do the trick.

You also need a regulator able to easily supply 3A (and dissipate 12W or so, large heatsink required). Plus you need a battery able to supply high power.
Sounds like I'll need to lower my lighting requirements. The thing is I want the lights to be noticeable in a dark area from a distance of about 50 meters. 3A regulators are probably more expensive than 1A regulators. Can I also get away with using 3 1A regulators where each one powers 1/3 of the entire circuit such that each third can't use more than 1A current?

and feed the LED's directly from the battery - this will allow you to put the LED's in series (rows of three perhaps?),reducing the waste heat considerably, and reducing the current required as well.
Because I have a beginner working with me, putting x LEDs in series will be more confusing to him than just 1 LED and 1 resistor.

how long do you want it to last?
The LED's need to be on for up to 12-18 hours a day. I'll use a battery for initial testing purposes then when things go well then I'll use a wall wart.
 
a adapter with 18V/1A rating and have it automatically convert to 6V/3A
18V 1A = 18 watts and that can convert to 6V 3A which is 18 watts. (depending on how you convert you will probably get 90% of your power)
I can get a 5 volt 3 or 4 amp "wall wort" or phone charger. Then you don't need a PWM to buck 18V down to 6V. You won't need the LM7805. Everything works from the AC adapter.
upload_2017-7-8_18-48-48.jpeg

I would use a MOSFET transistor because the input works at 0 volts = off and >2.5V=on and the input current is about 0uA. We could help you choose one.
 
Did you see the 30mA Max DC Forward Current rating for the LEDs? Don't run them at their max. Use 20mA instead.
Does your LED Wizard think you have 1.40V light bulbs instead of the 1.6V to 2.6V LEDs? Doesn't your LED Wizard know that all the LEDs have different voltages from 1.6V to 2.6V? Doesn't your LED Wizard know that with a 120 ohm resistor the 1.6V LEDs will be bright and the 2.6V LEDs will look dimmed?

Actually, you selected an LED that is old and dim. Modern green LEDs are much brighter.
 
In the wizard I specified the lowest voltage drop value from the LED datasheet so that I don't risk burning LEDs. If I selected the highest voltage drop value then I be in trouble if the LED in fact uses the lowest voltage drop value.

Well yes the same website sells brighter LED's but at 2x to 3x the price. The environment that I'm using when lighting the LED's is a dark room.
 
Since your cheap LEDs are spread far apart then you will not notice the difference in their brightness caused by their different forward voltages.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top