Design of control board of alcohol concentration tester
With the rapid development of China's economy and the continuous improvement of people's living standards, various motor vehicles have become an indispensable part of people's lives. Especially the emergence of private cars has undoubtedly greatly improved the efficiency of people's lives and work, but the problems brought about by it have also followed, and this is the problem of safety. Many years ago, traffic managers could only rely on subjective judgment, visual observation, and blood alcohol testing in hospitals to determine whether drivers were drinking. These unscientific and untimely methods have caused many unnecessary misunderstandings and troubles. The above-mentioned problems all have no choice but to have no portable, safe and accurate detection instrument that can detect alcohol concentration online. This instrument uses the YX-GS-800M low-power ethanol gas sensor as the sensitive unit, which converts the concentration of ethanol contained in the gas into an electrical signal, which is sent to the single-chip microcomputer through the A/D conversion circuit for processing, and the measured gas is visually displayed by the digital tube At the same time, determine whether to issue a voice alarm signal according to the specific situation.
1. Alcohol tester hardware resource configuration
1.1 MCU system
Hardware selection: 89S51 single-chip microcomputer is used as the microprocessor, and the sensor is a YX-GS-800M alcohol sensor and a monolithic integrated temperature current source sensor produced by the American Analog Devices Company. The voice alarm module uses a more powerful PM50100 multifunctional voice chip produced by Zhongqing Century Company. The keyboard and display part are realized by familiar 8279 and 74LS138, and ADC0809 is used for analog-to-digital conversion. The battery voltage detection circuit is made up of chip LM316 and peripheral circuits. The hardware circuit block diagram of the one-chip computer is shown as in Fig. 1.
1.2 Selection of alcohol sensor
This design is a portable testing instrument, so the most important part of each part of the device is small size and powerful. Taking into account that this design will be used in different environments after the product is formed, so when we select the sensor, we have made serious considerations for the temperature range of the alcohol sensor, sensitivity to alcohol, and low power consumption. Reference comparison.
After screening, the YX-GS-800M low-power ethanol gas sensor was selected. The performance indicators of the sensor meet the requirements of this design. The functions, characteristics and technical indicators of the YX-GS-800M ethanol sensor are briefly described below: a Features: High sensitivity to ethanol, fast response to ethanol, small size and low power consumption. b. Working environment: Temperature: -20℃~+50℃ Humidity: ≤95%RH. c. Technical indicators: as shown in Table 1.
1.3 Design of temperature detection circuit
The choice of temperature sensor is roughly the same as the alcohol sensor mentioned above. It is small in size and low in power consumption. The power supply part should be suitable for battery power supply. The output resistance should be large and the driving ability should be strong. The temperature measurement range should be large enough and the accuracy should be high. The nonlinear error should be small. The temperature sensor uses the AD590 monolithic integrated temperature sensing current source produced by American Analog Devices Company. It has high accuracy. AD590 has five levels of I, J, K, L, and M, of which the M level has the highest accuracy, with a non-linear error of ±0.3℃ in the range of -55℃~+150℃.
1.4 Design of A/D conversion part
ADC0809 is an 8-bit A/D conversion chip, which uses a successive approximation method to complete A/D conversion. ADC0809 is powered by a single +5V power supply. The on-chip 8-channel analog multiplexer with latch function can convert 8 channels of 0~5V input analog voltage signals in time sharing. It takes about 100 microseconds to complete a conversion. The chip also has a multi-switch address decoder and a latch circuit, and its output has a TTL three-state latch buffer, which can be directly connected to the data bus of the single-chip microcomputer; through an appropriate external circuit, the ADC0809 can respond to 0~5V The bipolar analog signal is converted.
1.5 Design of battery detection circuit
The voltage follower composed of LM316 and peripheral circuits can detect the battery voltage at any time and send the detection result signal to the microprocessor for processing through A/D conversion. When the battery voltage is lower than the set alarm value, the single-chip microcomputer gives a signal to realize voice alarm and display. LM316 is a versatile integrated voltage comparator with a wide range of applications. Its power supply voltage allows a wide range. It can be powered by positive and negative dual power supplies, or can be powered by a single power supply. If you use a +5V single power supply, you can directly drive a TTL device; if you use a +15V single power supply, you can directly drive a CMOS device, and it can output a current of 50mA. For ease of use, a +5V single power supply is used in this design.
1.6 Voice alarm circuit design
To maintain the leading performance of the design, it is necessary to choose a powerful voice chip, which can realize truly humanized man-machine communication. So this design chooses a new generation of intelligent voice chip PM50 that can speak real people. PM50 series intelligent voice chip is the latest intelligent voice product developed by Zhongqing Century Technology Co., Ltd. in 2003. The chip is composed of a dedicated voice microcontroller and FLASHRAM memory assembly. It has a multi-segment voice playback function of several seconds to 200 seconds, and a microcontroller Intelligent features of programming. The recorded voice can be divided into 1~8 segments or 128 segments, with eight input ports and nine output ports, and the functions can be customized by the user.
2. System software design of alcohol concentration tester
According to the connection of the hardware circuit diagram and the requirements of the system function, the software mainly includes: the main program, the result measurement read-in program, the display program, the delay program, and the average calculation program. The main program mainly completes the system initialization, reading the keyboard, judging, calling program modules, looping processes and other operations, which is the general skeleton of the entire software. The main function of the main program is to initialize the MCU state parameters, register initialization and program custom state parameters, and call functions such as subprogram flow, and provide subprogram entry addresses to improve system functions. The display program is completed by the 8279 integrated chip, which realizes human-computer communication, can realize automatic scanning of the keyboard/display, and recognize the key number of the closed key on the keyboard, which can not only greatly save the operation time of the CPU on the keyboard/display, thereby reducing the CPU It is used by us for these advantages, the display is stable, the program is simple, and there will be no malfunction.
to sum up
The hardware circuit is simple, which reduces the production cost, has market competitiveness, and is easy to operate. The instrument will automatically display the measurement results within a short time after exhaling into the instrument, and the live voice mode will broadcast the results and give reasonable suggestions whether it is suitable for driving. This instrument can also carry out a very targeted design, can display and broadcast the ambient temperature at any time, for different users in different provinces and regions, users can set the alarm concentration according to specific needs, fully consider the power-saving design, and have battery detection Circuit, when the battery power is too low, it will give a display and a voice warning prompt to replace the battery. When the instrument does not detect a signal within 4 minutes, it will automatically enter the sleep state and can store the last 10 measurement results for reference. Therefore, this design has strong practicability.