Difference between revisions of "MQ-2 Gas Sensor Module"
(→Introduction) |
|||
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | ='''Introduction'''= | |
− | + | [[File:mq-2 Gas Senseor.jpg]] | |
− | [[File:mq-2 Gas Senseor.jpg]]<br> | + | [[File:MQ-1.jpg]]<br> |
− | + | ||
− | The | + | 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. <br> |
+ | |||
+ | =='''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'''== | ||
+ | [[File:MQ-3.jpg]]<br> | ||
+ | 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'''<br> | ||
+ | '''Step 1: Connect the circuit.'''<br> | ||
+ | |||
+ | [[File:MQ-6.jpg]]<br> | ||
+ | |||
+ | [[File:MQ-4.jpg]]<br> | ||
+ | |||
+ | '''Step 2: Copy the following codes and paste them in Arduino.'''<br> | ||
+ | <pre style="color:blue"> | ||
+ | ///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); | ||
+ | } | ||
+ | </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 observe the consequence, we can use serial port monitor. <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> | ||
+ | |||
=='''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
Contents
Introduction
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
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.
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.
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 Arduino
Test Experiment for Raspberry Pi