A doorbell... etc...
Recently my doorbell failed. It wasn't just any old doorbell either.
The previous owner of my house worked for an alarm company & it
seems that he brought his work home. As well as an intruder alarm
system more suited to a bank he'd also installed a neat intercom
with the doorbell. Sadly, when the doorbell failed I didn't have the
time to sort it as I had no documentation whatsoever. I put a little
sticker on it saying, 'Please knock.' It's been like that for months
now...
I've been preparing teaching materials for my students based on the
ESP8266 WiFi microcontroller & ended up creating a new doorbell
when I stumbled upon OpenMQTTGateway
This is a very brief page because OpenMQTTGateway
does almost everything.
I bought a few 433MHz PIR detectors on Ebay:
These cost £2.99 including delivery.
They seem to come in two styles. One has little jumpers inside to
set the transmit code & the other generates a 'unique' code of
its own. They both work fine.
Build the gateway device. You need a ESP8266 and a 433MHz receiver.
I've used a Wemos D1 for convenience here. Since I took the photo
I've replaced the 433MHz receiver with a superhet
device. As well as being slightly smaller it also gives better
range.
Next: Set up a MQTT broker. Let's be cheap & use a Raspberry Pi
Zero:
These cost £5 if you can get one. Add a
£1 Wifi adapter & we're good to go. We need a micro usb
card too...
Fire up node-red on the Pi, I use the Thingbox which has MQTT &
node-red ready rolled. Design your system:
In this example I have 4 PIR detectors & a push button. They
alert me via 'pushover' which is
a web-app which pushes(!) alerts to my mobile phone.
It's very unsophisticated as it stands but it works a treat.
Not bad for £25?!
Summary
Let's summarise what is happening here; I have several simple 433MHz
devices: 4 PIRs & a handheld pushbutton which has on & off
buttons.
They transmit to the gateway (an ESP8266). Essentially they just
transmit a 'number' which uniquely identifies each device.
The gateway publishes to the MQTT broker on the Raspberry Pi.
Node-red, also on the RPi, picks up the published data (far left in
the diagram above) and passes it to the switch node.
The switch node matches the codes received to known devices. It's
basically a switch/case operation.
The 433Mhz devices 'spew' data so the following 'delay' nodes limit
their output which is fed into a 'change' node.
The change node swaps the numeric ID of the sensor to something
meaningful, eg '14112560' becomes 'door PIR' & we send this to
the 'tell pushover' node.
This is a 'http request' node which POSTs our data to Pushover.
& I receive a notification on my phone.
Ian Sexton 2017