Wireless security system running on batteries

Stevica Kuharski
4 min readMay 3, 2015

--

In the past few nights I had someone picking the flowers in the garden and stealing my gardening equipment. It’s needless to say that my sense of security is a bit shaken. But not stirred! I’ve sat down and built a simple alarm system that brought my (false) sense of security back!

Wireless security system running on batteries

I wanted to have it very modular and easy to pivot. The only choice with existing equipment in my study room was ESP8266, which is more than enough for the job. System is designed to have one module acting as a WiFi access point and slave modules that will be WiFi stations in the garden. To make things more fun, let’s make our AP somehow wearable so we can carry it around. How to prepare for ESP8266 development, what software to use and what components you need for that, read in my previous blog.

Software repository

MIT licence, https://github.com/kstevica/WiFi-Security-System. Models for 3D printing are included.

Access Point

Almost wearable WiFi access point running on batteries

Hardware needed:
ESP8266 01
variant http://www.ebay.com/itm/ESP8266-Serial-WIFI-Wireless-Transceiver-Module-Send-Receive-LWIP-AP-STA-A-/201205524305?pt=LH_DefaultDomain_0&hash=item2ed8c8a751
Step-down power supply http://www.ebay.com/itm/181561839126?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
Li-Po battery charging board http://www.ebay.com/itm/301454635811?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
2450 rechargable coin battery http://www.ebay.com/itm/400325057433?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
2450 coin battery holder http://www.ebay.com/itm/121145384970?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
Mini breadboard #1 http://www.ebay.com/itm/271637750695?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
Wires, mini switch button, 1x LED 3mm

Prepare the ESP8266–01 using the instructions in my previous blog.

Connect modules:
Battery VCC (+) to the first pin of the switch button
Step-down VIN to the second switch button pin
Charging board to the battery
Battery GND (-) to step-down module GND
ESP8266–01 VCC to step-down OUT
ESP8266–01 GND to step-down GND
LED cathode to ESP8266–01 GPIO2
LED anode to step-down GND

Working access point

Connect ESP8266–01 to the programming spider from the previous blog and upload LUA files using ESPlorer: sensorap.lua and init.lua from sensorap folder. Put the battery in the holder, switch it on and your wearable WiFi access point is ready. Battery has capacity 100–120 mAh, which will power the device for 1h and 20min. It needs ~30 minutes to charge to full again.

Sensor module

WiFi enabled motion sensor with external battery

Hardware needed:
ESP8266–201
http://www.banggood.com/ESP8266-ESP-201-Remote-Serial-Port-WIFI-Transceiver-Wireless-Module-p-964288.html
HC-SR501 motion sensor http://www.ebay.com/itm/251544368199?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
Mini breadboard #2 http://www.ebay.com/itm/190865158157?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
Step-down power supply http://www.ebay.com/itm/181561839126?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
Micro USB to DIP http://www.ebay.com/itm/361171470707?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
Wires, micro USB cable

Connect modules:
ESP8266–201 CH_PD to VCC
ESP8266–201 IO15 to GND
ESP8266–201 IO13 to HC-SR501 OUT
ESP8266–201 VCC to step-down OUT
ESP8266–201 GND to step-down GND
USB DIP VCC to step-down VIN
USB DIP GND to step-down GND
HC-SR501 VCC to step-down VIN
HC-SR501 GND to step-down GND
Micro USB cable to the USB DIP
Antenna to ESP8266–201

Packed in a box

Before we can use the ESP8266–201, we need to flash it. Connect IO0 to GND and flash the firmware the same way you did with the ESP8266–01 module. Upload the sensorread.lua and init.lua from the main folder. If you haven’t, now is the right time to 3D print the case for it. STL files for the box and the lid are included in the git repository. You will need to use duct tape or some superglue to secure the lid to the box. Before you’ll close it, don’t forget to connect the micro USB cable to the USB DIP module and antenna cable through the top antenna hole.

And that’s it! You have built simple security system that uses WiFi as a communication channel. Sensor module has an external battery so we can connect it to AC power supply with standard USB charger or even to a solar panel that can generate constant power of 50 mA on 5V.

WiFi security system

Remember, this is a hobby project. If you’re having a real security issues and believe that your property or you are in danger, consult with security agencies and/or police.

--

--