0% found this document useful (0 votes)
115 views

Embedded Home Security System: Design, Implementations, and Overview

The document describes an embedded home security system prototype created by the authors. The prototype uses an Arduino Mega microcontroller along with various sensors like PIR motion sensors, magnetic door/window switches, keypads, and cameras to detect intrusions and notify homeowners. The system is designed to be affordable and provide basic security features like motion detection, door/window alerts, and video recording. A computer interface allows users to monitor the system and receive alerts. The prototype demonstrated the feasibility of an inexpensive DIY security platform but had some limitations around wireless capabilities and automated features.

Uploaded by

Hafza Ghafoor
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views

Embedded Home Security System: Design, Implementations, and Overview

The document describes an embedded home security system prototype created by the authors. The prototype uses an Arduino Mega microcontroller along with various sensors like PIR motion sensors, magnetic door/window switches, keypads, and cameras to detect intrusions and notify homeowners. The system is designed to be affordable and provide basic security features like motion detection, door/window alerts, and video recording. A computer interface allows users to monitor the system and receive alerts. The prototype demonstrated the feasibility of an inexpensive DIY security platform but had some limitations around wireless capabilities and automated features.

Uploaded by

Hafza Ghafoor
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Embedded Home Security System

Design, implementations, and overview

Shawn Johnson Eric Fry


Computer Science, College of Natural Sciences Computer Science, College of Natural Sciences
Colorado State University Colorado State University
Fort Collins, United States Fort Collins, United States
[email protected]

Abstract—An exploration of feasible and practical options to into our prototype it is still something that we wish to
instantiate an integrated home security system with viable implement on our own at some point in the future. We also
communication options. would have liked to have had user control over which sensors
the system monitored. A keypad would have been beneficial in
Keywords-component; home-security, arduino, motion sensor, all removing the computer requirement, but our concern was
remote monitoring. that people have difficulties setting their thermostat and our
system obviously would have more functions. We designed a
I. MOTIVATIONS AND LIMITATIONS GUI on the computer to allow the user easy access to system
Unfortunately during tough economic times the burglary details. This also benefited the system by allowing remote
rates tend to increase. While one would like to believe that our access using Remote Desktop Connection for example.
homes are sanctuaries and that nothing bad could happen to us;
that’s simply not how the world works. We wanted to provide III. PROTOTYPE
an affordable system to deter a would-be intruder. In order to We wanted to have a working model that we could show, it
achieve this there are a few steps. First the perpetrator must be needed to be portable, and needed to operate in the same
aware that there is a system in place, second there must be overall fashion as the final product we hope to have at some
some alert to inform the home owner to allow them to make a point.
decision about the situation. Finally there must be a recording
device to track what has happened, this can later be used to aid The components we used in our prototype are as follows:
police efforts to locate the valuables you undoubtedly wish to
recover. While it may seem like there are already a slew of A. Arduino Mega
options in the field of security systems we realized how often The Arduino Mega is the driver behind our entire project,
these systems were absurdly expensive either having extreme not only does it receive and interpret signals from our sensor
hook-up fees or forcing the owner into a monthly contract devices, but it also allowed us to run the program entirely on it
which becomes very expensive with time. We want to (lacking the benefits of the GUI and inexpensive cameras of
implement a system that is both inexpensive and a onetime cost course). Our reasoning for picking the Mega was that we knew
and feel there is a real market for a solution such as ours. One for our prototype it would supply ample configurability and we
final motivation was that Eric’s mother had mentioned it would would not have to be concerned with running out of
be something she would be interested in. A limitation of this connectors. This microcontroller uses 3.3V and 5V to power
system that some may consider paranoid is our decision to have its related devices and is itself powered either by USB 500mA
all the components directly related to security to be strictly or can be powered via an external source up to 12V. We
wired. The reasoning for this is that there are options out there decided to power using USB partially due to convenience and
to scramble a large array of channels and using wireless for also the added benefit of limiting harm done to the system by
cameras for instance could be disrupted if someone were any mistakes we could potentially make in connections. The
running a Linux flashed wireless N router broadcasting freely. Mega is affordable at roughly sixty dollars.

