IoT USB Powered Motion Sensor

I designed this IoT USB powered motion sensor so it could be powered by any old USB phone charger laying around the…
3
5
0
378
updated October 27, 2021

Description

PDF

I designed this IoT USB powered motion sensor so it could be powered by any old USB phone charger laying around the house. It requires soldering and It uses the following components:

Electronics perf board
22Ga. wire
2.54mm female pin headers
2-Pin Screw Terminal Block Connector 2.54mm Pitch
AM312 Mini Pyroelectric PIR Human Sensor Module Infrared IR Sensor Detector
ESP8266 ESP-01 (Black) WiFi Serial Transceiver Module with 1MB Flash (NOT ESP-01S)
HT7333-A Voltage Regulator
1000uF Electrolytic Capacitor
100nF Ceramic Capacitor
Jabinco Type A Male USB 4 Pin Plug Socket Connector with Black Plastic Cover

Post-Printing

A little more info on how I set mine up...

There are three variants of the of ESP-01 WiFi Serial Transceiver Module

Revision Flash Power LED Blue LED Blue ESP-01 512k None TX/GPIO1/low Black ESP-01 1M Red TX/GPIO1/low Black ESP-01S 1M Red IO2/low The Black ESP-01 is what I used and will work with this project. The ESP-01S will not work with the wiring diagram I provided that uses GPIO 0 for the PIR motion sensor. It might work if you change the wiring to use GPIO 02, but I haven't tested it. Best to bread board it first. I discovered that there is a surface mount resistor on the ESP-01S that can be removed which will enable the PIR motion sensor to work on GPIO 0.

STEPS:

-Installed Tasmota on the ESP-01 (Black) and used the custom Tasmota config from here:
https://templates.blakadder.com/ESP01.html

-Setup a user account for the motion sensor on my Mosquitto MQTT server

-Ran the following Tasmota console commands:

My Custom rule (console) : KitchenMotionSensor
Rule1 0
Rule1 ''
SwitchTopic 0
Switchmode1 1
Rule1 ON Switch1#State=1 DO Backlog publish motion/house/kitchen True; RuleTimer1 1800 ENDON ON Rules#Timer=1 DO publish motion/house/kitchen False ENDON

Rule1 1 (enable rule)

RuleTimer1 (show timer)

-Create an automation in Node-RED to connect the motion/house/kitchen topic with the Sonoff Mini controlling the light switch for my over the sink light in the kitchen.

How I Designed This

About the design process...

I run Ubuntu Linux on all my home computers. This limits my choices for CAD software so I have taught myself how to use FreeCAD since there is a native Linux version that seems to be getting more stable as time goes by.

Category: 3D Printing

Tags



Model origin

The author marked this model as their own original creation. Imported from Thingiverse.

License


Highlighted models from creator

View more