Analog Night Light Circuit

I'm looking for help in understanding how this analog circuit works. It is a commercially available plug in LED night light that gets brighter the darker the environment is.

It's plugged into the wall to take 120VAC @ 60Hz, and through just 8 components it powers an LED and LDR to turn on when it's dark.

I count 1 transistor (S9014 NPN), 3 resistors, 2 capacitors, 1 rectifying diode, 1 zener diode. That's it. And it turns 120AC into several volts DC.

I can only assume this is a very bare bones probably-not-recommended method of turning AC to DC if you were to build an AC-DC converter.

What's going on? Is it only using half of the AC to basically light the LED half the time (30Hz)?

How does an LDR, which conducts more current with light (and therefore increases resistance when darker), 'turn on' once it stops passing current?

Typically, 1 of the capacitors is used to drop the 110 down to an appropriate level (look up capacitive reactance). The diode will be used to rectify the lower AC voltage with the zener used as a simple voltage regulator. The LDR is probably used to pull the base of the transistor down to turn it off (so when it is light, the transistor is biased off) with a pull up resistor to the base that turns the transistor on when it is dark. The transistor will be the switch for the LED. I assume that is the way it is probably wired. The down side of that is that without an isolation transformer, depending on just which way it is plugged in, the circuit can be hot relative to neutral/ground (which is why it is typically encased in plastic).

That is my guess anyway.

It's not a polarized plug, works either way

Look at Bigclive's channel. He explains how it works: youtube

// Per.

I'm pretty sure I have that exact same night light. 6 pack from Walmart? I was going to try and modify one to add a button to shut it off in the dark, but still turn back on automatically after a light-dark cycle. I made a list of what components were connected to which nodes, but I haven't translated that into a schematic yet. I'll have to do that when I get home.

The crowbar-looking circuit that Bigclive came up with doesn't seem right. I'll verify it against my device later.

Not sure where they're from, but probably Walmart or some such, I didn't buy them. Actually have several models, some incan, some 5mm bulb type LED, this one is like a 3528 SMD LED. The 5mm bulb type had noticeably more components than this SMD. It was the 5mm bulb type that stopped working that led me to disassemble it to look around inside. Couldn't find that broken one to take pics of before making this post so I took apart the SMD LED one and was surprised at how it had even fewer components.

https://www.walmart.com/ip/Meridian-Great-Value-4-Pack-LED-Automatic-Night-Light/26135731

That's what I bought.

Yeah, Meridian is the brand on them

Cool. Work ends in an hour so I'll find the node list I made and try to draw a schematic today.

Components:

100 Ohm resistor
10K Ohm resistor
510K Ohm resistor
100uF capacitor
0.82uF (250V) capacitor
1N4007 rectifying diode
C5V6 Zener diode
S9014 NPN Transistor
2835 SMD LED
LDR

INTP:
Components:

100 Ohm resistor
10K Ohm resistor
510K Ohm resistor
100uF capacitor
0.82uF (250V) capacitor
1N4007 rectifying diode
C5V6 Zener diode
S9014 NPN Transistor
2835 SMD LED
LDR

Hi,

If you can post a schematic that would allow us to tell exactly how it works.

There are a couple possibilities. For example, the 100 ohm resistor could be used as an input AC surge limiter or an LED current limiter.
The LDR probably connects to the base circuit of the transistor so that when there is enough light present it pulls the base voltage down and thus turns the transistor off which then turns the LED off.
The 0.82uf is the voltage dropping capacitor which drops the voltage significantly without consuming too much power itself.
The 510k could be used as a bleeder for that capacitor.

A schematic would tell us for sure.

I have drawn up a doodle but I'm intentionally deferring to Jiggy for that.
In the meantime:

Looks like the clamping circuit was right, here's the schematic I drew up.

The node lists if someone wants to try it themselves to verify.

The schematic is spot on, thanks.
Haven't heard of the node thing before but I'm guessing it's just the groups of leads that are connected on a trace area.

Hi,

Here is a breakdown using that schematic.
A somewhat cleaned up drawing is attached also.

100 ohm, AC surge limiter
620nf cap, voltage dropper
500k, bleeder for cap
zener, voltage protecton for circuitry to the right in case LED blows open
diode, rectifier
LED, light producing
LDR, light sensing
10k, pulldown for transistor base
transistor, pulls down LED voltage to turn it off
100uf cap, filter so 30Hz does not significantly affect the LED brightness

