A discussion began in a post entitled "Selecting resistor for LED driven by AC track voltage" in which I wanted to know some things about half-wave rectification to light up an LED. You can read through it if you like. The original question had to do with exchanging bulbs in a crossing gate flasher with LEDs. Part way through the topic a more detailed analysis of how AC voltage through a diode behaves to produce the half-wave DC output to drive an LED. I am opening this topic to summarize and continue that discussion.
I began with this post:
Here's a question about half-wave rectification. In a configuration like the one shown below, what kind of voltage would you get out of the initial diode? Would it be considered AC or DC voltage in terms of reading the output with a meter? What would be the voltage? Does it have anything to do with the 1.414 ratio value that comes from AC through a bridge rectifier?
GunRunnerJohn:
If you are running on track power, you should use a diode and a resistor. For up to 18V track power, a standard 1N4003 diode and a 470 ohm 1/4W resistor will handle one standard LED.
From this I wanted to know how he figured this out:
The question I have is what the voltage is after the diode.
Let's try your numbers using a 3 volt 20ma LED:
R = (Vs - Vf) / I
470 = (Vs - 3) / .020
(Vs - 3) / .020 = 470
(Vs - 3) = 470 * .02 = 9.4
Vs = 9.4 + 3 = 12.4 volts
The source voltage (12.4) was run through an LED resistor calculator and it indeed came up with the 470 ohm resistor value that GRJ had used in his application.
But how do you determine this given an AC voltage through a diode? How is 18 VAC track power changed to 12.4 volts half-wave DC?
I was looking for a value that could be multiplied by the AC voltage to yield the DC voltage output by the diode. Knowing that it is half-wave DC, it turns out to be an average over time. But I did find this:
Here are some useful numbers. The value 1.414 that I mentioned earlier is multiplied by the AC RMS (root mean squared) value to give the peak voltage. The average half-wave DC voltage is determined from the peak voltage times the constant 0.637 divided by 2. Or use the VAC RMS times the value .9 / 2 which is 0.45 to figure the average. The 0.9 value comes from 1.414 times 0.637 combined.
Volts half-wave DC = Volts rms AC * 0.45
I complained that this doesn't work out to get from 18 VAC to 12.4 half-wave DC:
That doesn't work with the above 18 VAC to DC conversion. According to this, Vdc from 18 VAC (rms) would be 8.1 VDC (average). I'm not sure what to think.
Stan2004:
Well, nowhere does GRJ say his circuit is driving 20 mA into the LED. I figure he chose a resistor value which gives a suitable brightness.
Your relationships in your most recent post look correct. The average voltage (as measured by a voltmeter in DC-mode) will be around 8V DC for an 18V AC (RMS) input. This is a practical value to use for hobby purposes. As the diagrams show, the voltage is pulsing reaching a peak of ~25V = 1.4 x 18V. But it's also 0 half of the time.
At the peak 25V following the diode, the 470 Ohm resistor limits the 3V LED current to about 45 mA = (25V - 3V) / 470 Ohms. But the current is also 0 half the time.
The actual math is quite complex involving non-linear equations which themselves are just models of the underlying semiconductor physics. There is also the issue of the voltage drop across the diode where you lose between 1/2 to 1 Volt depending on more non-linear equations.
Again, I emphasize the "practical" use of the relationships in your diagram. So 8V (average) thru a 470 Ohm resistor into a 3V LED suggests "only" 10 mA (average) of LED current. I suggest this is a good enough approximation for hobby work.
GunRunnerJohn:
The 470 ohm resistor was picked empirically, I made no attempt to do a "pure" calculation to get exactly 20ma average current.
Also, I sometimes add a capacitor into the mix to eliminate flicker of the LED. The cap typically charges to the peak voltage, so the current limiting resistor is sized to handle the peak voltage from the half-wave rectified track power. With 18V track power, the peak voltage of the half-wave power is around 12.6 volts, so my resistor is selected to handle that voltage. Truthfully, I simply ignore the diode drops as they're not that significant for this application.
The beauty of using LED's is it's not rocket science. As long as you don't let the average current go over the LED's rating, you can do pretty much anything you like as far as current limiting. I use all sorts of different current limiting values, depending on what lighting effect I'm trying to accomplish.
If you want absolute maximum brightness from your LED's without risking running them over spec, simply use DC and compute the resistor exactly.
Stan2004:
The peak voltage is 1.4 x 18V = 25V whether there's a capacitor or no capacitor. The capacitor provides reserve energy and supplies voltage during the half cycle when there would otherwise be 0 voltage. The practical effect is the average voltage increases from ~8V toward 25V as you increase the capacitor value. Knowing the peak voltage is important since capacitor selection is based on the peak voltage applied. For 18V AC track voltage, I'd use a 35V (or higher) capacitor.
As GRJ says, the capacitor smooth the pulsating voltage so that you demote visual flicker/flashing of the LED. Teenagers can see this flicker but the typical OGR reader lost the visual ability to see this years ago...
And so that is how it has gone so far. In summary, the useful items include the following:
GRJ's numbers to run an LED from track voltage -- Diode 1N4003 Resistor 470 ohms 1/4 watt.
The ratio to obtain the half-wave DC voltage -- Volts half-wave DC = Volts rms AC * 0.45
Adding a capacitor after the diode will smooth the DC voltage but will raise it toward the peak voltage depending on the value of the capacitor used. More capacitance (higher microfarads) will raise it closer to peak voltage.
Peak voltage -- Volts rms AC * 1.414
I think that about covers it. Any exclusions from the original thread were made by me and I take full resposibility for any misinterpretations or confusion herein.
I look forward to more discussion, criticism, comments, interjections, and questions on this topic.