# What should my resistor wattage be to run a LED on 240VAC?

I'm looking for a sanity check on my figures here because I'm concerned my resistor wattage is unrealistic.

I would like to run a red LED on a 240 VAC line. I have found that the forward voltage for a red LED is 2V and a max current of 20mA.

### To calculate the resistance I used ohm's law and set a target of 18mA:

R = V / I

R = (240VAC - 2V) / 0.018A

R = 13222 ohms or about 13.2k ohms

### What about the wattage? This is a high voltage after all...

W = V * V / R

W = (240VAC - 2V)^2 / 13222 ohms

W = 4.28

Does this seem right? Do I really need close to a 5W resistor to handle this?

Thanks everyone for the help. I think the big message here is that there is a much better way of doing this than dumping the extra power as heat from resistors and that the reverse voltage needs to be considered when dealing with the LED.

EM Fields thank you for posting such a detailed explanation of the options along with a diagram. Thanks to uint128_t who had a good comment about 240VAC being the RMS value and provided the equation to calculate the 340V peak.

Using a capacitive reactance method (shown in diagram c of EM Fields answer), which I had never heard of, is a better way to approach this type of circuit. I know that several of you have mentioned it which was very helpful. Thank you Dwayne Reid, Evan, and anyone else I missed.

For anyone else who is new to this like me then I found these additional resources to be helpful:

• And that's why we don't use a resistor for this. That, and the fact that you now have 238V across it. Jul 19, 2016 at 23:26
• Would be worth reading about the safety issues as well. Without transformer isolation, 240VAC power mains are very nasty and can injure or kill. Even USA single phase 120VAC can be lethal. See electronics.stackexchange.com/questions/244414/… You may be better off using a 240VAC to 12V transformer instead, or a unit designed to drive LED lighting. If you insist on no transformer isolation, then you must somehow ensure that there is clearance and isolation from the entire 240VAC wiring, including the LED itself. Jul 20, 2016 at 0:11
• Slight correction: 240VAC is RMS voltage, and has a peak voltage of 240 * sqrt(2) = 340Vpk. Your resistor needs to be 18.8k to limit current to 18 mA, and will dissipate ~6.1W peak or 4.3Wrms. You still need (at least) a 5W resistor, however. Jul 20, 2016 at 0:13
• Google Capacitive Dropper Led for the typical setup. The YouTube videos of Big Clive reverse engineering led light bulb and simple night light circuits are a great explanation. Jul 20, 2016 at 3:18
• @uint128_t: Not true. Neglecting the issue of the LED's reverse voltage limitation, the RMS voltage is what's heating up the resistor and the LED and is the voltage that should be used to determine the power the resistor and the LED will dissipate. Jul 21, 2016 at 0:33

You'll need to keep the reverse voltage to the LED at less than about 5 volts, and an easy way to do that is to connect a diode in parallel opposition to the LED across the LED.

Using resistive dropping, there are a couple of ways to do that.

In (b), below, the flicker rate will be twice that of (a), which may be advantageous in some applications.

In (c), below, a full wave bridge is used instead of a parallel diode, the flicker rate will be twice the mains frequency, and (d) is an example of a reactive dropper where the capacitive reactance of C1 is used to drop the mains voltage more or less losslessly to a voltage which the LED can use.

V5 and S1 are used to generate a turn-on transient at the first peak of V4, for test purposes, and the LTspice circuit list is appended just in case you want to play with the circuit(s)

