Hi all,
I always wanted to build my own version of a Home alarm system for my house.
First things first, let me just say that the house was pre-wired for an alarm system during it was built.
So other than the doors/Windows traps ( N.O. reed switches) there is a 4-wire shielded cable going to each room for the PIR traps.
There are also the same type of cables for the keyboard and the external siren.
Now to the point. While a conventional type of alarm would still be complicated but within my design capabilities (I'm being overconfident here), I would like to take advantage of the existing cabling infrastructure to gather also Temperature/Humidity data. The reasoning behind this is that in the future I might also want to control the air-conditioning in each room, either based on those data, or remotely via WEB or SMS (but thats way ahead in the future).
As the whole construction needs to have the highest WAF** possible, I need to be using as less additional to the alarm components as possible, meaning that it would be ideal if the additional components fit inside the plastic cover of the PIR sensor it self, or they fit in a small plastic box that the PIR will be mounted on (like a plastic wall mount for the PIR).
**WAF: Wife Acceptance Factor
I came up with the bellow block diagram (seems like Arduino forum automatically resize the image):
On the far right you see the PIR and the Humidity/Temperature sensor. The sensor is a HUT21D sensor using I2C for communication. It is far more reliable and accurate than the cheep DHT's are. The way I'm planning it is that a small uC like ATTiny85 sits in a small box, or even inside the PRI plastic cover and handles communication with the HUT21D and at the same time senses the NO switch of the PIR sensor.
The ATTiny on the Room Unit, communicates via Serial to another ATtiny (or similar) to the main Unit. This is done, as there will be 4 such sensors and concurrent serial communication can be troublesome if the main uC is not equipted with 4 UARTS (plus at least one more needed for keyboard).
The ATTiny's of the main unit will act as slaves on a I2C bus, where the main uC ATMega328 will read their data and at the same time sense the other Window/Door traps and the keyboard and act as the heart of the alarm.
Now, what I want is for the temperature/Humidity data to end up on the Raspberry Pi. The Pi is already connected through the SPI with an nRF24L01 module and communicates with a ATTiny which in turns controls the communication with a HUT21D outside the house. There is also Network connectivity there (not shown) so the Pi will host a small internal web server to display statistics.
So that is what I have till now. I would like your thoughts/experiences on what I plan so far and more:
- Is what I plan so far feasible? Can the ATTiny work with I2C and SerialSoftware concurently?
- Will internal clock on the ATTiny be sufficient, or is it better to have an external clock? will that leave pins available? (MainUnit -> RoomUnit might be the future I was telling you about)...
- Anyone having any experience with Alarm keyboards? As WAF is a major pain here, I'm thinking of going with a commercial keyboard/LCD and either hack it, or try to understand its protocol...
- Any suggestions on how to connect to the Raspberry? Serial? I2C slave, SPI?
- Any suggestions on how to connect the siren?
Thank you all for even spending the time to read this!