You are on page 1of 11

(/)

Teclado Virtual de Wonder Woman Gal TiLTA ‫ ﺟدﯾد‬TT-0511-R


escarabajo BadUSB... Gadot My wife Your... ‫ﻣﻘﺑض ﺧﺷﺑﻲ ﻣﻘﺑض‬...
PEN 11.86 PEN 36.66 PEN 672.08
PEN 13.93 PEN 707.45

TPTOB 2 pcs Daytime 10W coche QI carga 10 juegos/lote canal


Running Headlight... inalámbrica... led integrado,...
PEN 19.57 PEN 182.58 PEN 165.21
PEN 60.66 PEN 365.16

AliExpress
Advertisement

Home (https://www.electroschematics.com/) » Alarms (https://www.electroschematics.com/category/alarm/) »


PIC12F675 Microcontroller Based Security Alarm Circuit

(https://www.electroschematics.com/wp-content/uploads/2013/04/PIC12F675-Security-Alarm-Circuit-Schematic.png?
t=795%2C484)

PIC12F675 Microcontroller Based Security Alarm


Circuit
T.K. HAREENDRAN (HTTPS://WWW.ELECTROSCHEMATICS.COM/AUTHOR/HAREENDRAN/)

PIC12F675 (/tag/pic12f675)

Share this:
 (https://www.electroschematics.com/pic-based-security-alarm/?share=twitter&nb=1)

 (https://www.electroschematics.com/pic-based-security-alarm/?share=facebook&nb=1)

 (https://www.electroschematics.com/pic-based-security-alarm/?share=linkedin&nb=1)  More
Crime in general is still on the rise, and having a security alarm installed is no longer a perquisite of the
wealthy! Here is a simple and compact security alarm system to protect your home/shop and valuables. The
circuit is built around a tiny microcontroller chip PIC12F675. Besides, a ready-made Passive Infrared (PIR)
module is integrated with the alarm system for reliable(/)human-motion detection.

The built-in passive infrared sensor detects human movement by sensing temperature changes over the scene,
and works even in the total darkness. Human body heat moving across the scene will trigger the PIR sensor, and
the trigger signal will be sent to the control circuit instantly. As the output of the alarm system can be
connected to external lamps or alarm sirens, these devices will be instantly activated upon the detected motion.
As a result, the intruder who entered the guarded area, even in total darkness, will instantly be exposed.

Note that PIR sensor can be used not only for detecting motion in the darkness, but it can even be used
e ectively in daytime where it may produce much less false alarms compared to other motion detection
mechanisms. Here, the PIC12F675 works as a “logic interface” between the detection device and the alarm
actuator.

(https://www.electroschematics.com/wp-cont

ent/uploads/2013/04/security-alarm-architecture.png)

Security Alarm Circuit Description


As stated, this project describes a home security alarm based on a Passive Infra-Red sensor module (PIR1).
There are many vendors that manufacture the PIR sensor modules and almost all of them are pretty much the
same in function. They have a single output that goes high (3.3V) when the motion is detected. Hera, a
PIC12F675 (IC1) microcontroller continuously monitors the output from the PIR sensor module and turns an
electro-magnetic relay (RL1) on when it goes active.

The circuit can be powered from four AA/AAA cells that gives 6 VDC supply. A 1N4007 (D1) diode is used in series
to drop the voltage down to near 5.3 V as the operating voltage for the PIC microcontroller should be below 5.5 V.
As well, this diode provides the protection to the whole electronics in case of reverse polarity of the power
supply. PIR sensor modules usually have a 3-pin connection (Vcc, Output, and round). The pinout may vary, so it
is recommend to check the manufacturer’s datasheet to con rm the pins. Sometime, they do have labels on the
PCB next to the pins. Most PIR sensor modules can be powered through 5 to 12 VDC supply as it has its own
“low-drop voltage regulator” chip, on board.

(https://www.electroschematics.com/wp-
content/uploads/2013/04/PIC12F675-Pin-Assignment.png?
resize=537%2C137)
Pin Assignment of PIC12F675
The output of the PIR sensor module (PIR1) is monitored through GP5 (pin 2) of PIC12F675. PIC12F675 is an 8-
Pin Flash-Based 8-Bit CMOS Microcontroller. Note that,here the PIC12F675 microcontroller uses the internal
clock oscillator at 4.0 MHz. When the motion is sensed, this output is high at about 3.3 V . You could still use
(/)
this voltage as a valid logic high for IC1 by changing the code , but It is preferred to use this voltage to drive the
base of a BC547 transistor (T1) so that at the collector we will have the full swing of the logic voltages.

When power supply is turned on by the on/o switch (S1), IC1 monitors the voltage at the collector of the
transistor after a delay of about 60 seconds. This initial delay is introduced deliberately to avoid false
triggerings, because the PIR sensor requires an initial stabilization time of about 10 to 60 seconds in order to
function properly. A red LED (LED1) is connected to port GP0 of IC1 (pin7) with a current limiting resistor (R3) in
series. The LED blinks at a slow rate during this delay time.

After this delay, IC1 starts monitoring the voltage at the collector of T1. The LED blinking pattern is now
changed to indicate the “standby” mode. In standby mode, T1 is cut o , and the collector output is at logic high
(+5 V). When a “valid” motion is sensed, the high output from the PIR sensor module saturates the transistor
and the voltage at the collector drops down to logic low. Consequently, of port GP1 (pin 6) of IC1 goes high to
switch on the 5V DPDT relay (RL1) through transistor T2. This output will remain High, as long as the motion
exists, and this active condition is indicated by a steady-glow of LED1. DPDT Switching contacts of RL1 can be
connected to powerful external lamps and/or alarms.

PIC12F675 Security Alarm Circuit Schematic

(https://www.electroschematics.com/wp-cont

ent/uploads/2013/04/PIC12F675-Security-Alarm-Circuit-Schematic.png)

Security Alarm PCB Layout

(https://www.electroschematics.com/wp-cont

ent/uploads/2013/04/security-alarm-pcb-layout.png)

PIC12F675 Software
The rmware is written in C and compiled with MikroC Pro for PIC. When the power is rst turned on, the
microcontroller waits for 60 seconds before it starts monitoring the PIR sensor output. This wait time is
required for the PIR sensor to stabilize when rst powered on. When the microcontroller detects the PIR sensor
(/)
is triggered, it drives the relay switch. Multi-mode control of the visual indicator (Red LED) is also managed by
the PIC microcontroller.
////////////////////////////////////////////////////////////////////////////////
// Microcontroller = PIC12F675
// Operates on Internal 4MHz Clock
// Compiler Used is MikroC Pro for PIC by Mikroelektronica
(/)
// Demo version can be downloded from http://www.mikroe.com
// In Demo version, the programcode limit is 4 Kb
// Program Developed By Vineesh Viswam,Emkor Technologies
// Tested by TechNode Engineering Electronics
//
////////////////////////////////////////////////////////////////////////////////
#define LO_IN GPIO.F5
#define LED GPIO.F0
#define BUZ GPIO.F1
#define LOW 0
#define ON 1
#define OFF 0
////////////////////////////////////////////////////////////////////////////////
int i,j=0;
////////////////////////////////////////////////////////////////////////////////
void interrupt()
{
INTCON.GIE = 0;
if (INTCON.T0IF)
{
j++;
if(j == 80)
{
LED = ON;
Delay_Ms(80);
LED = OFF;
j = 0;
}
}
INTCON.T0IF = 0;
INTCON.GIE = 1;
}
////////////////////////////////////////////////////////////////////////////////
void main() {
TRISIO = 0b00100000; //GPIO.F5 configured as input and all others are output
GPIO = 0b00000000;
CMCON = 0b00000111; // Turn OFF All Comparators
OPTION_REG = 0b10000111;
INTCON = 0b00100000; // Enable Timer0 Interrupt
TMR0 = 0b00000000;
OSCCAL = 0b11111100; // Internal 4MHz Oscillator Configured to operate at Maximum frequency
ANSEL = 0b00000000;
LED = OFF;
BUZ = OFF;
INTCON.GIE = 0;
for(i=0; i<60; i++)
{
LED = ON;
Delay_Ms(500); // LED Flashing
LED = OFF;
Delay_Ms(500);
}
LED = OFF;
BUZ = OFF;
INTCON.GIE = 1;
while(1)
{
if (LO_IN == LOW)
{
INTCON.GIE = 0;
LED = ON;
BUZ = ON;
while(LO_IN == 0);
}
else
{
LED = OFF;
BUZ = OFF;
INTCON.GIE = 1;
}
}

}
////////////////////////////////////////////////////////////////////////////////
About Co-author
PIC coding for this circuit was handled by Vineesh Viswam (vineeshtviswam@gmail.com) design assistant at
(/)
Emkor Technologies, Kottayam, Kerala. Vineesh Viswam is also a “freelance coder” of TechNode Engineering
Electronics, Pallimukku, Kadakkal, Kollam, Kerala – an independent electronics R&D lab, founded by me. At
present, I am the copyright owner of this work.

Share this:
 (https://www.electroschematics.com/pic-based-security-alarm/?share=twitter&nb=1)

 (https://www.electroschematics.com/pic-based-security-alarm/?share=facebook&nb=1)

 (https://www.electroschematics.com/pic-based-security-alarm/?share=linkedin&nb=1)  More

Previous
Trailer Stop & Turn Signal
Converter
(https://www.electroschematics.com/trailer-stop-turn-signal-converter/)

Next
Arduino Based Part Fill (https://www.electroschematics.com/arduino-
Automatic Valve
auto- ll-valve/)

Related Tutorials

No related posts.

Recent posts

HDD BLDC Motor (https://www.electroschematics.com/hdd-bldc-motor/)


Dual Channel PWM Module (https://www.electroschematics.com/dual-channel-pwm-module/)
Small Blower Cooling Fan and Novel Project Ideas (https://www.electroschematics.com/blower-cooling-fan/)
Water Pump for Hydroponics (https://www.electroschematics.com/water-pump/)
Heart Rate Sensor (https://www.electroschematics.com/heart-rate-sensor/)

12 Comments

Join the conversation!


You must be logged in (https://www.electroschematics.com/log-in/) to post a comment.

solangi01
Dear
circuit not working properly rst power up led blanking 1 minute and continues on and relay also continues on plz help what
can i do.

Posted on March 14th 2016 | 10:41 am (https://www.electroschematics.com/pic-based-security-alarm/comment-page-2/#comment-1897655)


 Log in to Reply (https://www.electroschematics.com/wp-login.php?redirect_to=https%3A%2F%2Fwww.electroschematics.com%2Fpic-based-
security-alarm%2F)

(/)

solangi01
I would like to use this project for my home plz send me HEX le I m very thankful to u

solangi01@gmail.com (mailto:solangi01@gmail.com)

Posted on March 13th 2016 | 1:23 pm (https://www.electroschematics.com/pic-based-security-alarm/#comment-1897623)


 Log in to Reply (https://www.electroschematics.com/wp-login.php?redirect_to=https%3A%2F%2Fwww.electroschematics.com%2Fpic-based-
security-alarm%2F)

moataz-monsefgmail-com
Please i need the hex le urgently i will use it in my project

Posted on February 25th 2016 | 7:15 pm (https://www.electroschematics.com/pic-based-security-alarm/#comment-1897134)


 Log in to Reply (https://www.electroschematics.com/wp-login.php?redirect_to=https%3A%2F%2Fwww.electroschematics.com%2Fpic-based-
security-alarm%2F)

josephwilonjayahoo-com-au
I would like to use this project for my diploma project Please send me the hex le and i will using compiled with MikroC Pro
for PIC

Posted on February 18th 2016 | 6:27 am (https://www.electroschematics.com/pic-based-security-alarm/#comment-1897033)


 Log in to Reply (https://www.electroschematics.com/wp-login.php?redirect_to=https%3A%2F%2Fwww.electroschematics.com%2Fpic-based-
security-alarm%2F)

josephwilonjayahoo-com-au
I would like to use this project for my diploma project

Please send me the hex le and i will using compiled with MikroC Pro for PIC

Posted on February 18th 2016 | 6:24 am (https://www.electroschematics.com/pic-based-security-alarm/#comment-1897032)


 Log in to Reply (https://www.electroschematics.com/wp-login.php?redirect_to=https%3A%2F%2Fwww.electroschematics.com%2Fpic-based-
security-alarm%2F)

maithili k
Please send me the hex le

Posted on January 13th 2016 | 1:40 pm (https://www.electroschematics.com/pic-based-security-alarm/#comment-1891720)


 Log in to Reply (https://www.electroschematics.com/wp-login.php?redirect_to=https%3A%2F%2Fwww.electroschematics.com%2Fpic-based-
security-alarm%2F)

Rukmal Hettiarachchi
Thank you for the circuit
I want this circuit hex le.

Posted on November 15th 2015 | 6:06 am (https://www.electroschematics.com/pic-based-security-alarm/#comment-1864050)


(/)
 Log in to Reply (https://www.electroschematics.com/wp-login.php?redirect_to=https%3A%2F%2Fwww.electroschematics.com%2Fpic-based-
security-alarm%2F)

pankaj
please send me ahex hex le for this circuit

Posted on August 23rd 2015 | 4:59 pm (https://www.electroschematics.com/pic-based-security-alarm/#comment-1771786)


 Log in to Reply (https://www.electroschematics.com/wp-login.php?redirect_to=https%3A%2F%2Fwww.electroschematics.com%2Fpic-based-
security-alarm%2F)

preda
Please upload complete Hex le to be use in page.

Thank tou very much

Posted on April 06th 2015 | 4:41 pm (https://www.electroschematics.com/pic-based-security-alarm/#comment-1634672)


 Log in to Reply (https://www.electroschematics.com/wp-login.php?redirect_to=https%3A%2F%2Fwww.electroschematics.com%2Fpic-based-
security-alarm%2F)

rawi
Thanks. This is a good project.
I would like to use this project for my presentation, however,I want to also add a normal light bulb for bicycle beside the
blinking led.
How do I draw the schematic diagram and the additional coding required for the bicycle normal bulb to light up during usual
situation but turn o , then , replaced by the led blinking bulb for 30 seconds before turn o during emergency and then the
normal bulb light up again.
I really need your help…please.
Thanks you very much.

Posted on March 06th 2014 | 1:41 pm (https://www.electroschematics.com/pic-based-security-alarm/#comment-280740)


 Log in to Reply (https://www.electroschematics.com/wp-login.php?redirect_to=https%3A%2F%2Fwww.electroschematics.com%2Fpic-based-
security-alarm%2F)

View More (https://www.electroschematics.com/pic-based-


security-alarm/comment-page-2/#comments)

Login
Email

Password
Remember Me

Log In
(/)
Register (https://www.electroschematics.com/register) | Lost your password?
(https://www.electroschematics.com/lostpassword)

Latest Article Comments

Working with Water Flow Sensors &... (https://www.electroschematics.com/working-with-water- ow-sensors-arduino/#li-


comment-1903343)
"Further Explanation of the Maths: Since I'm getting endless queries/requests raised by"

Retro Handset For Mobile... (https://www.electroschematics.com/retro-handset-for-mobile-phone/#li-comment-1903342)


"As clearly indicated in Ring 1 is the right (R) audio channel, but I prefer to use the Tip for this"

Retro Handset For Mobile... (https://www.electroschematics.com/retro-handset-for-mobile-phone/#li-comment-1903341)


"once it worked...but still not .. leave Ring 1 free you referred to ? SLEEVE is golden color"

Retro Handset For Mobile... (https://www.electroschematics.com/retro-handset-for-mobile-phone/#li-comment-1903340)


"Refer gure 3 and 4. Pin assignment of the 3.5mm headset jack (the TRRS jack) is shown in gure"

Arduino Water Level Indicator +... (https://www.electroschematics.com/arduino-water-level-indicator-controller/#li-


comment-1903339)
"can you some one list the components to be purchased to do this apart from UNO. also what would"

View More ()

Download
Datasheets
POWERED BY DATASHEETS.COM

Part Number

e.g. LM317

Search
Featured Design

(/)

Integrated Power Front End and Multi-


Phase Processor Supply Automotive
Reference Design
This processor supply RF is an automotive
power solution for use in high performance,
single-core-voltage application processors in
ADAS, supporting core supply currents up to
10 A at 0.9 V.

View More Designs

Bajada de precios

-5%

price drop

(https://www.facebook.com/groups/electroschematics/)
28 y 29 de octubre
(/)
Descuentos online en grandes marcas

ASPENCORE NETWORK

PRODUCTS: NEWS & ANALYSIS:

Electronic Products (https://www.electronicproducts.com/) EE Times (https://www.eetimes.com/)


Datasheets.com (https://www.datasheets.com/) EE Times Europe (https://www.eetimes.eu/)
EEM.com (https://www.eem.com) Power Electronic News
TechOnline (https://www.techonline.com/) (https://www.powerelectronicsnews.com/)
EBN (https://www.ebnonline.com/)
Elektroda.pl (https://www.elektroda.pl/)

DESIGN: TOOLS:

EDN (https://www.edn.com/) EEWEB (https://www.eeweb.com/)


Electronics-Tutorials (https://www.electronics-tutorials.ws/) PartSim (https://www.partsim.com/)
Planet Analog (https://www.planetanalog.com/) PCBWeb (https://www.pcbweb.com/)
Embedded (https://www.embedded.com/) Product Advisor (http://www.transim.com/iot/)
Embedded Know How (http://www.embedded-know-how.com/) Schematics.com (https://www.schematics.com/)
Electronics Know How (http://electronics-know-how.com/) Schematics.io (http://www.schematics.io/)
Embedded Central Europe (http://www.embedded-control- Engage (https://www.transim.com/Products/Engage)
europe.com/)
Embedded News (http://embedded-news.tv/)
IOT Design Zone (http://iot-design-zone.com)
Motor Control Design (http://motor-control-design.com/)

GLOBAL NETWORK FOR ADVERTISERS


EE Times Asia (https://www.eetasia.com/) Contact Sales (https://aspencore.com/contact-us/)
EE Times China (http://www.eet-china.com/) Media Guide Request (https://aspencore.com/media-guide-
EE Times India (https://www.eetindia.co.in/) request/)
EE Times Taiwan (https://www.eettaiwan.com/)
EE Times Japan (http://eetimes.jp/)
EDN Asia (https://www.ednasia.com/)
CONNECT WITH US
EDN Taiwan (https://www.edntaiwan.com/)
Facebook (https://www.facebook.com/aspencoregroup/)
ESM China (http://www.esmchina.com/)
Twitter (https://twitter.com/AspenCoreGroup)
EDN China (http://www.ednchina.com/)
EDN Japan (http://ednjapan.com/)

(https://aspencore.com/)

All contents are Copyright © 2019 by AspenCore, (http://www.aspencore.com/)Inc. All Rights Reserved.

Contact Us (https://aspencore.com/contact-us/) About Us (https://aspencore.com/) Privacy Policy (https://aspencore.com/privacy-policy) Terms of Use (https://aspencore.com/terms-of-use)
Site Map (/sitemap.xml)

// Google Sitelink Search Box code

You might also like