I am trying to simulate an LED night light circuit using LTspice. I want to measure the voltage of C2.
The C2 voltage is supposed to be 12 V (based on the textbook), but when I try to simulate the circuit, I only get 120 mV.
If I decrease the C2 value, the voltage increases, so I tried to change the C2 value to 0.47 µF but it only peaks at 5 V and decreases.
What am I doing wrong?
Edit: The circuit above is from my textbook and it says that I need to design an LED night circuit with 2-3 white LEDs without using transformer. The textbook explanations for the circuit is basically this.
Since I need to identify what voltage to power the LEDs, the textbook says to choose 12 V since there's a voltage drop of 8 V from the LEDs and current of 20 mA.
So to "step-down" the voltage, I can use resistor to drop the 170 V to 12 V. So the resistor has to drop 170-12 = 158 V. Using Ohm's Law, I can calculate the resistor value, 158/0.02 = 7900. But the power rating will be 158(0.02) = 3.16 W and that's a great amount of power for a night light.
So an alternative will be using a capacitor to drop the voltage with a reactance of 7900 Ohm. Using reactance formula, I got the C1 value of 0.336 µF (0.33 µF for standard value).
To convert AC to DC, I can use half wave rectifier and capacitor (C2) for filter. For the C2 value, I can use the formula from my textbook: C = I/fV I = current f = frequency V = Ripple voltage. The textbook assumes the V = 1V. So C2 = 0.02/(60)(1) = 333 µF.