LDR Based Automatic night lamp

I Have recently made a LDR based Dark detection circuit and it works correctly i.e. lit up a led when I turn off room's light and when on turning on room's light, led goes off. Circuit is very basic, using ldr, transistor, resistor, led and battery (like I have attached with the post). Now can I just replace the led with relay for night lamp switching purpose? Kindly ignore the 6 volts on the circuit I have similar circuit which works on 9 volts and have a relay which get toggles on 5 volts. Now my doubt is that if I install this circuit for switching my outdoor light, should the relay fluctuates in the transition time? I have a doubt that relay may toggle abnormally for some time in transition period, because I think the illuminance doesn't suddenly decrease at point of transition. I don't know if its a non sense question but please let me know if the relay just turn off and turn on accordingly or it may malfunction.

8012534324_c64fb60f08.jpg

BC547

NTE ELECTRONICS R46-5D12-6 Power Relay

R46−5D12−6 datasheet

NTE Type No.......................................... R46−5D12−6

Nom.Volt. ......................................... 6VDC

Contact Arr. ......................................... SPDT

Coil Res. Ohms (Typ)................................. 100

Nom.Power ...............................................360mW

Max.Contact Cur. @30VDC or 120VAC.............12A

Diag No. ...................................................D23

The BC547 can drive both the led and the relay coil. Simply connect the relay coil (pins 2 & 5) in PARALLEL with led and led resistor, as shown here.

Cut lamp power cable (with power disconnected obviously) and connect the cut ends to pins 1 & 3.

COM - PIN 1
N.C. - PIN 4
N.O. - PIN 3
COIL 2 , 5

Now my doubt is that if I install this circuit for switching my outdoor light, should the relay fluctuates in the transition time? I have a doubt that relay may toggle abnormally for some time in transition period, because I think the illuminance doesn't suddenly decrease at point of transition.

There's a fairly easy software fix called [u]hysteresis[/u].

Here's a made-up example of how it works...

  • Let's say your light level is 0-10 where 0 is dark and 10 is full-brightness.

  • You program the light to come-on when the light level falls to 4, but it doesn't switch-off until the light level comes back to 6.

Heaters & air conditioning systems all use hysteresis and sometimes they call it "swing" (i.e. 1 degree of swing).

You could also add some delay so that every time it switches, nothing can change for some period of time.

Simply connect the relay coil (pins 2 & 5) in PARALLEL with led and led resistor, as shown here.

does doing this will not show abnormalities in transition time? This works well when light illuminance changes suddenly i.e. proper brightness to proper darkness but in outdoors, where I want to connect this circuit, day just not suddenly converted to nights so I think this might be a problem. Also in forums I have seen this problem of flickering relay or relay producing abnormal sounds during period of transition. Please let me know the solution for this.. Is a 555 timer IC can help?

There's a fairly easy software fix called hysteresis.

I have made this circuit with Arduino and it works perfectly but I don't want to waste microcontroller for this... Is this thing possible without Arduino?

Thanks a lot for reply guys.

Post your code. This forum is supposed to be two way street. We help you and you help others. Please post your code for the benefit of those who have not yet achieved what you have accomplished.

"I have made this circuit with Arduino and it works perfectly but I don't want to waste microcontroller for this... Is this thing possible without Arduino?"

Use a comparator like LM311 with hysteresis. Look up the data sheet.

Weedpharma