Ideas - dsebastien/openSourceAlarm GitHub Wiki
Kixounet's ideas
Links to check
- Projet open source interessant pour puiser des idées : http://jeedom.fr (Merci à Jean B...) pour ces conseils
Almex's ideas
Low-cost security camera
- made with Raspberry Pi
- and its NoIR camera
- Pi-Pan for pan and tilt
- Refrences : http://www.sonsoftone.com/?page_id=287
Power Over Ethernet
- Via a PoE splitter : simple but not well integrated example1
- Via a homemade board : cheap but not well integrated example1
- Via a dedicated board : expensive but well integrated Xtronix Adapter PCB +/-70€ NoName +/- 60€
NovoSIP
Seb's ideas
General idea
Either a system focused on security or a general purpose home automation system. Depending on the chosen architecture, both might not be incompatible.
Architecture
- central system
- manage all controllers (see below)
- manage the configuration of the whole system
- manage the orchestration & automation (i.e., the smart stuff :p)
- run a Web server
- expose its features through a Restful API
- expose all system features
- allow development of different clients (e.g., Web, Android, ...)
- expose its features through a Web-based UI
- stand-alone controllers (wired or wireless)
- announces itself to the central system on startup
- for example: state version, supported features, list connected sensors/actuators, state battery status, ...
- monitor/control 1-n sensors/actuators
- alert the central system (e.g., state change, low battery, ...)
- respond to the central system requests (e.g., current state, battery state, ...)
- announces itself to the central system on startup
- stand-alone gateway
- act as.. gateway between the central system and the stand-alone controllers
- bonds the wireless & wired (IP) networks together
- should cost as little as possible given the limited role in the overall system
- Example: Arduino with an ethernet shield or something cheaper like http://www.ebay.com/itm/360821023697
- plugin system
- extend the capabilities of the central system (e.g., gsm module)
- configurable notification system
- different types: mail, sms, ...
General (high level) features
- tag controllers and sensors/actuators (e.g., Front Door controller)
- group controllers in zones and tag groups
- define rules/actions/action sets for controllers, zones, groups of zones, ...
- log history (events, gathered data, ...)
Hardware
Central system
- Linux/ARM based: ODroid, Beaglebone, RPi or similar platform
- connected to the IP network (preferably wired)
- main objectives: relatively small, extensible, self-contained (no external dependencies)
- should have a backup battery and or should be connected to an UPS
Controllers
- main objectives: as small as possible, low cost & low consumption (e.g., based on ATMEL or whatever else cheap)
- example: Arduino pro mini (8$)
- exists in 3.3V and 5V
- pinout diagram: http://www.robot-italy.net/downloads/pighixxx/ProMini.pdf
- Pushing code on the Arduino Pro Mini can be done using an USB-to-TTL adapter (FTDI)
- http://arduino.cc/en/Guide/ArduinoProMini
- https://www.sparkfun.com/products/retired/8772
- http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm
- http://www.befr.ebay.be/itm/FT232RL-FTDI-USB-to-TTL-Serial-Adapter-Module-for-Arduino-Mini-Port-5-5V-3-3V-/281403748632?pt=UK_Computing_Other_Computing_Networking&hash=item4184f87118
- another Arduino (e.g., UNO) can also act as USB-to-TTL adapter for another Arduino, as long as the AVR is removed (otherwise both will be programmed at once)
- a Bus Pirate
- http://dangerousprototypes.com/docs/Bus_Pirate_AVR_Programming
- for this normally the Bus Pirate needs to be put in UART bridge mode and the Arduino needs to be connected (using RX/TX/GND/Vcc and since the Bus Pirate will act as a bridge, the RX/TX (Arduino) should be connected to the RX/TX of the Bus Pirate)
- other tutorial: http://hintshop.ludvig.co.nz/show/buspirate-avr-programming/
- example: Moteino (20€)
- Arduino compatible with RFM69HW transceiver included
- http://lowpowerlab.com/moteino/
- easier than buying Arduino pro mini + RFM69HW separately and soldering them..
- breadboard compatible (easier for prototyping)
- fully compatible with the Arduino IDE
- basically we take this, add sensors/actuators and we program it using Arduino IDE and that's it :)
- forum: https://lowpowerlab.com/forum/index.php/board,1.0.html
- https://lowpowerlab.com/shop/index.php?_route_=moteinousb
- example: arduino pro micro (Arduino compatible made by Sparkfun): same as Arduino pro mini but has micro usb onboard
- example: Arduino Mini Ultra (Arduino compatible with low power consumption): http://www.rocketscream.com/blog/product/mini-ultra-8-mhz-arduino-compatible/
- should use standard/easy to find battery types (e.g., AAA)
- should be plug and play: easy to install/configure
- should be well enclosed, nice to look at
- a set of basic controllers could be created (wireless and/or wired):
- open/closed (e.g., for doors, windows)
- movement/presence detector
- physical switch (e.g., on/off switch)
- alarm control module (e.g., numeric keypad w/ RFID and/or NFC) with some functions
- put the 'arm' in alarm ;-)
- disarm
- auth then change pin code
- auth then register new RFID
- ...
- GPS tracker
- temperature/air quality/humidity/light/noise/gaz/smoke/fire/water leaks ...
- siren
- contrôleur pour volets électriques
- could be interfaced with Java: http://playground.arduino.cc/Interfacing/Java
- should be optimized to consume as little power as possible
- Arduino narcoleptic library: https://code.google.com/p/narcoleptic/
- Arduino low power library: https://github.com/rocketscream/Low-Power
Software Back-end
For the main back-end, we could rely on OpenHAB: http://www.openhab.org/features.html
- Wiki: https://github.com/openhab/openhab/wiki
- Example project using OpenHAB as back-end:
Communications
Gathering sensors/detectors state could be done using radio communications:
Zigbee (too much $$$)
- http://en.wikipedia.org/wiki/ZigBee
- http://www.zigbees.com/
- Xbee: http://en.wikipedia.org/wiki/XBee (now supports http://en.wikipedia.org/wiki/IEEE_802.15.4)
- Links:
- http://www.instructables.com/id/Wireless-communication-Arduino-RF/
- http://fritzing.org/projects/arduino-radio-frequency-modules
- prototyping using: http://arduino.cc/en/Main/ArduinoWirelessShield
- http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/zigbee-mesh-module/xbee-zb-module
- http://www.ti.com/tool/CC2531EM-IOT-HOME-GATEWAY-RD?hootPostID=be0ad2f0371352201929eda2a8ee6162
- http://www.electronicshub.org/dtmf-controlled-home-automation-system-circuit/?utm_content=buffer96f81&utm_medium=social&utm_source=plus.google.com&utm_campaign=buffer
- XBee & BeagleBone: http://elinux.org/ECE497_Project:_XBee
- Xbee Guide: https://www.sparkfun.com/pages/xbee_guide
- http://www.seeedstudio.com/wiki/index.php?title=RFbee_V1.1_-_Wireless_Arduino_compatible_node
- http://www.seeedstudio.com/depot/rfbee-v11-wireless-arduino-compatible-node-p-614.html
RFM69HW
- 3€, long range (~400m in open air), encryption (AES-128), ...
- Datasheet: http://www.hoperf.cn/upload/rf/RFM69-V1.3.pdf
- http://www.befr.ebay.be/sch/i.html?_from=R40&_sacat=0&_nkw=rfm69&LH_PrefLoc=2&_arm=1&_armm=63&_ruu=http%3A%2F%2Fwww.befr.ebay.be%2Fsch%2Fi.html%3F_from%3DR40%26_sacat%3D0%26_nkw%3Drfm69%26_arr%3D1
- Arduino lib: https://github.com/LowPowerLab/RFM69
- Usage on Arduino Nano: https://lowpowerlab.com/forum/index.php?topic=171.0
- http://www.befr.ebay.be/itm/RFM69HW-433Mhz-20dBm-HopeRF-Wireless-Transceiver-RFM69HW-433S2-/181571017312?pt=LH_DefaultDomain_0&hash=item2a4679da60
- Usage with Arduino pro mini:
- https://github.com/flok99/radio_gateway_rpi
- Arduino Sketch: https://github.com/flok99/radio_gateway_rpi/blob/master/Arduino/radio_bridge.ino
- Uses SPI: http://fr.wikipedia.org/wiki/Serial_Peripheral_Interface
- Power consumption optimization: http://forum.arduino.cc/index.php?topic=226261.0* Arduino compatible test module: http://www.anarduino.com/miniwireless
- Demo code
- Breakout boards (to simplify prototyping)
- Alternative for prototyping
- solder SIL connectors on the RF69HW: https://www.google.be/search?q=sil+connector&tbm=isch
- use a simple wire for the antenna
- Can be programmed wirelessly (i.e., use a RFM69HW gateway to update all the network nodes): https://lowpowerlab.com/forum/index.php/topic,597.0.html
- Its range can be further enhanced by tweaking the bitrate:
- There is a fritzing part for it: https://fritzing.googlecode.com/issues/attachment?aid=27530099000&name=rfm69.fzpz&token=ABZ6GAdWJ69NC5aM3jvKtr7UPXyMrfpq-Q%3A1419969229018
nRF24L01
- http://www.elecrow.com/wiki/index.php?title=Sensor_Node
- http://www.elecrow.com/communication-c-78/rfism-c-78_122/nrf24l01-module-p-373.html
- DevDuino (16$): http://www.elecrow.com/devduino-sensor-node-v2-atmega-328-p-1046.html
Example data flow:
- Controller -> Wireless <- Gateway (e.g., Arduino w/ ethernet shield) -> MQTT broker <- MQTT client -> whatever we want
- Links
Uses MQTT and Mosquitto
- MQTT: http://en.wikipedia.org/wiki/MQTT
- Mosquitto: http://mosquitto.org/
- MQTT broker
- Other MQTT brokers
To process the MQTT messages
- we could develop a client directly in OpenHAB
- we could develop a client in Java
- we could develop a client in NodeJS
- http://mcollina.github.io/mqtt_and_nodejs/
- MQTT.JS: https://github.com/adamvr/MQTT.js/
- https://www.npmjs.org/package/ponte
- https://www.npmjs.org/package/mqtt
- NodeRed supports the creation of workflows: http://nodered.org/
- https://www.npmjs.org/package/ascoltatori
- testing can be done from the browser: https://www.npmjs.org/package/mows
- or use something else: https://github.com/mqtt/mqtt.github.io/wiki/software?id=software
Why NodeJS?
- heavily used by the IoT community
- lightweight & FAST -> ideal for a low-power backend
- can be combined with TypeScript (transpilation to JS) to get type safety
Why Java?
- used to it
- higher level
- type safety
- integration with OpenHab would be easier
Web UI to manage the system's configuration
- initial system setup
- secret code(s) update
- sensors/actuators configuration (e.g., zones, detector names, ...)
- alerts configuration (e.g., alert if ..)
- timing (e.g., trigger alarm after x)
- notifications per alert
- restart the system
- perform a system check (e.g., batteries status ...)
- open/close the garage door
- HTTPS
Parts list
Sites:
- Seeedstudio: http://www.seeedstudio.com
- DigiKey: http://www.digikey.com/
- RS: http://uk.rs-online.com/
- Anarduino: http://www.anarduino.com/
- Selectronic: https://www.selectronic.be/
- Velleman: https://www.velleman.eu/home/?country=be&lang=fr
- Mantec (Namur) (have all the Velleman catalog parts): http://mantec.be/
- MBTronics (Brussels): http://eshop.mbtronics.com/
- ElectroDragon: http://www.electrodragon.com/
- Hobby electronics: http://hobbycomponents.com/
- Cotubex: http://www.cotubex.be/electronics
To buy by Seb:
- Moteino x2
- Beaglebone Black: 45€ (http://uk.rs-online.com/web/p/processor-microcontroller-development-kits/7753805/)
- Bus Pirate (useful for testing/debugging): http://www.seeedstudio.com/depot/bus-pirate-v3-assembled-p-609.html?cPath=174
Bought by Seb:
Central system
- ...
Controller
- Arduino Pro Mini 3.3V (7€): http://www.seeedstudio.com/depot/Arduino-Pro-Mini-328-33V8MHz-p-1442.html
- RFM69HW 433MHz (RFM69HW-433S2) (x10) (3.42€/unit): http://www.befr.ebay.be/itm/181571017312?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649
Other
- FTDI adapter (USB to serial): http://www.befr.ebay.be/itm/281403748632?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649
- a ton of male headers
- a ton of female headers
- dupont cables
Controller identification
Each controller could be identified using a guid or serial number:
- if no identifier is defined: request one from the central system
- save it to the EEPROM when received
- if an identifier is set, it is sent along with any data transmitted to the central system
The identifier can be stored in the EEPROM (at a predefined location) using the following API:
We should decouple a controller identifier from its controlled sensors/actuators; one being its identity and the other being the set of "devices" it controls.
Security
Wireless home automation & security systems are usually very weak security-wise. Often, no authentication/authorization is implemented, most of the security is just security by obscurity and, at best, there is a rolling code protecting the system.
Since IoT gaining more and more traction, protection systems are being studied. The idea of a home RF firewall seems interesting: http://www.jamesbrown.me.uk/publications/content/brown13b.pdf
We could imagine having a protection module, responsible for protecting the home network from outsiders :)
Documentation
- the project's electronic parts can be documented using Fritzing: http://fritzing.org/
Links to check
- http://www.davy.preuveneers.be/publications/isami10.pdf
- http://forum.beaglefu.com/topic/135-project-idea-beaglebone-black-home-automation-and-security/
- http://en.wikipedia.org/wiki/Home_automation#Security
- http://lifehacker.com/how-can-i-get-started-with-home-automation-510246491
- http://en.wikipedia.org/wiki/List_of_home_automation_topics
- http://www.smarthome.com/
- http://www.slideshare.net/andysc/the-house-that-twitters
- https://www.npmjs.org/browse/keyword/iot
- phant (data collection server for IoT)
- http://www.freedomotic.com/
- Java back-end
- supports security & RBAC
- has a REST API
- abstracts the endpoints (UUIDs usage, event based, ...)
- http://www.projects.privateeyepi.com/home/home-alarm-system-project
- Ninja Blocks: http://ninjablocks.com
- Socket.IO: http://socket.io/
- http://www.tested.com/tech/robots/456466-know-your-arduino-guide-most-common-boards/
- http://arduino.cc/en/Products.Compare
- Arduino Wireless shield: http://arduino.cc/en/Main/ArduinoWirelessShield
- Arduino Ethernet shield: http://www.instructables.com/id/Remote-Home-Automation-Example-Arduino-Etherne/
- http://www.raywenderlich.com/38841/
- http://www.raywenderlich.com/19781/electronics-for-iphone-developers-tutorial-create-an-arduino-traffic-light
- http://lowpowerlab.com/blog/2013/10/02/raspberrypi-home-automation-gateway/
- http://lowpowerlab.com/blog/2013/10/11/raspberrypi-home-automation-gateway-hardware-and-demo/
- http://lowpowerlab.com/moteino/#whatisit
- http://lowpowerlab.com/shop/index.php?route=product/product&product_id=57
- https://lowpowerlab.com/forum/index.php?topic=405.0
- moteino projects: https://lowpowerlab.com/forum/index.php/board,4.0.html
- moteino power saving: https://lowpowerlab.com/forum/index.php/topic,286.0.html
- similar project: http://hackaday.io/post/7360
- energy & graphs: http://emoncms.org/
- http://hackaday.io/project/2519-arduino-anti-theft-alarm-shield
- http://www.instructables.com/files/orig/FIA/ND6R/I0NOFU06/FIAND6RI0NOFU06.ino
- http://www.instructables.com/files/orig/F8U/Q4NS/I0NOFO05/F8UQ4NSI0NOFO05.ino
- http://micro.arocholl.com/
- http://www.funcubedongle.com/
- http://www.ti.com/tool/cc1111emk868-915
- rfcat: https://bitbucket.org/atlas0fd00m/rfcat
- http://www.xplmonkey.com/rf.html
- http://www.hdsdr.de/
- http://busware.de/tiki-index.php?page=CUL
- http://geekdistillery.blogspot.it/2012/12/a-cheap-ti-ez430-chronos-watch-to.html
- https://andrewmohawk.com/2012/09/06/hacking-fixed-key-remotes/
Laurent's ideas
Concernant la plateforme, moi ce que je ferais, c’est partir sur une board qui intègre à la fois un système linux embarqué et un arduino ou compatible à coté. Ca permet d’utiliser l’arduino pour interfacer l’alarme avec le monde extérieur (nombre de « zones » minimales à définir) via des entrées optocouplées évidemment…
La partie linux embarqué serait alors responsable de la communication au niveau IP, avec pourquoi pas une interface web, envoyer un mail etc.. bref de programmer une intelligence un peu plus complexe que ce que permettra l’arduino… Reste à définir si l’éventuel modem GSM/GPRS et/ou la sirène est geré par l’arduino ou pas.
La seule chose qui manque donc c’est un shield qui contiendra des borniers à vis pour faciliter le raccordement au capteurs et/ou sorties style alarme et des optocoupleurs pour protéger l’alarme contre les surtensions, les court jus, … En bref l’impitoyable monde extérieur ;-)
Sinon premier step, définir les features minimales et celles « ce serait vraiment cool d’avoir ça ».
Exemple de plateformes :
http://www.seeedstudio.com/depot/Intel-Edison-for-Arduino-Preorder-p-2149.html?cPath=6_7 http://www.seeedstudio.com/depot/86Duino-One-an-embedded-platform-based-on-Vortex86EX-SoC-p-1846.html?cPath=6_7
Celui là est vraiment pas mal : http://www.seeedstudio.com/depot/86Duino-EduCake-an-allinone-embedded-platform-based-on-Vortex86EX-SoC-p-1845.html?cPath=6_7