Design of sensor module based on system-on-chip

Publisher:创新火箭Latest update time:2010-04-08 Source: 微计算机信息Keywords:Sensors Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

With the advent of the Internet era and the continuous improvement of information technology requirements, especially the increasing popularity of the Internet and the increasing number of Intranets in enterprises, it is necessary and possible to combine computer network technology with intelligent sensor technology. The concept of intelligent sensor network is thus generated. Intelligent sensor networking technology is committed to studying the network communication function of intelligent sensors, integrating sensor technology, communication technology and computer technology to achieve true unification and coordination of information collection, transmission and processing. This paper develops a sensor module hardware and software design based on a system-on-chip chip.

2 Sensor module hardware system structure

The principle block diagram of the sensor module (STIM) is shown in Figure 1, which mainly includes: transmitter array module, signal conditioning module, multi-channel data acquisition module, TEDS module and TII intelligent interface. In order to enhance the integration of the system, the design adopts the integrated on-chip data acquisition system ADuC812.

Sensor Module

The output signal of the sensor is amplified and conditioned by the conditioning module and input to the multi-channel ADC in the ADuC812 chip. After the ADC converts the corresponding channel into digital, it is stored in the RAM and then read into the NCAP through the TII intelligent interface. In order to facilitate the upgrade and update of TEDS content, the system uses an asynchronous serial port to download the electronic data sheet to the on-chip Flash of ADuC812. In addition, the asynchronous serial port can also be used to download and debug user programs to facilitate system development.

3 Detailed design of sensor system hardware

3.1 STIM sensor front-end signal acquisition circuit design

The temperature sensor is implemented by AD590 chip of AD company, which is a monolithic integrated two-terminal temperature-sensing current source. Its circuit schematic is shown in Figure 2, where R1=5.1KΩ, R2=R3=10KΩ, R4=2KΩ, and R5 and R6 are 10KΩ potentiometers respectively. When AD590 generates current signal due to temperature change, a potential difference is generated across resistor R1, thereby generating a voltage signal at the input end of the operational amplifier, and the zero drift is adjusted by the addition circuit; the operational amplifier OP07 performs proportional amplification, and the amplification factor is adjusted by potentiometer R6, so that the test temperature range is 0~65℃, and the output voltage is correspondingly 0~2.5V.

3.2 Reset Circuit Design

ADuC812 requires an external POR (Power-on reset) circuit. The power-on reset circuit keeps the RESET pin at a high level when the power supply voltage is lower than 2.5V; and when the power supply voltage is higher than 2.5V, the RESET pin keeps a low level for at least 10ms. In this module, a POR circuit designed with a dedicated POR chip ADM810 is used. ADM810 is a CMOS monitoring circuit chip that can monitor power supply voltage, power supply failure, and the working status of the microprocessor. The reset signal RESET is used to start or restart the CPU. During the power-on period, as long as the power supply voltage VCC is greater than 1.0V, the output high level voltage can be guaranteed. During the rise of VCC, RESET remains at a high level until the power supply voltage rises above the reset gate (4.65V). After exceeding this threshold, the internal timer releases RESET after about 200ms, returning it to a low level. Whenever the power supply voltage drops below the reset threshold (i.e., power sag), the RESET pin will go high. If a power sag occurs during a reset pulse that has already started, the reset pulse will be maintained for at least 140ms. During power-off, once the power supply voltage VCC drops below the reset threshold, RESET will remain high as long as VCC is not lower than 1.0V.

3.3 TII Interface Module

The TII interface is the focus of hardware design. This interface is not an additional network protocol, but an interface connecting NCAP and STIM. It mainly defines the point-to-point connection between the two and the short-distance interface of synchronous clock. TII is a serial communication interface based on the SPI protocol, in which DIN, DOUT, DCLK and NIOE complete the communication function, NTRIG and NACK realize the channel reading, writing, triggering and response related to STIM, STIM uses NINT signal to request service from NCAP, and NCAP uses NSDET signal to detect STIM module to realize plug-and-play of STIM. The system uses the SPI bus of ADuC812 and other I/O resources to simulate the TII ten-wire interface. The connection diagram is shown in Figure 3. In order to realize the hot plug of STIM module, the power supply of TII interface needs to be processed. Hot plug protection circuit can be added to STIM, and of course, protection circuit can also be added to NCAP. This system adds protection circuit to NCAP.

3.4 Signal conditioning storage circuit design

During the design of the data acquisition system, the electrical signal input to the data acquisition system does not necessarily match the input range of the ADC. Therefore, it is generally not directly sent to the ADC for conversion. The input signal must be conditioned. The analog signal after signal conditioning meets the requirements of the ADC. The signal sent by the sensor is sent to the amplifier OPA4350. At this time, the amplifier OPA4350 forms a voltage follower, which plays the role of impedance transformation to increase the output current. The signal output from the amplifier is input to the AD conversion channel of the ADuC812 controller for data acquisition.

