Building
a High Tech Alarm System with Raspberry Pi
Second Edition
Have you seen “Mission Impossible” with Tom Cruise? Would you like to know how to catch him with a $40.00 sensor? Then this book is for you.
This book will guide you through the building and test of a ten zone alarm system. In addition to building the hardware, we will also cover the code which runs on the Raspberry Pi. The code currently ‘speaks’ and writes English, but by following the directions in the code chapter you can easily make it speak French, Spanish, German or Dutch.
In this book we will discuss the basic components of any alarm system. All alarm systems have two basic functions. First, they monitor their environment looking for a change such as a door or window opening or someone moving about in the room. The second function of the system is to alert the human to this change. Our alarm system uses a scanning type software to detect intruders.
We will use the ‘standard’ guard dog as an analogy. In a
scanned type of system, the guard dog paces back and forth at the fence looking
out for either an intruder or someone that it recognizes. In our design, if you
have an alarm key, you can disarm the system and enter. In an interrupt driven
system, the dog is asleep until it hears an intruder (or you). It then wakes up
and deals with the situation. I have chosen the scanning method because in my
opinion the software is easier to write and explain. It can scan all ten zones
in about one second.
Also, because our alarm system runs on 12 volts, you don’t
have to be a licensed electrician to install it. If you can plug in a wall
adapter, you can build and test this alarm system.
Step 1 – The Walk-about
As the
name suggests, take a walk around the property you will be protecting, both
inside and out. Try to think like a bad guy.
Ask
yourself “If I wanted to break into this house / office / warehouse, how would
I do it?”
Take
pictures if you think it will help. Make sketches of the inside and outside of
the building so that you can plan where you are going to put your sensors.
There are several free CAD programs that will help you with this.
Here is a simple check list for you:
·
How
many doors are there?
·
What
type of doors are they? Garage doors? Human entry doors? Pet doors? (Seriously
burglars have used children)
·
How
many windows are there? How many open?
·
How
many windows on the ground floor and how many on the second floor? (Burglars
use portable ladders)
·
Is
there a hedge or a privacy fence. (Burglars love cedar hedges and privacy
fences.)
·
Once
the burglar is inside, where can they go from there? (Main hallway, kitchen
door, patio door)
·
How
many rooms are there that you will have to protect?
·
Is
everything on the same floor or is there more than one floor.
·
What
about special alarms? Panic alarm in the bedroom? Smoke alarm in the kitchen?
Flood alarm in the basement? Heat detector in the garage?
Table of Contents:
Chapter 1:
In chapter 1 we discuss the basic components of most alarm
systems. From simple door and window contacts to more sophisticated sensors
like Passive Infra-Red (PIR) motion sensors. (Remember Tom Cruise and the
$40.00 sensor?) In addition to the eight alarm zones there are two Fire Zones.
These zones are connected to heat rise or smoke detectors. These zones are
designed to alert the human of a fire, even if the system is disarmed.
Chapter 2
In chapter 2 we learn how the hardware that is connected to
the sensors works. How does the hardware detect motion or a door or window
opening? How does the hardware detect a cut alarm system wire? How does the
system detect a shorted sensor?
Chapter 3
Chapter 3 is about the ‘Human Interface’. In this chapter we
discuss how the system interacts with the outside world. System messages such
as “System Armed” are sent to a two line liquid crystal display. The system
also talks to the world using the stereo speakers attached to the Raspberry Pi.
As I said before, the default language is English. This can be changed to
French, Spanish, German or Dutch by the system designer. An alarm key or
optional RFID card reader can be used to arm or disarm the system.
Chapter 4
Chapter 4 describes the software in detail. The software has
a two minute entry and exit delay via zone 1. The latest version of the
software allows for a USB video camera to be connected to the alarm system. The
Motion software package also includes motion detection and video capture.
Chapter 5
Chapter covers the assembly of the main printed circuit
board of the alarm system. Thru hole parts are used thru out the design so
advanced soldering skills are not required.
Chapter 6
In chapter 6 we construct and test the harnesses which
connect the human interfaces to the alarm system. Details of how the PIR motion
sensors, door/window contacts are connected to the system. What the heck is an
‘end of line resistor’ and what does it do? The alarm system board is tested
using push button switches.
Chapter 7
Chapter 7 describes four typical scenarios. The planning of
an alarm system to protect a two story, four bedroom house; a restaurant or
pub; an office space and a laboratory. These are ‘typical scenarios’ because no
two installations are the same.
Chapter 8
This chapter describes some future enhancements to the
system for more advanced users. Other sensors which can be used with the alarm
system are described in detail. Instructions for running the alarm system
“headless” (No keyboard, monitor or mouse required.) are also provided.
Chapter 9
This chapter describes in detail an expansion board which
can be built and attached to an existing alarm system board. The expansion
board uses I2C technology to communicate with the alarm panel. The system is
capable of addressing up to six expansion boards. Each expansion board has
eight inputs and eight outputs. The alarm inputs on the expansion board are
identical to the ones on the main board. The eight outputs are solid state
relays capable of sinking two amperes at twenty four volts or forty eight watts.
It is my hope that you will enjoy reading this book as much
as I enjoyed writing it.
Author Bio:
William (Bill) Pretty
Bill
began his career in electronics in the early 80’s with a small telecom
startup company that would eventually become a large multinational. He
left there to pursue a career in commercial aviation in Canada’s north. From there he joined the Ontario Center for
Microelectronics, a provincially funded research and development center. Bill
left there for a career in the military as a civilian contractor at what was
then called Defense Research Establishment Ottawa. That began a career which
was to span over 30 years.
Over
the years Bill has acquired extensive knowledge in the field of technical
security and started his own company in 2010. That company was called William
Pretty Security Inc. and provided support in the form of research and
development, to various law enforcement and private security agencies.
In
2014 he retired to pursue a career in writing. He has several books for sale on
Amazon, for the electronics hobbyist.
Comments
Post a Comment