0% found this document useful (0 votes)
6 views3 pages

Code

The document is a code for a gas leak monitoring and alert system using an ESP32 microcontroller with Blynk integration. It includes functionalities for reading smoke sensor data, displaying alerts on an LCD, and sending notifications via email when gas leakage is detected. The system also activates a buzzer for alerts and updates the LCD display based on sensor readings.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

Code

The document is a code for a gas leak monitoring and alert system using an ESP32 microcontroller with Blynk integration. It includes functionalities for reading smoke sensor data, displaying alerts on an LCD, and sending notifications via email when gas leakage is detected. The system also activates a buzzer for alerts and updates the LCD display based on sensor readings.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

#define BLYNK_TEMPLATE_ID "TMPL2oQOewPof"

#define BLYNK_TEMPLATE_NAME "Gas Leak monitoring and alert "


#define BLYNK_AUTH_TOKEN "MYEILdq8Gk9NVcnJsdghw-DFcmFO3dCz"

#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

#include <LiquidCrystal_I2C.h> //LCD DISPLAY

char auth[] = BLYNK_AUTH_TOKEN;

int lcdColumns = 16;


int lcdRows = 2;
// set LCD address, number of columns and rows
// if you don't know your display address, run an I2C scanner sketch
LiquidCrystal_I2C lcd(0x27, lcdColumns, lcdRows);

char ssid[] = "Tomz";


char pass[] = "tomlitomz";
BlynkTimer timer;

const int smokeA0 = 34;


//pins that works with internet
//analogRead( 39 );
//analogRead( 34 );
//analogRead( 35 );
//analogRead( 32 );
//analogRead( 33 );
int sensorThres = 100;
const int buzzerPin = 23;
int data;

void sendSensor(){

[Link](V0, data);

//[Link](data);

if(data > 600){


//[Link]("test@[Link]", "Alert", "Gas Leakage Detected!");
[Link]("fire_alert_notification","FIRE ALERT!!!!!!!! Shop L03,
Joina City- Corner Julius Nyerere Way & Jason Moyo Avenue, Central
Business District, Harare [Link] A987 Av");
[Link](0, 0);
// print message
[Link]("FIRE ALERT!!!!!:");
//[Link](data)
digitalWrite(buzzerPin, HIGH);// Turn the buzzer on;
delay (60000) ;
digitalWrite(buzzerPin, LOW);
delay (60000) ;

}
else {
[Link](0, 0);

[Link]();
// print message
[Link]("NO DANGER:");
digitalWrite(buzzerPin, LOW);}
}
void setup() {
// initialize LCD
[Link]();
// turn on LCD backlight
[Link]();
pinMode(buzzerPin,OUTPUT);

[Link](9600);
[Link](auth, ssid, pass);
pinMode(smokeA0, INPUT);
[Link](2500L, sendSensor);
}

void loop() {
data = analogRead(smokeA0);
[Link](0,1);
//delay(500);
[Link](data);
delay(1000);
[Link](data);
[Link]();
[Link]();
}

You might also like