SensorsUncategorized

What is MQ2 Gas or Smoke Sensor & How does it work ?

Hey Engineers & Developers! Supposing you’re a long-time subscriber or a first-time visitor to our website, I’m Riyad Munshi, thrilled to have you here. In this blog, you will gain insight knowledge of MQ2 Gas/Smoke Sensor for detecting gas or smoke. Whether you’re a hobbyist or a professional in this field, understanding the basics of the MQ2 Gas/Smoke Sensor can greatly enhance your projects and applications.

What is MQ2 Gas/Smoke Sensor?

The MQ2 gas or smoke sensor is widely use sensor that detects a variety of gases and smoke in the surrounding environment. This sensor is based on the Robust Body Sensor (RBS) technology, which allows it to accurately detect the presence of gases such as LPG, propane, methane, alcohol, hydrogen, and even smokes.

MQ2 Gas Sensor

With its ability to detect such a wide range of gases, it has become a valuable sensor in residential, commercial, and industrial devices and Applications.

Working Principal of MQ2 Gas/Smoke Sensor!

  • Sensing Mechanism: The MQ2 gas or smoke sensor operates on the principle of chemiresistive detection. It can sensing element made of a metal oxide semiconductor (MOS) material. When the sensor is sensing the target gas or smoke, a chemical reaction occurs on the surface of the sensor’s element.
  • Detecting Gas Concentration: The presence of the target gas or smoke causes changes in the conductivity of the sensing element. This changes in conductivity converted into electrical signals. The electrical signals can be measured and analyzed by micro controller or other controlling devices.
  • Heating Element: The MQ2 gas or smoke sensor also have a heating element to improve the chemical reaction on the sensing element. This heating element ensures that the sensing element operates at an optimal temperature, for accurate detection of gases and smoke. The heating element is powered by a low voltage, typically between 5V and 10V.
  • Calibration: It is important to calibrate the MQ2 gas or smoke sensor periodically to ensure accurate readings. This process ensures that the sensor provides accurate measurements over time.

Hardware Overview of MQ2 Gas/Smoke Sensor!

The internal structure of the MQ2 gas sensor consists of several components. The MQ2 Gas Sensor operates based on the metal oxide (MOx) semiconductor technology.

MQ2 Gas Sensor Module

Gas-Sensitive Material: The core of the MQ2 sensor is a gas-sensitive material. It’s electrical conductivity changes when it comes into contact with specific gases. Typically, the gas-sensitive material is a tin dioxide (SnO2) semiconductor.

Gas Sensitive Materials

Anti-explosion network: MQ2 Gas Sensor use a stainless steel mesh called Anti-explosion network. In industrial environments, there is a need for electronic equipment that is designed to prevent the initiation of an explosion. Devices such as cameras, sensors, and communication equipment used in potentially explosive atmospheres may be designed as explosion-proof.

Anti-explosion network:

Heater Coil: The gas-sensitive material in MQ2 is heated by a built-in heater coil. The heating process is essential for the sensor’s operation as it increases the sensitivity of the gas-sensitivity.

Heater Coil

Ceramic Substrate: The gas-sensitive material is often deposited on a ceramic substrate. The ceramic material provides mechanical stability and electrical insulation.

Ceramic Substrate

Adjustment Potentiometer: You can increase decrease sensitivity of MQ2 sensor via a potentiometer, on back of the board . Turn the potentiometer to clockwise for increasing the sensitivity or turn anticlockwise for decreasing sensitivity.

Back of MQ2 Gas Sensor Module or Adjustment Potentiometer

The micro controller on the module continuously check the analog pin (A0) has cross the value set via potentiometer. If it crosses the value, the digital pin (D0) will go HIGH or 5v (positive) and signal LED turns on. This is useful when you need to trigger an action. When the smoke crosses a limit, you can turn on or off a relay to turn on alarm or any future actions.

Technical Specifications of MQ2 Gas/Smoke Sensor

  • Sensor Type: Semiconductor gas sensor based on metal oxide (MOx) technology.
  • Detected Gases: LPG (Liquefied Petroleum Gas), Propane, Methane, Carbon Monoxide, Smoke.
  • Operating Voltage: 5V DC.
  • Load resistance: 20 KΩ.
  • Heater resistance: 33Ω ± 5%.
  • Heating consumption: <800mw.
  • Current Consumption: Low power consumption, suitable for battery-powered applications.
  • Sensing Resistance: 10 KΩ – 60 KΩ.
  • Concentration Scope: 200 – 10000ppm.
  • Warm-up Time: Over 24 hour.
  • Analog Output: Provides an analog voltage signal that varies based on the concentration of the detected gas
  • Digital Output: Some versions of the MQ-2 sensor may include a digital output that signals the presence or absence of a certain gas concentration threshold.

