Author Topic: Thank you Felix - Moteino motion sensors stopped real burglars!  (Read 5288 times)

gianmarko

  • Newbie
  • *
  • Posts: 33
last sunday at 3.15 AM burglars broke into my cellar.

my anti intrusion system, based on a network of moteino, triggered an alarm and i was able to scare them away with just my Ipod and a shooting timer/watch

so this is a thank you to the great work done, Felix, from a very happy customer :-)

im in the process of improving the anti intrusion system with more sensors and better software and functiopnality.

gm

« Last Edit: August 13, 2015, 08:09:29 AM by Felix »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6023
  • Country: us
    • LowPowerLab
Re: Moteino sensors stop real burglars!
« Reply #1 on: August 10, 2015, 02:01:05 PM »
Wow really?! That's awesome!
I assume there's evidence of them breaking in and not just a false alarm somehow.

Anyway this would be the first record of a Moteino stopping a real break-in :)
Any more details? Was this a MotionMote or just another type of detection using Moteino? Any photos? Anything that can be blogged about or plan to blog about it yourself?

gianmarko

  • Newbie
  • *
  • Posts: 33
Re: Thank you Felix - Moteino sensors stop real burglars!
« Reply #2 on: August 11, 2015, 06:31:40 AM »
Hi Felix

i have developed the system using some stuff bought from you, mostly moteinos, and stuff sourced on ebay

of course i used some of your code and the knowledge found on your site and elsewhere

system is based mostly on PIR motion sensors, and door switches that use common magnetic contacts connected to a moteino.

my house is quite big but standard moteinos dont have any problem communicating with the "base station"

the base station sits on my bedside. it shows the last 4 alarms on a 4x20 display. display is usually dark, if any alarm is triggered it will light up and show which sensor triggered the alarm.

if "night mode" is selected through a switch, any alarm will sound a beep and wake me up. only certain sensors will trigger a beep.

a push button clears up the display and switches off the display illumination

a GSM module is connected to the base station's moteino and will send a text message on my cellphone if the function is activated . text message sending is activated through a remote control, which is also based on a moteino. i can have multiple remote so my wife also has one, so when i leave the house i can activate the alarm from outside.

the base station is powered by a mightyboost, so the system will work even if there is a power failure or the burglars cut the power.

i have a large old house with lots of storage spaces, workshops, etc, and a cellar, where i keep expensive equiipment and personal belongings. the doors are very old, around 100 years, and locks very rudimentary, also the main door to the house is very old, but i like it and dont want to replace it with a security door, besides, then i would have to secure all windows and i dont want to live in a prison.

i live with my wife and my son. Rural Switzerland used to be very safe but things are changing here too, so burglaries are becoming more common and burglars are not afraid of entering your house at night while you are sleeping;  i dont care too much if burglars enter in the house when we are away, i have a good insurance, but i have a small child and an intrusion will be dealt with with maximum prejudice.

thats why i decided to build this system. i could buy one, but of course is a lot more fun to build my own :-)

the system is designed mainly to alert me if there is an intrusion somewhere when i and my family are  at home.

sunday morning around 3.20 i woke up, was a very hot night and i had all the windows open at the 1st floor where i sleep, my wife is away with my son so i was alone. the buzzer
of the alarm was switched off but the display was on showing an intrusion in the cellar at 3.15, so few minutes before. i sometimes get intrusion detections in the barn, but there are cats and mice there and sometimes i get false alarms. cellar alarm however is uncommon, so i got up, grabbed my bedside gun and a torchlight and went to the balcony, from where i can see the cellar door and back of the house. i could not see well if the door was closed so i went downstairs to check. cellar door was wide open, but i could not see anything strange, so i thought i forgot it open and the cat triggered the alarm.
i went twice around the house but could not see or hear anything, so i went back to bed.

the morning after i needed something that was in the car, so i noticed the car was open with evident signs of someone searching inside. i then went back in the cellar to check better and saw that my ipod and a watch/timer were missing. so yes, people were in and they probably heard me getting up (old house with very creaky floors) and left, or perhaps they saw the thousands of 9mm cases i keep in the cellar for making my ammunitions, and realized that there is someone who shoots a lot in the house and decided to leave in a hurry. perhaps they were hiding in the garden but i didnt see them.

they also entered the garden of my neighbour but they didnt take anything

so i am now 100% sure someone entered in the cellar,  and thanks to the anti intrusion system the burglary was cut short with limited damage for me and no serious damage for them...

if you like i will take a few pictures of the system i built and of the house, so to have an idea of the situation.

