# Using AC with LEDs (Part 2) - and make this handy counter light.

9 Steps
In Using AC with LEDs (Part 1) we looked at a simple way to run LEDs with a transformer connected to AC Mains.

Here, we will look at getting our LEDs to work without a transformer and build a simple light that is integrated into an expansion bar.

WARNING: For countries with 110v mains, we'd be working with voltages of 150 volts! For Europe and other countries, we are talking about 300 volts or more! At these levels, electricity is lethal! Do not continue unless you are comfortable with working with high voltages and are aware of the precautions to take!

AC supplies are quoted in rms (root-mean-square) values. The PEAK voltage is sqrt(2) * Vrms, which is about 1.4 * Vrms
Remove these ads by Signing Up

## Step 1: Some background

The simple and obvious way to get hundreds of volts down to a level to operate a LED at 20mA is to put a resistor in series with the LED. To find out what values we are talking about, we'll use the peak value of 110v, which works out to be 150v for our example (it'll be double for Europeans and Ozzies)

150 / 20mA = 7500-ohms (we should subtract the voltage of the LED from 150v first, but the difference is minor)

7500-ohms? Not too bad... But then let's consider the power rating of this resistor, using the Power rule: P = (V2) / R, we get:

150 * 150 / 7500 = 3 watts, and that's a pretty hefty resistor. Brits with 240v mains will need a 17000-ohm resistor rated for almost 7-watts. And these will be running HOT!

Fortunately, by substituting a capacitor for the resistor, we can get the same reduction on voltage without the (or as much) heat. Capacitors delay the phase angle of AC which we can use to oppose itself, much like receding waves on the shore cancelling out some of the force of incoming ones.
 1-40 of 86 Next »
divyesh.dhamecha says: Apr 25, 2013. 4:31 AM
i want to use 1 led of 20mA and 230 volt ac supply.what is the value of resistor and capacitor should i have to put.f=50 Hz.
qs (author) in reply to divyesh.dhamechaApr 26, 2013. 11:01 PM
The minimum number of LEDs for this circuit is 2, although you can substitute a 1N4001 diode for one of them. Then use R=1K and C=0.2uF (or 0.22uF) as stated in Step 2.
sousap says: Apr 1, 2013. 8:19 AM
hi! what about connecting a full LED strip to mains.
LED strips are organized in modules, each has 3 led in series with a resistor, then all the modules are paralel. in terms os voltage they the led strip is 12vDC
can we build a simple Capacitor circuito to feed the all strip?
Paulo
qs (author) in reply to sousapApr 1, 2013. 11:42 AM
Thanks for the comment.

As noted, the design here is not very efficient and is suitable for low power, multiple-LED applications. The "LED strip" will further cut into this efficiency as they lose another 20% in the resistor. Better to invest in a 12-volt wall-wart for \$5 on eBay and use that.

However, it is completely feasible to cut 15 pieces off the strip and (re-) connect them in series. Then they will run off (a rectified) 120vac mains.
nodoubtman says: Jul 17, 2012. 10:26 AM
don't forget to put up a diode to protect!
thanks!
marC:)
qs (author) in reply to nodoubtmanJul 17, 2012. 11:33 AM
When LEDs are placed back-to-back, like they are here, each acts as a diode to protect its 'twin', so no extra diode is needed!
fcat1 says: Oct 5, 2011. 2:01 AM
Hi QS,

I tested with 0.22uF 630V non-polar Caps, one 1K ½W resistor, two white led wired in parallel, it work, so my query is, if I would like to add another 2 x 7 LED in parallel, do I still need another set of C & R ? Is there any limitation number of parallel row added to the circuit ? Thx in advance : )
qs (author) in reply to fcat1Oct 5, 2011. 6:57 AM
Hi, each RC set can handle up to 8 pairs of LEDs, in series. You can have more, if you do not mind slightly dimmer LEDs.
fcat1 in reply to qsOct 5, 2011. 7:31 AM

I just built & replaced one of my table lamp with 2 rows of 7 White LED & it works : )

My question is, if I wish to add another 2 rows of 7 White LED, do I still need another RC set or I just parallel connect to the existing circuit ? Is there any limitation ?

Btw, if I want to filter out the flicker effect, add one Bridge Rectifier to it correct ? (400V rated @ 1.5A) ?
qs (author) in reply to fcat1Oct 9, 2011. 10:12 AM
If you wish to use this method for another 14 LEDs, you would need another RC pair.
cknudstrup says: Sep 20, 2011. 8:54 AM
the 3/64 bit would be smaller than the 1/16 bit so it probably was a 13/64 bit
jexter says: Apr 4, 2011. 6:34 PM
Great project, and well described! Just one suggestion as a possible edit for step 6:

"Decide the end you wish to work on - whether you want the light to shine UP or DOWN. Then plug it in where you plan to use it and mark the top and bottom."

Some electricians (at least in the U.S.) always install receptacles with the ground up, others with the ground down, and many like to mix it up. It would be a shame to go through whole project and then find out your UP light was shining DOWN!

