# On / Off Panel of LED Circuits - Wiring

Discussion in 'The Projects Forum' started by imruffsdad, Jul 18, 2008.

Jul 18, 2008
17
0
Hello,

I'm trying to build a simple panel of LED's (all the same 3 volts) in rows, and under each LED is an on/off switch (O = LED and X = Switch). I've actually got these all set up in a thin piece of sheet metal.

O O O O O O O O O O
X X X X X X X X X X

There are three rows like the above with 10 LED's in each row and a switch for every LED.

I want to wire them up so that I can turn them on and off at will by flipping the switch without effecting any other LED in the grid. Simple right? Flip a switch and the LED is on, flip it again and it's off. Flip all the switched and they are all on, etc.

Ignoring the on off switches for a moment:

I'm a newbie but from what I've read, I should be able to wire these together in parallel and hook them up to two AA batteries in a carrier and then wire all the positives to the positive of the carrier and then negative to the negative of the carrier and they should all light up. The batteries won't last very long but if I've read correctly they should all light up, is this correct? Do I have the Volts part right but I'll be maxing out the amps of my two double AA's?

Now bring in the switches:

This is were I get confused (assuming the last paragraph was remotely accurate.) I'm thinking I wire the positive to the bottom of all my switches and then take the other terminal of the switch and wire that to the positive of each LED. In my head that means the positive is always flowing because it goes from the bottom of each switch to the next and when I flip the switch it send the power to the LED. How am I doing with that logic?

Last, I don't want to use batteries:

I want to use a wall wart to power this grid. Does the wall wart need to be three volts? Can I ask for some help on the Amperage, assuming parallel and all the same voltage LED's is correct from above, what's the amperage for a grid of 30 3V LED's?

Micellaneous Questions:
Do I need any resistors in this design?
Do I have to have a 3v Wall Wart or can I use a resistor to bring a 9 volt one down to 3 volts at the beginning of the series?
Am I close at all? I've been trying to figure this out for a couple months now.

I really appreciate your taking the time to read this lengthy request. I've read lots of the beginners stuff. I've tried some of the calculators. I've looked at many other projects but haven't seen anyone do something similar to this.

Thanks Again,

Dennis

2. ### SgtWookie Expert

Jul 17, 2007
22,201
1,807
OK, so let's take it slowly

A basic LED circuit consists of the LED itself, a source of current, and a current regulator/limiter. Wire and switches are optional

LEDs are rated for Vf, or "forward voltage" at a particular current.
Red LED's are usually somewhere between 1.7v and 2.1v.
Yellow LED's are usually somewhere between 2v and 2.5v
Green LEDs are usually somewhere between 2v and 3v.
Blue LEDs are usually somewhere between 3v and 3.8v.
White LEDs are usually somewhere between 3.4v and 4.2v.

A typical specification for a red LED might be:
2.3Vf (MAX) @ 25mA
2Vf (Typ) @ 25mA
That means the typical LED in the lot will have a Vf of 2 when 25mA is flowing through the LED, and that no LED will require more than 2.3v for 25mA current to flow. What this really means is that the Vf of the LEDs is going to vary somewhat. You can't depend upon it to be exactly 2v to get a 25mA flow all of the time. Otherwise, you could simply connect any LED in the lot to a source of exactly 2v, and exactly 25mA would flow through the LED.

You will find that the Vf of LEDs, even in the same lot, might vary up to 10%, perhaps more.

So, you can't control them by voltage; you need to control them by current.

Resistors are by far the most common current limiter used in LED circuits. They're cheap, and they work.

But you have a problem - you say you want to use two 1.5v batteries to power 3v@ (something) rated LEDs. I'm afraid that's just not enough to allow for current limiter/regulation provisions. Generally, you should have at least 0.75v "headroom" above the Vf of the LED if you're going to be using a resistor.

OK, so you have LED's rated 3Vf@25mA.
Since alkaline AA cells put out 1.5v when they're fresh, and rechargeables only put out about 1.2v, that's not going to work. So, let's put three in series.
3 x 1.5v = 4.5V. Now we have enough 'headroom'.

Now we need to figure out what our current limiter resistor needs to be.
Ohm's Law says:
R = E/I, or
Resistance in Ohms = Voltage / Current in Amperes
So, you have a 4.5v supply, and an LED rated 3v @25mA (0.025 Amperes)
A quick adaptation of Ohm's Law:
Rlimit = (SourceVoltage - VfLED) / LEDCurrent
Rlimit = (4.5 - 3) / 25mA
Rlimit = 1.5 / .025
Rlimit = 60 Ohms
Now we need to find the closest standard value of resistance that we can use, that is equal to or higher than the value calculated for Rlimit.
http://www.logwell.com/tech/components/resistor_values.html
Scanning through E24 values, we find that 62 Ohms is the closest that we can get.
Now we need to figure out what the actual current is we'll be getting:
LEDcurrent = (Source Voltage - VfLED) / Rlimit (basically, same formula - just swapped around a bit)
LEDcurrent = 1.5/62
LEDcurrent = 24.2mA (rounded off) - that's close enough.
Now we need to figure out the wattage of the resistor.
P = EI, or Power in Watts = Voltage x Current
P = 1.5 x 0.0242
P = 0.0363 Watts, or 36.3mW
We double that number for the sake of reliability.
0.0363 x 2 = 72.6mW - a 1/10 Watt resistor will work just fine. We can use 1/10 Watt or any higher-wattage rated resistor.

So now, let's just put together the first part of the circuit - the batteries, the resistor, the LED, and we'll toss in the switch for good measure.

See the attached schematic.

File size:
6.9 KB
Views:
96
3. ### SgtWookie Expert

Jul 17, 2007
22,201
1,807
So, let's just keep going with that. Right now, since everything from here on out is just a resistor, an LED, and a switch in series, connected all in parallel to the batteries, it's duck soup, right?

File size:
10.9 KB
Views:
76
4. ### SgtWookie Expert

Jul 17, 2007
22,201
1,807
Now let's talk about batteries and amp-hour ratings.

An AA Alkaline battery has a rating of around 2500mAh (2.5Ah) which means that it can supply 25mA for 100 hours, or 250mA for 10 hours, or 2.5A for one hour. It doesn't quite work out that way however, because the slower the current flow out of the battery, the less power is dissipated across the battery's internal resistance.

So, if you hooked up 10 of your switch/LED/resistor combinations in parallel with three AA batteries, you would be putting a 242mA load on the battery bank. The batteries would last roughly 10.33 hours - IF the current was constant.

Let's see what happens as the battery voltage drops. Let's say we've been flipping switches and watching LEDs burn for several hours, and the batteries have run down from 4.5v to 4v.
LEDcurrent = (Supply Voltage - VfLED) / Rlimit
LEDcurrent = (4-3) / 62
LEDcurrent = 1/62 = 16.13mA
The batteries have only lost 1.66v each, and the current has dropped nearly 9mA!

That's good for our battery life though - the LEDs are dimmer, but since the current draw on the batteries is significantly less now, the batteries will last longer.

So, if you hooked up 30 LED's in the manner that's already been discussed, you should get at least 3.5 hours of light out of it. In reality, for the first two hours or so, the LEDs will be practically at full brightness. The closer that you get to the 3.5 hour mark, the dimmer the LEDs will get - but they will stay dimly lit for quite a while.

Does this all make sense to you?

Jul 18, 2008
17
0
First let me say thank you so much for all of your assistance. It is greatly appreciated. I took this part of your post and pulled out 4 of my Wall Warts that I have lying around the house and plugged in this math in attached WartMath.jpg.

I think I have all those numbers right and I think the next step in your process was to figure out the wattage of the resistors for each of my LED's
Now we need to figure out the wattage of the resistor.
P = EI, or Power in Watts = Voltage x Current
P = 1.5 x 0.0242
P = 0.0363 Watts, or 36.3mW

Where does 1.5 come from. The only Voltage 1.5 I can see is the voltage of 1 AA battery but I don't think thats what your mean here.