II. EASE OF USE


One of the major pitfalls of home security systems is that
they are only valuable if used regularly and used properly. We
wanted to keep this relatively simple idea in our mind
throughout the design of this project to ensure that it will be
truly useful. We had hoped we would have scheduling
completed where one could input the hours they expected to be
out of the house and the alarm would engage and disengage
itself automatically. While this functionality did not make it
Arduino Mega
B. Computer devices and each keypad can be used with up to 10 receivers.
 Used to create a more user friendly connection to our In the presented prototype we had last minute issues with the
system. power building up and creating false positives when set with
the Arduino, essentially lacking the proper resistor to allow the
 Allowed our project to stay very inexpensive by using charge to drop to ground if it was not enabled. We did
the computer to control cameras. however get these items working with an LED to showcase
their basic function and that they interacted appropriately. The
 Provided an interface which we could use to present advantage this system offered was that the wireless keypads or
the different sensors reporting for our demonstration. remote keys could be used anywhere in the house or have one
 Gave a very polished look to our system using Swing in the bedroom, one in the garage and one at the front door.
to generate not only a GUI but also a taskbar icon. Initially we had thought of using the panic receiver as a way of
switching the system state but concerns of setting the alarm
 Send our e-mail alerts without needing to get a LAN when intending to disarm and vice-versa arose. We were able
attachment for our Arduino. to get these at about fifteen dollars each and had 3 of them to
accommodate the functions we desired.

C. Parallax PIR
This sensor is your typical passive infrared device. It
detects motion at a distance of about 20 feet. This unit is
relatively simple and has two output modes to choose from.
We chose to use the high signal when motion was present.
These have a retail cost of about ten dollars. We decided to use
two to show the sensors picking up different sides of the room.

Skylink receiver and keypad

F. Buzzer
We used a basic 3V buzzer to be used to give an audible
Parallax PIR response to the user without requiring them to use the GUI on
the computer. Predominantly for allowing the user to know
D. Normally Closed Magnetic Switch when the alarm is being armed or disarmed and giving an
This very simple object is a key component in almost every audible alert with a timer before setting the alarm to give the
home security system found. Essentially while the door or user time to lock the facility if they are leaving. This item can
window that you are monitoring is closed the current will flow be found at your local electronics store for under five dollars
through the switch. If however one opens the window or door
the current will stop and we can act appropriately. The range
on prices is quite large anywhere from two dollars to ten G. Cameras
dollars with shipping and order quantity tending to be the For our prototype we opted to go with webcams while these
limitations. do not support the final goals of our project they do make it
extremely viable as a cheap alternative. To get a real camera
system that was able to record the way we wanted would have
been at a minimum of one-hundred dollars. We used a
thirteen dollar webcam and a webcam that was borrowed in
order to implement two control styles. In total we spent
thirteen dollars on our webcam.

Our prototype had the following functionality:


Normally Closed Magnetic Switch  It was able to detect using all 4 sensors, which could
be monitored via our GUI on the computer.
E. SkyLink Universal garage door remote control  Using java and system calls we enabled the system to
This was an attempt to create a simple control scheme for send e-mail alerts if an intrusion was detected, which
the basic arm and disarm capabilities. These are easily can be forwarded to cellular telephones.
configurable as buttons which we had planned to use 1 receiver  The alarm could be enabled or disabled from either
to arm, one to disarm and finally one that would act as a panic the toolbar icon or from the application window.
switch. Each receiver is able to communicate with many
 Webcam implementations; one was an always on supplied with the motion detector to help us set the sensitivity
