The hottest natural gas intelligent alarm system b

  • Detail

Design of natural gas intelligent alarm system based on SPCE061A

with the improvement of people's living standards, natural gas has been widely used. However, natural gas leakage caused by improper use or neglect of management in leading the development of the industry has greatly threatened the safety of people's lives and property. At present, the general natural gas alarm has a single function, or manually reset the valve system, with low performance stability; Large monitoring systems are expensive compared with PLLA and need special technicians to manage them. They are not suitable for small and medium-sized enterprises and families. In view of the current situation of this kind of natural gas management, an intelligent natural gas monitoring system controlled by single chip microcomputer is studied and designed, which has the characteristics of simple structure, low price, easy operation and easy expansion. Backed by the powerful function and expandability of SPCE061A single chip microcomputer, it can realize various real-time, effective and multi-functional control operations of the natural gas monitoring system, especially suitable for use as a household intelligent alarm and a natural gas monitoring system in residential areas, factories and mines. The main functions of the system are: to realize the real-time monitoring of natural gas leakage; Real time tracking and display of on-site natural gas concentration; With voice alarm function; Automatically close the natural gas pipeline solenoid valve and open the exhaust device according to the alarm condition. It is worth noting that the voice alarm function. Among them, voice signal is the main carrier of information. If the results can be directly reported by voice in these measurement occasions, it will bring great convenience to the operators. Here is a new type of natural gas sensor test system with new functions. It can detect and display the concentration of natural gas in the air in real time. When the concentration reaches a certain value, it will send out a local voice alarm. If no one turns off the alarm after 3 minutes, it will give an alarm and start dialing the number stored in the MCU in advance; When the first one is not answered, start dialing the next number. In this way, the next number will be dialled repeatedly until someone answers. At the same time, the alarm will be broadcast. At the same time, the natural gas solenoid valve will be closed under the control of the single chip microcomputer, and the gas exchange equipment will be opened

l hardware design

the hardware circuit of this design is mainly composed of four parts: alarm input circuit, alarm control circuit, alarm implementation circuit and automatic alarm processing circuit, as shown in Figure 1. Among them, there are two kinds of alarm: local voice alarm and automatic playing voice alarm. Specifically, it is composed of five parts: sensor detection circuit, MCU control circuit, concentration display circuit, local alarm circuit and alarm. The following is a detailed analysis of each circuit

1.1 sensor

a gas sensor is a sensitive device that can sense a certain gas and its concentration in the environment. It converts relevant information such as gas composition and concentration into electrical signals, which can be detected, monitored and alarmed through the control system; It can also form an automatic detection, control and alarm system with the computer through the interface circuit. It is a very important monitor. In the selection of gas sensor, many factors should be considered, such as measurement object and environment, sensitivity, frequency response characteristics, linear range, stability and accuracy. Mq-4 gas sensor has high sensitivity to natural gas, low sensitivity to ethanol and smoke, fast response and recovery characteristics, long service life, reliable stability and simple driving circuit, so it has become the preferred device in this design. Mq-4 is mainly used for domestic or industrial natural gas detection devices. Its working voltage is less than 15 V, the negative thermal resistance RL is adjustable, the operating temperature range is -10 ~ +50 ℃, the storage temperature range is -20 ~ +70 ℃, and the applicable measurement range is 300 ~ 10000 ppm. Because mq-4 gas sensor has different resistance values for different kinds of gases with different concentrations, it is very important to adjust the sensitivity when using this type of gas sensor. Generally, 5000 ppm natural gas is used to calibrate the sensor

1.2 single chip microcomputer spc2e061a

Sunplus SPCE061A is a 16 bit single chip microcomputer. It has built-in 2 kwordsram and 32 kword flashrom, 32-bit general programmable input/output port, 2 16 bit programmable timers/counters, 14 interrupt sources. It has voice processing function and can realize playback, recording, voice recognition and other functions. The system uses the voice broadcast function of Sunplus MCU to realize alarm voice and prompt voice

1.3 alarm circuit

the alarm circuit starts to dial automatically when the natural gas concentration reaches a certain value to warn the owner to take certain measures. It is mainly composed of the following three parts

1.3.1 MT8888 and its interface circuit

dtmif signal transceiver shall be MT8888 of mitel company in Canada. It is one of the newer DTMF signal encoding/decoding chips produced by the company. The chip has strong functions, low power consumption, stable and reliable operation. The main functions of MT8888 in this system are automatic dialing, signal tone detection and DTMF signal reception. The interface circuit between MT8888 and Sunplus MCU is shown in Figure 2. The DTMF signal output by MT8888 needs to be amplified before being sent to the line