• ###### WartMath.jpg
File size:
10.4 KB
Views:
58

Jul 18, 2008
17
0
I get this. So with my numbers from my first response to you, where you have

R1
62

Depending on which Wall Wart I was going to use mine might be R1 = 100 in the case of the 5V Wall Wart and R1 = 450 in the case of the 12 Volt Wall Wart. Am I getting this?

Jul 18, 2008
17
0
So if I have 30 3Vf LED's at 20mA each that means I'm drawing 30 X 20mA or 600mA. So of my Wall Warts I could use the:

WW1: 6V 1500mA or the
WW2: 5V 2000mA (2 Amp) but I could not use the
WW3: 12V 500mA one because there's not enough mA to drive this circuit.

Do I have that right? And does it follow that using these same parameters as we've been talking about, I could drive 90 + LED's off of WW2 because that would be 1800 mA which gives be plenty of mA plus room. And the resistor would stay the same that being 100 for each of the 90 LED's?

Thanks again so very much.

Dennis

8. ### SgtWookie Expert

Jul 17, 2007
22,201
1,807
OK, in the 1st 9 paragraphs/sentences of my 1st reply, with an LED rated 3v, just two AA cells wouldn't be enough, so I chose to use three AA cells.
3 x 1.5v = 4.5v = Supply Voltage
So, when figuring out what the resistor would have to deal with, you subtract the LED Vf from the supply voltage to get the voltage across the resistor.
The Vf of the LED was stated as being 3V, so:
4.5v (supply) - 3v (LED) = 1.5v = Vresistor.
That 1.5v is used for the other calculations; determining the resistor Ohms required to limit the current by R=E/I, and then calculating the wattage of the resistor by P=EI. In both, E=1.5.

9. ### SgtWookie Expert

Jul 17, 2007
22,201
1,807
OK, wall warts are a new ball game. They are not usually regulated.

This means that your 6v 1500mA supply might actually put out 9v with just a light load on it, but with a full 1500mA load, it will be somewhere around 6v.

So, you are going to need some form of voltage regulation besides using current limiting diodes. Otherwise, the current going through your LEDs will vary widely depending upon how many or how few are switched on.

Traditional store-bought linear regulators such as a 7805 or LM317 will not work very well, as they drop too much voltage across themselves. You are going to need a simple voltage regulator made from a transistor, a Zener diode and a resistor.

However, it's after midnight and I'm getting quite sleepy.

10. ### SgtWookie Expert

Jul 17, 2007
22,201
1,807
OK, finishing up now...

You're going to need a few more parts.
An LM317 regulator, a couple of resistors, and a couple of capacitors.

See the attached schematic. The LM317 is an adjustable positive regulator capable of putting out up to 1.5A (with proper heat-sinking) from 1.2v to 37v with a 40v input. However, you're just using your 6v 1500mA wall wart.

Wired up with the two resistors I've selected, the regulator will put out 4.3v.

It is necessary to use at least the capacitor on the output. The input capacitor could be omitted, but I suggest you leave it in the circuit.

Since you say that your LEDs are 3v @ 20mA, that means that:
Rlimit = (4.3V - 3V) / 20mA = 65 Ohms.
68 Ohms is the closest standard value.
That means I(Rlimit) = 1.3V/68 = 19.1mA, and the same current goes through the LED.
Power consumed in Rlimit = 1.3v*19.1mA = 24.8mW, even doubling that is less than 1/20 Watt.

Note that your wall wart return gets connected to ground, which are all those triangular symbols in the circuit made from three short lines. Ground is considered to be a 0v reference, and voltage potentials are usually measured from that ground reference.

For simplicity's sake, I've just shown three resistor/LED/switch combinations attached to the output. You should be able to put 30 such combinations on there without problems. Even with 30 LED's switched on as a load, there will only be about 573mA current draw.

It would be a good idea to use a heat sink on the LM317 to help keep it cool. Be careful, as the output terminal is also connected to the large tab that you use for connecting to a heat sink - don't short it to ground by accident.

