Maker Pro
Maker Pro

Capacitive Reactance Circuit

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
Well I couldn't have simply stated that I wanted to drive 1 LED off of mains as the title and hoped to have survived! :D
LOL

It's trite, but I have a device that takes a red colored small based bulb which I am having a hard time locating. I thought instead, with some of my new knowledge, why not upgrade from incandescent to LED?! :p:D

XC1 is X rated cap with equivalent resistance of about 5.6k Ω.
The scope is of voltage across D3 (LED) and power through it.
1. When you have a sine wave like below, do you average it out?
2. Would I expect to see an average of about 8mA?

upload_2014-10-20_10-45-19.png

This is the readout across and through R1.
3. Would I have to account for both swings of potential in my equation for power? 20V or 10V?
I am leaning towards simply P=10*0.02
4. Could I include a pot to adjust brightness?
Thanks for your help in advance!
upload_2014-10-20_10-52-0.png
 

Attachments

  • upload_2014-10-20_10-41-8.png
    upload_2014-10-20_10-41-8.png
    110.4 KB · Views: 220

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
XC1 is X rated cap with equivalent resistance of about 5.6k Ω.
Right, a reactance of 5.6 kΩ at 60 Hz.
1. When you have a sine wave like below, do you average it out?
2. Would I expect to see an average of about 8mA?
It's not a sinewave. But LTSpice will calculate the average for you! Zoom the waveform display so it only contains the stable part of the waveform (because it calculates based on the displayed area) and Ctrl-click the "I(D3)" marking above the waveforms. It pops up a box that tells you the average (mean) current - 9.4556 mA - and the RMS current. The average (mean) is the important one, since the voltage across the LED is fairly constant. The RMS current is almost the same anyway.
3. Would I have to account for both swings of potential in my equation for power? 20V or 10V? I am leaning towards simply P=10*0.02
I copied your circuit exactly and I get noticeably different waveforms:

epoint 270923 waveforms 2.png

I don't know why you have your voltage and current waveforms out-of-phase like that. Since we're looking at a resistor, they should be in phase and proportional.

But again, you can get LTSpice to do all the hard work to calculate your power dissipation. Create a new trace with a formula that multiplies those two signals together. I named all the nodes in my circuit, so in my case the formula is V(b,c)*I(R1). Here's a capture showing the voltage across R1 (in green) and the power dissipated in it (in red):

epoint 270923 waveforms 3.png

The red trace has two peaks for every voltage cycle - one at maximum positive voltage, and one at maximum negative voltage. But it never goes below zero - the power scale on the right goes from 0 mW to 90 mW.

Now you can zoom in to remove the startup period, and Ctrl-click on the "V(b,c)*I(R1)" text at the top of the graph, and LTSpice will tell you that the average (mean) power dissipation is 45.112 mW.

The series resistor in a capacitor-fed power supply should always be a fusible resistor.
4. Could I include a pot to adjust brightness?
Yes. Maybe the simplest way would be to just connect it across the LED.

Edit: Harald has done some excellent resources on LTSpice and all its hidden features, in the Resources section.
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
Right, a reactance of 5.6 kΩ at 60 Hz.

Heyhey! What do you know, I am getting closer to being able to design a simple circuit ;-)

Would you be able to post your file for the circuit in LTSpice. I want to see what is different between my copy and yours.
Thanks!
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Sure. I have to temporarily give it a .TXT extension so the forum software will accept it.
 

Attachments

  • epoint 270923 capacitor-fed LED.asc.txt
    1.8 KB · Views: 220

Laplace

Apr 4, 2010
1,252
Joined
Apr 4, 2010
Messages
1,252
LTSpice will tell you that the average (mean) power dissipation is 45.112 mW.

I tried calculating the power in R1 the old-fashioned way with phasors, assuming that the diodes provide an AC short circuit and R2's effect is negligible. So the circuit reduces to XC1 & R1.

The phasor angle is atan(-5644/470) = -85¼° so the RMS voltage across R1 is 120∙cos(-85¼°) = 9.96V. That would make the power dissipation in R=E^2/R = 99.2/470 = 211mW.

