Close
0%
0%

Home security

Home security project based on atmega and ardunio. MQTT gateway for data gathering.

Similar projects worth following
Home security project based on atmega and ardunio. MQTT gateway for data gathering.

This project should replace standard home security alarms, and And function as gateway to pass or receive data from various sensors. All configuration is done over nice web interface.

Gateway board consists of atmega1284P that has inputs for sensors and outputs to relays. It also hosts Wiz5500 Ethernet for configuration and overview, RFM69HW for radio remote nodes, communication module to wired nodes (RS485 protocol), GSM modem, Battery backed up RTC, EEPROM for log, I2C expansion connector, and AC supply and battery monitoring.

Gateway board has 8 analogue inputs that can recognize different events on PIR sensors, and 5 digital inputs. Inputs can be further expended.

Remote nodes act as authentication units or sensors. Currently they are set to receive iButtons as keys to arm/disarm the system.

All is now working and boards or PCB are fore sale!

  • 1 × ATMEGA 1284P custom main board Arduino environment compatiblie board with inputs outputs modified to work with sensors.
  • 1 × ATMEGA 328P custom entry board Arduino environment compatiblie board for remote enty.
  • 1 × Wiz5500 Ethernet connection.
  • 1 × RFM69 Electronic Components / Misc. Electronic Components
  • 1 × PIR sensors Any commercially available wired PIR Sensor.