1.3.2 pick up/hang up detection circuit

the automatic pick up/hang up circuit is shown in Figure 3. Hang up when iob0 is low; When iob0 is at high level, off hook

1.3.3 ring detection circuit

ring detection circuit. When a bell flow signal comes, iob2 outputs a square wave. Counting this square wave can determine the number of rings

1.4 display circuit

the display circuit mainly uses 4-bit LED digital tube to display the concentration in the air detected by the single chip microcomputer in real time, which is very convenient

1.5 local alarm circuit

the audio power amplifier LM386 is used to amplify the voice signal output by Sunplus MCU and drive the loudspeaker to alarm. The loudspeaker alarm circuit is shown in Figure 4

1.6 alarm processing circuit

at the same time of alarm, the single chip microcomputer controls the relay to automatically process the alarm, that is, close the natural gas solenoid valve and open the air exchange equipment. The alarm processing circuit is composed of solenoid valve opening and closing circuit and exhaust circuit; The opening and closing of solenoid valve is composed of solenoid valve, transmitter, DAC0832, etc. The M series 2-position 2-way energy-saving gas solenoid valve (direct acting type) of aide is adopted, which is characterized by low voltage and small energy consumption. Permanent magnetic steel is provided at the structural coil, and the coil is powered by low positive and negative pulse sampling rate. When the positive pulse power supply is applied, the valve is opened and maintained. At this time, the power cut-off valve is in the open position; When the reverse pulse power supply is applied, the valve is closed and maintained. At this time, the power cut-off valve is in the closed position. As the solenoid valve needs to be driven by pulse signal, the system uses DAC0832 working in single buffer mode as the waveform generator to provide positive and negative pulses, so it can be opened and closed automatically to realize the adjustability of installation position. DAC0832, ordinary household exhaust fan, electromagnetic relay, sn75452 driver and AC220V power supply are selected for the exhaust part, and TPL photoelectric isolator is used to completely electrically isolate the on-site signal from the single chip microcomputer system, so as to improve the anti-interference ability of the system

2 software design

2.1 main program

the main function of the main program is to realize alarm and local control. The loop structure is adopted to query each alarm input port and control input port in sequence. When an alarm signal or control signal is input, the program will turn to the corresponding program section for operation, and then enter the loop after the operation. The flow chart is shown in Figure 5

2.2 alarm subroutine

alarm subroutine mainly performs automatic circular dialing and voice broadcasting. Judge various signal tones in the process of circular dialing, and then make corresponding actions according to the judgment. The specific flow chart is shown in Figure 6

2.3 MT8888 software design

2.3.1 MT8888 initialization

mt8888 needs to be initialized within 100ms after power on. MT8888 initialization should go through SR reading; Write cra=0000b; Then write cra=0000b; Write cra=1000b; Write crb=0000b; Read Sr

2.3.2 transmission of DTMF signal

in DTMF transmission (i.e. dialing) program, set MT8888 to DTMF mode and make it work in burst mode without interruption. Write the transmission register R and then read the status register Sr. if b1=l of Sr, it means that this transmission is over and the next number can be sent

2.3.3 signal tone detection

after the number is dialed, signal tone detection is also required to judge whether it is dialed. First, set the MT8888 operating mode, write cra=1110b, and then write crb=0001b, so that the MT8888 operates in the call processing (call) mode, tone out cannot be output, interrupt is allowed, and non burst mode. The signal tone detection program is mainly to count the square wave output by IRQ/CP within 5 s. if the count value is greater than l 792, it is a dial tone, 1024 ~ 1791 is a busy tone, 256 ~ 1023 is a ring back tone, and less than 255 is an invalid signal tone

3 conclusion

the design of the intelligent natural gas monitoring and alarm system is realized by combining the technology of machinery, detection and other related disciplines. In terms of intelligent control. The single chip microcomputer SPCE061A is used as the control core of the system, and its resources are applied to the design to the greatest extent, which not only reflects the flexibility of the application of the single chip microcomputer small system, but also realizes the intelligent control with various functions. Due to the intelligent management led by single-chip microcomputer technology, it can realize the dynamic monitoring of natural gas concentration, with stable and reliable operation, high sensitivity and more convenient operation. It has very important market application value. In practical use, different applications have different lower limit of alarm concentration. Therefore, in order to improve the sensitivity and accuracy of the system, considering the influence of temperature, environment and power supply voltage, the starting alarm concentration should also have a certain range. In addition, the system can also be modified and expanded according to the actual application to meet different application requirements

Copyright © 2011 JIN SHI