Difference between revisions of "MQ-2 Gas Sensor Module"

From Wiki
Jump to: navigation, search
 
(4 intermediate revisions by the same user not shown)
Line 19: Line 19:
 
=='''Working Principle'''==
 
=='''Working Principle'''==
 
[[File:MQ-3.jpg]]<br>
 
[[File:MQ-3.jpg]]<br>
After wiring VCC and GND, the Power LED of the module lights up. Before your using, it is a normal phenomenon that the sensor generates heat slightly and that the power supply preheats for at least 2 minutes. It is normal for the sensor to generate heat slightlyB, because there is heating wire inside. But it is abnormal that the sensor becomes overheating.  
+
After wiring VCC and GND, the Power LED of the module lights up. Before your using, the power supply preheats for at least 2 minutes. It is normal for the sensor to generate heat slightly, because there is heating wire inside. But it is abnormal that the sensor becomes overheating. When there is no impact of the sensible gas or the gas concentration is not more than the preset threshold, the digital interface D0 outputs high level and the voltage of the analog interface A0 is around 0V. When the gas concentration is beyond the threshold, the digital interface D0 outputs low level and the digital indicator light is on. And the output voltage of the analog interface A0 increases with the raising of the gas concentration,A0 Output: 0.1-0.3V (relatively non-polluted).
When there is no impact of the sensible gas or the gas concentration is not more than the preset threshold, the digital interface D0 outputs high level and the voltage of the analog interface A0 is around 0V.  And the output voltage of the analog interface A0 increases with the raising of the gas concentration. When the gas concentration is beyond the threshold, the digital interface D0 outputs low level and the digital indicator light is on. And the output voltage of the analog interface A0 increases with the raising of the gas concentration,A0 Output: 0.1-0.3V (relatively non-polluted).
+
With the gas concentration being higher, the voltage can reach up to 4V.  
A0 Output: 0.1-0.3V (relatively unpolluted). With the gas concentration being higher, the voltage can reach up to 4V.  
+
Rotate the knob of the potentiometer clockwise, you can get the sensing range of the gas concentration wider (only for the sensitivity of the TTL output).   
Rotate the knob of Adjust the potentiometer clockwise, you can get the sensing range of the gas concentration wider (only for the sensitivity of the TTL outputof the TTL Output) wider.   
+
The digital output D0 can drive the relay module directly, which can form a gas switch. The digital output D0 can also drive the positive buzzer module and this module can be used to make up a gas alarm. The analog output A0 can be connected to AD module and get the approximate values of the ambient gas concentration via AD conversion.
The digital output D0 can drive the relay module directly, which can help getform a gas switch. The digital output D0 can also drive the positive buzzer module and this phenomenonmodule can be used to make up a gas alarm. The analog output A0 can be connected to AD module and get the approximate values of the ambient gas concentration in the surrounding air via AD conversion.
+
  
 
='''For Arduino'''=
 
='''For Arduino'''=
Line 34: Line 33:
  
 
'''Step 2: Copy the following codes and paste them in Arduino.'''<br>
 
'''Step 2: Copy the following codes and paste them in Arduino.'''<br>
<pre>
+
<pre style="color:blue">
 
///Arduino Sample Code
 
///Arduino Sample Code
 
void setup()
 
void setup()
Line 48: Line 47:
 
}
 
}
 
</pre>
 
</pre>
The codes above are used to acquire the signal of the gas sensor via the analog interface 0 and to output the signals into the computer via serial port. To observeget the consequence, we can use serial port monitorCommAssistant. <br>
+
The codes above are used to acquire the signal of the gas sensor via the analog interface 0 and to output the signals into the computer via serial port. To observe the consequence, we can use serial port monitor. <br>
  
 
[[File:MQ-5.jpg]]<br>
 
[[File:MQ-5.jpg]]<br>
  
Due to the internal structure of the gas sensor, the measurement can only begin after one minute’s preheating. During preheating, you can easily feel the hot of the probe. When the preheat is finished, the data are around 120 (only for reference, the value can be variable with the changing of the circumstance). According to the parameter of the probe, in the clean air, the data value might be less than 310. <br>
+
Due to the internal structure of the gas sensor, the measurement can only begin after one minute's preheating. During preheating, you can easily feel the hot of the probe. When the preheat is finished, the data are around 120 (only for reference, the value can be variable with the changing of the circumstance). According to the parameter of the probe, in the clean air, the data value might be less than 310. <br>
  
 
=='''Resource'''==
 
