Microcontroller-based automatic night light circuit

Posted on Feb 7, 2014

While discussing an all-linear automatic night light circuit I mentioned that I was testing an MCU-based ANLC. Well, I`ve been tweaking the firmware since. The other day I installed the sensor outdoors and have connected the circuit to control 220VAC loads. Last night the circuit got fooled when clouds moved in at around 2am and reflected sufficie

Microcontroller-based automatic night light circuit
Click here to download the full size of the above Circuit.

nt city lights and streetlights that the MCU thought it was already the beginning of dawn and switched off the load. This is because the software algorithm is such that a 10-bit ADC change of just 0x00A from the average dark ambient light level is interpreted as dawn. Competent programmer that I am, the firmware also includes a conditional which turns the load back on again should the light level drop back to the average dark level. And some half hour or an hour later (not sure because I went back to sleep before waking up again some time later) it did actually did return to dark level conditions. A sonalert buzzer is temporarily hooked up such that it sounds when the load (perimeter security lights) is off and as far as I know (sleepy head that I am) the next time the load was switched off by the circuit was around 5am-true dawn. Earlier that same evening at around midnight while remotely monitoring the voltage output of the sensor ("ldr" in the schematic) with a DMM I was surprised to see the numbers climbing rapidly. The output had already settled at ~20mV but then increased quickly within minutes and peaked at ~310mV. I had to look out the window just to make sure I wasn`t witnessing a circuit glitch but that in fact ambient light level was shooting up. And true enough the sky had turned orange and bright-from the cloud cover. The circuit did not turn the load off because the firmware was using a different hysteresis...

Leave Comment

characters left:

Related Circuits

  • New Circuits



    Popular Circuits

    Optical communication system
    DIY Satellite Finder Circuit
    Schematic Diagram for Model 350 PAFN
    filtering noisy power signal
    Switching power supply circuit with STK6303
    DC-coupled single-tube amplifier