• Hardware model: Node Mcu ESp8266 with WiFi
•
• Blynk server
• Blynk Library version v1.2
#define BLYNK_TEMPLATE_NAME "Gas Monitoring"
#define BLYNK_AUTH_TOKEN "sTh1_gc1d1sbrmKMThH0OmD4NJsZhx4J"
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
BlynkTimer timer;
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
char auth[] = "sTh1_gc1d1sbrmKMThH0OmD4NJsZhx4J"; //Enter Authentication code sent by Blynk on your regested email
char ssid[] = "STC_WiFi_4G"; // Enter WIFI Name Here
char pass[] = "00000000"; // Enter WIFI Password Here
int mq5 = A0; // smoke sensor is connected with the analog pin A0
int data = 0;
void setup()
{
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
timer.setInterval(1000L, getSendData);
}
void loop()
{
timer.run(); // Initiates SimpleTimer
Blynk.run();
}
void getSendData()
{
data = analogRead(mq5);
Blynk.virtualWrite(V2, data);
if (data > 225 )
{
Blynk.notify("Gas Leakage Detected");
Help, please.