Techatronic
Published

Blynk LPG Detector

This is an LPG detector project that uses an MQ-6 sensor for detecting LPG gas leakage.

BeginnerFull instructions provided2 hours231
Blynk LPG Detector

Things used in this project

Hardware components

NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
×1
Gravity: Analog Propane Gas Sensor (MQ6) For Arduino
DFRobot Gravity: Analog Propane Gas Sensor (MQ6) For Arduino
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
×1
Arduino UNO
Arduino UNO
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

Code snippet #1

Plain text
void setup() 
{
  Serial.begin(115200);
  Blynk.begin(auth, ssid, pass);
  timer.setInterval(1000L, getSendData);
}
 
void loop() 
{
  timer.run(); // Initiates SimpleTimer
  Blynk.run();
}

Code snippet #2

Plain text
void setup() 
{
  Serial.begin(115200);
  Blynk.begin(auth, ssid, pass);
  timer.setInterval(1000L, getSendData);
}
 
void loop() 
{
  timer.run(); // Initiates SimpleTimer
  Blynk.run();
}

Code snippet #3

Plain text
void getSendData()
{
data = analogRead(mq6); 
  Blynk.virtualWrite(V2, data); // Blynk INPUT Connect V2 Pin
 
  if (data > 700 )
  {
    Blynk.notify("LPG Detected!"); 
  }
 
}

Code snippet #4

Plain text
void getSendData()
{
data = analogRead(mq6); 
  Blynk.virtualWrite(V2, data); // Blynk INPUT Connect V2 Pin
 
  if (data > 700 )
  {
    Blynk.notify("LPG Detected!"); 
  }
 
}

Code snippet #5

Plain text
//TECHATRONIC.COM
// BLYNK LIBRARY
// https://github.com/blynkkk/blynk-library
// ESP8266 LIBRARY
// https://github.com/ekstrand/ESP8266wifi

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
char auth[] = "your-auth-code"; //Enter Authentication code sent by Blynk
 

char ssid[] = "your-wifi-ssid"; //Enter WIFI Name
char pass[] = "your-wifi-password"; //Enter WIFI Password
 
SimpleTimer timer;
 
int mq6 = A0; // LPG sensor MQ -6 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(mq6); 
  Blynk.virtualWrite(V2, data); // Blynk INPUT Connect V2 Pin
 
  if (data > 700 )
  {
    Blynk.notify("LPG Detected!"); 
  }
 
}

Code snippet #6

Plain text
//TECHATRONIC.COM
// BLYNK LIBRARY
// https://github.com/blynkkk/blynk-library
// ESP8266 LIBRARY
// https://github.com/ekstrand/ESP8266wifi

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
char auth[] = "your-auth-code"; //Enter Authentication code sent by Blynk
 

char ssid[] = "your-wifi-ssid"; //Enter WIFI Name
char pass[] = "your-wifi-password"; //Enter WIFI Password
 
SimpleTimer timer;
 
int mq6 = A0; // LPG sensor MQ -6 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(mq6); 
  Blynk.virtualWrite(V2, data); // Blynk INPUT Connect V2 Pin
 
  if (data > 700 )
  {
    Blynk.notify("LPG Detected!"); 
  }
 
}

Credits

Techatronic

Techatronic

72 projects • 122 followers
Electronic engineer

Comments