in the meanwhile i have rewired the base station, it was built on a breadboard and i had sometimes problems of false contacts, it is all soldered now and more reliable.

the code of the base station is nothing special, and needs improvements, if someone wants to look i will publish it.







 

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6023
  • Country: us
    • LowPowerLab
Re: Thank you Felix - Moteino sensors stop real burglars!
« Reply #3 on: August 11, 2015, 07:54:05 AM »
That's quite a story, if you want to add anything else, photos, code, this thread is a good place.
Thanks for the details and sharing your experience, I'm glad we can use this technology to do more useful things than blink LEDs!

gianmarko

  • Newbie
  • *
  • Posts: 33
Re: Thank you Felix - Moteino sensors stop real burglars!
« Reply #4 on: August 12, 2015, 06:29:56 AM »
this technology can surely do a lot more than blinking leds!!!

in fact my motorbike is running on an quite sophisticated homemade fuel injection which is based on atmel processors., i havent designed the EFI but i worked with the designer to adapt it and integrate it on my engine

this technology has huge potential, and i think house automation and security are great fields of application. some of my friends laugh at my ideas  and applications but they are dead wrong.

and all the things i have built and developed, once the code is sorted out , are incredibly reliable even in the worst case scenario.



i will take some photos and post them when i have a little time.

i have also attached a moteino to one of those cheap smoke sensors and it seems to work fine, so i will also have smoke detection, which is nice, as the house is made of wood and my wife very distracted ;-)



keep up the good work Felix :-)

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6023
  • Country: us
    • LowPowerLab
Re: Thank you Felix - Moteino sensors stop real burglars!
« Reply #5 on: August 12, 2015, 07:29:03 AM »
Looking forward to photos!!
About your smoke detector Moteino, is it a passive or active install? Ie does it feed power from the detector or it runs on battery? And how does it detect the smoke alarm?

gianmarko

  • Newbie
  • *
  • Posts: 33
Re: Thank you Felix - Moteino sensors stop real burglars!
« Reply #6 on: August 12, 2015, 02:50:07 PM »
Here are some pics.



this is the house, the side where the access to the cellar is. this is also the "back" door, there is another entrance door on the other side but it is visible from the road and it has a better protection. this side is not visible from the road and neighbours cant see the entrance




this is the cellar door. the cellar does not communicate with the house, unlike most houses. burglars often break in from the cellar



this is the remote control to activate the gms module. pretty rudimentary but works :-) really no time to take care of details. set to on or off and push the button till the red led activates. led is activated by the ack from the base station



this is the door, also visible the most precious thing i own :-)



this is the door sensor



this is the door lock....



this is the base station. again, pretty rudimentary, and lots of hot glue :-)



this is one of the motionmotes, this one without case. i still have a few cases but the fit is so tight i gave up :-)



as you can see i am a big fan of hot glue :-) perfect to stop flying wires from breaking up at the soldering point. a trick i learned racing car models
also good for assembling stuff quickly

Here is the receiver code,nothing to write home about

info on the smoke detector will follow
EDIT: pics resized for embedding and some corrections.


« Last Edit: August 13, 2015, 08:06:31 AM by Felix »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6023
  • Country: us
    • LowPowerLab
Re: Thank you Felix - Moteino sensors stop real burglars!
« Reply #7 on: August 12, 2015, 03:22:07 PM »
Nice setup, very DIY, thanks for the details - just don't include the address :D
How does the MightyBoost handle power loss and GPRS transmissions?
« Last Edit: August 13, 2015, 08:05:39 AM by Felix »

gregcope

  • Full Member
  • ***
  • Posts: 172
  • Country: gb
Re: Thank you Felix - Moteino sensors stop real burglars!
« Reply #8 on: August 13, 2015, 02:19:02 AM »
GM,

Great stuff, this is something I also wanted to setup so interested in any code/hardware info.

gianmarko

  • Newbie
  • *
  • Posts: 33
Re: Thank you Felix - Moteino sensors stop real burglars!
« Reply #9 on: August 13, 2015, 04:34:09 AM »
hi greg. the hardware is pretty straightforward, i will be happy to answer any question

the sensors are mostly motionmotes, and a variant of it where the PIR sensor is replaced by a cheap magnetic contact. there is room for improvement here because the contact is normally closed and works as pulldown against a pullup resistor. even using 220k pullup, batteries last less that motionmote batteries. would be good to find something better and with lower current consuption. i think that the internal moteino pullup will use more current, but havent checked that due to lack of time to experiment.

