First, smoke sensor MQ-2
Second, the Smoke module structure diagram
Three, the Smoke module schematic diagram
Four, the characteristics of the smoke module
1, with signal output indication.
2. Two-way signal output (analog output and TTL level output).
3, the TTL output valid signal is low level. (When the output low signal light, can be directly connected to single-chip microcomputer)
4, the analog output 0~5v voltage, the higher the concentration voltage higher.
5. It has good sensitivity to LPG, natural gas and city gas.
6. The result is affected by temperature and humidity.
Five, Smoke sensor applications
Can be used for home and industrial gas leak detection device, suitable for liquid gas, butane, propane, methane, alcohol, hydrogen, smoke and other measurements.
Vi. procedures
<span style= "FONT-SIZE:18PX;"
>/******************************************************************* realization Function: The test program uses the chip: At89c52 Crystal oscillator: 11.0592MHZ Baud Rate: 9600 compilation environment: Keil *********************************************************************///Description: 1, when the measurement concentration is greater than the set concentration, MCU IO port output low level #include <reg52.h>//library file #define UCHAR unsigned char//macro define unsigned character #define UINT unsigned int//macro Non-symbolic integer sbit LED = p1^0; The 1th bit (i.e. P1.0) of the P1 port of the SCM is defined as the sbit DOUT = p2^0 of the indicator end;
Defines the 1th bit (i.e. P2.0) of the P2 port of the microcontroller as the input terminal of the sensor/********************************************************************
Delay function *********************************************************************/void delay ()//delay program {UCHAR m,n,s;
for (M = A, M > 0; m--) for (n = 0; n > 0; n--) for (s = 248; s >; s--); }/******************************************************************** main function ****************** /void Main () {while (1) Infinite loop {LED = 1; Off P1.0 lamp if (DOUT = = 0)//When the concentration is above the setpoint, perform the conditional function {delay ();//delay anti-interference if (DOUT = = 0)//Determine concentration When higher than the set value, execute the conditional function {LED = 0; Light P1.0}}}}</span>