Friday, October 7, 2016

Connecting balanced PIR sensor.

Picture on right side shows how to connect balanced PIR sensor. The idea is beautifully simple, I'm not the author I have got inspired by professional alarm boards. It is required to add two resistors into the end of every PIR sensor loop, and create simple voltage divider. Any analogue input on gateway is prepared to handle such divider. Resistor values are set in software and expected value is 2k2 Ohm for both. As you see from diagram there only 3 wires needed to connect a PIR to gateway input as ground is common to both. There is possibility to daisy chain the sensors in one loop, but then you need 4 wires and the resistor divider will be present only on last sensor in chain.

With such setup the gateway is then able to recognise 3 different states of any sensor. That is OK, PIR and Tamper. And it is very hard to tamper the wires connected to sensor as attacker is not able to measure the resistance hidden inside the sensor.

Tuesday, October 4, 2016

Gateway 1.7. pre-order

Gateway PCB is in fabrication, and I'm hoping for the best that there will be no errors on PCB. It will have following parameters:
  • MCU ATmega1284P, 16KB RAM, 128KB Flash.
  • 8 analogue inputs for balanced PIR sensors.
  • 4 digital inputs for simple sensors, like door/window reed switches.
  • 1 box tamper input.
  • TWI/I2S expansion connector for up to 4 additional 8 channel analog inputs.
  • 2 relay outputs with selectable 12V power out.
  • RS485 protected interface for wired nodes.
  • RFM69HW for wireless nodes and sensors, pigtail and rubber antenna.
  • W5500 10/100Mbps Ethernet for web interface and MQTT.
  • SIM900 GSM modem for SMS alerting, pigtail and rubber antenna.
  • RTC clock with separate battery backup with NTP synchronization.
  • 512kb EEPROM as logger
  • Power Off and Empty battery inputs.
  • Standard FTDI Arduino programming interface.

I have been so bold that I put it on pre-order in the BUY section on right for 72EUR or 79USD.

Sunday, October 2, 2016

Fun with timers

Setting 4 timers on gateway web interface with double the start and stop time for each one. Then adding 4-channel relay board to node. And here is result, nice binary counter :)

Friday, September 30, 2016

Software upgrades

With new version of hardware in fabrication, I have turned back to software side of gateway. I have made significant improvements in zone thread and also improved the alarm event thread (AET). It stays, that it can handle 3 simultaneous alarm events at once. That is the software is able to wait for authentication when you enter one zone, while setting alarm for any other two, or any combination.  Additional  AET can be added, but 3 should be enough for any normal household or property. Overflowing event will not be lost, but logged, and if reoccurring it will trigger AET again. In real scenario your inner house zones will have authentication time set to 0 seconds, and they will be properly handled by AET in no-time. Only time the AET will overflow is when your local SWAT team enter your house by every window at once. Still it will set alarm On and notify you and you neighbours :).

I have reworked time keeping mechanism. Mainly inspired by simple idea that the NilRTOS, that is used for gateway, can trigger thread periodically at any given millisecond interval. I have tossed away routine, that was asking RTC chip connected by TWI/I2S every time software was needing exact time. And instead created a new timer thread with 1 second wakeup interval. There the thread increase internal second counter, keeping the time available to other threads. Also there is 2 byte counter that will sync with RTC chip when it overflow, that is every 2^16 seconds, at least once a day. It nicely give back some processing power to all threads as TWI/I2S transfers are only 400kbs.

With all that I was able to get back to original idea of having not only a security system, but also a sensor gateway. All started with unifying authentication nodes and sensors. Now they are put together simply as nodes in web interface, and they can also have name assigned along with address and local number. This further improves registration and handling of sensors. I added new feature, or better new type of node. An input node that represents a remote relay, switch or any other output resource that can be addressed by float point value. It works astonishingly well and it does not matter if the node sits on wired or wireless network.

Another news are new feature sets called triggers and timers. As name imply it will do just that :), but I will leave it for new blog post. I think it is worth it.

Also PCB's are fabricated and waiting for shippment.

Saturday, September 24, 2016

Gateway 1.7 - new board

After busy summer, I had finished testing all other features of 1.6 gateway. All went fine and no additional change to layout is needed then the problematic W5500 PHY part. And I have sent to fabrication new version of Gerber called GW 1.7.

Here is the final render:



Monday, August 15, 2016

Back to gateway

I have used my recent W5500 breadboard friendly PCB to overcome problem with W5500 directly on gateway. As you may know there is problem with packed loss during transmission, which make it nearly impossible to further debug other parts. I have soldered ISP header on the gateway and used is as SPI to attach W5500 PCB. This works just great! I'm back to 100MHz full duplex Ethernet business. With improvements to Webduino library and some other tweaks, it have gained on speed towards web clients, as well as more time to process things internally in RTOS.

I have stared to test input blocks. Digital ones are same as on old gateway, and tere is no surprise. However analogue part was redesigned, but first test shows it works as expected. I will have to test further what over voltage or shorts it can withstand. I'm happy with that, because I'm more digital then analogue guy :), or better yet software type :D.

I have noticed that during uploading new sketches into gateway, I toggle the GSM module On and Off. This is a bit of drag as you imagine. It could be solved further in software, but I have rather done some changes on pin assignment.  I have tossed out GSM_RESET, as it can be reset hard way by switching GSM_POWER. And change it to input pin reading GSM state (GSM_STATUS). This way software can recognise instantly during start-up if the GSM module is already On or Off.

Next I will test outputs and RS485 interface. Then check power supply fall back and real time battery backup. If all goes well, I'll release final version of new gateway, which I plan to sell as starting point to DIY home security for anyone interested.

Monday, August 1, 2016

W5500 for sale

I have put the PCB and assembled board to store section on right. It offers all the function as W550io:
  • Size 2.5 x 5 cm.
  • Require 3.3V.
  • 80Mhz SPI.
  • RJ45 jacks with integrated magnetics.
  • ACT and LINK LEDs.
Choose PCB only or fully assembled version.
Standard 0.1" pin header with GND, 3V3, SS, SCK, MISO, MOSI, RST, INT pins.
Schematics are added for download.