• ###### 4.3vRegWLEDs.PNG
File size:
14.8 KB
Views:
69

Jul 18, 2008
17
0
Ok, if you have it in you, here is my pictorial representation of your schematic. Am I getting closer? Anyone else want to comment? The original ideas was to power from a wall wart in this picture it's 6V, 1500 mA, to power 30 LEDs with switches to turn them on or off at will.

Thanks,

Dennis

File size:
240.8 KB
Views:
32
12. ### SgtWookie Expert

Jul 17, 2007
22,201
1,807
That'll work! Nice job

I see you have what looks like Radio Shack catalog numbers in there. While Radio Shack is convenient for location, the parts are really expensive if you're buying quantities of things.

Check out Electronic Goldmine; they frequently have deals on stuff.
http://www.goldmine-elec.com/
Their switches and LEDs are much less expensive than you will get at Radio Shack.

I suggest that you get toggle switches that mount in a round hole. You'll get awfully tired of trying to make rectangular holes for those snap-in rectangular switches. One good mistake, and it's time to throw the panel away and start over.

You may wish to get diffused LEDs, particularly if you will be looking at this a lot. Super bright LEDs are just far too bright to use for panel lights; you can become blinded if you look at them directly for too long.

Jul 18, 2008
17
0
Sorry, I didn't have my camera so I couldn't post these with my initial question, but here's the actual panel that I already have put together I just didn't know how to wire it up. The photos were just so I could find some pictures, I know about Radio Shack and there 800% markup. Wow! And I couldn't find a toggle switch online that was strictly on off so I used the rocker for my illustration. Thanks again so much for all your help. I truly appreciate it.

All the best,

Dennis

File size:
10.6 KB
Views:
43
File size:
17.8 KB
Views:
26
14. ### SgtWookie Expert

Jul 17, 2007
22,201
1,807
Say, you have two different colors of LEDs in that panel!

The green LEDs will have a different Vf than the red LEDs.

If you try to use the resistors we calculated for the green LEDs with the red LEDs, they will rapidly burn out!

Let's measure the ACTUAL Vf of some of these LEDs, and find out what it really is.

It is better to do this now, than burn up a lot of stuff!

You will need:
1) Your 6v wall wart power supply
2) An LM317 regulator
3) A 62 Ohm resistor
4) Some hook up wire, or several test leads with alligator clips (preferred)
5) A DMM (multimeter).

Connect one end of the 62 Ohm resistor to the OUTPUT terminal of the LM317.
Connect the other end of the 62 Ohm resistor to the ADJUST terminal of the LM317.
Connect an alligator clip of a test lead, or length of hookup wire, to the ADJUST terminal of the LM317. This will be your + current supply, the LM317 will put out about 20mA wired this way.
Connect the + output terminal of your 6v wall wart to the INPUT terminal of the LM317
The - output terminal of the 6v wall wart will be your - current supply. A test lead with alligator clips on each end will make your life easier here.

Connect the - output terminal's lead to the shorter (cathode) lead of an LED, and connect the + (ADJUST terminal of the LM317) to the longer (anode) lead of the same LED. Plug in the wall wart. Measure the voltage across the two leads of the LED, and record it. Unplug the wall wart.
Test several more of the same color in this same way (a minimum of three)

Change to the other colored LEDs. Measure the forward voltage of several of those the same way.

Then let us know what you have measured.

Jul 18, 2008
17
0
Hey Sgt. Wookie. I haven't forgotten about this. Two kids under 5, summer, work, etc. Finding time is the hard part. I'm assuming my original will work if I swap out all the green LED's and make them all the same type of LED. I will try this though just so I can learn something. Expect a report of the proper setup when I catch my breath from life.

Thanks,

Dennsi

16. ### SgtWookie Expert

Jul 17, 2007
22,201
1,807
Naw, don't swap out the LEDs. Just know that the Vf is going to be different (lower) for the red LEDs than the greens. The red LEDs will probably measure somewhere between 1.7v and 2.1v for the same amount of current as the greens.