motion detector taking still images. The other was of the motion detectors. After that fiasco we assumed we were
set up using a command prompt implementation that relatively in the clear and all else would go as planned; all
would allow up to twenty minutes of video and audio devices had previously been tested and shown to work. But as
to be recorded. any project manager knows there will always be delays even on
the most basic of tasks. Next while implementing the garage
door keypads we discovered that they were not properly getting
IV. DIFFICULTIES grounded if the connection was supposed to be incomplete and
so charge would build up and eventually have enough to
Being computer science majors an obvious difficulty was
circumvent the button and complete the circuit enabling
the lack of working knowledge of circuits and the practice of
disabling or panicking the system periodically. We had
balancing proper voltage. This became apparent more than
encountered an issue like this before when first learning how to
once throughout this project when we learned about how to use
program on the Arduino and practicing with a simple button.
pull up and pull down resistors. Another obstacle was the
To solve this issue we added a resistor from the powered side
script that we ran contacted an SMTP mail server directly
of the button to ground. Unfortunately this didn’t work for
which was not permitted by the firewall at our university where
some reason when we were finishing up the project. We
the demonstration was given, we overcame this by using
attempted to change the resistance between the buttons and
remote desktop connection to demonstrate the ability of our
ground but either ended up sending the signal to ground always
batch files of running the webcams or sending e-mails. Setting or encountering the same period issue. These issues definitely
up the serial connection from our java program to the proper
set us back on time and prevented us from being able to present
COM port to be able to send and receive messages was
as much as we had wanted.
definitely a learning experience and required us to add a library
to our java folder (rxtx). The motion detectors seemed to be a
constant struggle for us and regrettably something we put way
too much time into. At first we felt that they worked, or at V. GRAPHICAL USER INTERFACE
least appeared to work however; we realized that it was simply
our perception that they were picking up ambient temperature The GUI we designed was to allow us to showcase our
changes since the window was open. These sensors require a current system and also support future implementations and
calibration period of about sixty seconds which can become enhancements. We kept with standard practices making sure to
quite a nuisance when you are constantly resetting them and keep common buttons in the same places among different
trying a new configuration to hope that a resistor you just screens shown in Figures 1 and 2 of the following page, and we
placed will fix your problems. Eventually we got them also made sure that the user had ample notifications if they had
working on an LED but when we set them back to the Arduino been attempting to exit the program to minimize the likelihood
we would once again receive a period signal after the first of accidentally closing the program shown in Figure 3 again on
trigger. After asking the class and looking over the breadboard the following page. We knew that users would not like to have
repeatedly we discovered that our use of the transistor for our their alarm as an open program with its own window all the
buzzer was incorrect and when the was to go off it was sending time so we tried something we hadn’t done before which was
the voltage intended for the buzzer to ground, which I believe to implement a task tray icon which the user could leave
was able to draw enough mA to turn off the motion detector, running in the background unhindered which is shown in
which stopped the grounding which in turn started the cycle Figure 4 on the following page. Some things we could
again. So we fixed this and adapted some code that was improve of the overall appearance would be to use the toolkit

Hardware Diagram
to find the resolution of the monitor that the application was VI. CODING
being displayed on and set the startup position based on that
information. Another cosmetic idea is that we are able to use Writing the code for this project was an interesting
any picture file that we would like to be our task icon and that experience and something that we could have improved
we could potentially create a logo and use it there. upon especially given our experience as Computer Science
majors. First we will talk about our Java programming
that was done for this project. We picked Java for its
cross-platform capabilities and also because it was a
familiar language with tools that we could use to debug
issues that arose.

A. Java Coding

After taking 3 years of computer science courses I was


surprised to find how much the coding practices that we have
been taught so fundamentally were ignored as we tried to
scrape the pieces together to accomplish this task in time. The
fundamentally difficult thing here was the amount of code that
we had to forge together. The main application had been
adapted from a program we wrote in another class and the
serial communication was adapted from the rxtx example.
Figure 1. Main menu The serial code was built as a hello world style program and
we needed to change that to interface with not only the main
program but the task icon as well. Initially this caused lots of
grief as we learned how to proper initialize the class to start
the connection and not call the class again while still returning
the class. Luckily once we had the connection it was
relatively easy to send data back and forth and to use a switch
statement to allow our java program to handle all of the
different type of situations we had expected. We did however
have to modify the send code for the rxtx and allow it to send
the message we wanted as opposed to a hello world that had
been hard coded in. If the code were to be expanded into the
future we would probably need to implement messages that
are longer than one byte. But for the scope of our
demonstration 256 types of messages each way was more than
enough. To implement these messages you would simply
Figure 2. Status Screen need to either create a size then message convention or
hardcode a larger size in so each send and receive will know
the size to expect and the program will not pass on the data
until the proper size has been achieved. The task icon was
something that neither of us had done before but we felt was a
worthwhile endeavour and would benefit the overall feel of
our product. Getting the main program to hide as opposed to
ending the program was something that took some
investigation as well.

