ADJUSTABLE DAY/NIGHT SWITCH

Completed : 17 August 2021

Background adapted from an image from pngtree.com  circuit board png from pngtree.com

This experiment was done after Gerard completed the module on how to utilize a Light Dependent Resistor (LDR), also known as a Photo Resistor.

LDR

A LDR is a resistor whose resistance changes with a change in light falling on the device. In this case the resistance decreases as the light intensity increases.

Principle of Operation of the Adjusted Day/Night Switch

A standard Day/Night switch senses the level of light and when it gets dark it switches on a light or allows another device to start operating. Gerard through it would be nice to try and set up a circuit that allows one to change the level at which the day/night switch activates.

To achieve this, he coupled a Potentiometer into the circuit to have the ability to set the level of the switch. To see the level, one is setting the switch to operate at, this level is represented by a row of LEDs (Red in this case). The higher the level of light at which the switch operates, the more LEDs in the row are lit. The scale is from a 0 to 8. (No LEDs lit to 8 LEDs lit).

The current light level is also monitored and displayed in the same manner (Blue LEDs) use a similar scale of 0 – 8.

The two values are compared and once the light level falls below the set light level a relay activates which then can be used to control any other device.

Controller Board Set Up

Full Block Diagram

LDR Set Up

LDR Circuit Diagram

Potentiometer Set Up

Potentiometer Circuit Diagram

Light Level LED Set Up (Blue LEDs) Set Up

Switch Level LED Set Up (Red LEDs) Set Up

LED Circuit Diagram (Used Twice. One for Red LEDs and other for the Blue LEDs)

Shift Register Pin Diagram

Truth Table used to Switch the LEDs

Relay Set Up

Relay Circuit Diagram

In the finally testing an intermittent error would occur when the relay was switching a 220V light source.   It seems that there is an electromagnetic coupling between the secondary side of the relay and the rest of the circuit causing the shift registers to work erratically, even if the software is operation as designed (the LEDs switched on and off without any command to do so).  Removing the 220V source from the relay, resolved the issue.

Total Experiment

Videos of Working Experiment


Light Sensor


Switch Sensitivity


Opertaional Demonstartion



Click here to go back to the Arduino Index Page

Click here to go back to the Top of this page