LED Nightlight Base Teardown & Simulation

I volunteered to take a look inside a small LED nightlight base to see how well it might work as a power supply for other circuitry:

Nightlight - overview
Nightlight – overview

Note: the AC plug is not polarized. Either blade can contact the hot side of the AC line.

The cadmium-selenide photocell in front turns the white LED on when it sees darkness and off when it sees lightness, with a more-or-less proportional response during dimness. The LED has an obvious 60 Hz flicker, particularly during its partially on phase, so I didn’t expect much inside.

The component side of the PCB faces toward the blades, which you’re looking along the lengths of:

Nightlight - PCB component side
Nightlight – PCB component side

The solder side faces away from the outlet:

Nightlight - PCB solder side
Nightlight – PCB solder side

Flipping the solder side left-to-right and overlaying the two images produces an X-ray-ish view useful for tracing the circuitry:

Nightlight - PCB trace overlay
Nightlight – PCB trace overlay

Some doodling extracts an LTSpice schematic:

Nightlight schematic
Nightlight schematic

None of the component values seem particularly critical; the diodes and transistor are close approximations to what’s really inside. I think the 100 Ω resistor also serves as a fuse, should anything else go wrong.

Setting the CdS cell to 1 MΩ = “dark” turns the LED on:

Nightlight - ON waveforms
Nightlight – ON waveforms

Although I don’t trust the numbers very far, the LED current waveform definitely suggests the flicker isn’t all in my head.

Setting the cell to 10 Ω = “light” turns the LED off, by the simple expedient of clamping the filter capacitor voltage well below the LED’s forward drop:

Nightlight - OFF waveforms
Nightlight – OFF waveforms

When the LED is off, the transistor current is slightly higher than the LED’s on-state current, because saturation voltage:

Nightlight - OFF - transistor current
Nightlight – OFF – transistor current

The current runs right through the 820 nF capacitor, which serves as a more-or-less 3.2 kΩ ballast resistor:

Nightlight - OFF - 820 nF cap current
Nightlight – OFF – 820 nF cap current

It’s a nice film cap and should have a low ESR, but this seems a bit sketchy to me.

So, basically, the nightlight doesn’t really have a power supply in the usual meaning of the term and isn’t suited for driving anything other than the white LED inside the case. Relocating the LED outside the case is an Extremely Bad Idea™, because the anode is one diode away from what might well be the hot AC line; one little oopsie and you’ve got a lethal shock hazard.

  1. #1 by tantris on 2019-05-20 - 10:03

    People buy these things because it automatically shuts the LED off during the day, Which makes you feel good about saving the planet.
    Not that the 0.1W matter much, but whoever designs a circuit that pretends power saving by bypassing the LED should be dunked in the river.
    – And maybe a second time for the safety of this contraption.

    • #2 by Ed on 2019-05-21 - 14:32

      It’s definitely one of those “Hell hath no fury like that of an unjustified assumption” kind of things. You’d think off = lower power, but …

  2. #3 by Jason Doege on 2019-05-20 - 11:22

    Could the circuit be re-jiggered to put Q1 in series with D3 instead of in parallel?

    • #4 by Ed on 2019-05-21 - 14:41

      With some surgery that looks do-able, although it lies beyond my remit for the case… [grin]

  3. #5 by Vedran on 2019-05-20 - 13:10

    USB wall warts are cheap or even free these days. Brand name ones from old phones are probably even safe :)
    I also love up-cycling 19V laptop bricks into custom LED fixtures. Pushing 100W+ makes short work of dark areas

  4. #7 by Raj on 2019-05-21 - 04:06

    Many years ago I made some night lights similar to this but they all suffered LED failures. So I gave up!

    • #8 by Ed on 2019-05-21 - 14:54

      On the upside, you’re still with us!

Spam comments always vanish. Comment moderation may cause a delay.

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s