IoT SENTRY
WELCOME Judges
OUR MOTTO: TO PROVIDE BASIC SECURITY TO EVERYONE IRRESPECTIVE OF THEIR ECONOMIC STATUS
COMpONENTS REQUIRED TO MAKE THIS PROJECT:
hardware :
software:
/
Serial.println(isTheftAlert);
if (isTheftAlert==1) {
Serial.println("SECURITY BREACH DETECTED CALL EMERGENCY NUMBER");
Blynk.logEvent("theft_alert","SECURITY BREACH DETECTED CALL EMERGENCY NUMBER");
// flag=1;
}
else if (isTheftAlert==0)
{
// flag=0;
}
}
void setup(){
pinMode(PIR_SENSOR, INPUT);
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
//dht.begin();
Code:
C++
#define BLYNK_TEMPLATE_ID "YOUR TEMP ID "// NOT SHOWN FOR SECURITY REASONS
#define BLYNK_TEMPLATE_NAME "YOUR TEMP NAME "// NOT SHOWN FOR SECURITY REASONS
#define BLYNK_AUTH_TOKEN "YOUR AUTH tOKEN "// NOT SHOWN FOR SECURITY REASONS
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "YOUR SSID"; // type your wifi name// NOT SHOWN FOR SECURITY REASONS
char pass[] = "YOUR PASS"; // type your wifi password// NOT SHOWN FOR SECURITY REASONS
#define PIR_SENSOR 4
BlynkTimer timer;
//int flag=0;
void notifyOnTheft()
{
int isTheftAlert = digitalRead(PIR_SENSOR);
}
Serial.printl(isTheftAlert);
if (isTheftAlert==1) {
Serial.println("SECURITY BREACH DETECTED CALL EMERGENCY NUMBER");
Blynk.logEvent("theft_alert","SECURITY BREACH DETECTED CALL EMERGENCY NUMBER");
// flag=1;
}
else if (isTheftAlert==0)
{
// flag=0;
}
}
void setup(){
pinMode(PIR_SENSOR, INPUT);
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
//dht.begin();
TIMER.SETINTERVAL(5000L, NOTIFYONTHEFT);
}
VOID LOOP(){
BLYNK.RUN();
TIMER.RUN();
}
code explanation in short:
This code is for an ESP8266-based IoT project using Blynk. It monitors a PIR motion sensor, and when motion is detected, it logs an alert to Blynk and prints a message to the serial monitor. The code connects to Wi-Fi, initializes Blynk, and sets up a timer to check for motion every 5 seconds.
hope you liked my project and enjoyed the convenient website
thank you