i studied the possibility of installing the magnet offset relative to the contact, so that the contact is normally open and it closes when the magnet passes close by when the door opens, but it is impractical as the magnet needs to be located quite far away and the thickness of the door is not enough

perhaps someone smarter than me will come up with a low power solution.

regarding the smoke detectors.

i am using these cheap smoke detectors. i bought them in france for 4 euro each.

 the sensor is based on a IR emitter and a IR received separated by a labirynth, so they normally dont see each other. when smoke enters, it will scatter IR light and activate the sensor.



i have opened it and found the usual IC that is used in these applications.

the pin 7 will go HIGH when the smoke detector activates, and manufacturers were kind enough to even provide a place where to solder a wire





connect that wire to a int pin of the moteino, exactly like in the motionmote, and you have a smoke detector

the detector uses a 9v battery, so you can use that to power the moteino. the whole thing uses very little current.

pretty straightforward.

i am still using the old moteino libraries without battery voltage checks, when i have time (probably when i retire, that is, never :D ) i will implement that. would be also good to retrofit the memory so i can reprogram the inos OTA interface.

so if anyone decides to do something similar, id recommend the above.

base station can be improved, first thing i need is to write some code so that when a text message must be sent, the program checks that the gsm module is on and registered to the network, and eventually turns it on if it isnt.

time is all i need....




gianmarko

  • Newbie
  • *
  • Posts: 33
Re: Thank you Felix - Moteino motion sensors stopped real burglars!
« Reply #10 on: August 13, 2015, 08:44:29 AM »
just to sum it up

i think this is a quite good system. completely stand alone, self powered, very difficult to disable. you will need to jam the moteino tadio transmission, or the gsm network, so not something for the occasional burglar

missing the above, anyone breaking in will trigger an alarm.

and in case someone wants to test my system breaking in while im at home, this is the torchlight i keep beside my bed



it makes a lot of light, and when necessary, noise...




gregcope

  • Full Member
  • ***
  • Posts: 172
  • Country: gb
Re: Thank you Felix - Moteino motion sensors stopped real burglars!
« Reply #11 on: August 15, 2015, 03:35:39 AM »
Can I suggest putting all you code / data /design on GitHub?

gianmarko

  • Newbie
  • *
  • Posts: 33
Re: Thank you Felix - Moteino motion sensors stopped real burglars!
« Reply #12 on: August 16, 2015, 02:39:35 PM »
i need to find the time and figure out github, then yes, definitely

gianmarko

  • Newbie
  • *
  • Posts: 33
Re: Thank you Felix - Moteino motion sensors stopped real burglars!
« Reply #13 on: August 21, 2018, 08:26:00 AM »
Hi again

on request from a reader, i will post the code i used in my homemade home burglar alarm system

first a few words about the design choices

i dont have a loud alarm or siren; the base station will beep if an alarm is triggered; the base station sits on my bedside and will wake me up if there is any trigger; the display will show which sensor triggered; sensors are installed in layers, there are door sensors on doors, and motion sensors in rooms. if a motion sensor triggers i will evaulate if it is possible that someone was in the range of that specific sensor without having triggered other sensors, that allows me to evaluate false alarms; in principle, sensors are located so that is not possible to trigger one single alarm, which will be most likely a false alarm. also, motion sensors will usually generate more than one alarm. so far i never saw a false alarm from a door sensor, but pir sensors can generate false alarms, expecially if they see direct sunlight. so sensors should be placed so they dont see direct sunlight, or reflection from a bright wall of direct sunlight.
i have a motion sensor in a garage that, in may, will often trigger false alarms at sunset, when sunlight filters under the door. why may? because after may the trees will grow leaves and shield the sunrise, and before the sun rises at an angle that will not hit the garage door :-)

there is a day mode and a night mode. in day mode the base station will show on a 20x4 display only which alarm has received
in night mode some sensors will also trigger a sound alarm, and alarm is displayed. i exclude from the night mode those sensors that i will trigger for example getting up to go to the toilet...

there is a cancel button which will clear the display from all alarms and turn the display light off
when the first alarm is received, the display light turns on, showing an alarm has been received.
there is an away-from-home mode, that will cause the base station to send a text message over the mobile network when an alarm is triggered.
there is a remote control, based on a similar design as the sensors, that is used to turn on and off the away-from-home mode. the away-from-home mode can also be used to check that the GSM module is working and is connected to the mobile network.
activating or deactivating the away-from-home mode will also trigger a text message signalling that away-from-home mode is switching on or off.
a red led on the remote will show if an ack to the activation/deactivation has been received.