Besides, it will look more in the spirit of the season if you get it done before Dec 25th

Jul 18, 2008
17
0
Ok, I got a moment to myself and configured it the way you described. Voltage across the green LED's was 2.02, 2.00, 2.02 for the few I tested. Voltage across the Reds was 2.21, 2.20, 2.19. I used a 199 Ohm resistor instead of a 62 Ohm resistor as that's the closes up I had. Is that ok? I also dug up a Regulated Adjustable Wall Wart that I new I had purchased and it came out a pretty clean 6.0 volts. In contrast the 9 Volt (unregulated) one I had came out at 14 volts.

So plugging in these numbers to your original formulas I come up with:

Green:
Rlimit = (6v - 2.0v) / 25mA
Rlimit = 4v / .025
Rlimit = 160 Ohms

So it looks to me like a 200Ohm resistor for the greens and

Red:
Rlimit = (6v - 2.20v) / 25mA
Rlimit = 3.8 / .025
Rlimit = 152 Ohms

So it looks like I could probably get away with 150's but might as well use all 200 Ohm resistors to keep it simple. All my resistors are 1/4 watt or above so I think I'm ok there.

In your second schematic where you had R3 at 68 Ohms I'm now replacing that with 200 Ohms. With the regualted wall wart I'm guessing I don't need the input C1 Capacitor 220uF do I still need C2 1uF? And if you have the time, I'm still a little confused over what the front ended resistors are doing R1/220 and R2/510 in your schematic.

Thanks again for all your help.

Is this correct?

18. ### SgtWookie Expert

Jul 17, 2007
22,201
1,807
OK, so what happens to your current when you use a 200 Ohm resistor with both?
In the case of the green LEDs:
I = E/R (Current = Voltage / Resistance)
I = (6-2)/200 = 4/200 = 20mA
Your LEDs will be about 4/5 their maximum brightness, but will have a nice long life.
Let's check the current dissipation:
P = EI = 4 x 0.02 = 80mW; double for reliability = 160mW, so 1/4W will be adequate.

Red LEDs:
I = E/R (Current = Voltage / Resistance)
I = (6-2.2)/200 = 3.8/200 = 19mA
Slightly less than 4/5 their maximum brightness. That should be OK as well. Power dissipation will be less than for the green LEDs, since less current across less voltage.
P = EI = 3.8 x 0.019 = 72.2mW, doubled = 144.4mW.

Try connecting up a couple of the red LEDs and a couple of the green LEDs with the 200 Ohm resistors to see if they are bright enough for you.

Remember that if the LEDs are of the super bright variety, that you must not stare at them; as they can cause blindness.

Jul 18, 2008
17
0
Hi SgtWookie,

First; it's done and it works. Yeahhh!!!!!

Second; it's a prototype. This helped me a lot for the next one that will look much nicer.

I've included a few photos so feel free to critique. I haven't burned it in yet, I want to leave it all on for a few hours while I'm sitting in front of it. Other then that I'm pretty happy. I need to build a case and I'm completely finished. Thanks so much for all your help, I couldn't have gotten this far without you. I really appreciate it.

All the best,

Dennis

20. ### SgtWookie Expert

Jul 17, 2007
22,201
1,807
Hi Dennis!
Glad you have it mostly working...
Greens all look pretty even
Reds aren't so good though...
#2 is a bit bright.
#3 is a bit dim.
#7 is a bit dim.
#8 is not working.
#11 is not working.
This is to be expected in a project like this with so many connections.

Soldering is pretty tough at first. It gets easier with practice. Use 91% isopropyl alcohol to clean components before soldering; I use "acid brushes" to apply it. They have metal handles and black nylon bristles, and are very cheap. It works pretty well for flux removal, too. Use rosin flux. Try to find 63/37 solder, that's the easiest to use.

If you accidentally blob on too much solder, you can use a solder sucker or "solder wick" to remove the excess. Solder wick is a flat copper braid that is available in different widths. 1mm and 2mm are handy to have.

So, your eventual goal is to build a rocket launch controller?