Page 1 of 1

Complete Home Security/Monitoring System

Posted: Sat Nov 24, 2012 8:01 pm
by VinceBrowning
- So I have the intent of making a complete home security system with the Raspi as the brain. I want to have sensors on each door and window, cameras at each outer door and one in the garage, motion sensor lights on the corners of the house and a control panel that houses the raspi, a touch screen, and any other necessary components. There will also be an alarm system, email notification, and any other whistles and bells that may be worth the while.

- The Control/Information Panel will hold the touch screen monitor which would display a layout of my house. The windows and doors on that display will show green for secure/good and red for unsecured/etc. I want to make sure that I can bring up an on screen keyboard to enter the passphrase to arm/disarm the system (to include a distress code). I am also going to unsure that I have access to at least one external USB port so as to be able to hook up a wireless keyboard and mouse (or other devices) for maintenance.

- And the problems: I have a strong foundation in computer networking and communications... I know little on programming and null on graphics design. I would like help from the community to help me to learn how to write the software I need (I have an easier time learning things when given some direct help and attention with the subject).

- As I am a huge fan of open source software (not that I've ever actually looked at the source code of any of it), I would love to post a complete how to and source collection from the project.

Any help with this would be greatly appreciated. I would be ok with email support, as that is easiest for me. However I prefer help through the forum so that others who may want to do something similar are able to use what I've learned, and input their ideas as well.

Re: Complete Home Security/Monitoring System

Posted: Sat Nov 24, 2012 11:01 pm
by VinceBrowning
I have the help to place and wire all sensors. I have friends in many residential wiring businesses in my home town. So getting power to the system would be fairly easy. My concern is the coding of the monitoring software and the GUI for the touch display.

Could anyone help start me off by at least suggesting the language in which to write the code? An possibly pointing me to some similar code that could give me ideas or a foundation for this project?

Re: Complete Home Security/Monitoring System

Posted: Sun Nov 25, 2012 12:40 am
by Mursili
I am also interested in something like what you are proposing to do, but perhaps not as complete. I do not know about the graphical representation of the security condition of the house.

I am pretty new to this as well, but it seems that python is a powerful language for doing what you are proposing. I do not know if it can easily handle the graphics that you are talking about, but it seems well recommended.

I intend to use various online tutorials to get a grounding in python in the near future.

Re: Complete Home Security/Monitoring System

Posted: Sun Nov 25, 2012 1:00 am
by VinceBrowning
I have been looking into some python coding as well. I'm not sure how to code a GUI at all. But I do have the background for it which is a scale, home made outline of my house that has every doorway and window as well as the proposed locations of cameras and motion detectors. I'm going to study and practice with python some more. Should you come up with or find anything that could help, no matter how small, please post it. Everything can help, even if its not good for me it may benefit someone else.

Re: Complete Home Security/Monitoring System

Posted: Sun Nov 25, 2012 3:10 am
by VinceBrowning
I've found a forum post here which has some python code for checking the status of sensors. Due to my lack of knowledge and experience with coding, I'm not sure if this would continuously monitor the status of the sensors or if you have to manually check/refresh the status. I assume that it auto refreshes as fast as the CPU will allow, since it is an alarm system... any comments to better explain the second example from the first post of source code? The better I understand it, the better I can write my own code.

Re: Complete Home Security/Monitoring System

Posted: Sun Nov 25, 2012 12:01 pm
by Steven Boelens
Hi Vince,

I am doing something similar. I have a lot more experience using C / C++ / C# than Python so I choose C++ and not Python. My design of the home security system is just a fraction different. I don't plan to use a RPi just for the central node, but for most nodes. I have four doors and a number of windows that I need to monitor. Not each sensor will have it's own Pi but there will be multiple RPi's in the system. The system will also include smoke detectors and I am still considering including home automation in the same system as well (central heating and air conditioning, lighting etc). But perhaps it would be better to keep those separate.

So my system uses several RPi's. I think I am going to start with a architecture with a central system as this is probably the easiest to build. But I would like to have a system that doesn't rely on a single central node. I would like to have a mesh networked system in which all RPi's monitor all the other RPi's and all include a function to sound the alarm for example. With one central node the system is completely out of order if that central node is compromised. But with all the RPi's functioning like the central node it would by practically impossible to disarm the system using physical tools (cutting wires and the likes). In the central system cutting a wire (the correct one) to the central RPi could potentially disarm the entire system.

So my RPi's are going to require a lot of communication using sockets and the likes. I know that this is possible using C / C++ but I don't know if this is possible and practical in Python. Stuff I need are TCP/IP sockets but also UDP and broadcast functionality for autodiscovery of the mesh of RPi's.

Considering timing of the project: I am not in a very great rush to complete the stuff. I also want to include several cameras in the system as well (RPi's of course). And since these are not available yet I am taking things slow at the moment and doing a lot of other stuff in between.

I am very interested in how your project is going. Which camera's are you going to use? Are you going to do motion detection on the cameras as well?

Succes, Steven.

Re: Complete Home Security/Monitoring System

Posted: Sun Nov 25, 2012 12:42 pm
by ghans -
The author explains why the hard way is the esier way in the long term.


Re: Complete Home Security/Monitoring System

Posted: Sun Nov 25, 2012 12:57 pm
by scruss
It doesn't have the GUI you want, but wouldn't the (extremely mature) home automation package MisterHouse be able to do most of the work?

Re: Complete Home Security/Monitoring System

Posted: Sun Nov 25, 2012 3:41 pm
by VinceBrowning
It doesn't have the GUI you want, but wouldn't the (extremely mature) home automation package MisterHouse be able to do most of the work?
What doesn't have a GUI? The code I was asking about? I know that much. I'm working my way up to a GUI. I still need to write the scripts for monitoring all sensors. Once that's complete, I'll be jumping into the GUI.

I'm very interested in what you come up with. I especially like bringing in smoke detectors and the like. So long as their functionality is not compromised should the security system be compromised or for any reason be non functional. Please keep me updated on your work. If you have the time to help me learn c/c++ I would love to learn from an actual person. We could perhaps work closely together on the project. I honestly don't care which language I do this in so long as it works and I learn some coding from it.

Also Steve, the idea of a multiple pi, decentralized system also sounds great. I maybe forced to go that route as I have many doors and windows. I am also considering sensors on inside doors, and motion detectors in each room to track movement from room to room. Overkill, I know. I would like To go all out I can. I guess that's something easily added on later, once we have the foundation in place.

Not sure if this forum will give you access to my email, if so, please email me if you would like to work on this together. Just a warning though, I do intend to post code for others, so they too can use it.

Re: Complete Home Security/Monitoring System

Posted: Mon Nov 26, 2012 3:02 am
by DMShropshire
I like this. Please keep us up to date on the progress. I am also building a security system from scratch. Brand new to the programming game, i have already started with python. Managed to get my contacts working and reporting alarms today. Still on the very basic right now. I am a security tech for commercial business, so anyway I can help with ideas, wiring, troubles, and functions lemme know.

Re: Complete Home Security/Monitoring System

Posted: Mon Nov 26, 2012 5:12 pm
by Steven Boelens
As I mentioned I am currently not in a hurry to finish this as the camera which I intend to include isn't available yet. So I'm taking things nice and slow.

There are several other security system projects mentioned in the forum. I like the process of making it myself so I haven't been digging in too many projects yet. I have seen Python security projects in the forum as well (if you prefer Python).

@DMShropshire: I'll post some updates every now and then.

@Vince: Good to read that you are enthusiastic too. For learning a programming language like C++ you can check several online tutorials. I personally don't have any experience with these so there isn't a particular one I can recommend. I used "the C++ programming language" a long time ago to learn the language but that isn't really a learning book, more a reference index. I'm sure there must be better resources available now (both online and in print).

If you are going to do C / C++ coding for the RPi you might consider setting up a cross compiling tool chain. For small C++ programs compiling these on the RPi is quite doable, but for larger projects compiling on the RPi becomes quite slow. The stuff I have now takes about 40 seconds to compile on the RPi but only takes 2 seconds on my cross compiling tool chain on Ubuntu. If you do frequent compilations this is a big difference.

If you want something to work towards when learning I would recommend starting with monitoring and controlling the GPIO pins using the WiringPi library. Other very useful fields are C++ threading and also socket communication in C++.

If you need to you can PM me (see the button below the posts).


Re: Complete Home Security/Monitoring System

Posted: Mon Nov 26, 2012 6:04 pm
by tedhale
I have had several variations of this running at home for over ten years.
Now I am converting the system to use a RasPi.

The system has 8 inputs for hard wired motion detectors and door sensors.
Also, 4 relays for output
Serial port connected to a CM11a X10 interface.
There are several X10 motion detectors and I will be adding X10 door sensors soon.
And of course, lots of X10 light controllers.
I would like to add a camera but haven't done much with that yet.

There is more detail on my blog (see signature, below)
It is more focused on the hardware part than the software.

This thread might be a good place to bounce around ideas for this type of project.

Re: Complete Home Security/Monitoring System

Posted: Wed Nov 28, 2012 12:56 pm
by Mantrid
with regards to a GUI i literally just have a VERY simple PHP (password-protected) dashboard set up on my webserver and a daemon running on each pi monitors a mysql database or lockfiles on the webserver to find out if it should keep the cameras forced on/off or during scheduled hours. images are uploaded to the server as they're captured (in case the pi gets nicked itself) which can be viewed or deleted from the dashboard

An advantage of it being so simple is that I can literally control the (currently 2) cameras from my smartphone with very short load times and few screen-taps

Python daemon looping on the pi to control the application motion, php on the webserver. Not very flash but does the job

As you can see I am absolutley hopeless at both aesthetic design and php but hey, if it works ship it. No doubt I'll get bored in another day or so and break it by adding new stuff anyway ;)

Re: Complete Home Security/Monitoring System

Posted: Sun Dec 23, 2012 7:02 pm
by jvoo
I've been reading the forum posts with great interest. Seems to me for home security, getting a message to me via cellular if the internet is out is of utmost importance. Since AdamOutler and trevd has been able to statically compile adb for RPI, has anyone tested their system by plugging up their Android smartphone to their RPI and sending a SMS via command line using adb (ie independent of the internet and an email SMS gateway)?

Re: Complete Home Security/Monitoring System

Posted: Sun Dec 23, 2012 8:07 pm
by Mantrid
Theres a package called i think smstools or something, theres a few guides online if you google for that with a list of compatible phones to use as a gsm modem. got an old nokia for fifteen quid, gonna try setting it up after christmas

Re: Complete Home Security/Monitoring System

Posted: Wed Dec 26, 2012 4:56 am
by haimiko
How about using bluetooth to access a cellphone placed on the premises to do the remote dialing/SMS/email?

I have a lot of experience with PHP and was planning on writing a web based UI for the system.
I'm really new to RPi though. I know we can break out upto 16 GPIO (or alarm zones), but what are our options if we want more than that? Do we need to couple with an Arduino ?

I would personally like to make this an alarm with a home automation system to control lights...etc.

Re: Complete Home Security/Monitoring System

Posted: Mon Dec 31, 2012 1:56 am
by ktaylor89
Hello everyone, I was happy to see a post like this for the Raspberry Pi. I've actually been working on something like this using the beaglebone as the controller for quite some time. I'm tempted to move stuff over to the RPi simply because of cost and reliability.

I've actually written a good deal of python code for the beaglebone that polls the existing ADT magnetic sensors in my doors and windows. The python code can be found here:

One of the most difficult challenges to overcome in a system like this was minimizing interference from the homes 120V electrical system. Because the GPIO pins on the beaglebone operate on 3.3V I ran into an issue when I turned on some high draw devices like ceiling fans. It would end up causing enough interference that the beaglebone would record that the reference voltage from the magnetic switches would drop to a point in which it would look as if the door or window had been opened.

Two solutions exist to solve this problem. The first would be to raise the reference voltage to something that would be less susceptible to high frequency noise caused from a home electrical system. This would ultimately require dropping the reference voltage back down to 3.3V when it reached the beaglebones GPIO pin.

The second solution was to install a low pass filter on each of the GPIO pins thus negating the interference all together. This solution is the one I went with and you can find the PCB designs on my github page.

My ultimate goal for this system is to make something far beyond the current home security systems that companies like ADT offer. The biggest of which is constant logging of the entires in and out of the home that would eventually lead to a pattern recognition learning algorithm that would be able to intelligently determine what the likelihood of an entry or exit would occur at any given moment.

I'd love an opportunity to work with some of you designing a more well rounded alarm system. If you're interested in talking more post a reply or send an email to


Re: Complete Home Security/Monitoring System

Posted: Mon Dec 31, 2012 2:57 am
by haimiko
Sweet. Have you tried placing a 4.7Kohm resistor between the sensor and the GPIO? That's what usually works for standard alarm systems.

What were you planning on using for a user interface? I was thinking of buying a cheap $100 android tablet and mount to the wall , then with the aid of a web UI create a virtual keypad and menu driven system and status.

Re: Complete Home Security/Monitoring System

Posted: Thu Jan 03, 2013 12:56 am
by ktaylor89
The low pass filter seems to do the job just fine without any additional parts. I'm developing a web interface for overall status pane of the system. It'll include a function to arm the system. My goal was to use old touch screen phones like iPhone 3G's at each of the entry points and a larger tablet like device in the master bedroom.

The good bit is that with an existing alarm the control panels already have a minimum of four wires running to them. Perfect for a little USB power to charge the tablet/mobile device on the wall.

The real big hurtle with my project is the pattern detection software to predict entires. It'll likely be the last step in this project.

Re: Complete Home Security/Monitoring System

Posted: Sun Jan 13, 2013 3:49 am
by J0el
This is a fantastic idea and a great alternative to the costly home security systems. However there are a lot of great ideas here that makes the project scattered. For example I can't program so if we organize one person maps out the hardware requirements and one person writes software etc..

Should we start a Facebook Page? I'd love to have it run off wifi, have motion sensors and window/door sensors. It would be awesome to have the Web server call 911 with a prerecorded message with all your info

Shall we organize this and plan how we make it?

Re: Complete Home Security/Monitoring System

Posted: Mon Jan 14, 2013 5:38 pm
by tedhale
Typically, a pre-recorded message sent to 911 will be ignored. That is their policy.
They may send an officer to check it out, or not, depending on the localities resources.

Re: Complete Home Security/Monitoring System

Posted: Sat Jan 19, 2013 3:04 am
by Frostthejack
I am very interested in this as well and intend to start setting up a security system using the raspberry pi however there does not seem to be a lot of information out there on how to go about doing this.

So I have put together a Google groups page and am currently working on putting together a website to collect all the information I can so that when I am able to start working on this I'll now how to and so that others looking to get into this can as well.

I am posting here in hopes that some one will read this and help out in any way they can weather by posting on the Google groups page or maybe emailing me information they are willing to share. Any help would be greatly appreciated.

That is a link to the website. Right now I am just using it as a place holder until I can gather enough information to start posting on it. If you visit the website there is a button at the top that says forums on it. that will take you to the Google groups page which i have set up to work as a web forum.

If this idea takes off well I might look into buying a domain and setting up an official site from scratch.

Re: Complete Home Security/Monitoring System

Posted: Thu Mar 07, 2013 1:54 pm
by ChrisLeeBeer
Im interested in this project but would need a lot of help.
I only have experience in PHP, a webbased interface would be an option for me,
But i am willing to learn and contribute in any way.

contact me :

Re: Complete Home Security/Monitoring System

Posted: Fri Apr 05, 2013 4:24 pm
by work247

I am very interested in this idea/project.

One in five US household already has home security system installed. It will be cool if people could take out the control board and connect sensors to adapters/GPIO to Pi with a web/mobile interface to control/monitor. With smart phones, most people can check home security anywhere anytime. People can call police (or neighbor) if needed when away from home.

By reading specs from different manufactures, it seems to be we will have to deal with different signal format like Contact ID, or ZigBee.

It will be nice to have a board/adapter to normalize those different signal formats so we can abstract that from management application in Pi. Apparently. someone was thinking that already -

I am a software guy but can be very hands on hardware/wiring. I want to know if people with more industry experience would lead up an open source project.

I bought a Pi for my 10 year old as he asked for his birthday gift. He wanted to build a super computer someday with stack of Pi's but I want to contribute $30 each month to his college fund first. :-)

Re: Complete Home Security/Monitoring System

Posted: Fri Apr 05, 2013 11:01 pm
by Gadjetnut
If you are building an alarm system, please check out this website:

They have full instructions on how to create an alarm system with email alerts, web based dashboard to view and control you alarm. No fees.