View all 8 components

  • Gateway 2

    vysocan7609/15/2019 at 12:11 0 comments

    I did not post too much updates recently, but I was quite busy with new version of gateway. I manage to draw and let fabricate new PCB with 32bit ARM chip as main controller. For the purpose of first design I have shrunk the PCB to 100x100mm, but I have managed to squeeze all component I wanted there. Good news is that I was able to stay on 2 layers, and avoid much more expensive 4 layer PCB. I made the board at pcbway with the cheapest 6/6 method and the quality stays similar to my free boards. I will stay with them for sure.

    After realizing that 100x100mm PCB includes all I need, I will most probably stay with this new format. To sum up there is:

    • STM32F407 with 1GB of flash and 128KB of usable free RAM, running at 180MHz.
    • LAN8720A Ethernet PHY with 10/100Mbit.
    • Two step power supply with 12V to 4V switching and 4V to 3V3 LDO.
    • Battery for RTC CR2032. STM32F407 has on-board RTC.
    • 10 analog (balanced) inputs for PIR, smoke, ...
    • 2G SIM800C module
    • Radio for RFM69 or RFM95.
    • 64KB SPI FRAM, bit expensive, but no wait times and blazing speed compared to I2C EEPROM.
    • RS485 for wired connections.
    • 2 relays for sirens.
    • 1 tamper zone for enclosure. 
    • Micro USB port for firmware update and direct console access.
    • ST-LINK V2 port.
    • 3 LEDs.

    I guess it will pretty decent update to existing ATMega1284P.


    More on https://openhomesecurity.blogspot.com/2019/09/gateway-2.html

  • Preparation for new OHS gateway

    vysocan7602/03/2019 at 13:49 0 comments

    There is almost all functionality in OHS gateway that I have wanted when I started, however I have internal need to carry on :). One thing, I would like to improve, is the crypto capabilities that can never be achieved on otherwise very nice ATmega1284P 8 bit MCU. It somehow led me to look further into another step that would be 16 or 32 bit MCU. There are many choices in therms of available MCUs and platforms. Maybe to stay on Arduino platform and choose some of the ARM Cortex available. But I have decided to stay with older brother of now used NilRTOS called ChibiOS/RT, since the "operating system" RTOS is maybe the most important for me.

    ChibiOS can support variety of MCU including RaspberryPi and ATmega, but vast majority of supported MCU are STM32 families of many kinds. Looking at those mighty 32-bit ARM MCU, I have picked one called SMT32F407. These are high-performance Cortex-M4 32-bit RISC operating at a frequency of up to 168 MHz. They features a floating point unit (FPU), Ethernet, USB, RTC and so on. They have up to 1MB of flash storage and 128k of user usable RAM, and they are available in in various packages with varying pin count.

    My goal is to create new gateway with similar functions as the current ATmega one, and then build up on this.The gateway may have different number of hardware zones, but I want to use wire and wireless nodes and zones. That is, I intend to still use Arduino based nodes s much as possible, just because of their easy to use nature. I plan to add GSM module on gateway, maybe as add-on board, so it can be swapped to 4G module in future. And also wireless radio, maybe as add-on board too. SMT32F407 has software defined TCP/IP stack, and it can be used with IPv6, Web Socket, SSL/TLS and so on. And what I like most, as ChibiOS supports many more even higher performance MCU, the future grow will be then much easier.

    Saying all that I will continue to support, and develop new functionality on current ATmega gateway, as I use it at home :). The new one will not come anytime soon (this year), as it bring great deal of challenges in terms of HW and SW. Also I will keep the project open, as I do not like equipment that dies when its producer decides to cut it off, or just disable the required host server.

    https://openhomesecurity.blogspot.com/2019/02/preparation-for-new-ohs-gateway.html

  • New PCB review

    vysocan7601/21/2019 at 10:14 2 comments

    It is always nice when someone appreciate your work, especially if you give the product to public as free to use. It happened to me as well, I was asked to review a PCB fabrication house called pcbway.com. Without too much hesitation I have sent them Gerber files of OHS gateway, and two of weeks later postman brought me the package, nice :).

    I must say I have tried around 4 different China fabrication houses, and this one is fifth. I tend to do my board easy to hand solder, and I do not use fine traces or gaps bellow 10mils. This give me better trust to choose rather inexpensive manufacturing processes. There is not too much difference between ordering in pcbway and other houses, you do all as usual on their web pages. One difference though, is they probably inspect the gerbers by person. It came to me as I have used 6mil trace/gap option as the basic available, and within 1 day after submitting gerbers they proposed me to change it to 5mil. First time I've seen that actually someone had a glimpse of my layout before manufacturing. Of course it was a little more expensive, but still within the free coupon I was given for review.

    The boards themselves are nicely made. I can compare to 2 other PCB houses I have boards from. I will skip the traces evaluation since I have no visual or other tool to do any reasonable comparison. But first think you notice with bare eye is silk screen, it is noticeably vivid and precise. It's placement is usually the weakest point in China PCB houses. But this board is done accurately, not faint and not smeared. I think using this fab one can afford to put logo on silk screen and not be afraid that it will come out ugly.

    Second difference is via placement. When you use IC with many legs you usually route signals to other IC close to each other, this leads to having vias sit to each other in some pattern too. On such patterned vias you can easily spot the sharpness and bit placement. I must say there the vias on the PCB are great I would not be afraid to go with lower then my 0.3 millimeter.  Along with via quality goes actual hole placement. And it is similar to vias, nicely placed in exact center of pad.

    Third difference I've noticed is solder mask, using loupe the mask is somehow more corresponding to what is draw in gerbers. Put it simply, exposed copper pads are smaller and more precise. This will help especially during soldering, the small components will not wander around, and IC will not have as many solder bridges.

    Here is picture hopefully supporting my point, with pcbway PCB closer on top overlapping seeedstudio PCB. You can see here of-centered holes and wider solder mask along with nice silk text.

    As I said on beginning, I do not develop over-complicated PCBs with many layers, buried vias or impedance control, so my evaluation is as erudite as hobbyist can offer. But I would say I will use the pcbway services in future for sure.

  • Updates in 1.7.6.3

    vysocan7612/31/2018 at 08:01 0 comments

    New minor release is ready with following changes:

    • Full support for remote radio Authentication node including rather big change in RFM69 thread.
    • Update of WebUI, added JavaScript to Trigger menu to better show meaning of Pass option.
    • Update of WebUI, on Triggers and Timers overview. Many of the columns that are blocked via option, that is, they are now shown as blank instead of default for clarity.
    • Updated DigitalIO library most recent one and relevant OHS code.
    • Updated Ethernet library to most recent version (Now even newer Ethernet library available, need to do it again). 
    • Updated GSM library, there are some enhancements in parser.
    • Fixes in counting radio packets and other counters (++i vs. i++).
    • Few minor bugs fixed in WebUI.

    Compiled version: https://openhomesecurity.blogspot.com/p/firmware.html with link to GDrive.

  • New wireless mini node with RFM69

    vysocan7605/08/2018 at 06:03 0 comments

    Lately I have stared to play even more with various remote sensors wirelessly
    connected to OHS gateway. I have used my standard radio nodes, but its versatility is somehow to much for small wireless node. To save space and gain easier access to pins of MCU I have designed new node called Radio Node Mini. It resembles Arduino Pro Mini with ATmega328P, but it has place to mount RFM69 board on it. It also has micro USB connector for charging designed for 3.7 Li-Po or Li-On battery.

    It is breadboard friendly and measures only 24.4 x 32.8mm (0.96 x 1.29 in). All available pins are taken out to board sides and marked as on Arduino board. It is 3V3 board and it is available with 16Mhz or 8Mhz quartz oscillator. As it is made to work with Li-Po or Li-On battery it features battery voltage measurement on A6 via 2:1 voltage divider, and also ability to detect charging state connected to pin D8. Pin D2 is not taken out as it will be used as interrupt pin for RFM69. It has also possibility to assign pin D4 as reset for the RFM69 via solder jumper labeled RR. Board is programmable via FTDI programmer. Note, that it is not able to take power from micro USB without battery, the charger is providing only minimal current to the board when it does not detect the battery. However FTDI programmer can be used also as power source while developing.

    Board has excellent standby battery consumption within few uA when MCU and radio is asleep. It will last for months to year(s) depending on battery size and sleep conditions. Board is able to handle 500-2000mA battery. I especially like those flat 700-800mAh small quadrocopter batteries found on eBay. they are cheap, has similar size as the board, and have also protection circuit built in. Only drawback is that they have usually 100-150mAh less capacity then advertised.

    Boards are also now available in my store for 7EUR fully assembled. As option you can choose radio module, pigtail and antenna.

  • Wireless node configuration

    vysocan7601/20/2018 at 18:17 0 comments

    Wireless nodes are part of OHS ecosystem. They serve as source of data from sensors, and as receivers for inputs. Inputs represents relays or other devices waiting for incoming commands. If you want to connect wireless node to gateway you need to set it up first. Start with download of example sketch from GitHub. Here is code for hardware version 1.4 https://github.com/vysocan/remote_1_4_RFM69. If you have on hand version with on-board temperature sensor and USB charging circuit then you can use the code almost without change. Basically you need to modify just the setting for radio module. Here is the part for radio

    // Radio
    #define NODEID      14
    #define NETWORKID   100
    #define GATEWAYID   1
    #define FREQUENCY   RF69_868MHZ //Match this with the version of your gateway #define KEY         "ABCDABCDABCDABCD" //has to be same 16 characters/bytes on all nodes, not more not less!
    #define ENABLE_ATC  //comment out this line to disable AUTO TRANSMISSION CONTROL
    #define ATC_RSSI -75 

    From this you need to only change following:

    NODEID      2     // is number from 2 .. 250, do not number the nodes with same NODEID!
    FREQUENCY   RF69_868MHZ // depends on your country, leave it as is or put RF69_915MHZ
    KEY         "ABCDABCDABCDABCD" // needs to match the KEY of gateway.
    ENABLE_ATC        // leave as is for battery powered nodes
    ATC_RSSI -75      // threshold for AUTO TRANSMISSION CONTROL, you can safely leave as it is.

    To start with minimal changes only, change just NODEID to be unique and KEY to match the one from gateway.

    ...

    Read moire on blog: https://openhomesecurity.blogspot.cz/2018/01/wireless-node-copnfiguration.html

  • New major version 1.7.6.0

    vysocan7611/17/2017 at 05:28 0 comments

    Since summer time I was adding some features to gateway that led into new major version 1.7.6.0. Changes include:

    • Remote zones added.
    • Added group arm and disarm chain. That is when arming/disarming group by key, Gateway is able to automatically arm/disarm another group or groups.
    • Added group state MQTT publish. Gateway now, if enabled, will publish state of group via MQTT. Such information can captured by Home Assistant or other automation program.
    • MQTT sensor publish structure modified, added group name to path.
    • Updated MQTT library and MQTT protocol to 3.1.1.
    • Added new sensor type "Battery", to easily identify battery powered nodes voltage. 
    • Added new sensor type "Gas", to easily identify any air quality environmental sensor.
    • Added SMS command gateway. Authorized numbers from contact list are able to get Group state or set it On, Off, Arm and Disarm by sending SMS in predefine format to gateway GSM number. This functionality need some testing.
    • Updated NilRTOS to latest version available. In future port is needed to ChNil, which is newer replacement of NilRTOS, but unfortunately not one to one compatible with NilRTOS.
    • Various small enhancements in code and web interface.

    New version is now at GItHub.

  • Realy nodes

    vysocan7608/29/2017 at 08:15 0 comments

    After some testing I have finished new relay node. As all nodes it is Arduino compatible board with ATmega 328P clocked at 16MHz@3.3V.

    • Size 6.1 x 5.6 cm.
    • On-board AC/DC power supply. Input 100-240VAC, 50-60Hz. Output 5V/3. Fused with TVS on input with slow blow 0.5A fuse.
    • 2x Japanese(Panasonic) power relays with COM, NC and NO inputs. With TVS on both.
    • It has more powerful RFM69HW soldered on back with IPX connector.
    • Temperature sensor to indicate overheating based on MCP7900A on ADC6. It is mounted under AC/DC power supply.
    • IO header, rest of pins are taken out. As well as +5V and +3V3 to add another relays or sensors.
    • Programmable via standard FTDI 6 pin 3V3 programmer.

    It is available in my online store.  Schematic is in my shared folder, and example sketch is placed on GitHub.

    Link to blog: http://openhomesecurity.blogspot.cz/2017/08/realy-nodes.html

  • SIM800 vs. SIM900

    vysocan7606/03/2017 at 07:55 0 comments

    Well it actually looks like there are some differences in SIM800 comparing to SIM900. Echo and command routines are working just fine, but reply to SMS send function is different. SMS is actually sent, but the function is not able detect successful sent. There seems to be two reasons. First, the the rely looks little different. That is the echo of SMS text is not preceded with empty line and "> ", but there is simply one line with echo. Second, the reply time of SIM800 is significantly slower then SIM900. It looks like "CMGS:#", the acknowledgement of SMS, comes after the SMS is delivered to actual number.

    First problem is relatively easy to solve, on beginning we cn ask GSM modem for the version and then branch the SMS send function depending on model. But the second must be investigated. I've seen some command that can make difference in how the SMS sending is handled, but the setting in SIM800 looks right., interesting :).

    http://openhomesecurity.blogspot.cz/2017/06/sim800-vs-sim900.html

  • Blue gateway 1.7C

    vysocan7605/27/2017 at 19:12 0 comments

    A picture is worth a thousand words. Here is new OHS gateway officially named 1.7C. Major difference comparing to 1.7. is 2G modem SIM800C. With four bands GSM support it can be deployed worldwide. And just one remark to relays, I have switched from black Chinese made Omron to blue one's made in Japan. They are slightly more expensive, but somehow cute and blue :). Link to blog.

