That's a near sure fire way to zap one of the diodes.
If the LED is turned on at near the 90 degree point of the AC waveform, very large initial current will flow to instantly charge the capacitor.
You need a resistor in series to limit this initial transient, as Dick noted..
The LTspice simulation below shows this:
With no resistance the initial current spike is in the kA range (yellow trace) limited only by the supply and diode circuit resistance.
A 3k ohm resistor limits it to about 100mA (blue trace) with the nominal peak current about 11mA.
Yet another reason for a resistor; some times the power line has high frequency noise on it. A capacitor alone will sent the noise through the LED. (high pass filter) The resistor will limit the current from 100khz switching noise. (also noise from poor power factor) Noise from motors and heaters turning on/off.
Lemme check. Not 1 failure yet with my little light. It's been years and years. Duris E3's still working. Not as bright as before. There must be something I did right. No burnt LED's. All happy and still working away.
We've had lightning strikes here. We've had effed up mains. We've had power surges. It was built to withstand abuse. And it has.
Best part of all is I can build more if I want to. I've the cases, pcb's etc.
Probably the product that has been tested the longest ever before being put up for sale.
Didn't know this post was 2 years old.. I found this topic just now.
In general, I was looking for something suitable for a night light powered by a wall outlet, for the same purpose as yours.
This night light uses a neon lamp, very dim light. Lamp burned out and I wanted to replace it with LED, single or few.
The housing is very slim, 9mm depth, so I need something very compact for this. What type of 24V MOV varistor used in your circuit?
I don't see the need for the two Zeners because LEDs are Zeners. I would use normal diodes.
1N4007 1A 1000V diodes? Why? There is only about 10 to 12 volts on the diodes. Not line voltage. Why not 1N4001? For low current LEDs I used 1N4148s 100V 200mA.
I have made these with out C2 or R3. The light does flicker at 120/100hz. Most people could not see it even after being told it flickers. I did make some with out R3 but with C2 but the boss said he was not paying for a part that made no difference. I think C2 helps eat up power line spikes.
I use a high value for R1 because it helps on "power up" and power line noise and spikes.
I know why R3 is there. I have preached 100s of time "use a resistor with a LED". I see little reason for R3. With out R3 the LEDs are powered by current from C1 not voltage. Set the value of C1 to get the current you want. 1uF 230V 110mA peak 70mA average. With R3C2 the ripple is very low but the average is the same.
Besides spike clipping, the zeners limit the voltage across C2 and the LEDs to 11.3 V; if an LED opens up, C2 does not explode. C2 also reduces flicker.
With a little bit of reverse thinking you can make a "chopper" regulator that ONLY allows the voltage to pass if it is below a certain threshold.
I did something similar for a custom Solid State Relay where we needed AC input to turn on the SSR and keep the LED on the Opto-Isolator "ON during the zero cross and time off of the chopper circuit. In the case of the OP, the LED on the front end of the Opto Isolator is what you want to look at. The circuitry on the SSR portion itself is a simple LED current regulator that can accept a voltage from 5V to about 40V. The AC input can range from 15VAC to 240VAC.