Since ADuC812 has only 256 bytes of data RAM, it is necessary to expand the RAM capacity externally. Here, IS61C256 is selected to expand the 32K data area. Considering that ADuC812 has 640 bytes of Flash integrated inside, it can be used as a storage area for electronic data tables, so there is no need to expand the Flash memory externally.

3.5 Online download and debugging

The program memory array can be programmed in one of two modes: one is serial download (in-circuit programming) mode; the other is parallel programming mode. Parallel programming mode is fully compatible with conventional third-party flash or EEPROM device programmers, but it is more complicated to use and requires the configuration of external pins in ADuC812 required to support parallel programming. Therefore, the serial download mode is used in the development and debugging of this module. As part of the factory boot code, ADuC812 itself has an in-circuit programming program, which makes it easy to download serial code through the standard UART serial interface. Simply pull the /PSEN pin of ADuC812 to a low level through a 1kΩ resistor connected to ground, and the device will automatically enter serial download mode when powered on. This system uses the RS-232 interface circuit of Figure 4 to achieve serial interface communication between the host computer and ADuC812.

RS-232 interface circuit

4 Sensor module software design

The program software is the soul of the system. The system relies on the operation of the program software to realize all the functions of the sensor module. The reasonable design of the program software can effectively play the function of the extended system hardware. The structure of the software design model of this module comes from the structure of the IEEE1451.2 standard. The processor of the system is ADuC812, which is compatible with the 51 series microcontrollers. It can use programming languages ​​​​for MCS-51, including ASM51 assembly language and C51 high-level language. Unlike the previous 80C51 microcontroller, ADuC812 has online debugging and downloading functions, which are provided by the development tool kit Quickstart development system that supports ADuC812. In other words, when the user system retains ADuC812, the user system can be debugged directly through the serial interface communication between the development system and ADuC812.

1. STIM software module.

STIM must include a TEDS, control and status registers, sensor channels, interrupt flags, address and function compilation logic, data transmission and processing functions, trigger and trigger acknowledgment functions, a TII driver and a sensor interface. The software of IEEE1451.2STIM is divided into four main parts: (1) sensor interface STIM module; (2) sensor independent interface TII module; (3) electronic data spreadsheet TEDS module; (4) address and function module.

2. Data collection procedures.

In order to enable the data acquisition system to obtain high-precision data, not only the above-mentioned anti-interference and accuracy-enhancing measures need to be taken in hardware, such as strict voltage stabilization of the power supply, RC high-frequency filtering of the ADC input signal, the use of high-precision and high-stability ADC reference source, and high-precision sensors, etc., but software optimization is also very important. Appropriate software design can further improve accuracy and improve the overall performance of the data acquisition system.

3. TEDS download program.

The TEDS download program of this system is an RS232 serial communication program, which is divided into two parts: the microcontroller program and the host computer program. Here we study the development of the microcontroller program. To achieve serial communication between the PC and the microcontroller, in addition to complying with the RS232 serial communication protocol, they must also have their own communication application software. The design idea of ​​the communication software is: the PC is the active mode. After the communication starts, the PC sends a request to the microcontroller, and the microcontroller returns a response signal. After the communication is normal, the microcontroller executes the corresponding function and responds according to the command sent by the PC. The microcontroller flow chart is shown in Figure 5.

MCU Flowchart

5 System Testing

The general design idea of ​​this test system is: ADuC812 is used as the lower computer. When receiving the command of the upper computer, it collects data and transmits the collected data to the upper computer through the serial port. The upper computer can easily convert the test data into intuitive charts and other forms, and can save them in the computer for future use. This system needs to compile software for the microcontroller and the upper computer respectively to realize data communication. This system uses VB to write the program of the upper computer and assembly language to write the program of ADuC812. Since VB has MSCOMM control, we can easily use the serial port to collect the required data. Moreover, the VB program is easy to understand, has strong portability, is simple to develop, has a short cycle, and has powerful drawing functions. It is particularly suitable for systems that need to draw curves.

Innovation of the author of this article: This article gives a comprehensive introduction to the developed sensor module. The research of this system has laid a certain foundation for the research of IEEE1451 networked intelligent sensors and provided an example for the development of various standardized IEEE1451 sensor modules STIM.

Keywords:Sensors Reference address:Design of sensor module based on system-on-chip

Previous article:Laser output power measurement and control design based on AD7896
Next article:Application of low-pass filter in harmonic detection of instantaneous reactive power theory

Latest Analog Electronics Articles
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号