Smoke Detector Using MQ-2 Gas Sensor and Bharat Pi

by bharatpi in Circuits > Arduino

368 Views, 0 Favorites, 0 Comments

Smoke Detector Using MQ-2 Gas Sensor and Bharat Pi

MQ-2-Smoke-LPG-Butane-Hydrogen-Gas-Sensor-Detector-Module-3.jpg
61VoC1mAJfL._SL1500_.jpg

·      This project uses a smoke detection motion sensor and Bharat Pi to detect the presence of smoke or combustible gases in the environment.

·      The primary purpose of the smoke detector is to provide an early warning system to alert occupants of a building or home about a potential fire or gas leak.

Supplies

aaaaaaaa.jpg
Untitled Diagram (1).jpg

Hardware components

Below is the given list of all the hardware components that are required for this project:

·      Bharat Pi Board (You can buy Bharat Pi board from on Amazon)

·      MQ-2 Sensor

·      Jumper Wire

·      LED  

Software apps and online services

We are going to use Arduino IDE for programming the Bharat Pi. The Bharat Pi can be connected using a USB Type-C connector. Serial drivers are required to be installed for the detection of Bharat Pi. You can download the serial drivers from this depending on the operating system.

·      Arduino IDE

·      CH341 serial drivers for Bharat Pi



Downloads

Story

MQ-2-Smoke-LPG-Butane-Hydrogen-Gas-Sensor-Detector-Module-3.jpg
Artboard-1-e1686767346235.jpg
247488209-2de0aa2c-7df7-481e-a941-b4c3681b5366.png

What is a SMOKE Detection Sensor (MQ-2 sensor)?

 A smoke detector is a device that senses smoke, typically as an indicator of fire. 

 MQ-2 sensor is a smoke and flammable gas sensor which can detect LPG, methane, propane, butane, alcohol, and hydrogen.

The sensor has a built-in sensing material that changes its resistance depending on the type of gas it detects. This type of sensor is also called chemiresistors.

The relationship between the output voltage and the intensity of smoke is as    follows :

As the intensity of the smoke increases, the output voltage also increases.

 As the intensity of the smoke decreases, the output voltage also decreases.

What is Bharat Pi:

In this project, we are using Bharat Pi which has both ESP32 microcontroller and a SimCom A7672S 4G/LTE module.

Bharat Pi is an IoT prototyping board for students, innovators, startups, and developers. A simplified board with an all-in-one compute, network and storage on a single board to build rapid prototypes.

Bharat Pi bundles the power of ESP32, 4G/LTE module in a Arduino form factor. This makes Bharat Pi compatible with all Arduino and ESP32 programs and shields

Wireless monitoring can be done using WiFi or with a Sim based 4G/LTE connectivity.

Bharat Pi is a rugged board with good quality and could be used even for production and live customer deployments!



Code Snippet

FNLWPMGLJEASWFP.jpg
int led = 32;        // the pin that the LED is atteched to
int sensor = 23;       // the pin that the sensor is atteched to
int state = HIGH;      // by default, no motion detected
int val = 0;        // variable to store the sensor status (value)

void setup() {
 pinMode(led, OUTPUT);   // initalize LED as an output
 pinMode(sensor, INPUT);  // initialize sensor as an input
 Serial.begin(115200);    // initialize serial
}

void loop(){
 val = digitalRead(sensor); // read sensor value
 if (val == HIGH) {     // check if the sensor is HIGH
  digitalWrite(led, HIGH); // turn LED ON
  delay(100);        // delay 100 milliseconds
  
  if (state == LOW) {
   Serial.println("Motion detected!");
   state = HIGH;   // update variable state to HIGH
  }
 }
 else {
   digitalWrite(led, LOW); // turn LED OFF
   delay(200);      // delay 200 milliseconds
   
   if (state == HIGH){
    Serial.println("Motion stopped!");
    state = LOW;   // update variable state to LOW
  }
 }
}

Smoke Detection Sensor-Based Projects and Applications

·      The most common and widely used application of smoke detection sensors is in smoke alarms or detectors.

·      Smoke detection sensors can be integrated into smart home systems to enhance safety and automation.

·      In industrial settings, smoke detection sensors play a crucial role in fire prevention and early warning systems.

·      Smoke detection sensors are used in firefighting robots to locate the source of fires and navigate through smoke-filled environments.

·      Smoke detection sensors are integrated into heating, ventilation, and air conditioning (HVAC) systems to prevent smoke or fire spread through ducts.

·      Smoke detection sensors are integrated into heating, ventilation, and air conditioning (HVAC) systems to prevent smoke or fire spread through ducts.