View all 71 project logs

Enjoy this project?

Share

Discussions

midnightcow wrote 11/21/2014 at 07:24 point
Hello,
Are you interested in the new WIZnet chip W5500 is more enhanced than W5200? If you want to have experience for W5500 and the related product as WIZ550io and ioShield, I will send it to you free.
WIZnet have the ethernet soultion as well as WiFi such as WizFi250.
Please feel free to contack to me. I will wait your reply.
Thank you.

  Are you sure? yes | no

midnightcow wrote 11/21/2014 at 07:27 point
I will send my email address to you with private message. Please read the message.
Thank you.

  Are you sure? yes | no

vysocan76 wrote 11/21/2014 at 08:02 point
Hello, that would be just great :) I will be happy to test it and use it. I can send you some boards in return.

  Are you sure? yes | no

midnightcow wrote 10/06/2014 at 23:41 point
Hi, vysocan76.
Good Job!!!
I am working in WIZnet, and working hard to activate forum(wizwiki.net/forum).
I am interested in your project, I find what I can help you.
If you need my help, feel free contact to me.
Thank you

  Are you sure? yes | no

vysocan76 wrote 10/07/2014 at 07:22 point
Hello midnightcow,

thanks for interest, that is just great. I have problem with wiz820io. I have found that the wiz820io is not recovering correctly on power failure. There is need to reset whole board manually after power on. I have the wiz820io reset pin tied to atmega reset.
I was thinking to add reset watchdog to the board, but haven't had time to test yet. Or to use INT wiz820io pin which I have connected to atmega, and it is not used by driver for software reset.

  Are you sure? yes | no

