NodeMCU Motion Detect ( PIR ) Mail Notification

by AndreasO1 in Circuits > Arduino

3787 Views, 19 Favorites, 0 Comments

NodeMCU Motion Detect ( PIR ) Mail Notification

pipePIR.JPG
NodeMCU PIR with Mail Notification

What you need:

NodeMCU 1.0

PIR i use a HC-SR501

PowerSupply for outdoor use

Some wires

USB 3.0 Port to program and run the nodemcu (I do not know USB 2.0 can work,too. But 3.0 has more Power)

I use Arduino IDE 1.6.8 with NodeMCU ESP8266 libraries

Make sure your setup works, with a blink example sketch, or similar.

Connecting

Load the Data From My GitHub and Set It All Up

to WEB.PNG

Load the files to your webspace:

add_data

data_review.php

dbconnect.php

Get it from my GitHub: https://github.com/Landixus/NodeMCUMotion

setup your files in add_data.php and dbconnect.php (You need to setup these files, they are commented)

You need a mySQL database on you webspace:

The SQL file with 1 entry is in my GitHub, you can execute the SQL Statement for example with phpMyAdmin.

try that it works with:

http://YOURWEBSITE.DOMAIN/arduino/add_data.php?mot...

it must add an entry and send you an email, if you get your entry and mail, go to Arduino ide and load the code in the NodeMCU after you setup

your SSID and Password, also the other values for your website. (documented in code).

my PIN is: "int pirPin = 4;" (D2)

in line 88 / 89 you find the data to change for your website, also with an .htaccess example for serious use.

Wire Up

Node-MCU-Pin-Out-Diagram1.png
pipePIR.JPG

The pir HC-SR501 works with 3.3V.

See my Video, you can power it with 3.3V the PIN next to the Trigger Jumper.

Power from 3.3V right from the UBS Port from the NodeMCU and bring GND to GND

The PIR is really Sensitive, you can try to make a pipe over the sensor to make it less sensitive:

Beware of much mails! The best location is INSIDE for use.

Outside, you get many fake detects during light changing.

If you are running in trouble just drop me a comment, and i try to help.