Now you can build your own simple security alarm button using a tiny microcontroller chip PIC12F675 ! The circuit is nothing but an aural alert unit, which raises a warning tone when the trigger button is pushed by someone. The unit can be powered from four 1.5V AA/AAA cells wired in series (6VDC).
The circuit can be energized by turning the power switch S2 to “On” position. The Red LED (LED1) blinks 3 times when the power is turned on to indicate that the system has been powered up. Then IC1 (PIC12F675) waits for about 10 seconds before it starts monitoring the trigger switch status. After the initial delay, when the IC1 detects S1 is closed (door opened) , it drives the piezo –
speaker (PZ1) with a square wave signal, and the piezo – speaker remains on as long as the trigger switch is enabled. If the trigger switch is disabled (changes to open state) the piezo – speaker will not sleep immediately, but still be on for about 10 more seconds but with a slightly different frequency.
The firmware is written in C and compiled with MikroC Pro for PIC. Note that MCLR function is disabled, and WDT is OFF in this project. Demo version of MikroC Pro for PIC can be downloaded from http://www.mikroe.com
/* Microcontroller = PIC12F675 Internal Clock @ 4.0 MHz T.K.Hareendran / 2018