Application and design of SPCE061A in sensor test system

Publisher:shtlswLatest update time:2012-08-18 Source: 中电网Keywords:SPCE061A Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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 oscillators;

• 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 wake-up by touch;

• Use Sunplus audio codecs SACM_S480 and SACM_A2000 to play compressed voice resources;

• Phase-locked loop PLL oscillator provides 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.

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; 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. [page]

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-core plug socket. In addition, there is also a 9-core RS232 interface that is widely used.

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 effective 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 effective 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 a certain channel sensor 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. [page]

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.

Keywords:SPCE061A Reference address:Application and design of SPCE061A in sensor test system

Previous article:Understanding of MCU assembly delay program
Next article:AD9834 frequency sweeper based on msp430

Recommended ReadingLatest update time:2024-11-16 15:58

Design of temperature and humidity measuring instrument with voice function
introduction Temperature and humidity are indispensable parameters for calibrating the environment. In many places such as vegetable greenhouses and grain warehouses, the requirements for temperature and humidity are very strict. Therefore, higher requirements are put forward for the real-time detection of environme
[Microcontroller]
Design of temperature and humidity measuring instrument with voice function
Improved design of infrared pump based on SPCE061A control
O Introduction Infrared pumps are usually used to complete the function of "extending your hand to get water out, retracting your hand to stop the water", and generally provide manual and automatic pumping modes, and have low voltage detection alarm and voice prompts after use. When the infrared pump is wor
[Analog Electronics]
Improved design of infrared pump based on SPCE061A control
Design of a sound-controlled car based on Lingyang SPCE061A single-chip microcomputer
With the development of the electronics industry, automation is no longer a new topic. While putting forward higher and deeper requirements for the system industry, intelligence has become an inevitable development trend. Intelligent products have gradually entered the market, entered thousands of households, and pe
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号