B. Arduino Coding

Figure 3. Task Icon


On the Arduino side of things this was our first time computer and simply have the GUI accept calls from an
programming on a microcontroller and it was difficult to learn already designed scheduler, such as task scheduler.
what an appropriate practice was. Our program on the
B. Power Outage/Tampering Tolerance
Arduino is lacking elegance and design. Our iterative
approach to this project was good to master each set of A wise burglar in these times is likely to head behind your
required skills however our lack of understanding the in house and cut the power before entry. While we cannot
beginning lead to almost no concept of design before prevent this we can take steps to defend our homes against it.
implementing the code. Portions of our code are in methods Our most convenient solution to this problem is by introducing
that are called inside of the main loop while there are still an uninterruptable power supply to the system. Although this
sizeable code fragments in the main loop that had not been put definitely increases the installation size of our system it is a
into their own methods. Questions arose such as will the requirement that is not subject to negotiation. UPS’s from
compiler search through the entire code like java and then quality companies include USB monitoring that would allow
jump to the main and run from their or will it work more like the Arduino to detect that the main power has been lost. At
C where you must at least declare the names of all the this point design decisions about how important monitoring is
functions that you will use before the compiler reaches main. at this stage, whether the home modem should be on a UPS to
When we set an output to low does this ground the cable that keep the internet to send messages still or if the camera system
is attached to it, which we discovered later that it does. Serial should remain on all come into effect. Our recommendation is
connections on the Arduino Mega were a dream very easy to to enable all cameras and use the UPS to power them as long
use to send and receive data and there were plenty of examples as possible. If your home is being broken into we assume that
to be found in library again an easy switch statement and we the burglars will not wait 15-45 minutes after cutting the
were well on our way. The only issue with this is the way the power to enter the house and hopefully you can get an image
code looks the receive function was still done in the main loop of them. We did not have the opportunity to explore these
and made the code much more disorganized than it probably areas since moderate uninterruptable power supplies cost
should have been at our level of programming. roughly one-hundred dollars especially if you want the USB
monitoring.
VII. FUTURE WORK C. Multiple User Accounts
There were many things in this project that we had hoped to Along with the scheduling, user accounts was something
have completed before the time came to present our prototype that we really felt would put our product on the map. The
we will be taking a look at these items and why they were not ability to set different times in which certain users were
implemented and what it will take to implement them in the allowed to disable the alarm was something we truly wanted
future. to accomplish. This idea would allow you to give a password
A. Schedule based automatic activation to someone who was supposed to help around the house
(house sitting, cleaning services, et cetera) that would allow
Our vision for this is that you would input your schedule
them only to disable the alarm at times which you had set up
and the system will arm and disarm itself appropriately, one of
previously. The issues we ran into when we considered
the difficulties in doing this was we did not want to create
implementing this was that some form of database would be
false alarms in the case that someone left the windows open
required to keep the user accounts more permanent, we felt the
while they went to work one day or the back door was open
user accounts was something that would be easiest
for the dog and never got closed before arming the alarm. Our
implemented on the computer and then have our program
solution to this was to have the Arduino recognize that it was
transfer the data over.
being armed in scheduled mode and to treat sensors that were
already triggered as non alarm critical events. The other thing D. Keypad
this system could do would be to e-mail you and let you know A user keypad with LCD would really help this project
which sensors it was ignoring during that time period. This stray from the computer interface relies on at the moment.
idea had a few complications to it. First of all, it would Getting a nice enclosure for the keypad/LCD would benefit
require that the Arduino have a sense of time since eventually the prestige of our product. We spent too much time looking
we wanted this to be a truly embedded system. Since the for a keypad that matched our vision. We would have liked a
Arduino does not have a real time clock included on its chip keypad that had an onboard controller so we could abstract out
we would need to add an external real time clock or rely on each key and use them in 4 ports instead of 10. This was
the inaccurate millis() function and have it be updated simply a software convenience we were hoping to find and it
periodically from a source with a reliable time. Another help to keep the number of pins required down especially if
required component would be that the schedule must be stored future implementations use a microcontroller with lees input
so one would need to set the schedule into the EEPROM to than the Arduino Mega.
guard against users having to completely reconfigure their
home security device each time it loses power. Another E. Online Monitoring
approach to this entire problem is to keep the reliance on the While currently you can use remote desktop to connect to
your computer at home and monitor the system. A future
goal of this project is to get the data from the Arduino hosted controlled and we would need either a storage medium
on a website which can be accessed anywhere in the world. secured in the house or we would need to upload the data to a
Hopefully by using a NIC attached to our Arduino all of this web server. Both have their advantages, having a recording
will be achieved without the use of the computer. device in the home makes it possible to record vast amounts of
Inexperience with dealing with http servers and publishing our data and potentially would allow storing weeks of video
own content kept us from attempting to fulfill this goal capture, however; this system has the liability of being stolen
especially due to the relatively low impact this would have and therefore would need to be installed in a wall or be hidden
had on our prototype. This was not one our top priorities in very well. These network cameras can be found at online
this project, however it is still a goal that we feel must be retailers such as newegg.com for anywhere between $100 and
accomplished before this can be a competitive system. $500 dollars.
F. Zone Control H. Audible Alarm
On our original concept we talked about implementing In our current implementation when our alarm goes off the
zones allowing the user to effectively monitor portions of their computer has the speakers create the noise for the alarm while
house based on commands they would be able to input. The that is fine for a person who has nice speakers set up to their
largest reason this was not implemented on our prototype is computer it’s simply not the shock and awe that you hope you
due to the limited number of sensors we had. To implement alarm system will be when it is coming out of laptop speakers.
this feature in the future would not be terribly difficult if one In the future implementing a real siren would be the goal to
were to hard code into the system. Yet we want our system to achieve. With our current configuration the only power
be flexible and for the user to be able to define almost source was the Arduino which was being limited by the USB
everything. Therefore our code both on the computer and on specification of 500mA. Ideally we would want our speaker
the Arduino itself would need to be revamped and need to to be powered directly from the circuitry of the house and to
begin allowing for more dynamic controls over the sensors. simply be controlled by the Arduino.
Including which sensors are critical when the system is armed.
Furthering this would allow the user to be running multiple VIII. CONCLUSION
types of alarms simultaneously. Perhaps having an alarm that This project was a great introduction to the world of
was always on in a room seldom used by the family and yet microprocessors and a learning experience for both of us. We
containing valuables. We wanted the Zones to be able to feel the time we spent on this project was substantial and yet
control specific sets of cameras so if the motion detector went has benefits that will reach far beyond what we do in school.
off in the basement it wouldn’t have to turn on cameras all One day I would like to have a system of my own design
over the house only those involving the basement until the integrated into my own house and it would be something that I
system had discovered new sensor data in other areas. Again would enjoy creating. For our prototype we expect it to cost
this is something that we could have built into our code roughly one hundred and sixty-eight dollars however there
essentially passing different serial commands telling the were expenses not included in that such as the breadboard,
computer to run different batch scripts which controlled LEDs and generic buttons for us to explore the basic
different cameras. functionality of the Arduino with. We believe that using a less
expensive Arduino and buying some of these items online in
G. Ethernet controlled system
bulk could substantially reduce the cost of creating our
We hope that in the future we would have the Arduino system. We feel very privileged as undergraduate students to
outfitted with an Ethernet shield allowing it to communicate be able to have a project that we can present as something of
with the internet on its own. With this in mind we also want entirely our own design.
to get the cameras to be more professional and have higher
quality. We would need cameras that can be Ethernet

You might also like