Can't understand why the phasor method would be so far off from the SPICE simulation. ???
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
I know why! It's because I messed up when I copied chopnhack's schematic.

For some reason I made R1 100Ω instead of 470Ω. With the correct value, LTSpice gives the mean power dissipation as 207.54mW. Sorry!

The voltage and power waveforms are still noticeably different from chopnhack's second image in post #1 though.

epoint 27093 waveform 3 corrected.png
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
The first thing I notice that is different is that I entered a value under ESR for cap1 whereas your model doesn't show that. I think that may have something to do with it, no?

upload_2014-10-20_22-29-20.png
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Yes it might. Did you fix my error in the value of R1? What value did you use for the ESR of C1?
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
You shouldn't use an ESR of 5.6 kΩ for C1. C1's capacitive reactance of 5.6 kΩ at 60 Hz is due to its capacitance, 0.47 µF. LTSpice calculates and simulates the capacitive reactance based on the capacitance and the frequency. You don't need to calculate it yourself and enter it as an ESR figure.

ESR is a constant resistance, separate from and independent of the capacitive reactance. It represents one of the imperfections in a real-life capacitor. If you want to enter a figure for the capacitor's ESR, try something in the range of a few ohms or less. It's insignificant compared to the capacitor's reactance at 60 Hz.
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
Wow, did not know that LT did that calculation - very smart program, thanks. I don't know why my sim. doesn't look like yours. I will rebuild it and try again - Edit - Did and the wave forms are 90 degrees out of synch.

I also notice that this is far from a constant current drive, there is a lot of noise when looking at the current - it shows a change from 0 to 30mA and back - is that too much for a LED to handle? I assume shortened worklife.


Does anyone know of a source for physically small X2 rated caps?
 
Last edited:

Fish4Fun

So long, and Thanks for all the Fish!
Aug 27, 2013
481
Joined
Aug 27, 2013
Messages
481
chopnhack....using a capacitor to limit current through an LED is a mixed bag....but it works....unless you have a source of fairly cheap 250V capacitors just laying around, I am not sure you wouldn't be better off simply using an LED driver designed to be line driven (I am assuming you don't have a low voltage source readily available????) The problem with line driven circuits that use a capacitor for current limiting is that they can be really dangerous....line driven 1W LED drivers with galvanic isolation are available from E-Bay for << $3.00....I realize you don't really need 350mA of current, but you could always use a power resistor in parallel with the LED to limit the LED current....still likely lower power consumption than an incandescent bulb....and a lot safer than using a capacitor to limit current.....

You might also consider a DIY transformer with the primary in series with the device....This would be a true "hack"...but relatively safe....depending on the device's current consumption, just wrap a few turns of magnet wire around a small torrid core and connect either end in series with the supply to the device....then wrap another piece of magnet wire around the same core and connect it to a bridge rectifier.....measure the no-load voltage after the rectifier and then measure the short-circuit current....since you are only looking for ~ 30mW it shouldn't take very long to find the proper turns on the primary/secondary to power your LED....depending on how much current the primary device draws, make sure your primary wire is large enough to safely carry the current to the device....in any case i would use 16ga or larger for the primary....the secondary can be any size you like as this will be a very low VA//very low efficiency transformer....but that is kinda the point....

