I purchased a cheap night light that plugs directly into a 240V wall outlet. It has three color changing LEDs.
The problem was, those LEDs were way too bright. I decided to modify that night light a little, so they're not as bright.
The reverse-engineered schematic is a little strange in that when the light is off (during daylight) it actually draws a considerable amount of power - about as much when the LEDs are turned on.
(Value of C2 is just the default value for caps the schematic tool I used assigns to those components. I don't know the actual value. LDR1 is red, because it was the selected item when I took the screenshot, it has no significance)
As you can see in the schematic, at night, the current drops through the LEDs (they have no current limiting resistor.)
As the ambient light gets brighter, the resistance through LDR1 drops, and the transistor Q1 starts conducting current.
During daylight, the LEDs are effectively shorted through the resistor. As more and more light gets on LDR1, the LEDs will be less and less bright.
I tried to limit the maximum brightness of the LEDs, by introducing a current-limiting resistor (red circle in the schematic, just above D1). I noticed that I had to use a quite large resistance, around 180k, to have any effect.
The brightness was limited alright, but I also noticed, that when LDR1 was fully covered, i.e. the entire current dropped through the resistor and the LEDs, a buzzing sound emanated and after about two minutes the device broke and is now completely broken. I don't know what part broke as of yet, but I assume Q1 failed open.
LDR1 had a maximum resistance of around 33kΩ - 38kΩ; it was difficult to measure in complete darkness without any light bleeding onto the LDR.
C2 is a tiny 0402 capacitor of unknown value, I assume it's a tiny little bypass capacitor that probably doesn't do much to begin with.
Unfortunately, I don't know the current draw after the bridge rectifier. It was difficult to get a reading with a multimeter as the color-changing RGB LEDs constantly kept changing the voltage drop through them. I seem to have measured a voltage drop of around 9V. Taking the bridge rectifier diodes into account, I'd assume a 10V drop: \$ 10V \times \tfrac{1}{\sqrt2} \approx 7V_{RMS} \$
The capacitive dropper has an impedance of \$ X_c = \tfrac{1}{2\pi f C} = \tfrac{1}{2\pi \times 50Hz \times 100 \times 10^{-9}F} \approx 31.8kΩ \$. Together with R1 this must therefore drop \$ 240V - 7 = 233V \$.
\$ \tfrac{233V}{32.36kΩ} = 7.2mA \$, now that to me, seems really low.
Now here are my questions:
This circuit seems very weird to me, especially how the LEDs are shorted to turn them off and the entire voltage is dropped via the transistor. I'd understand using the transistor as a low-side switch in line right after the LEDs, but using them like that seems just wrong. Am I misunderstanding something? Is this preferred for some reason?
Why did the circuit break when I introduced a resistor right in front of the LEDs? Where did it most likely fail?
How would I actually go about dimming the LEDs such that the whole thing doesn't break?
I'm assuming for point 3, that I should simply have made the resistor R1 a higher value, further limiting the current through the rest of the circuit.