Application of smoke sensor MQ-2

Source: Internet
Author: User

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>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.