Version 4
SHEET 1 1172 680
WIRE -432 192 -480 192
WIRE -272 192 -352 192
WIRE -96 192 -272 192
WIRE 128 192 32 192
WIRE 256 192 208 192
WIRE 336 192 320 192
WIRE 480 192 416 192
WIRE 528 192 480 192
WIRE 672 192 608 192
WIRE 848 192 672 192
WIRE -272 224 -272 192
WIRE -96 224 -96 192
WIRE 672 224 672 192
WIRE 848 224 848 192
WIRE 480 256 480 192
WIRE -480 288 -480 192
WIRE 32 288 32 192
WIRE 144 288 144 240
WIRE -272 320 -272 288
WIRE -224 320 -272 320
WIRE -96 320 -96 288
WIRE -96 320 -160 320
WIRE 672 320 672 288
WIRE 720 320 672 320
WIRE 848 320 848 288
WIRE 848 320 784 320
WIRE -272 352 -272 320
WIRE -96 352 -96 320
WIRE 480 352 480 320
WIRE 672 352 672 320
WIRE 848 352 848 320
WIRE -480 464 -480 368
WIRE -432 464 -480 464
WIRE -272 464 -272 416
WIRE -272 464 -352 464
WIRE -96 464 -96 416
WIRE -96 464 -272 464
WIRE 32 464 32 368
WIRE 144 464 144 368
WIRE 144 464 32 464
WIRE 192 464 192 240
WIRE 192 464 144 464
WIRE 480 464 480 416
WIRE 480 464 192 464
WIRE 672 464 672 416
WIRE 672 464 480 464
WIRE 848 464 848 416
WIRE 848 464 672 464
WIRE -480 512 -480 464
WIRE 32 560 32 464
FLAG -480 512 0
FLAG 32 560 0
SYMBOL res -336 176 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R5
SYMATTR Value 9100
SYMBOL res -336 448 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R6
SYMATTR Value 9100
SYMBOL voltage -480 272 R0
WINDOW 3 24 96 Invisible 2
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V3
SYMATTR Value SINE(0 340 50)
SYMBOL LED -224 336 R270
WINDOW 0 24 66 VTop 2
WINDOW 3 0 32 VBottom 2
SYMATTR InstName D6
SYMATTR Value NSCW100
SYMBOL diode -256 224 M0
WINDOW 0 46 33 Left 2
SYMATTR InstName D5
SYMATTR Value 1N4148
SYMBOL diode -256 416 R180
WINDOW 0 48 31 Left 2
WINDOW 3 24 0 Left 2
SYMATTR InstName D7
SYMATTR Value 1N4148
SYMBOL diode -80 288 R180
WINDOW 0 43 31 Left 2
WINDOW 3 21 64 Left 2
SYMATTR InstName D9
SYMATTR Value 1N4148
SYMBOL diode -112 352 R0
WINDOW 0 -53 34 Left 2
WINDOW 3 -51 71 Left 2
SYMATTR InstName D10
SYMATTR Value 1N4148
SYMBOL res 624 176 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R7
SYMATTR Value 100
SYMBOL voltage 32 272 R0
WINDOW 0 4 6 Left 2
WINDOW 3 24 96 Invisible 2
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V4
SYMATTR Value SINE(0 340 50 0 0)
SYMBOL LED 720 336 R270
WINDOW 0 72 32 VTop 2
WINDOW 3 0 32 VBottom 2
SYMATTR InstName D8
SYMATTR Value NSCW100
SYMBOL diode 688 224 M0
WINDOW 0 42 33 Left 2
SYMATTR InstName D11
SYMATTR Value 1N4148
SYMBOL diode 688 416 R180
WINDOW 0 -52 32 Left 2
WINDOW 3 -78 -3 Left 2
SYMATTR InstName D12
SYMATTR Value 1N4148
SYMBOL diode 864 288 R180
WINDOW 0 -53 33 Left 2
WINDOW 3 -76 -2 Left 2
SYMATTR InstName D13
SYMATTR Value 1N4148
SYMBOL diode 832 352 R0
WINDOW 0 39 33 Left 2
SYMATTR InstName D14
SYMATTR Value 1N4148
SYMBOL cap 320 176 R90
WINDOW 0 0 32 VBottom 2
WINDOW 3 32 32 VTop 2
SYMATTR InstName C1
SYMATTR Value 180n
SYMBOL sw 224 192 M270
SYMATTR InstName S1
SYMBOL voltage 144 272 R0
WINDOW 0 -42 3 Left 2
WINDOW 3 24 96 Invisible 2
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V5
SYMATTR Value PULSE(0 1 5m)
SYMBOL zener 464 256 R0
WINDOW 0 -52 33 Left 2
WINDOW 3 -92 69 Left 2
SYMATTR InstName D16
SYMATTR Value KDZ6_2B
SYMBOL zener 496 416 R180
WINDOW 0 46 31 Left 2
WINDOW 3 24 0 Left 2
SYMATTR InstName D15
SYMATTR Value KDZ6_2B
SYMBOL res 432 176 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R8
SYMATTR Value 510
TEXT 46 492 Left 2 !.tran 100m
TEXT -408 248 Left 2 ;5W
TEXT -416 520 Left 2 ;5W
TEXT 48 520 Left 2 !.model SW SW(Ron=.01 Roff=1G Vt=0.5Vh=0)
TEXT -280 568 Left 3 ;(c)
TEXT 488 576 Left 3 ;(d)

• What is the software used to create that circuit diagram as per version 4 text that appears at the end? Sep 12, 2019 at 3:28
• this looks good :D Apr 2, 2020 at 11:30

