【正文】
2bit successiveapproximation A/D converter chip with threestate buffer, its conversion time is about 25μs. AD574A can directly connected to AT89S52 without additional interface logic circuit, with internal high accuracy reference power supply and clock circuit, AD574A can operate normally without external clock sourceand reference power supply. Other Modules Digital Display Module Traditional LCD module is unsuitable in this system because the working environment mainly lies deep in dark coal mine tunnel. LED with soft light should be the alternative. It is suitable for the adverse circumstances under coal mine features by dampproof, excellence temperature characteristics and long distance visual effects. In this system, a 6bit LED is adopted to dynamically display the ch4 gas concentration value, with the segment port and bit port connected with PA port and PB port of 8155(1) separately. Keyboard Input Module In keyboard input module, we arranged 13 keys including 10 number keys and “Data collection” key, “Enter” key, “reset” key. Adopted opposite direction connect method, PB port and PC port of 8155(2) connected to keyboard’s row circuit and column circuit respectively. Serial Communications and SoundLight Alarming Units The serial munications module is shown at the left part in Figure 9, signal of microcontroller is transmitted to host puter above ground by RS485, and MAX485 is used to convert the voltage. RS485 is a multipoint twoway halfduplex munication link based on single balancedwire circuit featured by high noise suppression, high transfer rate, long distance transmission and Wide monmode range, its maximum transfer rate reaches to 10Mbps, maximum cable distance reaches to 1200m[13,14]. P21 and P10 of AT89S52 will take control of soundlight alarming unit when the test value of CH4 gas concentration exceeds the preset value. 4 Software Design of Control System The primary functions of the software control system including system initializing, threshold value setting, methane gas concentration data collecting and displaying, serial munications etc. To achieve the above functions, we developed serial programsusing 51 serials microcontroller assemble program language including main program, keyboard scanning program, A/D converter program, alarming program, serial munications program, data display program, system alarming diagnosis program, doublebyte multiply program, triplebyte to binarycodeddecimal program and watching dog program. The system is prised of many modules, Owing to limited space we introduce main program only. main program initializing single chip microputer’s registers and I/O ports, then scanning keyboard to see if the data collection key is pressed, if no, keep scanning keyboard until data collection key is pressed. When the collection key is pressed down, default threshold value is shown on the panel, if user wants to reset threshold value, just press the ADJUST VALUE key to set a new value, and press ENTER key to finish this step. When ENTER key is pressed, system start the operating of data collection and A/D conversi