midnightcow wrote 11/06/2014 at 01:35 point
Hi,
As you mentioned before, WIZ820io(W5200)'s reset pin had better to connect to AVR's GPIO. Because W5200 need over 150ms for reset after RSTn goes high. Also, The RESET low time maybe over 20us.
For more detail, refer to W5200 datasheet. You can see at http://www.wiznet.co.kr/Admin_Root/UpLoad_Files/BoardFiles/W5200_DS_V130E.pdf
I expect that you will process your project very well.
Thank you.

  Are you sure? yes | no

vysocan76 wrote 11/11/2014 at 10:37 point
Hello, thanks for the link. I have used reset watchdog, First test are OK. You can look for updated schematics on my blog.

  Are you sure? yes | no

midnightcow wrote 11/13/2014 at 02:02 point
Hello,
I saw the updated schematics, MCP130 satisfied the low time of W5200 RESET.
Becaue W5200 need to the time over 150ms after RESET high, MCU should wait the time. If you will implement the firmware, you will check the time.
Thank you and have a nice day!!!.

  Are you sure? yes | no

vysocan76 wrote 11/19/2014 at 15:17 point
Hello, not sure what you mean that I whould implement the time in the firmware. I believe that the MCU stays in reset state together with W5200 chip. Can you elaborate more on this.
Thanks ...

  Are you sure? yes | no

midnightcow wrote 11/21/2014 at 03:58 point
Hello,
I don't have your board, so i can't elaborate it. But i will check the reset high time on your github source codes.
Thank you.

  Are you sure? yes | no

midnightcow wrote 11/21/2014 at 07:13 point
I was checked the code - setup() in main_board.cpp. Becase Ethernet.begin() was called after low speed device as EEPROM and Serial is begined, I think that W5500 reset high time is garanteed.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates