The performance of the human olfactory system is quite outstanding. In the past few decades, people's understanding of the olfactory process has increased rapidly, but the current results are still less than people's expectations. The first gas sensor developed using the oxidation-reduction reaction of gas on the electrode was reported by Wikens and Hatman in 1964. Buck et al. used gas modulated conductivity and Dravieks et al. used gas modulated potential to develop gas sensors in 1965. In 1982, Persaud et al. of the University of Warwick in the United Kingdom proposed a structure that uses gas sensors to simulate the animal olfactory system. A gas sensor is a chemical sensor that is sensitive to a certain gas. It can change the resistance of the sensitive film with the concentration of the external gas or the type of gas. The current gas detection uses a gas sensor plotter to directly plot the voltage signal of the sensor. Due to the shortcomings of the plotter, such as poor dynamic follow-up, slow response speed, lack of flexibility, and low measurement accuracy, it is difficult to draw a high-frequency and high-precision time-voltage curve of a gas sensor. For the dynamic test of gas sensors, the plotter cannot meet the requirements at all. Based on the properties of gas sensors, this paper studies and develops a gas sensor signal acquisition method that uses RS232 to establish a connection with a computer, thereby improving the accuracy of gas sensor signal acquisition and the manual efficiency of the experiment.
2 Working principle of gas sensor and its control task
2.1 Working Principle of Gas Sensor
In terms of materials, the most commonly used gas sensors are metal oxides, polymer materials, piezoelectric materials, colloidal sensitive films, etc. In terms of use, they are divided into general and specific types. Select gas sensors according to test needs. This measurement system can be applied to all gas sensors.
The two key parts of the gas sensor are the heating resistor and the gas sensitive film. The heating resistor changes the working temperature of the sensor, making it work at the gas sensitive working temperature. Due to the change of external gas, the resistance of the sensitive material of the gas sensor changes. The gold electrode connects the two ends of the gas sensitive material, making it a resistor whose resistance changes with the external gas.
The structure and test principle of the gas sensor are shown in Figure 1.
2.2 Control Tasks
The acquisition task is designed according to the characteristics of the gas sensor. The temperature of the sensor is required to be around 250℃ (or higher). At this temperature, the gas shows high sensitivity [2]. In view of the uncertainty of the gas-sensitive resistance of the sensor, the resistance of the sampling resistor should match the resistance of the gas-sensitive resistor (the resistance of the gas-sensitive material changes within 15 times). The sampling resistor and the heating voltage are controlled by a computer. The power requirement of the heating resistor Ro is between 0.3~1.5W, and the value of Ro is around 30W, so it can be known that the voltage value of Ro is between 1~7V. The temperature of the heating resistor is approximately linearly related to the size of the heating voltage. The temperature is increased by increasing the voltage to select a temperature suitable for gas testing (usually a heating voltage of 5V is selected). If it is a dynamic measurement, the heating voltage is made into a rectangular wave, and the duty cycle can be set by software.
The sampling resistance is required to be a discrete value, which can be 1k, 2k, 5k, 10k. In terms of the characteristics of the gas sensor itself, it can be divided into several grades, and the resistance of its gas-sensitive film is not constant. This paper introduces the design of this system based on the standard that the resistance value of the gas-sensitive film changes from 10kW in the air to 1kW in the gas to be tested. The test voltage is a fixed value, and its accuracy affects the signal voltage. In the actual experiment, the test voltage value is selected as 5V, and the value (voltage) of the test signal is required to be measured. The obtained sampling signal can quickly calculate the gas sensor resistance to be measured in the computer (generally speaking, it is only necessary to directly look at the change in voltage), thereby depicting the waveform of the gas sensor resistance changing with the external gas.
3 Gas sensor signal sampling and control circuit
Controlling the test device through a computer can make the entire testing process simpler and more accurate.
3.1 Determination of sampling period
The sampling period Ts determines the quality and quantity of the sampled signal: If Ts is too small, the number of sampled signals xs (nTs) will increase dramatically, occupying a large number of memory units; If Ts is too large, the sampling points will be too far apart, some information of the analog signal will be lost, and the signal will be distorted when the sampled signal is restored to the original signal. Therefore, the selection of a suitable sample holder is directly related to the authenticity of the signal. When the spectrum X(f) of X(t) under a continuous signal is a finite spectrum and Ts <= 1/2f c, (fc is the highest frequency in the sampling period), the signal can be collected without distortion. In the dynamic measurement of the gas sensor, fc is about 500Hz, and Ts should be 1ms to meet the requirements.
3.2 Chip Selection
In order to overcome the characteristic that the resistance Rs of the gas sensor is not fixed during manufacturing, the value of the sampling resistor should be adjusted according to the value of the gas sensor before sampling to ensure that the obtained signal is within the measurement range. At the same time, the signal value should match the acquisition voltage. If the signal voltage is too much lower than the sampling voltage, the measurement accuracy will be affected. The test voltage V c is 5V, the ADC uses a 12-bit relative resolution of 0.0244% (1LSB), and the resolution of the ADC is 1.22mV (1LSB).
Vout=[Vc/(R c+Rs)]×Rc
According to the gas sensor being selected as 10k to 1k and the sampling resistor Rc being selected as 5k, the value of the signal voltage V out can be obtained to be between 1.666V and 4.166V.
Use analog-to-digital conversion chips to collect gas sensor signals, and select the following chips to make a single-chip microcomputer control circuit.
(1) ADC: The external test signal is an analog quantity, so it is converted to digital first. The ADC1678 chip is selected. It has a resolution of 12 bits, a conversion time of 5ms, a conversion error of less than 1LSB, an output level of TTL level, does not require an external clock and reference voltage, and an operating voltage of +5V or ±12V. Its biggest advantage is that it has a built-in sample and hold function;
(2) Multi-way analog switch: select the required sampling resistor. The AD7502 chip uses a 16-pin dual in-line package and is a dual 4-channel multi-way switch chip. It selects two of the 8 inputs based on the state of the two-bit binary address lines A0, A1 and the on/off switch (EN), and connects them to the two output terminals respectively;
(3) Single-chip microcomputer: It integrates an 8-bit central processing unit; 4kB of read-only memory; 128 read-write memory; 32 I/O lines; 2 timers/event counters; 1 nested interrupt structure with 5 interrupts and 4 priorities; serial I/O ports for multi-processor communication, I/O expansion or full-duplex UART (Universal Asynchronous Receiver Transmitter) and an internal oscillator and clock circuit. The single-chip microcomputer controls various parts of the test circuit. Establishing a connection between the computer and the single-chip microcomputer can realize the computer's control of the external. [page]
3.3 Design of communication interface
The connection between IBM-PC and MCU adopts zero modulation three-wire type, that is, only three wires, RDX, TXD and ground wire, are needed to connect PC and MCU. Since the serial port of MCU is a standard TTL level interface (3.8~5V represents "1", 0~0.3V represents "0"), and PC is equipped with RS232 standard serial port, the electrical rules of the two are inconsistent, so to complete the communication problem from MCU to PC, the level conversion problem must be solved first.
The single-chip microcomputer is connected to the computer through the TC232CPE chip. A TC232CPE only needs a +5V power supply to solve the problem of two sets of signal level conversion. The chip can automatically generate the logic level required by RS232C, which can realize the direct connection between the single-chip microcomputer and the interface of the IBM-PC. The RS232 interface of the IBM-PC is composed of the universal asynchronous send/receive 8250UART as the core. The BIOS of the PC provides interrupt calls specifically for serial communication.
Use optoelectronic isolators to isolate the voltage to prevent high voltage from affecting low voltage and digital voltage.
The data acquisition system of computer and single chip microcomputer is shown in Figure 2.
4 Software Design
The MICRO-C51 compiler is used in the single-chip microcomputer. The 8051 C language compiler is economical and practical, has a fast compilation speed, is designed according to the standard UNIX C language compilation syntax, provides a variety of function libraries for program design, provides nested comments, can be embedded in assembly language, and can design interrupt programs in C language [4].
Use Delphi6 to build serial communication program and components. Delphi calls Windows API functions to build communication mechanism. Table 1 shows the API functions used. Use Delphi to call API functions to build communication between computer and COM port. Add Windows in the uses section of the source program.
5 Conclusion
Figure 3 is a dynamic characteristic spectrum of the sensor tested under a 1:1 mixture of 200 PPM acephate and 200 PPM trichlorfon. It records the voltage change from the test point to the end point, which plays an important role in analyzing the atmosphere environment of the gas sensor.
The experimental results show that the output of computer data acquisition has a high dynamic response and can sensitively reflect the changes in external gases, achieving dynamic characteristics that gas sensor plotters cannot achieve. In multi-sensor measurements, the signal values of each gas sensor at the same time can be compared.
Previous article:Circuit design of precipitation collection system using siphon sensor
Next article:C++ inheritance method of function with parameters
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Is this post of the study club incomplete? The formula part?
- [NXP Rapid IoT Review] + Review the Bluetooth function and learn how to program the application
- I need help with a fully digital phase-locked loop Verilog code and modelsim simulation
- EEWORLD University Hall----Sharing of FOC ceiling fan application cases based on Lingdong MM32SPIN series MCU
- Solving for the transfer characteristic curve of an op amp
- What does the typical transmission distance of an infrared receiver mean?
- GD32307E-START power on + led control
- Common options for compiling c6x
- Today at 10:00 AM Live: Comprehensive explanation of TI MSP Academy tutorial
- Overview of TI's 28335 chip