Once again, nice job, and definitely on my to-do list.

ruashiasim says: Mar 31, 2011. 2:00 AM
would it be possible to add a photoresistor in line to turn this off at day and on at night? the lowest photoresistor dark rating I could find would be 2-3k ohms. could I use 1/2 watt 100mA superflux leds?
qs (author) in reply to ruashiasimMar 31, 2011. 11:30 AM
The addition of a photo-resistor will not be advisable - as it will dissipate far too much power when it is turning on or off. The idea is that this is a convenient light in a darker area so it is OK to have it on constantly.

For higher power lights, this is not a good circuit, take a look at some of my earlier answers and check out both parts 1 and 4 of this series
OzoneTom says: Aug 30, 2010. 1:35 PM
I like the approach in that it seems to be more efficient than using transformers and bridge rectifiers. What value modifications would be required to add additional strings of LEDs in parallel to the pair in this design? Thanks.
qs (author) in reply to OzoneTomAug 30, 2010. 3:23 PM
What this type of circuit has in terms of simplicity, it gives up in efficiency.

A well-matched transformer system can be 80% efficient and off-line (Switched) circuits even higher; using a capacitor (or any other method) to limit current flow is much less efficient, although it slowly increases with the number of LEDs.
At the point where the total Vf of the LEDs equal the equivalent DC voltage, about 52 for 117vac, we can direct connect the LEDs and the efficiency then becomes 100%.
Blofish in reply to qsOct 5, 2010. 4:19 PM
So this would be more efficient if you were making something like a led light in a florescent tube type of design using 52 LEDs and no resistor?
qs (author) in reply to BlofishOct 5, 2010. 6:30 PM
Yes, since all available power is sent through the LEDs, the usage efficiency is 100%.

The image below is a light just announced by Phillips which uses a cluster of 96 LEDs to operate directly off rectified 230v mains.
Jeevendra says: Jul 15, 2010. 10:56 PM
I'm a newbie to this stuff, but very interested. Can you tell me more about the calculations? Or better yet if you can guide me to some webpage where I can find more details. If we're to have more LEDs, lets say 20, will changing the capacitor and resistor value be sufficient? Or does it need a more advanced circuit? I used a 1k/ 1W resistor and a 0.6uF/ 400V capacitor. Is this wrong? Your help is greatly appreciated, as it'd help me to get started. We have 220V - 240V AC supply here. Thank you in advance...
qs (author) in reply to JeevendraJul 16, 2010. 9:21 AM
Jeevendra,

