introduction
In recent years, the research on gas sensors has developed rapidly, and the testing of gas sensors has become more and more common. Sensor testing is mainly to detect the indicators of the sensor to determine whether the sensor is a qualified product. The performance indicators of the sensor generally include static indicators and dynamic indicators. The detection of static indicators is a necessary process. The use of sensor automatic testing system can solve many problems such as low efficiency caused by manual detection, human errors and high labor intensity of operators. Gas sensors are widely used in industry and daily life, especially combustible gas sensors play a pivotal role in fire prevention and explosion prevention. This type of sensor is mainly used to measure the concentration of flammable gases in the environment, such as hydrogen, natural gas, and gas. It is usually made into an alarm to monitor the concentration of combustible gases in the air. When the concentration exceeds the indicator, the sensor will output a warning signal to trigger the alarm device. The indicator detection of the sensor is very important, because once the indicator is deviated, the sensor will falsely alarm at a non-specified concentration. It is not advisable to alarm too early or too late. The voice signal is another main carrier of information. If the result can be reported directly by voice in the measurement situation, it will bring great convenience to the operator. In order to accurately and quickly detect the indicators of gas sensors in large quantities, this paper uses the SPCE061A microcontroller combined with logic circuits to design a multi-channel gas sensor test system with high test accuracy, high speed and the ability to communicate with computers.
SPCE061A Overview
The cost-effective 16-bit single-chip microcomputer SPCE061A launched by Lingyang Technology has a set of instruction systems and integrated development environment (μ'nsp IDE) that are easy to learn and use and have high efficiency. This development environment supports standard C language, which can realize the mutual call between C language and Lingyang assembly language, and provides library functions for voice recording and playback, which can easily realize functions such as voice playback, recording, synthesis and recognition. SPCE061A also integrates an ICE (in-circuit emulation circuit) interface, which makes programming and simulation of the chip very convenient. The ICE interface does not occupy the hardware resources on the chip. Combined with the integrated development environment (μ'nsp IDE), users can use it to simulate the chip in reality, and the program is also downloaded through this interface. It has two 16-bit general-purpose programmable I/O ports, which are equivalent to 32 general-purpose I/O ports. It can easily connect and drive the liquid crystal display module (LCD) to realize the display of characters and graphics.
SPCE061A performance characteristics
16-bit microprocessor;
Operating voltage: (CPU) VDD: 3.0V~3.6V,
(I/O) VDDH is 3.0V~5.5V;
CPU clock: 0.32MHz~49.152MHz;
Built-in 2K words SRAM;
Built-in 32K word FLASH;
Programmable audio processing;
Crystal oscillator;
When the system is in standby mode (clock is stopped), the power consumption is only 2μA/3.6V;
2 16-bit programmable timer counters (with automatic preset initial count value);
2 10-bit DAC (digital/analog conversion) output channels;
32-bit general-purpose programmable input/output channels;
14 interrupt sources can come from timer A/B, time base, 2 external clock source inputs and key wake-up;
With the function of touch key wake-up;
Using Lingyang audio codecs SACM_S480 and SACM_A2000 can play compressed voice resources;
The phase-locked loop PLL oscillator provides the system clock signal;
32768Hz real-time clock;
7-channel 10-bit voltage analog-to-digital converter (ADC) and single-channel sound analog-to-digital converter;
The sound A/D converter input channel has a built-in microphone amplifier and automatic gain control (AGC) function;
Equipped with serial device interface;
With low voltage reset function and low voltage detection function;
Built-in online simulation circuit interface;
With Watchdog function.
Working principle of gas sensor and system testing principle
Gas sensors mainly include semiconductor type, contact combustion type, chemical reaction type, optical interference type, thermal conduction type, infrared absorption type, etc. Semiconductor gas sensors are more widely used. [page]
Working principle of gas sensor
The semiconductor gas sensor consists of a gas-sensitive part, a heating wire, and an explosion-proof net. It is a sensor that adds sensitizers such as Pt and Pd to metal oxides such as SnO2, Fe2O2, and ZnO2 in the gas-sensitive part. The selectivity of the sensor is controlled by the amount of added sensitizer. For example, for the ZnO2 series sensor, if Pt is added, the sensor has a higher sensitivity to propane and isobutane; if Pd is added, it is more sensitive to CO and H2.
The gas sensor uses a ceramic tube as a frame, covered with a layer of sensitive film material, and uses the gold-plated pins at both ends of the film for measurement. The most commonly used materials for the sensitive film are metal oxides, polymer materials, and colloidal sensitive films. Its two key parts are the heating resistor and the gas sensitive film, and its structural principle is shown in Figure 1. The gold electrodes connect the two ends of the gas-sensitive material, making it equivalent to a resistor whose resistance changes with the concentration of the external gas to be measured. Since metal oxides have high thermal stability, and this sensor only produces a reversible redox reaction on the surface layer of the semiconductor, and the internal chemical structure of the semiconductor remains unchanged, it can also achieve high stability after long-term use. The principle is briefly described as follows: Once the metal oxide is heated, the oxygen in the air will take away electrons from the donor energy level of the metal oxide semiconductor crystal particles, and adsorb negative electrons on the crystal surface, increasing the surface potential, thereby hindering the movement of conductive electrons. Therefore, the gas sensor has a constant resistance value in the air. At this time, the reducing gas reacts with the oxygen adsorbed on the surface of the semiconductor to produce an oxidation reaction. Due to the desorption and absorption of gas molecules, the surface potential changes, so the resistance value of the sensor will change. For reducing gases, the resistance value decreases, while for oxidizing gases, the resistance value increases. In this way, the concentration of the gas can be detected based on the change in resistance value.
System Testing Principles
The gas-to-electricity conversion mechanism of semiconductor oxides as gas-sensitive materials is: in different gases, the oxidation-reduction reactions of semiconductor oxide materials are different, which causes different changes in the material conductivity (conductance and resistance are reciprocals of each other), so that the sensor can distinguish the measured gas. Therefore, as long as the change in the conductivity of the gas sensor in a known gas can be measured, the performance indicators of the gas sensor can be measured. The test circuit of the gas sensor is shown in Figure 1. The load resistor RL is connected in series in the sensor, and the series circuit applies a working voltage VC. VF is the heating voltage at both ends of the hot wire. In clean air, the resistance RO of the sensor is large, and the output voltage on the load resistor RL is small; when in the gas to be measured, the resistance RO of the sensor becomes smaller, then the output voltage on the load resistor RL is large, and the relationship between its voltage value and the resistance value RO of the VRL device is as follows:
(1)
Where: VC is the measured voltage, generally 5V; VRL is the load voltage; RL is the load resistance (known); RO is the resistance value of the element. As the known gas concentration changes, the load voltage changes differently, and the element resistance of the sensor will also change accordingly. Based on the resistance value of the element resistance under different gas environments, it can be determined whether the sensor's indicators meet the standard values.
System hardware design
The gas sensor test system is based on measuring the resistance value of the sensor and uses the single-chip microcomputer SPCE061A for data processing. The gas sensor test system is shown in Figure 2 and consists of a component test box and a PC microcomputer. The component test box mainly includes two parts: the component box and the single-chip microcomputer system. The main function of the component box is to simulate various on-site use environments of gas sensors. All sensors to be tested are placed on the component board and can be selected by the electronic switch in the single-chip microcomputer system. When a certain concentration of gas is filled, the resistance value of the sensor to be tested changes accordingly, causing the output voltage of the sensor load to change. After the voltage signal is sampled and held, it is sent to the single-chip microcomputer system for processing.
The SPCE061A microcontroller is selected in the microcontroller system. It has a 7-channel 10-bit voltage A/D analog-to-digital converter and two 10-bit D/A digital-to-analog conversion channels, which saves circuit board area and simplifies the hardware circuit. The user only needs to add the instruction to start the A/D conversion during software programming to complete the operation. In order to maintain the accuracy of data acquisition, it is necessary to collect data N times and then take the average value, that is, the load voltage VRL collected each time must be sent to the arithmetic logic unit of the microcontroller after A/D conversion, and the arithmetic average calculation is performed with the A/D conversion results of N-1 times. The final result is placed in the storage area, waiting for the host computer to perform data analysis and judgment. SPCE061A has two 10-bit D/A conversion channels inside. For the realization of voice function, the D/A digital-to-analog converter inside the microcontroller can be used to send the pre-set voice signals such as "start measurement" and "end measurement" through the digital-to-analog conversion channel to the speaker.
Figure 1 Gas sensor structure principle and test circuit
Figure 2 Test system
Table 1 9-core RS232 interface
Figure 3 Main program flowchart
System software design
The system software includes two parts: the lower computer software and the data analysis software.
The software of the lower computer mainly completes the acquisition, storage and timing of the sensor input signal, sends data to the PC through the RS-232 serial interface, and realizes the functions of voice data encoding, storage, decoding and D/A conversion. The main program block diagram of the lower computer is shown in Figure 3, and the interrupt subroutine and voice subroutine are not repeated here. At present, RS232 is the most widely used serial interface in the PC and communication industry. RS represents the recommended standard and 232 is the identification number. RS232 adopts a single-ended communication transmission method. A complete RS232 interface has 22 wires and uses a standard 25-pin plug socket. In addition, there is also a 9-pin RS232 interface that is widely used. [page]
The RS232 standard defines the voltage levels of logic 1 and logic 0, as well as the standard transmission rate and connector type. The signal size is between 3V and 15V for positive and negative. RS232 stipulates that the level close to 0 is invalid, and logic 1 is defined as a negative level. The signal state of the valid negative level is called marking, and its functional meaning is OFF; logic 0 is defined as a positive level, and the signal state of the valid positive level is called spacing, and its functional meaning is ON. The equipment specified in the RS232 standard can be divided into two categories: data terminal equipment (DTE) and data communication equipment (DCE). This classification defines different lines for sending and receiving signals. Generally speaking, computers and terminal devices have DTE connectors, and modems and printers have DCE connectors. This article uses the widely used 9-core RS232 interface for data acquisition. Table 1 shows the signal and pin assignments of the 9-core RS232 interface used in PC network equipment.
The data analysis software adopts Visual C++6.0 development system and has a good human-computer operation interface. It can measure and collect any parameters of the sensor at any time, and can view the response curve and historical operation records of any channel of the system.
Figure 4 is the measurement result and data analysis window in the PC virtual instrument of this system, in which the resistance of the 8-channel sensor in normal air is RO. When two gases with different known concentrations are injected, the resistance of the element is R1 and R2 respectively, which can be used to calculate its sensitivity in these two cases. Figure 5 is the response curve of the first channel sensor randomly selected, which can more comprehensively reflect the output characteristics of the sensor of a certain channel within the set time. It can be seen from the figure that when the gas-sensitive element of the first channel is injected with a gas of known concentration, the resistance reaches stability in about 1.7s, that is, the sensor output begins to stabilize. The output characteristic parameters are shown in the window display data of Figure 5, which can be used to judge and compare whether the indicators of the sensor meet the standard values.
Voice function implementation
Figure 4 PC virtual instrument analysis window
Figure 5 Response curve
The realization of the voice function of the gas sensor test system is mainly reflected in the fact that when measuring the sensor data, the speaker will issue voice prompts, such as "start measurement", "start measuring resistance RO", "start measuring resistance R1", "start measuring resistance R2", "start drawing response curve", "reset", etc. When the measurement is completed, the system will broadcast: "RO measurement completed", "R1 measurement completed", "R2 measurement completed", etc. The voice broadcast circuit is shown in Figure 6.
Figure 6 Voice broadcast circuit
The Lingyang SPCE061A microcontroller has a dual-channel DAC audio output (DAC1 and DAC2 are the (21) and (22) pins of the SPCE061A microcontroller). The analog signals of DAC1 and DAC2 are output through the plug-in CON3①③ pins respectively. Since the DAC output is current type, the DAC output can drive the speaker to make sounds after being amplified by the SPY0030 audio amplifier. This provides great convenience for the audio design of the microcontroller, and the specific voice function is mainly realized through the program. Voice processing can be roughly divided into A/D conversion, encoding processing, storage, decoding processing and D/A conversion. The development software of SPCE061A has a SACM-LI library, which can make A/D, encoding, decoding, storage, and D/A into corresponding modules. Each module has its own application program interface API. After understanding the functions to be implemented by each module and the content of its parameters, calling the API function can realize the voice processing function. The commonly used SACM_S480 and SACM_A2000 playback algorithms involve adding voice resources, that is, compressing the required WAV files according to the required compression ratio, converting them into resource tables and calling them in the program. In this way, after the recorded voice files are compressed and stored in the memory, the voice output function can be realized by calling the API function of the voice module during the program execution.
Conclusion
The SPCE061A single-chip microcomputer is applied to the gas sensor test system, and the sensor test system is designed to achieve accurate measurement of the sensor signal to be tested by the sensor test system, meeting the use requirements. The system has the advantages of high measurement accuracy, high speed, and simple hardware circuit, overcoming the shortcomings of low precision and slow speed of manual measurement. At the same time, it adopts the method of connecting with a computer, which is easy to operate, highly versatile, and highly intelligent, laying a good foundation for the automation of sensor testing, and also has a certain reference value for the design and development of other similar test systems.
Previous article:Design and implementation of street lamp energy-saving monitoring system
Next article:Real-time multi-task operating system based on MSP430
Recommended ReadingLatest update time:2024-11-16 15:01
- Popular Resources
- Popular amplifiers
- Analysis and Implementation of MAC Protocol for Wireless Sensor Networks (by Yang Zhijun, Xie Xianjie, and Ding Hongwei)
- Introduction to Internet of Things Engineering 2nd Edition (Gongyi Wu)
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Modern Motor Control Technology (Wang Chengyuan, Xia Jiakuan, Sun Yibiao)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- EEWORLD University ---- RF Circuit Basics
- EEWORLD University ---- ARM Programming
- C6678 shared memory problem
- Design and practice of common analog systems for e-sports based on TI devices (Part 1)
- EEWORLD University Hall----Electrical Engineering and Electronic Technology (China University of Mining and Technology)
- 【EasyARM-RT1052 Review】+ MQTTClient transplantation
- A set of common codes suitable for small projects
- The universal tool for impedance measurement
- Advice for beginners of DLP4500 light modulation.
- RC parallel circuit bandwidth problem - 3db bandwidth position problem, please help