This project was to build a simple garage security system to alert of intruder
access to the garage by notification over Wifi.
Wemos D1 mini & mini protoboard
The esp8266 is the workhorse of any project - it monitors the sensors and
sends notifications over Wifi. I used the
Arduino system with
Platformio for development.
For the small amount of circuitry required one of these tiny protoboards:
You can either get contacts that attach on the door and frame, or ones that
fit flush inside the door/door frame. The flush ones look better, but take a
bit more time to install (drilling / chiselling required), and require the door and frame are both wood.
Weather proof box
To stop the spiders having a field day on the D1 mini it’s worth protecting it
in a box. A bargain at £1.02.
To connect the sensors I used 6-core cabling, only using 2 of the cores.
- Cable clips
- Cable ties
- PCB mountable screw terminals
- USB power supply
|Wemos D1 mini
|D1 mini protoboard
||~$.40 (5 for $4)
|Flush door contact
|USB mains plug
(Excuse the confusing mix of currencies!)
All in, around £10 is pretty good value for the project.
- 20mm spade bit (for the flush sensor)
- 3.5mm wood drill bit
- Soldering iron & solder
- Wire cutters
- Wire strippers
It’s a very simple circuit - D1/D2 are wired into one side of the contacts,
and the other side is grounded. D1/D2 are set as pull-up using the internal
esp8266 pull-up resistors.
I didn’t connect the tamper circuit on the sensors, since this doesn’t really
add anything security wise.
The code is pretty simple, so I’ve left as an exercise. Mine integrates into
my home automation system sending MQTT messages on events, but you could
equally call an HTTP url, for example.
I powered it by USB since our garage is wired up with mains, of course if
someone breaks in they can just switch off the power to the D1, but hopefully
it’ll beat them to sending out a notification of the door sensor being
Also, MQTT ‘wills’ might be an interesting feature to use here, so if the node
is disconnected from Wifi for whatever reason a message fires. Something like
a software tamper switch.
Install the sensors
Time for some woodworking!
It works well. There’s plenty of scope to expand - eg add a siren alarm (may need step-up voltage to 12V).
There are comments.