Overall design strategy:
Half wave rectification for LED means bigger electrolytic cap (100uf)and bigger series cap (620nf).
This isnt always desirable because with full wave rectification both of these caps can be halved
for the price of 3 more low cost rectifier diodes. So bad untilization of capacitors.
The 100uf cap filters the 30Hz or else it would be noticable to the human eye.
The transisor and LDR are used to turn off the LED and at the same time keep the resistance across
the LED low so that the diode still does most of the work even when the LED is off. That results
in one less resistor.
The zener normally will only conduct in the reverse direction but will clamp the voltage to a
safe level if the LED blows open.
The 620nf cap allows powering a low voltage cirucit with low power without requiring a transformer.
The 500k resistor bleeds the 620nf cap in case the unit is unplugged and the user touches one of
the two AC prongs, however if the user shorts out the two prongs with a finger or screwdriver
immediately after unplugging a faint burst of light may appear due to the remaining energy in
the cap getting to the LED. That's of course in a low light environment and assuming it is
unplugged at the right time in the AC line wave.

INTP:
The schematic is spot on, thanks.
Haven't heard of the node thing before but I'm guessing it's just the groups of leads that are connected on a trace area.

Node (circuits): In electrical engineering, node, refers to any point on a circuit where two or more circuit elements meet. Without any further knowledge, it is easy to establish how to find a node by using Ohm's Law: V=IR. When looking at circuit schematics, ideal wires have a resistance of zero. Since it can be assumed that there is no change in the potential across any part of the wire, all of the wire in between any components in a circuit is considered part of the same node.

Each different color in circuit above is a different node

I did my first ever Wikipedia edit just now, removing a sentence from that paragraph that wasn't true.

MrAl:
620nf cap, voltage dropper

That's just my handwriting, it's actually 820 nF. Check the Zener's label to compare it to how I actually write 6's.

MrAl:
The zener normally will only conduct in the reverse direction but will clamp the voltage to a
safe level if the LED blows open.

Are you sure? If I understand your explanation right the Zener is "only" for protection. So the circuit would work without it as long as everything is OK. But I think the Zener will be conducting in forward mode while Mains 2 has higher voltage than Mains 1 - there must be a way to discharge the 820 nF cap faster than 500k resistor. Or am I wrong? AC is a bit difficult to understand for me.

Without the zener it won't work - capacitors block DC, the zener provides the return current flow for the
other half-cycle of mains - otherwise the capacitor would just charge up till no current need flow at all.

Still trying to get a deep understanding of the LDR function.
When there is no light, the LDR shuts off basically all current, so it has nowhere left to go except to the LED. I get that much.

But when there is light, is the LDR's goal to be a path of lower resistance than the LED? Then what is the point of the transistor? Is it simply to ensure a path for all current to go through the LDR and transistor instead of the LED? Transistor current when on 'sucks' all the current away from going past the LED?
What is the point of the 10K pulldown? If that were removed from the circuit so the LDR was just running into the transistor, isn't the x amount of resistance in the M Ohm range of the LDR enough to shut off the base?

Smajdalf:
Are you sure? If I understand your explanation right the Zener is "only" for protection. So the circuit would work without it as long as everything is OK. But I think the Zener will be conducting in forward mode while Mains 2 has higher voltage than Mains 1 - there must be a way to discharge the 820 nF cap faster than 500k resistor. Or am I wrong? AC is a bit difficult to understand for me.

Hi,

Maybe i stated that wrongly because zeners are usually referred to as conducing in reverse when their voltage threshold is reached (ie 5.6v) and in the forward direction they usually conduct with a very low voltage like 0.7v or something.
The way i was referring to is that when the zener clamps to 5.6v that is the forward direction, and when it clamps in 'reverse' it clamps to -0.7v or thereabouts.

So yes of course the zener provides protection as well as reverse conduction so the cap can work normally in an AC circuit. Without that other mode of conduction the cap would charge up and stay charged and would not function as an AC voltage dropping device. So the zener has a double function here.

Yeah LDR's conduct more once light hits them. Basically the light energy gives electrons in the device more energy and thus more freedom to move which of course makes conduction better and thus lowers the apparent external resistance.

The transistor is there to shunt current away from the LED rather than to allow current to conduct to the LED. It's another way of doing it, but this way the impedance across the LED stays low which allows the AC part of the circuit to function normally even when the LED is turned off (transistor conducts), Without that action if the LED is turned off, there would have to be some other mechanism to keep the low voltage section at a low voltage so it doesnt blow up the electrolytic cap, which is of a lower voltage variety like 10v or 12v or something like that. If the cap charged up to the full line voltage peak, it would have to be rated at 200v (most parts of the US) and that would make it a big capacitor which would not fit inside a small night light package. Alternately, another zener would be required to keep the voltage down to 5 to 10 volts or so.

So this is an attempt at a low parts count design, but they did overlook the fact that electrolytic caps and high voltage 0.62uf caps are more expensive than rectifier diodes, and both of those caps could have been lowered to 1/2 their values if they used full wave rectification instead of half wave. So three more cheap diodes could have made the design cheaper by some amount of cash. Maybe they figured the assembly would cost more for three more diodes so i will have to give them the benefit of the doubt.