MQ2 Gas/Smoke Sensor Pinout

MQ2 Gas Sensor Module Pinout
  • AO (Analog Output): Connects to an analog input on your micro controller.
  • DO (Digital Output): Connects to a digital input on your micro controller (if available).
  • GND (Ground): Connects to the ground of your power supply.
  • VCC (Power Supply): Connects to the positive supply voltage (usually 5V).

Uses and Application of MQ2 Gas/Smoke Sensor

The versatility and reliability of the MQ2 gas or smoke sensor make it suitable for various applications. Some of the applications include here.

  • Home Safety: The sensor can use in homes to detect gas leaks, ensuring timely response to minimize potential threat.
  • Industrial Environments: In industrial settings, the sensor plays a vital role in ensuring workplace safety by detecting dangerous gases and smoke particles.
  • Fire Detection Systems: The MQ2 gas or smoke sensor is an integral part of fire detection systems, enabling early detection of smoke and Fire Occurrence.
  • Environmental Monitoring: The sensor finds applications in environmental monitoring systems, helping to detect and analyze pollution in the air.
  • Gas Leakage Detection: It can use in commercial Industries, such as restaurants or hotels, to detect the leakage of flammable gases like LPG.

Using MQ2 Gas/Smoke Sensor with Arduino

Using an MQ2 gas/smoke sensor with an Arduino is a common and straightforward project. The MQ2 sensor can detect various gases, including methane, propane, carbon monoxide, and smoke. Here’s a basic guide on how you can set up the MQ2 sensor with an Arduino.

Wiring MQ2 sensor to the Arduino

Connect the MQ2 sensor to the Arduino using jumper wires.

Wiring MQ2 sensor to the Arduino
  • Connect the VCC pin of the MQ2 sensor to the 5V pin on the Arduino.
  • Connect the GND pin of the MQ2 sensor to the GND pin on the Arduino.
  • Connect the AOUT pin of the MQ2 sensor to any A0 pin on the Arduino.
  • Connect the DOUT pin of the MQ2 sensor to any D2 pin on the Arduino.

Power up the Arduino by connecting it to your computer or an external power source.

Arduino Code

/*
Project:  Using HC-SR501 PIR Sensor with Arduino
Full Project Link: https://srtachzone.com/what-is-hc-sr501-pir-sensor-how-does-it-work/
*/
const int analogPin = A0;  // Analog pin connected to AOUT of the MQ2 sensor
const int digitalPin = 2;  // Digital pin connected to DOUT of the MQ2 sensor

void setup() {
  Serial.begin(9600);  // Initialize serial communication
  pinMode(digitalPin, INPUT);  // Set DOUT pin as input
}

void loop() {
  int analogValue = analogRead(analogPin);  // Read analog value from AOUT pin
  int digitalValue = digitalRead(digitalPin);  // Read digital value from DOUT pin

  Serial.print("Analog Value: ");
  Serial.println(analogValue);

  Serial.print("Digital Value: ");
  Serial.println(digitalValue);

  delay(1000);  // Delay for 1 second
}
const int analogPin = A0;  // Analog pin connected to AOUT of the MQ2 sensor
const int digitalPin = 2;  // Digital pin connected to DOUT of the MQ2 sensor

void setup() {
  Serial.begin(9600);  // Initialize serial communication
  pinMode(digitalPin, INPUT);  // Set DOUT pin as input
}

void loop() {
  int analogValue = analogRead(analogPin);  // Read analog value from AOUT pin
  int digitalValue = digitalRead(digitalPin);  // Read digital value from DOUT pin

  Serial.print("Analog Value: ");
  Serial.println(analogValue);

  Serial.print("Digital Value: ");
  Serial.println(digitalValue);

  delay(1000);  // Delay for 1 second
}

Results

The analog value obtained from the AOUT pin represents the gas concentration. You may need to calibrate the sensor based on your specific requirements and the target gas. The digital value obtained from the DOUT pin can be used to detect the presence of a certain gas beyond a set threshold. Remember to refer to the datasheet of your specific MQ2 sensor model for more accurate calibration and interpretation of sensor readings. Additionally, consider incorporating safety measures when working with gases and sensors.

Wrapping up

In this post, we’ve covered all the fundamental aspects of the MQ2 Gas/Smoke Sensor. I trust that the information provided has been clear and insightful. Feel free to ask any questions you may have about this topic in the comment section below. I’m here to help and provide additional clarification as needed.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button