In recent years, with the rapid development of sensor technology and information processing technology, higher requirements have been put forward for the measurement accuracy, data transmission distance and information processing capability of sensors in engineering applications.In order to overcome the shortcomings of ordinary force-sensitive and photosensitive sensors, such as poor anti-interference ability, short transmission distance, difficulty in zero adjustment, and the inability of measurement nodes to communicate with the host computer directly, this paper designs an intelligent sensor system with Freescale MC9S08SH4 microcontroller and AD7705 as the core. , adding software zero adjustment, floating point data processing, automatic compensation, two-way communication with the host computer, standardized digital output and other functions on the ordinary sensor, which can be very convenient

In recent years, with the rapid development of sensor technology and information processing technology, higher requirements have been put forward for the measurement accuracy, data transmission distance and information processing capability of sensors in engineering applications. In order to overcome the shortcomings of ordinary force-sensitive and photosensitive sensors, such as poor anti-interference ability, short transmission distance, difficulty in zero adjustment, and the inability of measurement nodes to communicate with the host computer directly, this paper designs an intelligent sensor system with Freescale MC9S08SH4 microcontroller and AD7705 as the core. , software zero adjustment, floating-point data processing, automatic compensation, two-way communication with the host computer, standardized digital output and other functions are added to the ordinary sensor, which can easily realize the real-time data acquisition and processing of the host computer, and has measurement accuracy High, compact structure, strong anti-interference ability and so on.

1. System composition

The intelligent sensor system consists of signal conditioning circuit, A/D conversion circuit, main control circuit, zero adjustment circuit, RS-485 communication circuit and power supply circuit. The signal conditioning module is responsible for conditioning and amplifying the mV-level differential signal output by the sensor; the A/D conversion module converts the analog signal output by the signal conditioning module into a digital signal for processing by the MCU; the zero-adjustment module can convert the current input at any time The value is set as the reference zero point; the RS-485 communication module realizes the communication between the main control circuit and the host computer; the power supply module provides power for the main control circuit, sensor, signal conditioning module and RS-485 communication module. The system structure is shown in Figure 1.

Design of Wireless Sensor Network System Based on TinyOS Operating System

2. Functional module design

2.1 Signal conditioning and A/D conversion module

The output signal of the sensor is generally a mV-level differential signal. The traditional signal conditioning circuit is to add one or more high-precision amplifier circuits before A/D conversion, which not only increases the cost, but also makes the circuit more complicated. The AD7705 has a complete analog front end, built-in programmable gain amplifier (PGA) and programmable digital filter, which can directly condition, filter, amplify and A/D convert the mV-level signal output by the sensor, and then output serially, without the need for Using an external instrumentation amplifier greatly simplifies circuit design.

The A/D conversion function of AD7705 is also very strong, and the Σ-Δ conversion technology it adopts can realize up to 16-bit error-free transmission. In this design, the two fully differential analog input channels of AD7705 can meet the input of two sensor output signals at the same time, and the signal gain, polarity, input channel, data output update rate and digital filter can be easily adjusted through software programming. Make settings. AD7705 circuit module shown in Figure 2. Among them, the sensor output signal is directly connected to the differential analog input channel AIN1 of AD7705.

Design of Wireless Sensor Network System Based on TinyOS Operating System

2.2 Main control module

The main control MCU of the intelligent sensor system is MC9S08SH4, which belongs to the S08 series 8-bit single-chip microcomputer of Freescale Company. It has the characteristics of small size, fast speed, rich on-chip resources and strong data processing capability. Its maximum clock frequency is 20 MHz, and the on-chip resources include 4 KB Flash, 512 B RAM, 8-way keyboard interrupt, SCI interface, SPI interface, IIC bus and other modules. It is packaged in TSSOP16 and has a small size, which is very suitable for this system. In order to minimize the board area, the programming interface of MC9S08SH4 in this design does not use the standard 6-pin BDM interface, but uses a custom 4-pin interface. The minimum system is shown in Figure 3.

