

Introduction This is a digital home security system with voice feature which can monitor room temperature, smoke, motion, and
windows & doors.
The goal of this project is to utilize the after-market parts and build an integrated home security system. Besides
traditional magnetic switch equipped on doors and windows, we have also incorporated temperature sensor, smoke
detectors, and motion sensor. Hence the security system will sound an alert when there is an attempt of break-in
or if there is possible smoke or fire.
The system is fully digital and also be fully customized. It incorporated a 16x2 LCD display with a 4x4 keypad. Each
sensor can be enabled or disabled, and alarm frequency and skim can also be chosen by users. We have also
equipped a voice playback chip, and it will speak which sensor has gone wrong.
High Level Design
Project Idea
The idea of our project comes from lab 3 when we did a simple security system. However, that security
system is quite basic and only offers simple password lock. Hence we would like to enhance our
security system with different kinds of sensors. We have also browse some of the old final project and
found the "Phone Dialer" project from spring 2002. Originally, we were going to put Zarlink MT8880C
DTMF transceiver chip, so it will dial a desire number that user specify. When the phone connected, we
will use Winbond ISD1420 voice record and playback chip to play pre-recorded voice signal. However,
due to the lack of the phone jack in the lab, plus the majority of the Cornell campus has digital phone
line instead of analog phone line, we decided to put away this idea. Since ISD1420 chip has address bit
feature, we decided to make our system playback certain pattern of voice when the system goes into alert status.
Program & Hardware Design
Program Detail
The hardest part of the program is timing. When any sensor goes wrong, the program will wait for
certain seconds (set by user), and then make ISD1420 chip play back the desired voice pattern we
want. Originally, we though we can just output the appropriate address bit and then make the chip
play, however, later on we discovered there is a THOLD in the ISD1420 chip that we need to take care
of, otherwise it will reference to the previous address bits. The voice playback chip does not have a
very fast internal clock, so we have to manually use the delay function in our program after we set the
address bits, and then make the chip play. Although using the delay function is somehow undesirable,
however, we have implemented our program such that this delay will not cause any error in our
software.
Besides, we also need to implement the keypad function so it acts accordingly when the LCD is
displaying certain menu. This is not very difficult but we have to take care of all the possible
circumstances. We have 12 submenus in our system. Set temp define the lowest temperature allowed
before sounding the alarm (70~120F, with step size of 1F). The Sec. Allow is the time in second before
the voice alarm goes off (0~30sec, with step size of 2 seconds).
We also have simple de-bounce feature for our keypad, and it will sound a buzz when you press any
key (if you HOLD a key but buzz will only sound once). Although the de-bounce function is as easy as
1.Enable System
2.(*)Temp Sensor
3.(*)Mot. Sensor
4.(*)Smk. Sensor
5.(*)Mag. Switch
6.Set Temp: 100F
7.(*)Voice Alarm
8.(*)Buzz Alarm
9.New Pswd:
A.Buzz Freq: 7
B.Buzz Skim: 3
C.Sec. Allow: 10
We also have simple de-bounce feature for our keypad, and it will sound a buzz when you press any
key (if you HOLD a key but buzz will only sound once). Although the de-bounce function is as easy as
1.Enable System
2.(*)Temp Sensor
3.(*)Mot. Sensor
4.(*)Smk. Sensor
5.(*)Mag. Switch
6.Set Temp: 100F
7.(*)Voice Alarm
8.(*)Buzz Alarm
9.New Pswd:
A.Buzz Freq: 7
B.Buzz Skim: 3
C.Sec. Allow: 10
lines, it takes a while to think about the logic and how to actually implement it. Also we implement
the backspace feature so that when use enter a wrong password, this key can be used to delete the
previous entered number. Also just a quick note, our password is masked on LCD for a safer purpose.
Hardware Detail
The first sensor we have is the temperature sensor. Since we implemented a digital thermometer in lab
5, we decided to use the same circuit. So we incorporated National Semiconductor LM34 temperature
sensor, with National Semiconductor LMC7111 OpAmp chip to amplifier our output voltage going into
ADC. The final connection of our circuit look like the following.
The second sensor we have is the motion sensor. Although we do not have the diagram of the circuit (it
has some IC components), we discovered there are few NPN transistors in the circuit. NPN transistors
are like switches, so it is obvious these are used enable the original buzzer on the circuit. Hence we
took the base pin together with ground to connect to our ADC pin input. If the voltage exceed VTH
(threshold voltage), we know the alarm goes off.
The third sensor we have is the smoke detector. The smoke detectors mostly equipped with
piezoelectric buzzer, which has F (feed back), C (main electrode), M (metal plate) three pins.
Piezoelectric buzzer has an internal crystal and will sound if small current is applied (voltage drop).
Hence we took out the piezoelectric buzzer and connect the F pin into our ADC input. When the sensor
goes off, the voltage will go high.
The final sensor we have is the magnetic switches. It is normally closed. So when the switch is right
next to each other, the resistance is zero. When the switch is separated, the resistance will become
infinity as if it’s disconnected. So we drive the switch with an 10K pull-up resistor, and connect the
output to the ADC. Since we have two magnetic switches, we decided to build a simple AND/OR gate
by using 1 74LS00 chip. There are four NAND gates in 74LS00, and if we connect two of NAND gate in
parallel with their input signal to another NAND gate, we will get as if there are 2 AND gate in parallel
with their signals to an OR gate. The diagram can be found in our appendix.
Speed of Execution
The speed of the execution is work very well. In the beginning the system will boot up with default
password 1234. The user can now navigate through our menu, and enable or disable each type of
sensor. If a particular sensor is enabled, the LCD screen will output a * symbol before the sensor
name. User can also set the alert temperature, enable/disable voice or buzzer alarm, and even specify
the ring tone and frequency of the buzzer alarm and the time before voice alarm goes off. The button
de-bounce scheme also works fine so users can navigate through the menu and use the keypad
perfectly.
Accuracy
After the user enables the security system, the green status LED will lid to indicate the system status.
User can now enter proper password to unlock the system. If any sensor goes wrong, the LCD will
output ERROR and with proper initial for the sensor (T for temperature, M for motion, S for smoke, D
for door or window magnetic switch). The red led light be will flashing at 4Hz to indicate such event. If
the buzz alarm is enable, it will sound the tone that user choose. If the voice alarm is enabled, it will
wait for few seconds (user specified), if the system is still not locked, then it will start playing voice to
indicate which sensor goes wrong. (For example, "Temperature Error, please check and unlock the
security system.") If another sensor goes wrong after that, the system will also act accordingly and
indicate that in the voice alert in addition to the LCD screen. ("Temperature Motion Error, please check
and unlock the security system.")
Conclusions
Expectation and Improvement
The result of our design has met our expectation, in which every sensor is working and will sound
specific alarm when the system goes into alert status. The keypad and LCD also offer great interface
and users can be familiar with our system in less than few seconds.
If we have chance to design this project again, we will add a phone dialer chip like the Zarlink MT8880C
we mentioned before. By doing so, we can make sure if no one is at home or if no one is around the
area, someone else can be notified to take immediate action. In addition, we feel like our PORTB is a
little bit wasted. We only have 4 output patterns but we are using all 8 pins. Next time we will use 74LS
series chip together with only 2 output pins from MCP, so together we can save 6 I/O pins. Besides, we
will like to have another small microcontroller at a higher frequency, so we can output our buzz alarm
at a higher frequency tone.
Intellectual Property
Besides the reference circuit from ISD1420 chip specification, reference keypad decode scheme from
lab 3, and temperature sensor circuit from lab 5, we have designed and coded everything on our own.
There is no code from public domain, and we did not reuse any code from the previous lab (we do
reference, but not copy). Because we are using two pre-built sensor circuits (motion and smoke
sensor), we feel like we should not pattern our whole design. However, if we take out these two parts
and only have these “inputs,” we definitely have opportunity to pattern our design.






No comments:
Post a Comment