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

Current Booster
Connecting an MSP430 to ADS1248 via SPI
the active power factor correction (PFC) of FAN4810 Circuit design
Ferrofluid Art Display
Photo Inverting
diy tube buffered passive preamp
starting AVR development
Parameter Variation Machines
Weekend Projects with Bre Pettis Joule Thief
SLAVE FLASH TRIGGER
Morse Keyer Redesign and Rebuild



Top