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

1Mhz-pierce-oscillators
100Mhz-vhf-crystal-oscillator
Undervoltage Detector
Fm Radio Transmitter Circuit
Latest Wireless Car Alarm circuit diagram and explanation
NiCd NiMH Battery Charger
Clap-Sensitive Relay with ON/OFF Feature
burglar alarm using ic timer 555556
TRF1115 RF Down-Converter
Car battery charger Automative car and motorcycle schematics
How Does DC to AC Inverter Circuit Works
USB-Powered PIC Programmer
Single-Shot Auto-Charge Flash Circuit
Job Analysis push-pull output
Binary circuit diagram box
Four-way operation of the dynamic braking circuit



Top