Story
Project Overview
This DIY system is designed to detect motion using a PIR sensor and notify the user via the Blynk mobile app. It uses a NodeMCU (ESP8266) as the core IoT microcontroller, connecting wirelessly to your home network to send real-time alerts whenever motion is detected
Key Components
-
NodeMCU (ESP8266) – Wi-Fi-enabled microcontroller
-
PIR Sensor (e.g., HC‑SR501) – Detects infrared changes from movement
-
LED indicator – Visual feedback on detection
-
Buzzer (optional) – Audible alarm on motion detection
-
Smartphone with Blynk App – For remote notifications
How It Works
-
PIR Sensor monitors infrared radiation and outputs a digital HIGH signal upon detecting motion within its field of view (~3–7 meters, ~110°) .
-
NodeMCU reads this digital signal on a GPIO pin. If level-shifting is needed (5V → 3.3V), a voltage divider is used.
-
Upon motion detection:
-
LED lights up (e.g., red for alert, green for idle).
-
Buzzer starts beeping (if included).
-
A push notification is sent via the Blynk app to the user’s smartphone .
-
Circuit Layout
-
PIR Sensor → NodeMCU digital input (example: D1/GPIO5), with power (VCC, GND)
-
LEDs → NodeMCU output (e.g. D7/GPIO13) via 220 Ω resistor (one LED for normal state, another for alert)
-
Voltage Divider (if needed) to ensure safe voltage levels between PIR output and NodeMCU input
Software & Blynk Integration
-
Setup in Blynk App:
-
Create a project using NodeMCU as the device.
-
Network type: Wi-Fi.
-
You’ll receive an Auth Token via email.
-
Add widgets: Toggle switch (e.g., to enable/disable monitoring) and Notification widget .
-
-
Arduino Code:
-
Connect NodeMCU to Wi-Fi using SSID, password, and Auth Token.
-
Regularly read PIR input:
-
If HIGH → update LED/buzzer → send
Blynk.notify("Motion detected")
. -
If LOW → reset indicators accordingly.
-
-
Add debouncing or timers to avoid frequent alerts.
-
Project Benefits & Applications
-
Use Cases:
-
Low-cost home or office security alert system
-
Room occupancy sensing
-
Motion-triggered LED or alarm activation
-
-
Advantages:
-
Affordable and accessible for beginners
-
Wireless (Wi-Fi) operation via NodeMCU
-
Real-time app notifications anywhere with internet access
-
Easily extendable for SMS, email, or camera integrations
-
Summary Table
Feature | Description |
---|---|
Detection Range | PIR sensor ~3–7 m, ~110° field of view |
Microcontroller | NodeMCU ESP8266 (3.3 V logic, built-in Wi-Fi) |
Alert Mechanisms | LED, buzzer, push notification via Blynk |
Connectivity | Wi-Fi network and Blynk cloud |
Best For | Basic motion alert systems via smartphone |
Extensions & Enhancements
-
Send SMS or email alerts using WebHooks/API integration
-
Attach a camera (ESP32-CAM or similar) to capture snapshots on motion
-
Integrate with cloud dashboards or databases for longer-term logging
-
Automate alarms, lights, or voice announcements upon detection
In conclusion, this project offers a straightforward and practical approach to building a motion detection alert system using NodeMCU, PIR sensor, and the Blynk platform. It's ideal for learning IoT fundamentals, sensor interfacing, and remote monitoring.