Improved bike headlight switch circuit presented here has been designed to switch bike headlight on (or similar loads) at a presettable ambient light level. The circuit is based on the renowned timer chip LM555 (IC1), here triggered by a decrement in ambient light level. Here is a 220V automatic light switch, just in case you need one.
how does the automatic headlight switch works?
When 12VDC supply is applied to the circuit, the voltage at pin 2 of IC1 is set by the voltage divider built around the Light Dependent Resistor (LDR) and trimpot P1 (100K). If the ambient light level (presetted by P1) is sufficient, pin 2 of IC1 is at a high potential and as a result IC1 is disabled. Capacitor C1 (100uF/25V) added across the LDR eliminates possible unwanted circuit functioning which may caused by sudden fluctuations in the light level.
However, when ambient light level drops, the resistance of LDR increases and the voltage level at pin 2 of IC1 drops to trigger the monostable circuit. Simultaneously, the base of transistor T1 (BC557) is pulled low and discharges the timing capacitor C3 (100uF/25V). Next, output (pin 3) of IC1 goes high to turn on the electromagnetic relay (12V/SPDT). The RC time constants (R1 and C3) sets this on time for a period of near 5 seconds. But if the light level stays low, T1 holds C3 in the discharged state and the relay stay on. Common (C) and Normally-Opened (N/O) contacts of the relay can be used to switch the headlight.
The timeout of five seconds is introduced deliberately to avoid erratic switching of the headlight due to other strong light reflections. This also allows the headlight to stay on for a finite time after the ambient light level restoration.
Bike Headlight Switch Notes