the base station is powered through a mightyboost, which allow it to be completely independent from power or internet connection.
all sensors are battery powered. motion sensors also last several months, depending on how much movement there is in the area. some of them are powered from 4xAA batteries, which ensure some 2 years of functionality.

i have 2 type of sensors, door sensors and motion sensors. lets start with the door sensors.
door sensors are based on common magnetic reed switches that are normally opened. something of the sort
https://www.ebay.com/itm/Recessed-Magnetic-Window-Door-Contacts-Security-Alarm-Switch-Reed-Adhesive-TB/392104317903?hash=item5b4b3d13cf:g:kwAAAOSwiOFZO4NJ

when the door is closed, the magnetic reed switch is closed, and the interrupt enabled digital input pin used in the moteino (D3) is in low state. when the door is opened, D3 will go high;  there is a pullup resistor of 330k ohm which has demonstrated to be enough for the task, and allows a 9v battery to last several months. each door sensor has its own number wich is sent OTA , which allows the base station to tell which sensor is which

all moteino used are equipped with a RFM69H transceiver, which has demonstrated to be more than adequate for the application. i have a big house with thick walls, sensors work everywhere in the house.

this is one of my first projects so the code is definitely crappy. but it works and has worked for several years now.
one thing i have noticed is that the serial data gets corrupted after the processor was in deep sleep, i never got round to figure out why, but is not critical. just need it during prototypeing


Code: [Select]

// Sample RFM69 sender/node sketch for motion sensor
// PIR motion sensor connected to D3 (INT1)
// When RISE happens on D3, the sketch transmits a "MOTION" msg to receiver Moteino and goes back to sleep
// In sleep mode, Moteino + PIR motion sensor use about ~78uA
// Library and code by Felix Rusu - felix@lowpowerlab.com
// Get the RFM69 and SPIFlash library at: https://github.com/LowPowerLab/

#include <RFM69.h> //get it here: https://www.github.com/lowpowerlab/rfm69
#include <LowPower.h> //get library from: https://github.com/rocketscream/Low-Power
                      //writeup here: http://www.rocketscream.com/blog/2011/07/04/lightweight-low-power-arduino-library/

#include <SPI.h> //get it here: https://github.com/lowpowerlab/spiflash

#define NODEID 21 //unique for each node on same network
// 01 - receiver 1x motion sensors 2x door switches
#define NETWORKID 99 //the same on all nodes that talk to each other
#define GATEWAYID 1
//Match frequency to the hardware version of the radio on your Moteino (uncomment one):
//#define FREQUENCY RF69_433MHZ
//#define FREQUENCY RF69_868MHZ
#define FREQUENCY RF69_915MHZ
#define ENCRYPTKEY "0123456789012345" //exactly the same 16 characters/bytes on all nodes!
//#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W!
#define ACK_TIME 30 // max # of ms to wait for an ack
#define LED 9 // Moteinos have LEDs on D9
#define SERIAL_BAUD 115200
#define MOTIONPIN 1 //hardware interrupt 1 (D3)

RFM69 radio;
volatile boolean motionDetected=false;

void setup() {
  Serial.begin(SERIAL_BAUD);
  radio.initialize(FREQUENCY,NODEID,NETWORKID);

  radio.encrypt(ENCRYPTKEY);
  attachInterrupt(MOTIONPIN, motionIRQ, RISING);
  char buff[50];
  sprintf(buff, "\nTransmitting at %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);
  Serial.println(buff);
}

void motionIRQ()
{
  motionDetected=true;
}

void loop() {

       

  if (motionDetected)
  {
    Serial.println("Motion!!!");


    if (radio.sendWithRetry(GATEWAYID, "DO01", 4)) // door sensors send a message DO plus a number from 01 to 99
     Serial.println(" ok!");
     else Serial.println(" nothing...");
     
     motionDetected=false;

  }   radio.sleep();
     LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);

}

void Blink(byte PIN, int DELAY_MS)
{
  pinMode(PIN, OUTPUT);
  digitalWrite(PIN,HIGH);
  delay(DELAY_MS);
  digitalWrite(PIN,LOW);
}

« Last Edit: August 21, 2018, 09:03:38 AM by gianmarko »

Sergegsx

  • Jr. Member
  • **
  • Posts: 87
  • Country: es
Re: Thank you Felix - Moteino motion sensors stopped real burglars!
« Reply #14 on: August 21, 2018, 12:27:16 PM »
Thanks for such a detail explanation. How do you make sure a node has not run out of battery? Or is not working maybe due to a bad wire connection? What are you using as a gateway to receive the MOTION message ? Thank you