Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Automatic night light

Status
Not open for further replies.

crono35

New Member
I've been wanting to make a simple circuit that would turn on a bedlamp once the room light is off- it should keep me from tripping over things as I always forget to turn the bedlamp on before turning the room light off.

The idea is simple enough, but there's a few problems I'm running into. I'm using this basic circuit as a guide:

**broken link removed**

It works great except there's no way to turn it off in the dark; basically the light sensor turns the circuit ON whenever it detects darkness, so once all the lights are off it keeps turning itself back on. I've somewhat worked around this issue by putting another LDR inline between +9v and the potentiometer, which keeps it from turning itself on if it's in the dark. However now the issue is that it turns on whenever it detects light as well as darkness. To get around that issue I put a diode between the new LDR and the potentiometer; now it doesn't turn on with light, but there are certain instances where it would turn off/on incorrectly (for example if the second LDR is dark for any reason, the first LDR won't enable the lamp. I don't know if there are any real world situations where this might be a concern though).

Does anyone have a better, cleaner way of going about this? It's been over a decade since my last EE days and I'm trying to get back in the swing of things. I'd like to stay away from incorporating ICs at this point if possible.
 
Hi,

Yes, buy or build a night light. They make them with and without light sensors. they take very little power so you could leave it running all day and night but the light sensor ones turn off as soon as they detect darkness and if they are on and you are not there so what. The LED type should last a long time.
 
I've been wanting to make a simple circuit that would turn on a bedlamp once the room light is off
So far so good.
there's no way to turn it off in the dark
Why would you want to?
the light sensor turns the circuit ON whenever it detects darkness, so once all the lights are off it keeps turning itself back on.
So it's doing what it's meant to. What's the problem? Are you saying you just want the bed-lamp to switch on when triggered, then go off after a certain delay?
 
As I read the OP's post, all he is asking for is the following.

1. In case he forgets to turn ON the auto dark light before he turns OFF the main bedroom light, he wants the auto light to come ON, IF the room is dark.
[ so that he does not stumble around in the dark]

2. When he gets into bed he wants to manually turn OFF/ON the auto light, as required.

E
 
If that's so then all that seems necessary is a simple manual switch addition to the original circuit?
 
Thanks for the replies guys. ericgibbs described what I'm trying to do pretty well. The problem with having a manual switch is that once you switch it off, you have to manually switch it back on again, which ruins the point of having the light automatically turn back on.

I'm also trying to come up with a way of differentiating between turning the room light off, and turning the night light off (once it turns itself off it will activate again). Is there such a thing as a self-resetting switch? Basically one where it stays off until a certain voltage is applied?
 
You need a light switch and a dark switch.
The dark switch turns the light on, you then manually turn it off and it stays in the off state untill it gets light again then the light switch activates and the circuit resets itself.

Cmos logic an be used to do this.
 
I think the problem I'm having is differentiating between it getting light from the room and it getting light from itself; it sees the loss of both as a condition for turning on, since the LDR can't be calibrated to ignore one but not the other.
 
Not necessarily a problem, depends on how bright it is, outside security lights have a photocell to detect darkness, they are positioned away from their own light, if you can do this with your design it'd probably be fine.
 
I'm assuming the main room light is mains-voltage (tungsten or CFL)? Is the bed-lamp too, or is it a low-voltage LED affair?

Here's the basis for a possible circuit which I think would do what you want, but its output would need an additional driver stage to suit the bed-lamp type :-
BedLampSwitch.gif

The LM324 is just an example opamp, used here as a comparator U1.
Photocell CdS, R1,R2 and R3 form a voltage divider string. R1,C1 develop the short-term (~100ms) average of the cell output to filter out lamp flicker effects. R5,C2 develop a longer-term (~1s) average of the cell output reduced slightly by the R2,R3 combo and hence provide a (variable) ambient illumination reference at the inverting input of U1. C1 voltage is normally just above C2 voltage.
If there is a sudden drop in illumination (e.g. when the room light goes off), C1 voltage drops relatively quickly and goes below C2 voltage so U1 output goes low, setting a latch formed by cross-coupled NAND gates U2a,U2b and providing a high output to turn the bed-light driver on. C1 output then rises again, but U2a output goes low, pulling down the C2 voltage via R7,D1.
Operation of the 'Off' button resets the latch, turning off the bed-light driver. The resulting C1 voltage drop cannot now go below the C2 voltage, so the latch does not get set by the bed-light switching off. With the latch reset, C2 voltage rises again slowly and the circuit is restored to its standby state. An 'On button allows the bed-lamp to be switched manually, independently of the auto switching.
 
Last edited:
You may need to experiment with R1,R3, depending on your particular CdS cell resistance and on your choice of comparator. For an LM324, the aim is to have C1 standby voltage at least 1.5V less than the V+ voltage.
 
That looks like a nifty circuit.
A LM358 might be bit more compact a choice for an op amp.
 
Status
Not open for further replies.

Latest threads

Back
Top