Introduction: DIY Motion Sensor (ESP - 8266)
This project is designed for DIY home security. This project is based off the Konnected project. Konnected brings new life to homeowners that have pre-wired motion sensors from ADT and other companies. By giving it an update with new technology while not having a monthly fee. I encourage you to check out https://konnected.io if you want to know more.
I am a big user of the Samsung Smartthings platform and this project was design for that. One problem I had out of the gate was my house was not pre-wired. I was tempted to wire my house but that's too much work. So I designed a 3D printed case to hold the motion sensor and an ESP-8266 that was flashed with Konnected for around 8 dollars. Before we get started yes I know I could of bought a GE Z-Wave Plus Wireless Smart Sensor; but it's fun to make products, learn something new, and save a little money. I am not including the Smartthings hub in the price. I expect you to have that already setup.
Step 1: Hardware
I DO NOT endorse, represent, or receive anything at all for the examples below.
- Smartthings hub https://www.amazon.com/Samsung-SmartThings-Smart-...
- DIY PIR sensor https://www.amazon.com/gp/product/B012ZZ4LPM/ref=...
- 3D Printer ( If you don't have one, there are sites online that will print at a cost.) https://www.makeuseof.com/tag/best-sites-order-3d..
- Wire https://www.amazon.com/Multicolored-Breadboard-Du... (any wire should work)
Micro USB charger and power brick https://www.amazon.com/Samsung-Galaxy-Charger-Act...
Step 2: Files and Software to Download
Programs used are for windows computers.
- NODEMCU Firmware Programmer https://github.com/nodemcu/nodemcu-flasher
- ESPlorer - This will be used to flash the lua files https://esp8266.ru/esplorer/
- Konnected software and original guide. https://github.com/konnected-io/konnected-securit...
- 3D printed case https://www.thingiverse.com/thing:3090238
Step 3: Software Setup / Flashing
Flashing the firmware.
Plug in the ESP 8266 into your computer.
- Open the nodemcu-flasher-master folder (which is in your downloads folder)
- Select win 32 or win 64 ( depending on your computer)
- Open the release folder and double click the ESP8266Flasher.exe
NodeMcu firmware programmer
- In the operations tab verify the com port is correct.
- Select the Config tab
- Click the first gear icon
- File explorer should of opened. Locate the konnected-firmware-X-X-X.bin file. (downloads- konnected security master -firmware)
- Select the operations tab.
- Click flash. The progress will be displayed near the bottom.
Wait till the flash is done before you continue.
ESPlorer -Installing the lua files.
- Open the ESPlorer program
- Verify the drop down box next to donate is set to 115200 -click open (it will change to close) -click the RTS button a few times till you see (Konnected Firmware)
- Click upload near the bottom
- File explorer will open. Locate the src folder (within the konnected security mater folder ) Press control A to select all.
- Click open The side will tell you the progress.
Connecting to Wifi and setting up Smartthings.
I followed the instructions on the konnected website to setup Wifi and Smartthings https://docs.konnected.io/security-alarm-system/
Step 4: Wiring
Using the wire in the description or any you might have laying around.
- Connecting
- Ground from the PIR to any GND on the ESP 8266
- Output from the PIR to pin D1 on the ESP 8266
- 5 v pin to the 3.3v on the ESP 8266 ( yes this will work)
Power
Plug the ESP 8266 into Power, wait a couple minutes.
test it by moving in front of the sensor.
If everything worked, gently slide the electronics into the 3D printed case.
Step 5: Lastly My Experience
I’m mentioning the problems/ changes I had to make in-case you run into it them.
Not detecting motion? Adjusting the sensitivity -
Going off every minute ? I had to replace the Sensor and wires.
I use a 2 Amp charging block.
After a week of use, I set up an automation in the Smartthings app for my room lights.
That’s a wrap. I hope you enjoyed the project.
Comments
5 years ago
These kinds of sensors are really useful for automating Halloween props.