Professional Documents
Culture Documents
Introduction
In these days it’s most important to have a home security system to protect your family and
belongings, but you may be hearing a lot of conflicting information on what you need and
don't need.
There are lots of options out there, and electronics dealers and home security specialists
always seem to want to sell you the fanciest, most detailed system. But is all that necessary?
In this project we will build a home security system ( burgular alarm ) that has a special
feature which is dialing the owner when the alarm is activated .
There are two options out there, dialing through the land line telephone and the use of mobile
telephone , we have choosed the mobile telephone as a safe way of communication as the
intruder can’t cut the telephone wires in this case.
Also we have choosed the most practical type of sensors which is the magnetic type that can
be fixed easily on the doors and winodws.
The system will be activated once any of these sensors are triggered , then it will turn an
audiable alarm ON, and indicated which door or window is opened through a list of LEDs.
Then call a predefined numbers stored on the mobile telephone itself.
Project components
When designing a security of safty system you will need a different types of sensors, the
sensors are the electronic or mechanical components that is triggered based on a certain
action, for example, you may want your system to sense if any of your doors or windows are
opened while you are away, in this case you need to have a magnetic sensor, it’s a something
like a switch and is closed or opened if you move a part of it away from it’s body
Another option is to sense who is moving arround the house using an Ultrasonic sensors
which acting like the Radar.
Any sensor can be used with this project, they are all different in function but have one
output , a signal sent to the main unit to tel it that there’s something wrong.
This is the brain of this project, we have choosed one of the best microcontroller that is
widely used in the industiral, automotive and security systems.
It’s the 40-Pin Enhanced Flash Microcontrollers PIC16f877A
It’s running from a +5v supply and clocked with 4MHZ crystal oscilator
Microcontroller
Fuse Regulator 5V
Power
in
12volts
Reset
buzzer
Mobile driver
The circuit schematic
Microcontroller Code Logic
unsigned short i;
void speed_dial3() {
PORTD.f1 = 1;
Delay_ms(2000);
PORTD.f1 = 0;
}
void speed_dial6() {
PORTD.f2 = 1;
Delay_ms(2000);
PORTD.f2 = 0;
}
void speed_dial9() {
PORTD.f3 = 1;
Delay_ms(2000);
PORTD.f3 = 0;
}
void Power_ON() {
PORTD.f0 = 1;
Delay_ms(2000);
PORTD.f0 = 0;
}
void clear() {
PORTD.f0 = 1;
Delay_ms(500);
PORTD.f0 = 0;
}
void alarm() {
for(i=0;i<50;i++) {
PORTA.f0 = 1;
Delay_ms(80);
PORTA.f0 = 0;
Delay_ms(80);
}
}
void beeb() {
PORTA.f0 = 1;
Delay_ms(100);
PORTA.f0 = 0;
}
void main() {
beeb();
// wait a little before opening the mobile
Delay_ms(10000);
while (1) {
alarm();
break;
}
PORTB = 0; // status led off
Delay_ms(500);
}
Delay_ms(10000);
Delay_ms(10000);
} // end while
} // end main
In this project we have used a simple buzzer with moderate audioble sound, but in the real
case usually a loud siren is used, we can use any type of alarms that is operated with 5v
through the alarm socket socket , if a louder sound is needed we can replace the transistor
with a bigger one that can supply higher currents.
In this project we came with a new easy way to interface the microcontroller with any type of
cell phones, we connect the output lines to the phone keyboard directly, in other words, we
simulate the “key press” we make the microcontroller connects the phone button terminals
We have used the speed dial feature of the cell phone, this function is found in most cell
phones, so when dialing Number1, just connect the terminals of the button 3, then button6
and finally button 9.
We used the Quad electrnoic switch IC, named MC4066 and is controlled with the PIC portD
Mobile Phone
PIC877A
1 2 3
4 5 6
7 8 9
In this type of projects we usually choose a simple cell phone, not only to lower the cost but
mainly to be easily interfaced and to have longer battery life.
We used the Alcatel Model OT-E101, a text mode simple phone and it’s modifed to connect
wires to the buttons 3,6,9, we have choosed these buttons specifically to have a shorter wires
as they are at the phone edge.
Mobile phone
Connection to
microcontroller
Basic Operation
1. First put the simcard in the mobile phone, then put the battery
2. Adjust the date and time
3. Then trun off the mobile
4. Connect the mobile to the circuit
5. Connect the power to the circuit
6. After 10 seconds the mobile will turn on automatically
7. After 30 seconds the operation will start ( the detection mode ), in this mode the green
led will start blinking means that the system is ready.
8. Now you can pick the magnetic edge away to trigger the alarm
9. You will hear an alarm from the buzzer for about 20 seconds
10. Then the system will start calling the first Number stored in the mobile memory, then
wait for 20 seconds then hang up
11. Then it will call the second number then the third number
12. Then the System will wait 1 minute until it return to the detection mode again
References:
PIC16f877A datasheets
http://ww1.microchip.com/downloads/en/DeviceDoc/39582b.pdf
hosam_eldin@hotmail.com