Introduction to mq-6 sensor:
The gas sensing materials used by mq-6 gas sensors are tin dioxide (SnO2) with low conductivity in clean air. When there is combustible gas in the environment where the sensor is located, the conductivity of the sensor increases with the increase of the concentration of combustible gas in the air. The change of conductivity can be converted into output signal corresponding to the gas concentration by using simple circuit. Mq-6 gas sensor has high sensitivity to propane and LPG, and has good sensitivity to natural gas. This kind of sensor can detect many kinds of combustible gases, and it is a low cost sensor suitable for many applications.
Module application:
It is suitable for detecting LPG (liquefied petroleum gas), propane and LNG (liquefied natural gas) in home or industry. Excellent resistance to interference of ethanol vapor and smoke.
Module features:
1. High quality double panel design, with power indication and TTL signal output indication;
2. It has do switch signal (TTL) output and AO analog signal output;
3. TTL output valid signal is low level( When the output level is low, the signal light is on, which can be directly connected to the MCU or relay module.)
4. Analog output voltage is 0 ~ 5V, the higher the concentration, the higher the voltage.
5. It is sensitive to propane, butane, LPG and LNG.
6. There are four screw holes for easy positioning;
7. Product dimensions: 32 (L) * 20 (W) * 22 (H)
8. It has long service life and reliable stability
9. Fast response and recovery characteristics
Electrical performance:
Input voltage: DC5V, power consumption (current): 150mA
Do output: TTL digital quantity 0 and 1 (0.1 and 5V)
Ao output: 0.1-0.3v (relatively pollution-free), maximum concentration voltage about 4V
Special warning: after the sensor is powered on, it needs to preheat for about 20s, and the measured data can be stable. The sensor heating is normal, because there is electric hot wire inside, if the hand is scalded, it will not be normal.
Test procedure:
实现功Can: This version of the supporting test program
Chip: AT89S52
Crystal oscillator: 11.0592Mhz
Baud rate: 9600
Compilation environment: Keil
[statement] this program is only for learning and reference. Please indicate the copyright and author information when quoting!
*********************************************************************/
/********************************************************************
Note: 1. When the measured concentration is greater than the set concentration, the IO port of MCU outputs low level
*********************************************************************/
#include//Library file
#define uchar unsigned char//Macro defines the type of unsigned character
#define uint unsigned int //Macro definition unsigned integer型
/********************************************************************
I/Odefinition
*********************************************************************/
sbit LED=P1^0;//Define the first bit (P1.0) of MCU P1 port as the indicating end
sbit DOUT=P2^0;//Define the first bit of MCU P2 port (p2.0) as the input of the sensor
/********************************************************************
Delay Functions
*********************************************************************/
Void delay() / / delayer
{
uchar m,n,s;
for(m=20;m>0;m--)
for(n=20;n>0;n--)
for(s=248;s>0;s--);
}
/********************************************************************
Principal function
*********************************************************************/
void main()
{
while(1) //Turn off P1.0 port light
{
LED=1;//Turn off P1.0 port light
if(DOUT==0)// when the concentration is higher than the set value, execute the condition function
{
delay();//Delay anti jamming
if(DOUT==0)//when the concentration is higher than the set value, execute the condition function
{
LED=0;//Turn on P1.0 port light
}
}
}
}
/********************************************************************
end