The LED is already a diode, but very likely can't handle the reverse voltage of over 300 volts that will be applied during the negative half of the power cycle, so you actually need a protection diode of some sort anyway.

• A reverse blocking diode is mandatory. The LED's made today will not tolerate reverse voltage like the LED's of 20 years ago.
– user105652
Jul 20, 2016 at 0:54
• The reverse voltage comment is really good and I hadn't considered that. I'm still looking for a clean way to do this without plugging in a 240v to 12v transformer. I'm really curious how the 120VAC LEDs are handling this. Jul 20, 2016 at 1:36
• Probably using a capacitor for current limiting and an anti-parallel diode to shunt the reverse current. That would be the cheapest way to go.
– Evan
Jul 20, 2016 at 21:01
• @Sparky256: A reverse blocking diode isn't a good idea because its reverse capacitance can let turn-on or mains transients through to the LED which will destroy it. Jul 21, 2016 at 0:37

Yes - it really does take a resistor with a large wattage rating.

There are a couple of things that will reduce the wasted power (and generated heat)

1) put a diode in series with the LED. This reduces the resistor dissipation by half.

2) use a capacitive-type power supply to drive the LED. You will need a small series resistor to limit the inrush current but the total dissipation can be reduced by at least 90%.

• The problem with 1)is that the diode's reverse capacitance can let turn-on or mains spikes propagate through to the LED and destroy it. Jul 21, 2016 at 0:21

Some thoughts.

1. For an indicator LED you don't need anything like 20mA, nor should you run an LED at the maximum current. 2mA is probably more than enough if you have a high-brightness LED.

2. You can use a bridge rectifier (either a single component or 4x 1N4148 or 1N400x) at the LED. This will reduce the flicker compared to a series diode (as @EM mentions). The diodes, in the circuit below (which is the same as @EM's circuit (c)), only see a couple volts PIV and a few mA so almost any type will do (I've shown the resistor split into two, but a single resistor of adequate rating will do):

simulate this circuit – Schematic created using CircuitLab

1. Say the average current is going to be 2mA. The average current determines the brightness. The resistor required will thus be (ignoring the LED + diode drop- the factor $\frac{\sqrt{8}}{\pi}$ comes from the ratio of RMS to average for a sine wave):

R = $\frac{(240V) \sqrt{8}}{\pi I_{AV}}$

and the power dissipation will be about

Pd = $240^2/R$

So for 2mA, R = 108K 0.53W (you could use 110K 1W or go slightly up in current and use 100K 1W)

A high voltage resistor is required if you want reliability and safety (because the mains can have huge transients on it), and it likely should be a fusible type.

1. LEDs are not considered insulated for mains voltage so you will need to provide a transparent lens or light pipe and otherwise insulate the LED to prevent any possibility of direct or indirect human contact, even with a poorly made, defective or broken LED.

I done a circuit similar to EM field's suggestion, but with a few components.

By the way I used different resistances in the two half periods because I did not have two resistors of the same wattage available (50Hz and the persistence of images softens the difference in brightness).

With some back-of-the-envelope calculation, neglecting the voltage drop across the diodes (this is a typical situation in which it is dishonorable :-) to do precise calculations) I done this:

(sorry for the picture, I'm not at computer).

In my calculation I kept large value of power, and considering that the resistance dissipate for only one half period, this value should be good also for 220V.

If this LED is being used as a significantly-bright pilot indicator or similar, I would use 4 or 5 LEDs instead of a single LED. There are two approaches: pure resistor voltage-dropping or capacitive voltage dropping.

Resistive:

simulate this circuit – Schematic created using CircuitLab

Capacitive:

simulate this circuit

In both cases, replace D5 with a short if you need only 4 LEDs.

• This is not really an optimal circuit. You have built a bridge rectifier out of LEDs (D1-4) and then used it to drive another LED (D5). D1-D4 will have 60 Hz flicker, while D5 will have twice the average current and 120 Hz flicker. If 60 Hz flicker is OK, it is simpler to just use two anti-parallel LEDs (or 1 LED and 1 diode). If you want 120 Hz, it is better to use silicon diodes for your bridge rectifier -- i.e., any of the circuits by EM fields above.
– Evan
Jul 21, 2016 at 17:57
• This is a fairly-minimal circuit that occupies little space. In addition, several LEDs provide more light than a single LED. This is useful in Industrial control panel applications, where the panel indicators are relatively large. Jul 22, 2016 at 5:35