Design of Wireless Sensor Network System Based on TinyOS Operating System

2.3 Zero adjustment module

The zero adjustment module has two functions, one is to zero the sensor before each measurement, and the other is to set the reference zero point immediately during the measurement process.

The traditional method of mechanical zero adjustment is to add a potentiometer to the circuit, and use the method of changing the voltage division value to perform zero adjustment. This method is slow to adjust and the accuracy is relatively poor. The software zero adjustment method is adopted in this design. First, the A/D conversion result when the sensor zero input is collected by the keyboard interrupt is used as the reference zero point and stored in a global variable; the value of each A/D conversion in the future is the same as the global value. The corrected result can be obtained by comparing with the reference zero point in the variable. The software zero adjustment method has high accuracy and very fast adjustment speed, and is especially suitable for setting the reference zero point immediately during the measurement process.

2.4 RS-485 communication module

The communication between the system and the upper computer adopts the RS-485 communication protocol. In practical applications, a host computer needs to tow multiple sensors, and has high requirements on the transmission distance. The RS-485 serial bus interface uses balanced transmission and differential reception for data communication, which improves the anti-common mode interference ability and transmission distance compared with RS-232; and the RS-485 bus can be used for multiple RS-485 interfaces. The interconnection of the equipment realizes the high-speed long-distance transmission of data. The RS-485 communication chip used in this system is MAX1487. The input port DI and the output port RO are respectively connected with the serial data sending end TXD and the serial data receiving end RXD of the MC9S08SH4. The read and write enable terminals are connected together and controlled by the PTA1 pin of the MC9S08SH4. When PTA1 outputs a high level, the sensor system sends data to the upper computer; when PTA1 outputs a low level, the sensor system receives data from the upper computer, as shown in Figure 4.

Design of Wireless Sensor Network System Based on TinyOS Operating System

2.5 Power Module

The power module adopts 24 V DC input. In addition to reserving 24 V and 12 V power supply interfaces for sensors, it also provides 5 V working voltage for AD7705, MAX1487 and MC9S08SH4. In order to make the system compact and small, the voltage regulator chips used in the power module are 78L12, 78L05 and LM1117 (SOT-223 package) with low current each. After on-site testing, it was found that due to the small power of the system, the heat generation of the power module is not large, which can ensure stable operation for a long time.

3. Software design

The software design part mainly includes MC9S08SH4 initialization, median filtering and mean filtering of A/D conversion results, setting reference zero point for data correction, data floating point processing, proofreading data frame format, through SCI module and RS-485 communication module. The data frame is sent to the upper computer. The specific process is shown in Figure 5.

Design of Wireless Sensor Network System Based on TinyOS Operating System

The host computer software is written in LabVIEW combined with SQL, and monitors the running status of the intelligent sensor system through the serial port and RS485 communication protocol. If necessary, the host computer software can reset the communication address of the digital sensor, A/D conversion bits, data frame format and Serial port baud rate and other parameters, and store the collected operating data in the database, which is convenient for future analysis and sorting.

The intelligent sensor system based on Freescale MC9S08SH4 and AD7705 implemented in this design takes full advantage of the features of MC9S08SH4, such as small size, fast speed, abundant on-chip resources, and strong data processing capability, combined with the built-in signal processing circuit and high precision of AD7705? Collide-? The built-in A/D converter adds software zero adjustment, floating-point data processing, multi-point measurement, RS-485 two-way communication, standardized digital output and other functions to ordinary sensors, which overcomes the short data transmission distance of ordinary force-sensitive and photosensitive sensors. , Difficult to adjust the zero point, the measurement node cannot communicate with the host computer directly, and the anti-interference ability is poor. After on-site testing, the system has the advantages of small size, high measurement accuracy, stable and reliable operation and so on.

The Links:   CC1200RHBR PM200DSA120 THE IC INFO