Daini
Published © CC BY-SA

IoT based Door Security Alarm Project with Blynk

Today security is one of the prime aspect in our society. Securing our home and family is important.

BeginnerFull instructions provided1 hour3,936
IoT based Door Security Alarm Project with Blynk

Things used in this project

Hardware components

Wemos D1 Mini
Espressif Wemos D1 Mini
×1
magnetic Door Sensor
×1
Arduino Nano R3
Arduino Nano R3
×1
LED (generic)
LED (generic)
×1
Buzzer
Buzzer
×1

Software apps and online services

Arduino IDE
Arduino IDE
Blynk
Blynk

Story

Read more

Schematics

s

Code

Code

Arduino
//nextpcb
//Blynk Door Security Notification System

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
BlynkTimer timer;
char auth[] = "xxxxx"; //Enter the authentication code sent by Blynk to your Email
char ssid[] = "xxxxx"; //Enter your WIFI SSID
char pass[] = "xxxxx"; //Enter your WIFI Password
int flag=0;



void notifyOnButtonPress()
{
  int isButtonPressed = digitalRead(D1);
  if (isButtonPressed==1 && flag==0) {
    Serial.println("Someone Opened the door");
    Blynk.notify("Alert : Someone Opened the door");
    flag=1;
  }
  else if (isButtonPressed==0)
  {
    flag=0;
  }
}
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
pinMode(D1,INPUT_PULLUP);
timer.setInterval(16000L,notifyOnButtonPress); 
}
void loop()
{
  Blynk.run();
  timer.run();
}

Credits

Daini

Daini

31 projects • 16 followers

Comments