Fish
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
I will rebuild it and try again - Edit - Did and the wave forms are 90 degrees out of synch
This is the voltage across R1, and the current through it? I think you must have made a mistake somewhere. R1 is just a resistor; the current and voltage are proportional at any instant in time (ignoring parasitic effects, which aren't significant at 60 Hz).
I also notice that this is far from a constant current drive, there is a lot of noise when looking at the current - it shows a change from 0 to 30mA and back - is that too much for a LED to handle? I assume shortened worklife.
Noise or ripple?

If it's ripple, you can reduce it by adding another stage of smoothing - i.e. another resistor in series and an electrolytic across after the resistor.
Does anyone know of a source for physically small X2 rated caps?
No, sorry. AFAIK none of the normal manufacturers make physically small X2 caps. Probably something to do with one of those pesky laws of physics. I guess they could use some special dielectric but perhaps that would be cost-prohibitive.

Edit: Did you remove the 5.6k ESR value for C1?
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
This is the voltage across R1, and the current through it? I think you must have made a mistake somewhere. R1 is just a resistor; the current and voltage are proportional at any instant in time (ignoring parasitic effects, which aren't significant at 60 Hz).

Not sure, I took out the ESR value and then re-ran the sim. R1 current and then probed across R1 for potential. Still out of synch... Strange - I even tried building a new one from scratch and got the same results.

Noise or ripple?
Ripple would be more precise. 60 peaks of current per second fed to the LED. That constant cycling must wear the part, no? The extra stage limits the cycling to between 5.6mA and 7mA.

No, sorry. AFAIK none of the normal manufacturers make physically small X2 caps. Probably something to do with one of those pesky laws of physics. I guess they could use some special dielectric but perhaps that would be cost-prohibitive.
Well they need to get to work on that!! LOL, maybe with these new materials they are studying - carbyne, graphene, etc. we will have enhanced products in the near future.

I am assuming you don't have a low voltage source readily available?

This is an existing fixture that I would like to convert into a LED if possible. It has a power cord coming into the device with a bulb holder. I was hoping for a small solution and to just reuse the power cord. Cap fed supply's are fairly common, but I noted that you are not a fan of them. Why is that?

Thanks for the ideas, a few directions can be taken from them. I looked on e-bay, but some of the LED drivers are nothing more than cap fed supplies, LOL. I did notice that one had a bridge rectifier. I do have some of those on hand, but didn't want to waste off all that heat with resistors.

What would you guys suggest as the most minimal size project to light one LED from mains? Was the cap fed supply the simplest most compact or is there something smaller?

Thanks!
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Not sure, I took out the ESR value and then re-ran the sim. R1 current and then probed across R1 for potential. Still out of synch... Strange - I even tried building a new one from scratch and got the same results.
The waveforms in post #1 are 180° out from each other - the positive peak on the voltage lines up with the negative peak on the current. This happens if the resistor is "connected backwards". Normally that's a meaningless concept for a resistor, but in LTSpice a resistor has two specific terminals - I don't know what they're called, but let's assume they are called A and B - and when you click on it, to graph the current through it, it graphs the current flowing from A to B. If A happens to be on the right in the schematic and B is on the left (which is unfortunately the default), then it will graph the current flowing through the resistor from right to left, which is the inverse of what you expect, i.e. the R1 current will appear to be 180° out of phase with the voltage.

To fix that, use F7 to move the resistor, rotate it by 180° (Ctrl-R twice) and place it back, then rerun the simulation and create a new graph.
Ripple would be more precise. 60 peaks of current per second fed to the LED. That constant cycling must wear the part, no? The extra stage limits the cycling to between 5.6mA and 7mA.
I don't think the cycling will matter per se, but if the ripple current is very high, then to get the required mean brightness, you may find the peak current is higher than the LED's peak current rating.
What would you guys suggest as the most minimal size project to light one LED from mains? Was the cap fed supply the simplest most compact or is there something smaller?
Not that I know of, but there are variations on the capacitor-fed supply. I'm working on some examples for you to look at.
 
Last edited:

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
OK, here are two variations on the capacitor-fed power supply. Both of them use bridge rectifiers.

I've specified a 330Ω 1/3W or 1/2W fusible resistor for Rin. This is a good compromise between power dissipated during normal operation (which must be comfortably less than the resistor's rated power), power dissipated during a fault (which should be as high as possible so the resistor goes open circuit as quickly as possible), and power dissipated during a disturbance at the mains input voltage (which the resistor should withstand).

The first one uses a smoothing capacitor, and a series resistor to the LED. I've used circuit references starting with '3' for this circuit.

epoint 270923 circuit 3.png
With the values given, there's relatively low ripple across the LED. This is because the ripple voltage across the electrolytic is less than ±20% of the mean voltage, and about 80% of the electrolytic's voltage is dropped across the series resistor, so the variation in LED current due to this ripple is also around 20% of the mean LED current.

epoint 270923 waveforms 3.png

The mean LED current with the given Cin capacitance of 0.47 µF is about 17.8 mA; this is almost exactly proportional to the capacitance of 3Cin (for a given input frequency and voltage, and nominal values of other circuit components). A value of 0.358 µF gives a mean LED current of about 10 mA.

3CS's capacitance determines the amount of ripple across it, and also the time taken from power-on until full current is achieved. 10 µF seems to give reasonable results. 3CS's voltage rating needs to be comfortably higher than the expected peak voltage. I suggested 16V on the schematic but it really should be 25V.

The peak voltage across 3CS is determined by the capacitance of 3Cin, which determines the mean LED current, and the resistance of 3RS, which determines the voltage drop across 3RS that's created by that current.

Feel free to play with the values and see the effects. I chose the values shown to achieve small size along with reasonably low ripple on the LED current. The bridge rectifier doesn't need to be rated for mains voltage, nor high current, so you may find a very small SMT bridge to replace the diodes. 3CS could be an SMT tantalum cap, and 3RS could be SMT as well.

Don't skimp on Rin though - it MUST be a fusible type, rated for 1/3W or 1/2W. I recommend using a THT part.


The second design doesn't use a smoothing capacitor or a series resistor, so the LED current falls to zero twice in every mains cycle. I've used circuit references starting with '2' for this circuit.

epoint 270923 circuit 2.png
This circuit is a lot simpler to understand. The 60 Hz AC mains voltage, in conjunction with 2Cin, simply acts a varying current source; the bridge rectifier applies that current directly to the LED on both positive and negative half-cycles.

epoint 270923 waveforms 2.png

Mean LED current is about 18.7 mA but the peak is about 30; this ratio of about 62% should hold for other values of Cin; again, Cin determines the current.
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
. the R1 current will appear to be 180° out of phase with the voltage.
.

Brilliant! That is exactly what was going on, thanks for clearing that up. I will try to remember that when I draw up a schematic!!
Thanks again :)
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576

