Building my Home alarm system (Hardware Phase)
I have a house. It has prewired windows and doors that I want to use for my own purposes. I DON’T have an alarm company. I refuse to pay some monthly fee for monitoring. I just don’t feel as though I have gotten the value that I expected in the past from the security companies. Basically I’ll just pay myself and become my own 24/7/365 monitoring solution.
So after a ton of Google-Fu and trying to decide what type of system I should use to replace ADT with, I settled in on using the awesome ESP8266 chips in the NodeMCU form factor. These tiny (and cheap) little devices could be wired up to all my existing wired doors and windows and then programmed to interface with my Home Assistant home automation platform. They are about 10 bucks and have built in Wi-Fi and a good amount of support out there on the internet for DIY projects. They really are awesome once you start working with them.
Here is the part list for my project :
- 3 x NodeMCUs – https://amzn.to/2ou0NON
- 3 x MicroUSB Charging cables – https://amzn.to/2sImP1z
- 3 x Development Breadboards – https://amzn.to/2tbRTUJ
- Lots of Jumper Wires – https://amzn.to/2tcw1bR
- Button Splice connectors – https://amzn.to/2tcd2OA
- SnapPower USB charger – https://amzn.to/2sCSORp
- USB Charge Cube – https://amzn.to/37hpeRs
- Replacement Reed sensors – https://amzn.to/2sCPmpN
- Light Sensor – https://amzn.to/2txrsIu
Let’s take a look at where I started :
It was your standard alarm box. All wires from the windows and doors fed back through to the walls to this 1980’s circuit board. They were all simple reed switches (red and black) with magnets at the windows and doors. When the window/door is closed, a magnet keeps the reed switch closed and the circuit is complete. When the window/door opened, the magnet is moved away, switch is opened and the circuit is broken. Easy for 1980’s tech to understand, easy for me to understand and easy for me to get the ESPs to understand.
First thing first, rip out all the wires from the motherboard(carefully).
Hopefully they are all labeled. Mine were not so I basically just peeled them off in pairs and used a multimeter to test them. Set it to tone and then walk around opening and closing windows until the tone goes away. (side note: I found 6 windows that had broken reed switches that were permanently closed through a process of elimination). Once you identify all of your windows and doors, LABEL them!
After I had most of the physical wires labeled, I started with the NodeMCUs. There are a ton of great resources around to explain how to program the NodeMCUs so I’ll let you find your own way through that but will give you the high level points :
I had 22 windows/doors but bundled a few together for a total of 17 zones. I purchased 3 NodeMCUs from amazon and figured I would could do 7 zones on each one of them.
I used ESPEASY software to flash and configure the NodeMCUs. You can see what GPIO pins I used in the diagram to the right. Green were good, but the red Xs gave me issues. This may have to do with my novice understanding of the whole ESP8266 architecture and microelectronics in general.
I used MQTT to talk back to my Home Assistant. If you don’t know about MQTT, it is a machine to machine messaging protocol. Super lightweight and perfect for these types of communications.
The way ESPEASY works in my set up is that every time a reed sensor is tripped (circuit broken), it will update MQTT. Home Assistant is configured to watch those MQTT topics and act accordingly when it detects a change. (window opening or closing). Based on that information, HA will do things.
ESPEASY uses a very nice web interface to do all of the configuration. It was pretty easy to use once the flashing was completed.
Once the NodeMCUs were flashed and configured, I started wiring them up.
Since I don’t like soldering (I’m not good at it), I decided to go with breadboards and wire jumper connections. It made it super easy to connect everything in. Plus if one of my ESPs goes bad, I can just pop it out and replace with a new one. The wiring was pretty easy. All the grounds (black) would be bundled together and then put to a GND on the NodeMCU, and each of the reds would go to a GPIO pin on the boards.
With everything wired up and tested, I removed the old motherboard and carefully put everything back into my alarm case.
The end result in Home Assistant was this:
It’s not the prettiest interface (I’m working on fixing that anyway) but it is WAAY more flexible than anything else I could have gotten. I have 17 zones that I can now use for input for various things in my Smart Home.
The Home Assistant code for all of this is located here :
One of the first automations I put in place was to turn off the HVAC systems if any of the openings were open for more than 5 minutes. Then make a short announcement and wait to turn the HVAC back on when the window/door was closed. I love it!
: –: : –: : – – – – – – – – – – – – – – – – – : : : : : –: : : : –: : : : : 1
The home assistant code is all based on YAML and is pretty easy to learn and write for. At some point in the future, I’ll have to do a quick write up on the main Home Assistant system running on my raspberry Pi.
So that’s about it; I ripped out my old alarm system, replaced it with 3 ESP8266 NodeMCU chips, stuffed it back into the old case, integrated it with Home Assistant and then started writing automations using my new sensors.
I built all of this a while ago and I have been running with it without issue. In fact, it works incredibly well.
Since then, I have also added in a light sensor to know if someone opens the panel case.
There is a ton of potential with this system and I plan to keep building it out but for now, this should get you started. I feel like this post might have been all over the place so if there are any BIG items I may have missed or glossed over, feel free to hit me up on twitter. Also be sure to visit my new YouTube channel and consider subscribing. It is all about Home Automation and my Bear Stone Smart Home Project.