This design came about when the author wanted better control of his 12 V solar-charged garden lighting installation. It is, however, a versatile circuit which can also be used to switch other types of equipment. Pressing pushbutton T1 energizes the relay K1 connecting the supply to the circuit, powering the 78L05 and generating a 5 V supply for the ATtiny2313 microcontroller. The output PD3 (pin 7) will now be switched High by the microcontroller to turn on the transistor and hold in the relay, keeping the lighting on for a pre-programmed length of time defined in firmware. A press of the same button can either turn off the lights or extend the lighting period.
Pushbutton T1 is connected via D3 to input PD2 (pin 6). A press of T1 (a minimum of three seconds after timer start) will stop the timer, turn the lights off and disconnect the circuit from the power supply.
The on-time can also be extended: one minute before the timing period ends the LED on PD6 (pin 11) will light up, warning that the switched equipment (the garden lighting in.
the author’s case) will shortly be turned off. Pressing button T1 (start/stop) now restarts the counter and extends the on time for a further period. As before the timer can be terminated at any other time by a press of T1. The timing periods can be easily changed by altering the values defined in the source code (download from ) for the ATtiny2313 and recompiling the program. Diode D3 prevents current from flowing through the relay and into the I/O pin of the microcontroller when the circuit is in its off state. Without D3 the circuit would be continuously switched on.
In its off-state, the circuit (including the 78L05 voltage regulator) is disconnected from the supply giving a total standby current of zero! www.elektor.com/090534