Test program:
Function: This version of the test program supporting
Use chip: AT89S52
Crystal: 11.0592MHZ
Baud rate: 9600
Compiler Environment: Keil
[Statement] This procedure is used only for study and reference, please indicate the copyright and author information!
************************************************** ******************* /
/ ************************************************* *******************
Note: 1, when the measured concentration is greater than the set density, single-chip IO port output low
************************************************** ******************* /
# Include // library files
#define uchar unsigned char // macro definition unsigned char
#define uint unsigned int // macro definition unsigned int
/ ************************************************* *******************
I / O definitions
************************************************** ******************* /
sbit LED = P1 ^ 0; // define microcontroller P1 port of the first one (ie P1.0) to indicate the end
sbit DOUT = P2 ^ 0; // define the microcontroller P2 port first one (ie P2.0) as an input sensor
/ ************************************************* *******************
Delay function
************************************************** ******************* /
void delay () // delay procedure
{
uchar m, n, s;
for (m = 20; m> 0; m--)
for (n = 20; n> 0; n--)
for (s = 248; s> 0; s--);
}
/ ************************************************* *******************
The main function
************************************************** ******************* /
void main ()
{
while (1) // infinite loop
{
LED = 1; // off P1.0 port lights
if (DOUT == 0) // When the concentration is higher than the set value, the implementation of the Con
{
delay (); // delay interference
When if (DOUT == 0) // determine the concentration higher than the set value, the implementation of the Con
{
LED = 0; // P1.0 port lights lit
}
}
}
}
/ ************************************************* *******************
End
************************************************** ****************** /
MQ-8: ออกแบบเพื่อตรวจจับไฮโดรเจน (H2) ใช้ในอุตสาหกรรมและการทดลอง
Product Overview:
Sensitive material MQ-8 gas sensors used in clean air, low conductivity tin oxide (SnO2). When there is an environment in which the combustible gas sensor, conductivity sensor with increasing concentration of combustible gases in air increases. Use simple circuit can convert the change in conductivity of the gas concentration corresponding to the output signal. MQ-8 hydrogen gas sensor of high sensitivity monitoring of other hydrogen-containing gas is also very good. The sensor can detect a variety of hydrogen-containing gas, in particular, city gas, is a low-cost sensor suitable for a variety of applications.
Application:
Suitable for home or industrial hydrogen leak monitoring devices. Can not interfere with ethanol vapor, soot, carbon monoxide and other gases.
Features:
-
Using high-quality dual-panel design,with power indicator and TTL signal output instructions.
-
The switching signal having a DO (TTL) output and analog output AO.
-
TTL output valid signal is low. ( Low-level signal when the output light can be directly connected to the microcontroller or relay module )
-
Analog output voltage with the higher concentration of higher voltage
-
There are four screw holes for easy positioning.
-
Has a long life and reliable stability
-
Rapid response and recovery characteristic
Input voltage : DC5V Power consumption ( current ): 150mA
DO output : TTL digital 0 and 1 ( 0.1 and 5V)
AO output :0.1-0 .3 V ( relative to pollution ),the maximum concentration of a voltage of about 4V
Special note: After the sensor is powered,needs to warm up around 20S,measured data was stable,heat sensor is a normal phenomenon,because the internal heating wire,if hot is not normal .
Wiring:
-
VCC: positive power supply (5V)
-
GND: power supply is negative
-
DO: TTL switching signal output
-
AO: analog signal output
NOTE:
After the sensor is powered, need to warm about 20S, measured data becomes stable, heat sensor is normal