Light timer switch with PIC12F629


Posted on Oct 23, 2012

This is a lamp timer capable of operating two separate relay switches. Outputs can be in three (or restricted to two) states: OFF, delayed ON and constant ON. Delayed ON mode is indicated by the LEDs. The source code is easily customizable for your needs: set your desired delay time or disable constant ON state. press the button once to turn on the lamp for a pre-defined delay. while ON, press the button again to turn the lamp constant ON (turn off delay timer). press the button again to turn the lamp OFF. alternative operation, if you disable the constant ON mode: press the button once to turn on the lamp for a pre-defined delay. while ON, press the button again to turn the lamp OFF.


Light timer switch with PIC12F629
Click here to download the full size of the above Circuit.

The source code is freely downloadable. This is written for the PIC12F629, but you can easily adapt it to other controllers like the 16F628 or OTP 12C508. The problem is that 30 minutes don't fit into 16 bits. The simplest solution is to increase MHZ to 12, so for the default dly_a, dly_b values you get 9 and 30 mins (the values specified get measured in 30ms instead of 10ms).




Leave Comment

characters left:

New Circuits

.

 


Popular Circuits

Antennas for HAM transmitters
Mains supply fail Emergency Light
Ranging-system
40W 4 channel audio amplifier
AC Ohmmeter ESR Meter Circuit
Half-bridge circuit
irf44 mosfet based on 100 watt
A high-power DC motor overcurrent protection circuit



Top