Thanks for the efforts Kris :)

I will play with these values for some time and see what I can come up with. I like the SMT bridge idea!

Ok, so playing with the schematic a little, I find that if you place a small capacitor across the LED (200μF 6.3v) the ripple is smoothed out to within 0.45mA fluctuations. I think that is pretty good for using such a small value. The size of the cap is small too because of the low voltage rating. Is 6.3V large enough for 1.87V shown by spice? More than a 3:1 safety margin.

Despite loving the idea of getting some SMT components to try out, I happen to have a DB104 on hand, salvaged from something else. I might have a go with that first. It is fairly small. I will draw something up in Eagle and let you know, thanks!
 
Last edited:

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Cool. No problem. But I should have mentioned that the "design 2", which has no smoothing capacitor and no series resistor, exposes the LED to potential overcurrent during input disturbances. Design 3, with the large smoothing capacitor 3CS and the 3RS series resistor, will do a much better job of absorbing any fast transients coming down the line.

Remember that the reactance of the input capacitor is dependent on frequency; another way of looking at this is that the more quickly the voltage across the capacitor is forced to change, the more current will flow through(1) the capacitor. So at 60 Hz, the voltage changes relatively slowly, and the maximum current flow (at the zero crossing point, where the voltage is changing the most quickly) is only around 30 mA. But most mains-borne disturbances are, or at least contain, frequencies higher than 60 Hz, and these cause higher currents to flow through the capacitor.

The input resistor helps to mitigate the problem, and protect the bridge and the LED, but the electrolytic and series resistor in design 3 will protect the LED very well, although they don't do anything to protect the bridge rectifier!

I think it might be helpful to add a smaller capacitor, say one tenth of the capacitance of Cin, from point B to Neutral, to help absorb fast transients. I haven't seen that done in any commercial design though. I will try a simulation.

(1) Some people will say that current doesn't really flow THROUGH a capacitor, but it certainly APPEARS to, and that's what's important.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Well, I tried adding a 47 nF capacitor from point B to Neutral and it made hardly any difference to the peak current through the bridge diodes when a disturbance is applied. I don't know why, but I trust LTSpice. (Not necessarily in all cases, but in this case, I trust it.)

My disturbance was a pulse waveform of 0V/30V with 1 µs rise and fall times, added to the 115V AC RMS input voltage. I would have expected the 47 nF capacitor to absorb those fast edges, but it didn't. I wish I knew why.
 
Top