Abstract: To accurately, efficiently, and in real-time measure pressure and temperature data in industrial settings, an intelligent pressure transmitter system based on the HART protocol was designed. The system consists of a pressure sensor, an intelligent transmitter, a HART/RS232 converter, and a PC host computer. This paper introduces the system's structure and functions, describes the hardware design scheme of the intelligent transmitter and HART/RS232 converter, analyzes the system's software processing flow, and presents the host computer interface based on VC++ 6.0 in the experimental results. Experimental and industrial field applications demonstrate that the system performs well and meets the requirements of HART products.
Keywords: HART protocol, intelligent transmitter, HART/RS232, VC++6.0
introduction
Industrial sites often require the measurement of certain parameters, but traditional transmitters mostly use analog signals to achieve communication between devices. The signals are easily interfered with and the power consumption is too high [1], making it difficult to transmit over long distances. The HART protocol, as an open protocol, has become the standard for smart instruments. Its feature is that it can realize digital signal communication on a 4-20mA analog current loop. This paper designs a smart pressure transmitter system based on the HART protocol, which supports the setting of the zero point and range of the pressure sensor, as well as software filtering, digital temperature compensation and digital linearization of the pressure parameters in the industrial field. It provides 4-20mA analog output and digital communication of the HART protocol. The upper computer software can be used to set the parameters of the sensor and display the digital parameters of the field, and save the relevant parameters of the pressure sensor in a text file.
1 System Structure Diagram
The system structure diagram is shown in Figure 1.
The pressure sensor collects pressure parameters from the industrial site and outputs a differential small signal; the intelligent transmitter amplifies and digitally processes the sensor output signal, while simultaneously monitoring the field temperature, outputting a 4-20mA current signal and a HART protocol digital signal; the HART/RS232 converter converts the HART signal (AC signals of different frequencies) into a digital signal conforming to the RS232 standard level; the PC host computer communicates with the intelligent transmitter through the HART/RS232 converter, displays the pressure and temperature measurement data in real time, sets relevant parameters of the pressure sensor, and saves the data as a text file.
Figure 1 System structure block diagram
2 System Hardware Design
2.1 Intelligent Transmitter
The intelligent transmitter uses a standard 24V industrial power supply to amplify, filter, and process the differential small signal output from the pressure sensor. It monitors the temperature values in the industrial field in real time and provides a standard 4-20mA analog current output and an FSK signal output based on the HART protocol. Its hardware structure is shown in Figure 2.
Figure 2 Hardware structure diagram of HART intelligent transmitter
2.1.1 MSP430F4270
The MSP430F4270 serves as the core of the intelligent transmitter. Its 16-bit ADC converter enables the digital conversion of differential analog signals; the I2C interface reads the temperature digital data converted by the LM75A; the SPI interface writes to the AD421 to control its output of a 4-20mA current analog signal; and the UART interface is used to communicate with the DS8500, and the HART protocol can be implemented through software programming.
2.1.2 OPA2333
The signal obtained from the pressure sensor is a small differential signal and contains a large common-mode component [2]. An instrument amplifier circuit is designed using OPA2333 (the circuit amplifies the differential signal and suppresses the common-mode signal; the larger the differential amplification factor, the higher the common-mode rejection ratio [2]) to suppress the common-mode noise in the input signal.
2.1.3LM75A
The LM75A is a high-speed I2C interface temperature sensor with an operating range of -55 to +125°C and an accuracy of 0.125°C. A microprocessor can read data from its internal registers via the I2C interface to obtain the ambient temperature value.
2.1.4AD421
The AD421 is a single-chip high-performance digital-to-analog converter (DAC) from Analog Devices (ADI) that can be directly powered by a standard 24V industrial power supply loop. Its main features are as follows:
◆4-20mA current loop output.
◆HART compatible.
◆Regulated output: 5V, 3.3V, 3V.
◆Precision voltage source for 2.5V and 1.25V.
◆ 16-bit digital serial input interface (SPI).
◆ Static current: 750uA (maximum).
2.1.5DS8500
The DS8500 is a single-chip, addressable remote sensor channel (HART) modem that meets the HART protocol physical layer specification requirements. This device integrates 1200Hz/2200Hz FSK signal modulation and demodulation functions, features extremely low power consumption, and requires very few external components due to its integrated digital signal processing capabilities. The input signal is sampled by an analog-to-digital converter (ADC) and then digitally filtered/demodulated. This architecture ensures reliable signal detection even in interference environments. The output digital-to-analog converter (DAC) generates a sine wave and provides a low-noise signal that can be continuously switched between 1200Hz and 2200Hz. Low power consumption is achieved during transmission by disabling the receiver circuitry, and vice versa.
1.2 HART/RS232 Converter
The hardware structure of the HART/RS232 converter is shown in Figure 3. The DS8500 communicates with the PC via an RS232 serial interface, and the HART protocol is supported by written host computer software. DIN receives data from the PC's UART, and DOUT sends data to the PC's UART. The DTR pin signal of the PC's UART interface controls the reset state of the DS8500, and the RTS pin signal controls the modulation and demodulation mode of the DS8500. A low-frequency transformer (a commonly used 1:1 audio transformer is sufficient) can be used to couple the FSK signal (AC signal) of the HART protocol.
Figure 3 Hardware structure diagram of HART/RS232 converter
3 System Software Design
3.1 Intelligent Transmitter Software Design
The microprocessor of the intelligent transmitter is MSP430F4270, and its software design is shown in Figure 4.
Figure 4 MSP430F4270 Software Design
Software programming supports both long and short frame formats of the HART protocol. The implemented general commands include: Command 0, read sensor-related parameters; Command 1, read the main measured pressure data; Command 3, read pressure and temperature data; Command 6, set a random address; Command 14, read the sensor number; Command 59, set the required number of preambles; and Command 109, enter or exit burst mode. Specific commands include: Command 128, write zero-point temperature compensation parameters; Command 129, write full-scale temperature compensation parameters; Command 130, read zero-point temperature compensation parameters; Command 131, read full-scale temperature compensation parameters; Command 132, set the sensor zero point; Command 133, set the sensor full-scale range; and Command 134, write the sensor manufacturer's number. The sensor parameters stored in the MSP430F4270's user FLASH include: random address, number of preambles, zero-point value, full-scale value, zero-point temperature compensation parameters, full-scale temperature compensation parameters, and the sensor manufacturer's number.
3.2 Host Computer Interface Design
The host computer interface was written in VC++ 6.0 software, and the serial communication protocol was developed using the MScom control. The HART protocol was implemented through software programming. Additionally, the host computer software has the function of saving sensor parameters as text files, named after the sensor manufacturer's serial number.
The core code of the host computer software is for calculating temperature compensation parameters based on the least squares method. The host computer selects five different temperature values and their corresponding zero-point pressure values within the system temperature range, performs quadratic curve fitting using the least squares method, and obtains the parameters of the quadratic curve equation, which are the zero-point temperature compensation parameters. These parameters are then converted from floating-point numbers to unsigned numbers (for serial communication) and written to the sensor's zero-point temperature compensation parameters via HART commands. The calculation of the full-scale temperature compensation parameters is performed in the same way.
Because the host computer program uses controls from VC++ 6.0, the controls need to be registered when running on computers without VC++ installed. First, copy "MSCOMM32.DEP, MSCOMM32.OCX, and MSCOMM.SRG" to the "C:\WINDOWS\system32" subdirectory. Second, click "Start—Programs—Accessories—Command Prompt," type "Regsvr32 C:\WINDOWS\system32\MSCOMM32.OCX" and press Enter. Click "OK" in the system prompt to complete the control registration. Third, exit the command prompt and run the program.
4 Results Analysis
Tests showed that the power consumption of the system's intelligent transmitter was approximately 3.2mA, which is less than the 3.5mA required by the HART protocol; the system's pressure measurement accuracy was 0.04%FS, meeting the accuracy requirements of HART products.
The system's HART host computer interface is shown in Figure 5. The baud rate is fixed at 1200bps; the address setting range is 0x00-0x0F, and it supports 15 HART devices simultaneously; the preamble number setting range is 0x00-0x14; the pressure and temperature values are displayed in floating-point format (IEEE 745 standard), with pressure displayed in both 4-20mA and percentage modes, and temperature displayed in °C.
Figure 5 HART host computer interface
5. Conclusion
This paper describes a hardware design scheme, software design concept, and implementation method for an intelligent pressure transmitter system based on the HART protocol. It successfully achieves high-precision measurement of pressure and temperature in industrial settings using the HART protocol. Experimental testing and industrial field applications demonstrate that the system meets the requirements of the HART protocol and its products, and operates stably with good performance.
References
[1] Xia Xiaojian, Ning Yonghai, Shen Sen. Research on low-power intelligent transmitter based on HART protocol [J]. Communication Technology, 2010(1):105-109.
[2] Tong Shibai and Hua Chengying, eds. Fundamentals of Analog Electronics [M]. Beijing: Higher Education Press, 2003(12).
[3] Stephen Prata, C. Rimer Plus (5th Edition), Chinese version [M]. Beijing: Posts & Telecom Press, 2005(2).
[4] Sun Xin, Yu Anping, eds. VC++ In-Depth Explanation [M]. Beijing: Electronic Industry Press, 2006(6).
[5] Zhang Yanfeng, Yan Jiaming. Temperature compensation algorithm for pressure sensor based on least squares method [J]. Computer Measurement & Control, 2007, 15(12).
[6] Jia Bonian, Yu Pu, Song Aiguo (eds.). Sensor Technology [M]. Nanjing: Southeast University Press, 2007(2).
About the authors : Yang Ze (1987–), male, from Yuncheng, Shanxi Province, holds a master's degree and his research interests include embedded system design and microprocessor applications. Wang Ji (1968–), male, from Changsha, Hunan Province, is an associate professor and his research interests include embedded system design and electrical automation design.
First author: Yang Ze, born January 20, 1987, male, Master's student. Affiliation: School of Information Science and Engineering, Central South University.
Contact number: 13873113830 Mailing address: Room 322, Minzhu Building, Main Campus, Central South University, Changsha, Hunan Province, 410083, China
[email protected]@gmail.com