Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Creative Partners
Published © GPL3+

Fire alarm using NodeMcu

We are going to learn how to build a Fire alarm using NodeMCU and Blynk App.

IntermediateFull instructions provided230
Fire alarm using NodeMcu

Things used in this project

Hardware components

Nodemcu
×1
Flame Sensor
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Blynk
Blynk

Story

Read more

Schematics

Circuit Diagram

Code

Code for nodemcu

C/C++
Firs u will have to install NODEMCU Library
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
BlynkTimer timer;
char auth[] = ""; //Auth code sent via Email
char ssid[] = ""; //Your Wifi name
char pass[] = "";  //Your Wifi Password
int flag=0;
void notifyOnFire()
{
  int isButtonPressed = digitalRead(D1);
  if (isButtonPressed==1 && flag==0) {
    Serial.println("Fire in the House");
    Blynk.notify("Alert : Fire in the House");
    flag=1;
  }
  else if (isButtonPressed==0)
  {
    flag=0;
  }
}
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
pinMode(D1,INPUT_PULLUP);
timer.setInterval(1000L,notifyOnFire); 
}
void loop()
{
  Blynk.run();
  timer.run();
}

Credits

Creative Partners
3 projects • 4 followers
Contact

Comments

Please log in or sign up to comment.