In this project we use ESP8266 in its NodeMCU form factor as a home security device which with the help of PIR sensor senses the movement of intruder and sends and email and mobile notification to the owner along with the time.What is PIR Sensor?
A passive infrared sensor PIR sensor is an electronic sensor that measures infrared (IR) light radiating from objects in its field of view. They are most often used in PIR-based motion detectors. PIR sensors are commonly used in security alarms and automatic lighting applications hence we would be using it.So Lets Get Started!Hardware Setup:
- Start by placing the NodeMCU on a breadboard as shown below:
- Place the PIR Sensor on the breadboard as shown below:
- Make the breadboard connections as shown :
VCC <<=>> VCC
GND <<=>> GND
OUT <<=>> D5
This project uses PlatformIO for compiling and building and for library management and Blynk for real time notifications.
- Make sure you have Python on your system by running the command and it should give you its version.
$ python --version Python 3.x.x
- Install PlatformIO with pip.
$ pip install platformio
- Download the Blynk App on your phone.
- Create an account.
- Scan the QR code given below with Blynk to get the project.
- Open your email and get the Authentication Token of the project.\
- Keep the Authentication token handy.
- Download the project from Github Repository.
- Open the file config.h in include directory and update the credentials.
/** * Configuration file */ // You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). constexpr auto auth = ""; // Your WiFi credentials // Set password to "" for open networks. constexpr auto ssid = ""; constexpr auto password = ""; // Your Email address for notification constexpr auto email = ""; // Pin for PIR Sensor constexpr auto PIR_PIN = D5;
- Plug ESP8266 in your computer and upload the code using the command
$ platformio run
Whenever the PIR sensor senses an intruder, it will send email as well as mobile notification to the person.
Github Repository Link : https://github.com/kumaraditya303/ESP8266-Blynk-Home-Security.git