Please reread the values for 220vac carefully! The values you supplied will seriously overdrive the LEDs and permanently damage them. The capacitor value is calculated as: ( 0.02 / ( 2 * pi * f * ((V * 1.4)-Vf) ), so it's not a linear relationship and certainly not directly proportional to the number of LEDs you want to use!

For 220v supplies, you can have up to 15 LEDs in each branch without changing the basic values, so you can easily have your 20 by putting 10 in series, in 2 opposing chains. See my response to lurkingdevil for an explanation of this.
lurkingdevil says: Jun 7, 2010. 3:29 AM
How can you wire upto 1-8 leds in each branch without previous calculation? Each added led will drop another ~3.3 volts and reduce the current going through the branch because the impedence is kept constant. I also don't understand how you can just have a range of accepted capacitance as that would directly affect the current going through.
qs (author) in reply to lurkingdevilJun 7, 2010. 6:44 AM
The circuit is designed to allow no more than 20mA at 150-volts (for 110v mains), so an extra LED represents less than 2.5% of the total, which is not easily detected. And that is also why I placed a limit of 8 LEDs total in a single branch - by then the drop will be 26-volts, or 17%, which will become noticeable.
zino1234 says: Nov 1, 2009. 9:24 AM
"Since we are already using a 1K resistor,"
erm..
can tell me why we need to add the 1k resistor ?
thanks
qs (author) in reply to zino1234Nov 1, 2009. 9:39 AM
The resistor is to protect the capacitor, while it, the capacitor, protects the rest of the components.
hanelyp in reply to qsJan 10, 2010. 2:27 PM
Depending on the AC phase when the circuit is plugged in, you could get quite a current surge through the capacitor for a brief moment.  Even enough to damage the LEDs.  The resistor limits the magnitude of this surge to low enough for the LEDs to survive until the capacitor charges up and can limit further current.  Other than during this turn on surge the capacitor plays the primary role in limiting current.

I once tried this same circuit without the resistor.  The capacitor was fine, but a string of LEDs got burnt out.
turbonut48 says: Dec 13, 2009. 2:39 PM
I was very careful with the polarity of the LEDs.

And it turns out, the capacitor is identical to what you show.
Oh well, 3 pairs are pretty good. Its a good first try for me.

Turbonut48
turbonut48 says: Dec 8, 2009. 9:17 AM
I used the .47 /350V cap and a 900 ohm resistor. The most I could put in series were 3 white LED pairs. If I added a 4th, only one side would light ( half of the cycle).
What do you think may have caused this? Cheap LEDs?

Turbonut48
qs (author) in reply to turbonut48Dec 8, 2009. 11:31 AM
It's possible there is a wiring problem with your LEDs - this symptom may be caused by having the leads connected + to +.

Another reason may be the use of a polarized or out of spec capacitor. Make sure it is a 0.47mF (or .47uF or 470nF, which are all equivalent) non-polarized unit.
yskroc says: Nov 30, 2009. 11:00 PM
A very fundamental question (which could be silly):  what is pi actually in your calculation?
Many thanks.
The Expert Noob says: Aug 18, 2008. 10:12 PM
I dont know if its late and my brain isnt working because I cant seem to straighten out the math in my head. could ya post like a text document or excell table that I can reference to? Cause when I went for my EE (double E) I must have slept thru the basic math of caps helping the resistor cause those formulas don't ring any bells. Sorry.
The Expert Noob in reply to The Expert NoobAug 18, 2008. 10:36 PM
ah i think i know what is throwing me off. the units that I need to be using. cause for the formula C = 1 / (2 * pi * f * X) and w/ your numbers, im getting 3.79uF~4uF not .379uF~.4uF....but like i said, it might be cause its late.
qs (author) in reply to The Expert NoobAug 18, 2008. 11:54 PM
The basic formula to calculate Xc, the reactance of any capacitor is:

Xc= 1 / (2 * pi * f * C)

Therefore the Capacitance for any desired Reactance, by solving for C,is

C = 1 / (2 * pi * f * Xc) in Farads

For f=60Hz and Xc=6500-ohms, I get 408E-9 or 0.408uF on my calculator, while f=50Hz and Xc=16000-ohms, yield a C of 198.8E-9 or about 0.2uF

Hope this helps!

alzrc_13j in reply to qsSep 3, 2009. 5:34 AM
ei qs im really confused about this thing hahaha is the resistor in series with the capacitor???if it is then aren't we talking about impedance already??? Z = R + jXc...isn't it???

if ur c is .4uF for 110v, then ur reactance would be Xc = 6.63k ohms right??? so

using the formula for the impedance above Z=1k + j6.63k
= 6.7k< -81.42 ohms right???

so if u calculate the total current I = (110 v/.707)/(6.7k<-81.42 ohms)
will give us
=(155.58<0 volts)/(6.7k<-81.42 ohms)

I = 23.22 < 81.42 mA...am i right????

pls correct me if im wrong hhehehehe i just want to confirm i really like to play with these things to but im just confused heehehe and what would be the voltage drop across the resistor????hahhhahahhahapls reply tnx....
The Expert Noob in reply to qsAug 19, 2008. 7:32 AM
OHHHH Now I see what I missed..... Reactance ohm that the capacitor is (6500)+the actual resistor (1k)=the total resistance in the circuit... for some dumb reason lastnight i was puting in 1kohm and the reactance....dee dee dee.
11010010110 in reply to The Expert NoobOct 4, 2008. 12:34 PM
Not exactly. The resistance is sqrt(R2 + Xc2) since Xc is kinda imaginary number
The Expert Noob in reply to The Expert NoobAug 19, 2008. 7:28 AM
1kohm and the reactance......1kohm as the reactance*** I cant even type. maybe i should go back to sleep.<br/>
The Expert Noob in reply to qsAug 19, 2008. 7:24 AM
h yes. That is what I get too. Now that I have had sleep :).... Ill be saving those formulas.
Polter says: Aug 27, 2009. 7:10 PM
Hello! great and informative instructable! Why is it that when making this circuit for 230v 50hz mains the cap must be between .15-.22 uf? What if I use .33uf cap? Can I go beyond 14 LEDs? I have 4 white LEDs a bridge rectifier, 1k 1watt resistor and a .33uf 630v capacitor. Im planning to plug it in 230v outlet. Im planning to add 12 leds to make a room light. On a side note, I think its a safer option to add a 1m 350v resistor to discharge the cap after it is turned off. Sorry for too many questions, I'm still learning about this stuff.
qs (author) in reply to PolterAug 27, 2009. 8:56 PM

The combined voltages of the LED is only a small fraction of the total AC voltage, and, if the capacitor is over .22uF, the current through the LEDs will be much higher that the rated 20mA. While it may not destroy the LEDs outright, it will seriously degrade its life-expectancy.

You will probably find each LED to be just as bright even if add 12 more LEDs to your circuit (bridge+resistor+cap). Again, the v-drop of 12 LEDs is about 40-volts, which is about 15% of the total voltage, and should not lower the light output noticeably.

Unless you plan on opening the circuit and playing with it after it's assembled, the 1M resistor will not affect safety.
dzhang says: Jul 17, 2009. 6:20 PM
I was wondering if its possible to put a bridge rectifier after the capacitor so that you don't have to have the 2 sets of LEDs and instead just get one regulated dc.
 1-40 of 86 Next »