Sharifdeen Ashshak
Published

Human detect home security system Using Iot

Human detection Security System Using IOT

BeginnerFull instructions provided499
Human detect home security system Using Iot

Things used in this project

Hardware components

PIR Motion Sensor (generic)
PIR Motion Sensor (generic)
×1
NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
×1
UTSOURCE Electronic Parts
UTSOURCE Electronic Parts
×1
Breadboard (generic)
Breadboard (generic)
×1
LED (generic)
LED (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE
Blynk
Blynk

Story

Read more

Code

Download the code here

C/C++
/**************************************************************
 * IoT Motion Detector with Blynk
 * Blynk library is licensed under MIT license
 * This example code is in public domain.
 * 
 *FOR MORE PROJECT VISIT WWW.BLACKKEYHOLE.COM
 **************************************************************/
#include <ESP8266WiFi.h>

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <BlynkSimpleEsp8266.h>
char auth[] = "65d9cf145e7a442291c612f24e1df68b";

/* WiFi credentials */
char ssid[] = "ROVAI TIMECAP";
char pass[] = "mjr747@1";

/* HC-SR501 Motion Detector */
#define ledPin D2 
#define pirPin D1 // Input for HC-S501
int pirValue; // Place to store read PIR Value
int motionDetected = 0;

void setup()
{
  Serial.begin(115200);
  delay(10);
  Blynk.begin(auth, ssid, pass);
  pinMode(ledPin, OUTPUT);
  pinMode(pirPin, INPUT);
  digitalWrite(ledPin, LOW);
}

void loop()
{
  getPirValue();
  Blynk.run();
}

/***************************************************
 * Get PIR data
 **************************************************/
void getPirValue(void)
{
  pirValue = digitalRead(pirPin);
  if (pirValue) 
  { 
    Serial.println("==> Motion detected");
    Blynk.notify("T==> Motion detected");  
  }
  
  digitalWrite(ledPin, pirValue);
}

Credits

Sharifdeen Ashshak

Sharifdeen Ashshak

15 projects • 3 followers

Comments