Design of flammable gas alarm device based on STC12C5A60S2 single chip microcomputer

With the reduction of traditional fuels such as petroleum and coal, flammable gases have been widely used in industry and people's family life. Although these gases provide convenience and create value for people's production and life, they still need to effectively monitor their concentration to prevent fire, gas poisoning and other harm to people's lives and property.

This paper presents a design of a flammable gas alarm based on STC12C5A60S2 microcontroller. In terms of hardware, the overall design scheme is given first, and then the hardware circuit units are analyzed and designed according to the functional requirements. In terms of software, according to the function of the hardware, the overall scheme of the flammable gas alarm device is designed, and the implementation methods of each functional module are introduced.

1 hardware design of flammable gas alarm device based on STC12C5A60S2 single chip microcomputer

1.1 System Structure Analysis

The alarm system block diagram is shown in Figure 1. The system uses the single-chip STC12C5A60S2 as the core, and cooperates with other peripheral circuits to complete functions such as signal acquisition, density display, key input, sound and light alarm.

First, the tiny voltage signal sent by the gas sensor is amplified by the signal conditioning unit, and converted into a larger voltage signal and transmitted to the STC12C5A60S2 single-chip microcomputer; then, the A/D conversion, concentration comparison, and linearization processing are performed on the single-chip microcomputer; finally, the gas is The concentration is sent to the LED display unit and it is determined whether the gas concentration exceeds the alarm limit.

When the gas concentration is in the normal state, the green light is on; when the gas concentration exceeds the set limit, the sound and light alarm unit immediately emits an audible alarm and completes the detection and alarm of the gas with the red light flashing, and simultaneously starts the ventilation and ventilation device. Increase ventilation and use a solenoid valve to close the gas passage to quickly reduce the gas concentration to a safe point. The system can also communicate with the host computer through the RS-232 bus for serial communication, which is convenient for collecting and processing data online and changing alarm limits.

Design of flammable gas alarm device based on STC12C5A60S2 single chip microcomputer

2 system hardware design

2.1 combustible gas detection circuit

This design uses a gas sensor TGS813 produced by Figaro, which has high sensitivity to flammable reducing gases such as methane. When there is a detection gas, the conductivity of the sensor increases as the gas concentration increases. In practical applications, a simple bridge circuit can be used to convert the change in conductivity into an electrical signal corresponding to the gas concentration. However, the output voltage signal generated by the bridge circuit is generally weak, and proper conditioning is required to convert to a voltage suitable for A/D conversion.

TGS813 data acquisition circuit shown in Figure 2. In the figure, R8, R9, R10 and the gas-sensitive resistor RS form a bridge to realize resistance-to-voltage conversion. The operational amplifier A1A is connected to a voltage follower, and the resistor R7 and the Zener diode D1 form a voltage stabilizing circuit to supply power to the bridge. The output voltage after the bridge conversion is amplified by another operational discharger A2A of the LM324, and the amplification factor is adjusted by the resistor R11 to output a suitable voltage for A/D conversion.

Design of flammable gas alarm device based on STC12C5A60S2 single chip microcomputer

2.2 main control unit circuit

The main control unit circuit diagram shown in Figure 3, the microprocessor STC12C5A60S2 is a single clock / machine cycle microcontroller, is a high-speed / low power / super interference enhanced 8051 microcontroller, the instruction code is fully compatible with the traditional 8051, but The speed is 8 to 12 times faster. Internal A/D, D/A converter, real-time clock, watchdog, etc., reduce the number of peripheral devices and reduce system cost.

Design of flammable gas alarm device based on STC12C5A60S2 single chip microcomputer

In Fig. 3, the peripheral connection of the single chip microcomputer has a basic reset circuit, a temperature compensation circuit, a serial port connection circuit and a keyboard circuit. Since the RS of the gas sensor TGS813 varies greatly with temperature, temperature compensation or temperature correction must be performed to improve the accuracy of the system. The system uses the temperature sensor DS18B20 to collect the temperature, and then uses the software method to temperature correction of the measured value. The RS-232 serial port connection enables communication between the system and the PC. The latest data can be downloaded from the PC, and the test data can be uploaded to the PC.

The keyboard circuit has four independent control buttons: mode (MODE), plus (+), minus (-), and ENTER. Press the mode button to indicate that the system enters the debugging state. At this time, press the + or - button to set the alarm value. Press ENTER to exit the setting mode.

Other Kinds Of Sleeves

Features of fishing rod sleeve


Materia l: PET
Diameter: custom
Length: custom
Expanding Ratio: 200%
Color: colorful
Melting point: 230 °C ± 5
Tinting strength: 100 ± 5 °C
Fireproofing grade: UL94V-2
Temperature endurance: -50 °C~ +150 °C
PET sleeve quality: UL,SGS,Rohs,Reach,etc.


1. Light weight & Flexible & Insulation & UV Resistant & Decoration & Flame-retardant & Durable abrasion resistance & Resistant to chemical degradation, in a wide range of industrial applications.
2. Braided of 0.25mm / 0.2mm Pet monofilament.
3. The open weave construction allows an easy installation on a bundle of hoses and cables, even if some with bulky or large connectors.

Other Kinds Of Sleeves,Fishing Rod Cover,Special Sleeve ,Fish Handle Cover,Fishiing Handle Sleeve

Shenzhen Huiyunhai Tech.Co.,Ltd , https://www.hyhbraidedsleeve.com