Building A Home Security System With Arduino - Sample Chapter
Building A Home Security System With Arduino - Sample Chapter
ee
pl
C o m m u n i t y
D i s t i l l e d
E x p e r i e n c e
P U B L I S H I N G
Sa
m
$ 29.99 US
19.99 UK
Jorge R. Castro
technologies and open source electronics, with vast experience in software design
and programming for mobile devices. He is passionate about open source initiatives.
He also dedicates much of his time to computer security and reverse engineering
(seeking vulnerabilities in software and analysis of malware).
Preface
The Arduino Uno is an open source microcontroller built on a single circuit board
that is capable of receiving sensory input from the environment and controlling
interactive physical objects. It is also a development environment that allows
writing software for the board in the Arduino programming language. It is used for
a variety of different purposes and projects, from simple projects such as building
a thermostat, to more advanced ones such as robotics, Web servers, seismographs,
home security systems, and synthesizers.
This book will demonstrate how Arduino Uno can be used to develop a highly
connected home security system by mobilizing a network of sensors, which can
feed alerts back to an Arduino Uno when alarms are triggered.
Preface
Chapter 5, Arduino and Sensors, shows you how to work with the libraries and what
to create, import, and modify to increase the power of your code. Furthermore, we'll
integrate more sensors and circuit elements, such as MOSFET and engines, and learn
to control them.
Chapter 6, Documentation and Version Control, shows you how to document your
code, share it, keep track of its status, and maintain a backup of your code. Finally,
you'll create a simple graphical application that allows you to remotely control
your Arduino Uno.
Chapter 7, Interaction and Connectivity, talks about how to create a system for detecting
people to increase the capacity of our infrastructure. We have a brief introduction to
the key elements of this chapter. Finally, we will conclude with a practical example.
New concepts and technologies such as real-time detection of faces and people will
be introduced (artificial intelligence).
This book comes after the growing trend of hardware devices, which are available
around us for a few bucks, and more specifically all talk about the Arduino platform.
Today, we find these small boards in such varied and common places like schools,
universities, small businesses, or public agencies.
The numerous advantages are well known, such as low cost, open designs, ease
of assembly, and ability to make adjustments. That's why almost any project,
whether professional or amateur, starts with a small design on a piece of paper and
then quickly passes into the physical world using these fabulous boards. We will
implement such a technological design to create our domestic security system.
In this chapter, you will be introduced to the world of home security systems.
Also, you will be shown the difference between traditional monitoring and home
automated systems. You will also learn how they work, the requirements to install
them in your home, and how to prepare your environment.
[1]
You should delve into this book only after ensuring that you are familiar with the
basic concepts of electronics and computers, and later delve into more advanced
principles in the subsequent chapters (but no need to worry as each and every point
is carefully explained using examples, and will link a lot of information to facilitate
understanding). Remember that this book should not be completely taken as a stepby-step guide on how to create a foolproof system, but as a tool that will give you
the knowledge needed to create your own domestic system.
Safety advisory: Throughout the projects developed here, you
should always observe the highest of safety measures, always be
attentive of your surroundings, and never work alone if you do not
possess adequate knowledge of higher technicalities. Also, try to
reduce or eliminate the use of high tension electrical equipment.
[2]
Chapter 1
The hardware
The physical elements that compose an infrastructure must bear all the technical
requirements for software. They can be subdivided into three distinct subgroups.
This classification should not be understood as something exclusionary because
an element can be found in more than one category, but this separation will help
you understand the functions performed in the system:
Sensors: They will be the senses of our system, just like the senses a human
body has. Their function is to collect information from the environment,
transform it into a digital value, and deliver it to a component that is designed
to control it. The data obtained will be the input for our equipment. This group
includes cameras, sound sensors, proximity sensors, motion detection sensors,
smoke sensors, infrared sensors, and temperature sensors among others.
Actuators: If the sensors provide us with all the necessary information from
our environment, the actuators will be the muscles that allow us to perform
actions on our surroundings. Once we have made the decision to perform an
action, we send a signal and force this element to work. Examples of these
are alarms, speakers, locks, and switches.
The software
As you saw in the last paragraph of the previous point, once we have some input
data and want to produce an effect upon its receipt, we need a tool that establishes
the rules that set the behavior of our system. This is taken care of by the software
resources, which are a set of programs for your system.
More specifically, we will use programming to create our own program and store
it on our microcontroller chip. Thus, we get the extracted data that we need (for
example, monitor the temperature of a room to detect a fire), process it (calculate
the dangers if they exceed a threshold) without our intervention, and implement
the necessary measures (trigger alarms and fire extinguishing measures).
At this point, I won't specify a concrete programming language. Let's just talk about
the software as a block, and later delve into different languages and applications
(throughout this book, we will use various programming languages, such as Python).
[3]
At this point of the book, the reader will be able to identify general terms and the
elements of a system and understand its functionality. But do you exactly know what
you need to begin constructing the system? Where and how to install it? If it is the
right place for the installation? You first need to design the system.
[4]
Chapter 1
[5]
On the other hand, if installations are performed outdoors, you should keep
them safe from inclement weather, including lightning, and from poor grounding
conductors. All this can destroy the circuitry of your system and may put you in
danger as well.
Finally, if you have pets at home, be aware of it when you install your
sensors and actuators that may have been expensive. This is because
they may end up damaged and hardly repairable. Besides, if you do
not choose the correct orientation, every time your dog or cat goes
through the garden, it may activate an alarm.
Remember that you have to perform maintenance of your devices
periodically. I recommend you to set aside a few days on the calendar
to remind you and perform basic maintenance.
The other tendency may be to use the existing wiring in your home. I am referring
to the generic wiring in your house that is used to run household electrical items.
There are initiatives such as the X10 technology that connects all the rooms of a
building, provided they are on the same electrical phase. It also uses the power
lines for signaling and controls. The main disadvantage of this standard of system
is the initial economic outlay.
[6]
Chapter 1
Summary
We have reached the end of this first introductory chapter, where we detailed
the different parts of a security system without going into the exact specifications
thereof, in a theoretical way, knowing their elements and functions to perform the
same. With all this, we are ready to fully dive into the next chapter. I assure you,
it will be intense and full of interesting content.
[7]
In the next chapter, we'll learn about what Arduino is, its history, and descriptions of
the different parts on the Arduino UNO. We will also learn how they work, and how
an Arduino UNO can be extended with shields.
[8]
www.PacktPub.com
Stay Connected: