11 ms·
Raspberry Pi security alarm – the basics
- sgt 4y agoYou shouldn't have to need an alarm in Norway though...
- thomasjsn 4y agoMaybe, but now I have one :) It has uses outside the security aspect as well; water alarm, door open notifications, home automations, it's fun and a great learning experience. Seeing how many people have expensive monitored alarm systems here; I'm pretty happy with my educational and cheap setup :)
- sgt 4y agoAbsolutely, great work
- momirlan 4y agoyou haven't seen enough scandi noir films...
- twothamendment 4y agoNice! I really didn't want a company involved in my security, but I knew I didn't have time to build something like this. I went the lazy way and used an Ademco Vista 20p. It is old school, but solid. I wanted to make it a little more friendly so I went with an AD2USB virtual terminal and raspberry pi. There is a python library for it and from there you can do whatever you want and the clucky old alarm system doesn't know the difference between you arming the alarm at the keypad or a cron job arming the alarm. Of course you also get all the events happening on the system.
- billfor 4y agoYeah the Ademco Vista series with the AlarmDecoder bridge is great for hardwired alarms as well as the Ademco remote sensors, and then can be handled through Home Assistant, OpenHab, or similar. One benefit of using conventional hardware is that you can connect it to an official alarm monitoring service and satisfy the requirement for a discount on your home insurance. Not sure if a completely DIY system can qualify for insurance purposes.
- deleted 4y ago[deleted]
- mastermedo 4y agoReally cool project! I always thought the most important thing about home security alarms is calling the police and filming the outside and inside of a house while transmitting the video feed live somewhere. Reading this post I was coming up with so many questions. 1. Shouldn’t there be a way for police to turn it off? 2. What are the legal consequences of the alarm accidentally firing and disturbing the neighbors at night? 3. Do sound alarms deter only small burglars?
- stacktrust 4y agohttps://historicbostonedison.org/Verified-Alarm-Response https://historicbostonedison.org/Verified-Alarm-Response /2011/ > The Detroit Police Department no longer responds routinely to house alarms, because 98% of house alarms are false. Detroit Police officers will respond ONLY to house alarms that can be VERIFIED as not being false alarms ... DPD recognizes four different ways that an alarm can be automatically verified ... An alarm system sends one signal from a door, window, or other perimeter/exterior sensor AND sends one signal from some sensor inside a house. An alarm system sends three signals from one or more interior sensors. An alarm system sends an audio signal that lets a company monitor hear an intruder. An alarm system sends a visual signal that lets a company monitor see an intruder. > Do sound alarms deter only small burglars? What deters non-small (organized?) burglars?
- atoav 4y agoLooking more expensive (cost/time vs expected gains) than comparable targets in the visible vicinity.
- CrLf 4y agoBut not so much that you start looking like a lottery ticket. ;)
- mastermedo 4y ago> What deters non-small (organized?) burglars? I think organized criminals would call off an operation if circumstances they haven’t predicted occur. Especially those that significantly increase the time or reduce the chances the operation will be successful. One thing is having the inside doors lock. Another is encountering an armed individual. Finding non-portable hard to open safes, etc. But then again, it’s mostly better to diversify where you keep your belongings so you don’t end up a victim of organized crime in the first place.
- mdturnerphys 4y agoIf I were to do this I'd probably start with a system from Unipi [0], either their Raspberry Pi add-on board or one of their PLCs. They're pretty handy and more versatile than standard PLC systems. [0] https://www.unipi.technology/ https://www.unipi.technology/
- serf 4y agoI was going to use a Unipi for a boat project awhile ago, but I felt silly spending 350+ on an RPi.. now that it's been a bit longer the price is a lot more attractive, given the inflated RPi costs.
- jpe90 4y agoWow! This is such a thorough post! I slapped together similar (but much less impressive) take on this theme very recently. I use VNC for remote access rather than SSH'ing into my home network directly. Do you opt to just forward a port on your router and send it to your pi's SSH port? I wasn't sure how risky that would be or what options exist for that. Also I noticed you mentioned a water sensor at the end, I did a similar project for that as well after I had some basement water issues. I just got a couple of super cheap humidity sensors and had them take a picture of the scene and email it to me if the sensors thought they were submerged. Great minds think alike! :) https://jeskin.net/blog/raspberry-cam-home-monitoring/ https://jeskin.net/blog/raspberry-cam-home-monitoring/
- thomasjsn 4y agoThank you :) I don't allow SSH into my home network — I only SSH into the Raspberry Pi to work on, or modify, the alarm system when I'm at home. For remote access to the alarm system itself I use Home Assistant, which communicates the the Raspberry Pi on MQTT. I'm, looking at cutting the power to the dish washer, and closing the main water valve in case of a water alarm. And there is a short siren burst every 10 seconds. But this is still very much a work in progress :) Nice project :)
- imhoguy 4y agoNot GP but may be helpful to someone: I wouldn't expose any home-net service to the Internet except Wireguard VPN. It listens on connection-less UDP and only responds to clients with recognized auth key. On the router you just forward UDP port to the machine with WG. There are clients for Windows, Mac, smartphones.
- neilv 4y agoJuxtaposed with the modern RasPi and Arduino, is bits of old-school: generic breadboard, through-the-hole soldering of rows of resistors, socketed DIPs... It's great that random hobbyists can send out to have a one-off fabrication of a slick PCB. But it's also nice when we can DIY more things.
- thomasjsn 4y agoI really like simple strip boards, as it allows me to make modifications after the fact. And I don't have the patience to wait for PCBs to arrive from China :p
- nonrandomstring 4y agoThis is an excellent article, detailed and thoughtful. Thanks. Got me thinking about some business things, and apologies if this goes off topic.... 50 years ago there were a wealth of books for electronic hobbyists to build things like this - home automation, home security, plant irrigation systems and suchlike. Later an industry sprang up to make products for this market which was initially niche and geeky. Small companies became big companies. Big companies became shitty, extractive, exploitative monopoly companies as the author describes. Today we lament an apparent choice between "convenience" and "too much work to do yourself". The cynics and naysayers are always keen to point out just how few people can accomplish anything like this - and that is indeed true. But between the lonely hobbyist with soldering iron in hand, and the big technology company was an era that seems almost dead today (for many reasons like customer support and reliable sourcing). It was the kit movement. Many of the early microcomputers were in fact kits. Clive Sinclair first offered the ZX80 as a "solder it yourself" job. Heathkit hifi and music synthesisers were a big thing for a while. Many people who couldn't build a home system like this might be interested in a DIY solution if they had a big helping hand up. I wonder what happened to the kit economy and why it doesn't work as a business model any more.
- minimalist 4y agoI think the software dimension adds some fuzziness to what can be considered a complete 'kit'. For instance, I've been able to piece together a voice assistant using a Matrix Creator [0] and a home alarm retrofit using Konnected [1] that is more tailored to my needs than any commercial offering could be. Both projects can be thought of as kits, but one can take any number of paths toward setting up and maintaining the software behind the system. Furthermore, the pace of development is so quick that a particular system may lose development interest to a newer sexier project, and if your system connects with third-party APIs, that is always a moving target. So, I think the spirit of kits lives on, just in a different way :) [0]: https://www.matrix.one/products/creator https://www.matrix.one/products/creator [1]: https://konnected.io/ https://konnected.io/
- mike_d 4y ago> what happened to the kit economy Like Adadfruit, SparkFun, Jameco, Seeed Studio, Tindie, etc?
- olx_designer 4y agoA few issues with DIY Alarm system to think about: - no ESD (high voltage impulse) protection - reliable power source - compatibility with external centralized security systems protocols I guess in every country any kind of monopoly leads to inflated prices and stagnation. We also have so many outdated and cost ineffective security systems here.
- thomasjsn 4y ago> no ESD (high voltage impulse) protection From the grid? See below. On the inputs? No, you're right. > reliable power source Not included in this post, because I'm not done with it yet, is the backup battery. The entire system runs on a 7.2Ah leaf-acid battery, which is connected to an electronic charger. So the alarm system power is isolated from the mains. I'm going to document this later in the series, when I'm all done :) > compatibility with external centralized security systems protocols I didn't really consider this, but it's easy to add if needed. Any examples?
- Narkov 4y agoIt might be worth looking into the Elk M1 security platform. It is fully supported in Home Assistant and allows you to leave all the messy electronics and integration work to a (somewhat) cheap, well engineered and understood platform. It's just hardware so no monthly fees or anything.
- thomasjsn 4y agoI actually like the messy electronics and integration work :) But it does look like a really well designed product.
- egberts1 4y agoOMG! I’ve spent months googling for a near exact replacement of ADT Command control panel but with Home-Assistant.io added on, and this Elk M1 is the closest and my now perfect solution to the most diverse problems I have: * supports Home-assistant.io * phone app * cellular data hookups (got my own cellular remote monitoring thing going) * both wired and wireless zones Again, like other commentators, I leave my video stream system separate from the alarm system (vid capture is on 24/7 private cloud) Also, spent many months reverse engineering the Ademco/Honeywell/ADT Command 7” LCD control panel simply because one can buy this for $5 to $50 (they are regularly tossed out by new homeowners who wish not to bother with ADT $399/year plans). RE effort was a pretty intense but complete add-on to Vista 20P alarm panel, but I just stopped because there are no others way to connect except by doing WiFi, was looking for a direct connect.
- egberts1 4y agoThe most important attribute is the zero dependency on commercial remote monitoring station. Now you can have your own private monitoring station. Zero $/month for remote monitoring station. https://www.elkproducts.com/m1-security-automation-controls/ https://www.elkproducts.com/m1-security-automation-controls/
- scottlamb 4y agoI own one. It's good but not perfect. Some complaints: * The protocol has a lot of oddities. E.g. it sends out spurious "fully armed" messages when it's actually in the process of arming [1] so a good integration has to debounce these. (The one built into Home Assistant doesn't, last I checked. It just reports weird states. iirc it will even say "arming" long after the panel is fully armed.) The command to (dis)?arm remotely only works if the user whose code is supplied is configured in a particular way. (Can't find the reference for this right now. It might be that the keypad's "Bypass key requires User Code" can't be checked or something non-obvious like that. Whatever the setting is it makes just entering the code not start arming the panel immediately but wait for another button press. I think the serial protocol just emulates that entering the code in the keypad, which is an unfortunate choice.) * The remote programming tool is a flaky VB.NET app. The protocol for this part isn't documented, although I've reverse-engineered part of it. fwiw, I have a work-in-progress Rust crate for talking with the Elk. [2] It can be used with Home Assistant via the MQTT alarm panel integration. [3] I can definitely see the appeal of rolling your own. One problem though is that I think when talking to an alarm company, the panel is supposed to be certified in some way, which would be a significant barrier for a hobbyist design. [1] https://www.elkproducts.com/forums/topic/spurious-armed-fully-message/ https://www.elkproducts.com/forums/topic/spurious-armed-full... [2] https://github.com/scottlamb/elkm1 https://github.com/scottlamb/elkm1 [3] https://www.home-assistant.io/integrations/alarm_control_panel.mqtt/ https://www.home-assistant.io/integrations/alarm_control_pan...
- deleted 4y ago[deleted]
- Erikun 4y agoCool project. Its a shame though, I don't know what its like around the world, but in Sweden its damn hard to get a hold of Raspberry Pis at the moment.
- d_rc 4y agoGet one from ebay. There is a bunch of sellers who are stocked.
- FrostKiwi 4y agoOhh, I thought there was a critical vulnerability XD
- CrLf 4y agoFirst off, kudos to the author, awesome project and a very nice read. During the first round of lockdowns I also spent a few lazy afternoons tinkering around this idea, mostly to get the feeling of how hard it would be (https://github.com/carlosefr/pialarm https://github.com/carlosefr/pialarm). There are a few nasty requirements commercial alarm systems have to meet that I don't see mentioned in the article, namely how it protects against tampering and voltage spikes (which can be used as a form of tampering). One way to protect the controller from ESD and shorts is to use optoisolators on every input and output, which should also be dry contacts (grounded=on, floating=off) whenever possible. To detect environmental faults and tamper-inducing faults the controller can use analog inputs (which the Raspberry Pi doesn't have, but can be easily added with an MCP3008 ADC, for example) instead of digital GPIOs. This is why commercial systems need input resistors inputs added at install time depending on the particular sensor configuration. As a software person, thinking about these things gives me a much greater appreciation for people doing industrial electronics design. PS: For the average geek, an easier path is to interface a Raspberry Pi to a "dumb" commercial alarm. You can have the Raspberry Pi behave like a standard sensor input or monitor the sounder outputs.
- thomasjsn 4y agoThank you :) There is no protection against voltage spikes on the inputs, there is just the pull-up resistor on the Raspberry Pi input. So this is a weak point. I did consider both EOL resistors and optoisolators when I first got started. But decided against it. There are dedicated tamper inputs, which runs through the tamper switches in multiple devices before returning to the control cabinet. But EOL resistors would be a better and more secure option. I have thought about using something like an AVR microcontroller to read the voltage level and convert to something the Raspberry Pi could use. Maybe in the future. I can always make changes in the future — thanks for your input :)
- wildzzz 4y agoAnother weak point I've thought of, which probably applies to many alarm panels with zero knowledge of the correct pin, is what safeguards are there preventing someone from doing replay attacks on the pin entry? I would think a hardlined panel would be more secure.
- aae42 4y agoi've been wanting to build one of these for years... for basically the same reasons, it's not just in norway, those incumbent security system providers have been making out like bandits for decades
- atum47 4y agoI wrote a simple notification system using server sent events. My plan is to push a notification to my phone as soon as someone enters a perimeter. I bought the pir sensors already. Soon as I have them in place working I'll share my project. It never ceases to amaze me, everytime I think of doing something, someone beats me to it, haha. Excelent projetc by the way
- PenguinCoder 4y agoAwesome project, great write up. Your level of detail and reasonings really helps understand everything. And puts my own writing to shame.
- thomasjsn 4y agoThank you kind sir, that is great feedback. Very motivating :) I think we all have it in us to write good texts, but it takes some motivation, dedication, and practice :)
- deleted 4y ago[deleted]
- baileybrent 4y agoA significant number of homes already have wireless sensors installed. Almost all of these sensors (glass break, motion, contact, key fob, etc) can be monitored via sdr using rtl_433. I always thought it would be a pretty viable start up business to sell a security system in a box for people with existing security equipment. Connect the security system in a box and then open and close your door/window/etc to begin monitoring those wireless events. Shameless plug: I wrote the rtl_433 GE/Interlogix sensor protocol decoder.
- garfieldnate 4y agoI see a lot of advertising for SimplySafe on YouTube, and I always wonder about the privacy issues that are basically required in a product that monitors your property and requires a monthly subscription to work (so it has to phone home, right?). I think there could be a real market for selling open-source, open-hardware security systems that go through transparent security reviews, since people who care about their security might also care about their digital security. This looks great!
- thomasjsn 4y agoThanks :) There has been some reports here in Norway of alarm station employees sharing photos of nude people — caught on their own motion sensor cameras triggering the alarm…
- Mister_X 4y agoWhat a nice build and documentation, you've really put a lot of thought and useful options into this project, thanks for that. Hmmm, what's your use case for the Armed home mode? I'd likely forget it, and open a window or door triggering the alarm. Water sensor support is a great idea, as I've had a couple of old water heaters fail in the past, nice addition. I have a Raspberry Pi 3+ sitting around doing nothing, so maybe this is a project for next winter. edit: Just saw your Kids traffic light, what a fun project to teach children about traffic signals.
- thomasjsn 4y agoThank you :) We use the Armed home option at night, we do remember to turn if off, because the digital calendar and lights in the kitchen won't turn on when it's activated. Kids are always a good excuse to create silly and fun projects :D