=='''Resource'''==
 +
[http://wiki.sunfounder.cc/images/8/80/MQ-2_Datasheet.pdf MQ-2_Datasheet]<br>
 
[https://www.sunfounder.com/learn/Sensor-Kit-v2-0-for-Arduino/lesson-10-flammable-gas-detection-sensor-kit-v2-0-for-arduino.html Test Experiment for Arduino][[File:LINK.jpg]]<br>
 
[https://www.sunfounder.com/learn/Sensor-Kit-v2-0-for-Arduino/lesson-10-flammable-gas-detection-sensor-kit-v2-0-for-arduino.html Test Experiment for Arduino][[File:LINK.jpg]]<br>
 
[https://www.sunfounder.com/learn/sensor-kit-v2-0-for-raspberry-pi-b-plus/lesson-22-gas-sensor-sensor-kit-v2-0-for-b-plus.html Test Experiment for Raspberry Pi][[File:LINK.jpg]]
 
[https://www.sunfounder.com/learn/sensor-kit-v2-0-for-raspberry-pi-b-plus/lesson-22-gas-sensor-sensor-kit-v2-0-for-b-plus.html Test Experiment for Raspberry Pi][[File:LINK.jpg]]

Latest revision as of 06:10, 5 September 2019

Introduction

Mq-2 Gas Senseor.jpg MQ-1.jpg

The gas sensitive material used in the MQ-2 gas sensor is SnO2, a low electrically conductive material in clean air. When there is combustible gas in the surrounding air, the electrical conductivity of the sensor will increase with the higher intensity of the combustible gas. Here, we can convert the changing electrical conductivity into output signal by building a simple circuit.

Main Features

  • Detected Gas: Combustible Gas, Smoke
  • Detection Intensity: 300~10000ppm(Combustible Gas)
  • Working Voltage: 5.0V±0.1V AC or DC
  • Preheating Time: ≥2 minutes

Introduction of the Pins

  • VCC: 5V Working Voltage
  • GND: Ground.
  • D0: Output Interface of Digital Switch (0 and 1).
  • A0: Analog Output Interface

Working Principle

MQ-3.jpg
After wiring VCC and GND, the Power LED of the module lights up. Before your using, the power supply preheats for at least 2 minutes. It is normal for the sensor to generate heat slightly, because there is heating wire inside. But it is abnormal that the sensor becomes overheating. When there is no impact of the sensible gas or the gas concentration is not more than the preset threshold, the digital interface D0 outputs high level and the voltage of the analog interface A0 is around 0V. When the gas concentration is beyond the threshold, the digital interface D0 outputs low level and the digital indicator light is on. And the output voltage of the analog interface A0 increases with the raising of the gas concentration,A0 Output: 0.1-0.3V (relatively non-polluted). With the gas concentration being higher, the voltage can reach up to 4V. Rotate the knob of the potentiometer clockwise, you can get the sensing range of the gas concentration wider (only for the sensitivity of the TTL output). The digital output D0 can drive the relay module directly, which can form a gas switch. The digital output D0 can also drive the positive buzzer module and this module can be used to make up a gas alarm. The analog output A0 can be connected to AD module and get the approximate values of the ambient gas concentration via AD conversion.

For Arduino

Using Steps
Step 1: Connect the circuit.

MQ-6.jpg

MQ-4.jpg

Step 2: Copy the following codes and paste them in Arduino.

///Arduino Sample Code
void setup()
{
  Serial.begin(9600); //Set serial baud rate to 9600 bps
}
void loop()
{
int val;
val=analogRead(0);//Read Gas value from analog 0
Serial.println(val,DEC);//Print the value to serial port
delay(100);
}

The codes above are used to acquire the signal of the gas sensor via the analog interface 0 and to output the signals into the computer via serial port. To observe the consequence, we can use serial port monitor.

MQ-5.jpg

Due to the internal structure of the gas sensor, the measurement can only begin after one minute's preheating. During preheating, you can easily feel the hot of the probe. When the preheat is finished, the data are around 120 (only for reference, the value can be variable with the changing of the circumstance). According to the parameter of the probe, in the clean air, the data value might be less than 310.

Resource

MQ-2_Datasheet
Test Experiment for ArduinoLINK.jpg
Test Experiment for Raspberry PiLINK.jpg