A rail-mounted isolated HART temperature transmitter and its working method
By using DC-DC power isolation and SPI signal isolation design, combined with a digital-to-analog converter and HART modulation and demodulation circuit, the problems of weak anti-interference ability and poor versatility of rail-mounted temperature transmitters are solved, realizing high-precision temperature measurement and reliable communication, and improving the anti-interference ability and ease of operation of the equipment.
Patent Information
- Application Number
- CN202511934303.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-20
- Publication Date
- 2026-11-17
AI Technical Summary
Existing rail-mounted temperature transmitters have weak anti-interference capabilities and poor versatility, resulting in reduced system accuracy and reliability. Furthermore, changing sensor types or modifying measurement ranges is cumbersome.
It adopts DC-DC power isolation and SPI signal isolation design, combines digital-to-analog converter and HART modem circuit, integrates signal processing, analog-to-digital conversion, data calculation, digital-to-analog conversion and loop output functions, realizes power layer distribution through DAC integrated power supply and DC/DC isolated power supply, uses digital isolators for physical isolation and signal interconnection, and supports HART communication to improve device versatility and ease of operation.
Without compromising the accuracy of analog signal measurement, it achieves high-precision temperature signal measurement and reliable communication, improves anti-interference capability and ease of operation, and meets the diverse needs of industrial sites.
Smart Images

Figure CN123111489A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of temperature transmitter technology, and in particular to a rail-mounted isolated HART temperature transmitter and its operating method. Background Technology
[0002] Temperature transmitters play a crucial role in the industrial sector, serving as indispensable instrumentation equipment in industrial settings. With the continuous development of industrial automation, the demand for accurate temperature measurement and monitoring is increasing. Temperature transmitters convert the millivolt / resistance signals detected by temperature sensors into industrial standard signals and transmit them to the control system, providing critical data support for temperature control in industrial production processes. To meet the needs of high-density installation and maintenance within control cabinets, DIN rail-mounted temperature transmitters have gradually become the market mainstream, with increasingly widespread applications in industrial production, significantly improving the automation level and management efficiency of industrial processes.
[0003] However, existing rail-mounted temperature transmitters have significant drawbacks. Their anti-interference capabilities are insufficient, making them susceptible to common-mode interference and other factors in the field, thus reducing the system's accuracy and reliability. Furthermore, their versatility and flexibility are poor; when changing the sensor type or modifying the measurement range, the transmitter must be replaced or the settings must be reprogrammed by a professional, making the process cumbersome and significantly reducing production efficiency.
[0004] Therefore, how to overcome the shortcomings of existing technologies and solve the problems of weak anti-interference ability and poor versatility of existing rail-mounted temperature transmitters is a problem to be solved in this technical field. Summary of the Invention
[0005] In view of the above-mentioned defects or improvement needs of the existing technology, and in order to solve the problems of weak anti-interference ability and poor versatility of existing rail-mounted temperature transmitters, this application provides a rail-mounted isolated HART temperature transmitter and its working method. By optimizing the hardware architecture and software process, the anti-interference ability, versatility and ease of operation of the device are improved, so as to meet the diverse needs of industrial sites.
[0006] The embodiments of this application adopt the following technical solutions: In a first aspect, this application provides a rail-mounted isolated HART temperature transmitter, including a signal pre-processing circuit, an analog-to-digital converter, a microprocessor, a digital-to-analog converter, a HART modulation and demodulation circuit, and a power protection circuit; the power protection circuit is located between the digital-to-analog converter and the external loop, and provides isolated power to the analog-to-digital converter through DC-DC power isolation, and directly powers the digital-to-analog converter, the microprocessor, and the HART modulation and demodulation circuit; The signal pre-processing circuit is used to receive the raw signal input from the sensor and perform pre-processing. The analog-to-digital converter is used to receive the pre-processed analog signal and convert it into a digital signal. The microprocessor receives the digital signal from the analog-to-digital converter through isolated SPI and performs temperature calculation. The microprocessor also communicates with the HART modem circuit through a serial port and interacts with the digital-to-analog converter through SPI. The digital-to-analog converter is used to receive digital instructions from the microprocessor, convert them into analog current signals, and output them to the external loop. The HART modulation and demodulation circuit is used to modulate the digital communication signal of the microprocessor into an FSK signal of the HART protocol or demodulate an external HART signal and transmit it to the microprocessor, and couple the modulated FSK signal to the digital-to-analog converter.
[0007] By adopting the above technical solutions, anti-interference design is achieved through DC-DC power isolation and SPI signal isolation. Furthermore, through the direct coupling design of the digital-to-analog converter and HART modem circuit, bidirectional digital communication is realized without affecting the measurement accuracy of analog signals. The equipment integrates the entire process of sensor signal processing, analog-to-digital conversion, data calculation, digital-to-analog conversion, loop output, and HART communication. Ultimately, it achieves high-precision temperature signal measurement and reliable communication in industrial settings. This not only enhances the equipment's anti-interference capability but also improves its versatility and ease of operation through HART communication, meeting the diverse needs of industrial environments.
[0008] In some embodiments, the power protection circuit is connected to both the DC / DC module power supply and the digital-to-analog converter (DAC), with the DC / DC module power supply connected to the DAC. The power protection circuit draws power from an external loop via LOOP+ / LOOP-. One path of power is regulated by a Zener diode to supply power to the DC / DC module power supply, which in turn supplies power to the DAC. The other path supplies power to the DAC, which in turn supplies power to the microprocessor and HART modem circuit.
[0009] By adopting the above technical solution, power distribution is achieved through DAC integrated power supply + DC / DC isolated power supply, which simplifies the circuit and suppresses interference through isolation design.
[0010] In some implementations, a digital isolator is provided between the analog-to-digital converter and the microprocessor.
[0011] By adopting the above technical solution, physical isolation and signal interconnection are achieved through digital isolators, enabling the ADC and MCU to complete data communication under the premise of anti-interference, thereby improving the measurement accuracy and stability of the transmitter.
[0012] In some implementations, the microprocessor is provided with a reset circuit, a clock circuit, and a debug interface. The microprocessor is connected to an analog-to-digital converter and a digital-to-analog converter via two sets of SPI interfaces, and to a HART modem circuit and a user configuration port via two sets of UART interfaces.
[0013] By adopting the above technical solution, the MCU coordinates the entire process of the system, including signal acquisition (ADC), signal output (DAC), communication interaction (HART), and user configuration, through the interface. At the same time, it ensures its own stable operation with the help of basic circuits and supports development and maintenance with the help of debugging interfaces, thus realizing the function of the control center.
[0014] In some implementations, the HART modulation and demodulation circuit includes a signal transmission link and a signal reception link; The signal transmission link includes a TXD pin, control logic, modulator, waveform shaping, digital-to-analog converter, buffer, and HART_OUT pin. The microprocessor transmits digital instructions to the control logic through the TXD pin. The control logic triggers the modulator to convert the digital signal into an FSK signal of the HART protocol. Then, the signal quality is optimized through waveform shaping. After being processed by the digital-to-analog converter and the buffer in sequence, the signal is output from the HART_OUT pin to the external loop. The signal receiving link includes a HART_IN pin, a bandpass filter, an analog-to-digital converter, a digital filter, a carrier detection demodulator, control logic, and an RXD pin. The FSK signal from the external loop is input from the HART_IN pin. After interference is filtered out by the bandpass filter, the analog signal is converted into a digital signal by the analog-to-digital converter. The digital filter further purifies the signal. Then, the carrier detection demodulator identifies the digital information corresponding to the FSK signal, and the control logic sends the signal back to the microprocessor through the RXD pin.
[0015] By adopting the above technical solution, the digital instructions of the MCU are converted into HART signals through modulation, and the external HART signals are converted into digital instructions that the MCU can recognize through demodulation, so as to realize bidirectional digital communication between the transmitter and external devices (such as handheld devices and host computers), while ensuring the anti-interference ability and transmission reliability of the signal.
[0016] In some implementations, the HART modulation and demodulation circuit further includes a voltage regulator, an oscillator, and a reference voltage source. The voltage regulator is used to provide a stable power supply for the internal circuitry; the oscillator is used to generate a working clock in conjunction with an external crystal oscillator; and the reference voltage source is used to output a precise voltage to ensure the accuracy of analog-to-digital / digital-to-analog conversion.
[0017] By adopting the above technical solutions, auxiliary functions such as voltage regulation, clock, and reference voltage are realized, providing a foundation for the stable operation of the HART modulation and demodulation circuit.
[0018] Secondly, this application provides a method for operating a rail-mounted isolated HART temperature transmitter, applied to the rail-mounted isolated HART temperature transmitter described in the first aspect, including automated operating logic for temperature measurement and communication interaction, wherein: The automated operation logic for temperature measurement includes: system initialization, completing the initial configuration of hardware and software parameters; enabling system interrupt function; obtaining sensor type; performing temperature acquisition; performing conversion output; executing the watchdog module; after execution, returning to the temperature acquisition step to run in a loop, continuously performing temperature measurement and output. The automated operation logic of the communication interaction includes: during the main loop operation, if a communication command arrives, the system will interrupt the main process and execute the communication logic in sequence: receive the command and data; process the command and data; execute the requirements of the command; and return the data required by the command and the execution status.
[0019] By adopting the above technical solution, with continuous temperature measurement as the main line and communication interaction as the branch, and through the interrupt mechanism to achieve flexible switching between the main line and the branch, it not only ensures the real-time output of temperature data, but also supports the parameter configuration and data reading of external devices, thus meeting the needs of "automatic monitoring + remote configuration" in industrial sites.
[0020] In some implementations, temperature measurement includes both resistance temperature detector (RTD) signal acquisition and thermocouple signal acquisition processes. The RTD signal acquisition process includes: entering the dedicated program branch for RTD acquisition; selecting the corresponding signal channel, configuring the analog-to-digital converter and starting the conversion; determining whether the conversion is complete, and waiting continuously if not; after the conversion is complete, saving the digital code value output by the analog-to-digital converter; converting the digital code value into the actual resistance value corresponding to the RTD; querying the RTD calibration table using a binary search method to map the resistance value to the corresponding temperature value; storing the calculated temperature value into a global variable for subsequent output or communication, and then returning to the main program. The thermocouple signal acquisition process includes: entering the dedicated program branch for thermocouple acquisition; selecting the corresponding signal channel, configuring the analog-to-digital converter and starting the conversion; determining whether the conversion is complete, and continuing to wait if not; after the conversion is complete, saving the digital code value output by the analog-to-digital converter; converting the digital code value into the actual millivolt voltage value corresponding to the thermocouple; querying the millivolt value corresponding to the cold junction temperature using a binary search method; querying the thermocouple calibration table using a binary search method to obtain the final temperature value by summing the hot junction millivolt value and the cold junction millivolt value; storing the calculated temperature value into a global variable for subsequent output or communication use, and then returning to the main program.
[0021] By adopting the above technical solution, with "A / D conversion + calibration table lookup" as the core, the RTD is directly converted from resistance to temperature, while the thermocouple requires an additional cold junction compensation step (to solve the error problem caused by the temperature change of the thermocouple cold junction). Ultimately, the temperature values are stored in a global variable, realizing a universal acquisition logic for both types of sensors.
[0022] In some implementations, the current output program logic includes: starting; calculating the output current value based on the correspondence between temperature and output current; converting the current value into a code value; initiating D / A conversion; determining whether the D / A conversion is complete, and if not, continuing to wait; if complete, returning to the main program to continue subsequent operations.
[0023] By adopting the above technical solution, the conversion from "temperature data to standard current signal" is realized, and finally a 4~20mA industrial signal is output through DAC for external control system acquisition, thus realizing the closed loop of "measurement-output" of temperature transmitter.
[0024] In some implementations, the communication interaction process between the upper and lower computers includes: starting; initializing the low-power serial port; generating a data command to read the transmitter; sending the data command to read the transmitter; determining whether the CPU has completed receiving data, and if not, continuing to wait; if completed, performing data verification to determine if it is correct, and if incorrect, returning to the step of sending the data command to read the transmitter; if correct, performing data processing; initializing the CPU port and enabling interrupts; preparing the acknowledgment frame and placing it in the input buffer; determining whether the CPU has completed sending data, and if not, continuing to wait; if completed, performing data verification to determine if it is correct, and if incorrect, returning to the step of initializing the CPU port and enabling interrupts; if correct, ending the process.
[0025] By adopting the above technical solution, a two-way communication closed loop of "sending read command → receiving response → processing data → returning response" is realized. Data reliability is ensured through checksum verification, and the communication efficiency and power consumption requirements of industrial equipment are adapted through low-power serial port + interrupt, thus realizing stable data interaction between the transmitter and external devices.
[0026] Compared with the prior art, the beneficial effects of this application include, but are not limited to, the following: 1. The device achieves anti-interference design through DC-DC power isolation and SPI signal isolation. Furthermore, the direct coupling design between the digital-to-analog converter and the HART modem circuit enables bidirectional digital communication without affecting the accuracy of analog signal measurement. The device integrates the entire process of sensor signal processing, analog-to-digital conversion, data calculation, digital-to-analog conversion, loop output, and HART communication, ultimately achieving high-precision temperature signal measurement and reliable communication in industrial settings. This not only enhances the device's anti-interference capabilities but also improves its versatility and ease of operation through HART communication, meeting the diverse needs of industrial environments.
[0027] 2. By integrating power supply into the DAC and using isolated DC / DC power supply, power distribution is achieved in a hierarchical manner, which simplifies the circuit and suppresses interference through isolation design.
[0028] 3. By using digital isolators to achieve physical isolation and signal interconnection, the ADC and MCU can complete data communication under the premise of anti-interference, thereby improving the measurement accuracy and stability of the transmitter. Attached Figure Description
[0029] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments of this application will be briefly described below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0030] Figure 1 A module block diagram of a rail-mounted isolated HART temperature transmitter provided in this application; Figure 2 This is a schematic diagram of the isolated power supply provided in this application; Figure 3 A schematic diagram of the digital isolator setup provided in this application; Figure 4 A schematic diagram of the microprocessor provided in this application; Figure 5 This is a schematic diagram of the HART modulation and demodulation circuit provided in this application; Figure 6 A flowchart illustrating the automated operation logic of temperature measurement and communication interaction provided for this application; Figure 7 The flowcharts for the acquisition process of resistance temperature detector (RTD) signals and thermocouple signals provided in this application are as follows; Figure 8 The current output program logic flowchart provided in this application; Figure 9 The flowchart of communication interaction between the upper and lower computer provided in this application. Detailed Implementation
[0031] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0032] Furthermore, the technical features involved in the various embodiments of this application described below can be combined with each other as long as they do not conflict with each other.
[0033] Definitions: ADC: Analog-to-Digital Converter; MCU: Microprocessor; DAC: Digital-to-Analog Converter; SPI: Serial Peripheral Interface; HART: Open communication protocol for addressable remote sensor high-speed channels.
[0034] The present application will now be described in detail with reference to the accompanying drawings and embodiments.
[0035] Example 1: Embodiment 1 of this application provides a rail-mounted isolated HART temperature transmitter. The instrument is designed in an "ADC+MCU+DAC" mode. The measured target temperature is converted into a small electrical signal by a thermocouple or RTD sensor. After being amplified by the ADC chip, it is converted into a digital signal that is linearly related to the input electrical signal and communicates with the MCU via SPI. The MCU uses a calibration table to convert the temperature value for data processing. Then, the DAC chip linearly converts the processed temperature value into the corresponding (4~20) mA current output. At the same time, the instrument supports the HART protocol and can complete the configuration of configuration parameters.
[0036] For details, please refer to Figure 1As shown, this rail-mounted isolated HART temperature transmitter includes external inputs / outputs and internal module connections and functions. The external inputs / outputs include an input on the left and an output on the right. The left input connects to a thermocouple / resistance temperature sensor, receiving millivolt (thermocouple) or resistance (resistance) signals corresponding to the temperature. The right output connects to an external loop (such as an industrial control system) via LOOP+ / LOOP-, outputting a 4~20mA standard current signal and simultaneously carrying HART communication signals. The internal module connections and functions include a signal acquisition link and a signal output and communication link. The signal acquisition link includes a signal pre-processing circuit, an ADC, and an MCU. The signal pre-processing circuit receives the raw signal from the sensor, filters and conditions the signal (e.g., amplifies weak signals) to prepare for subsequent conversion. The ADC receives the pre-processed analog signal, converts it to a digital signal, and uses DC-DC power isolation to achieve power supply isolation and prevent interference conduction. The MCU receives the ADC's digital signal via isolated SPI, handling signal analysis, temperature calculation (combined with the sensor calibration table), parameter storage, and logic control. It also communicates with the HART module via a serial port and interacts with the DAC via SPI. The signal output and communication link includes a DAC, a HART modem circuit, and a power protection circuit. The DAC receives digital instructions from the MCU, converts them into a 4~20mA analog current signal, outputs it to the external loop, and simultaneously provides "Power 1" power to the MCU, HART module, etc. Its Cin pin is directly connected to the signal output terminal of the HART modem circuit through an nF coupling capacitor, serving as the HART signal output. The FSK signal superposition node enables collinear transmission of digital communication signals and analog current signals. The Cin pin can be connected to an external capacitor to ground to control the output slew rate and prevent current surges from interfering with communication. The HART modulation / demodulation circuit interacts with the MCU via a serial port, modulating the MCU's digital communication signal into a HART protocol FSK signal (1200Hz represents "1", 2200Hz represents "0", peak-to-peak value 1mA), or demodulating an external HART signal and transmitting it to the MCU. The modulated FSK signal is directly coupled to the Cin pin of the DAC via a coupling capacitor, superimposed on a 4~20mA DC current loop, and finally communicates with external devices (such as handheld devices or host computers) through LOOP+ / LOOP-. The power protection circuit connects to LOOP+ / LOOP- to provide overvoltage and overcurrent protection for the loop power supply, while also providing "Power Supply 2" power to the transmitter's internal modules.
[0037] Through the above settings, the entire transmitter achieves anti-interference design through power isolation (DC-DC) and signal isolation (isolated SPI). Furthermore, through direct capacitive coupling of the DAC and HART modem circuits, bidirectional digital communication is achieved without affecting the measurement accuracy of the 4~20mA analog signal. The device integrates the entire workflow from sensor signal processing → analog-to-digital conversion → data calculation → digital-to-analog conversion → loop output + HART communication, ultimately achieving high-precision temperature signal measurement and reliable communication in industrial settings.
[0038] Furthermore, since the split installation method introduces common-mode interference caused by ground potential difference, the instrument needs to have electrical isolation at the sampling input. Therefore, the power supply circuit is divided into two parts: input power supply and other module power supply. The input uses a DC-DC isolated power supply module to draw power from the loop. A 5.1V Zener diode is connected in series in the power supply loop as the input voltage, and the output is 3.3VDC. The other module power supplies mainly include the MCU, DAC, and HART. These circuits do not require isolation and use the same supply voltage, with the DAC chip internally outputting 3.3VDC.
[0039] For details, please refer to Figure 2 As shown, the specific connection relationships and functions of the isolated power supply can be divided into external power supply and input / output, and internal module connection and function. External power supply and input / output includes power input and loop interface; internal module connection and function includes power module and core function module connection. Specifically, the power input draws power from the external loop via LOOP+ / LOOP-, and after being regulated by a 5V Zener diode, it powers the internal modules. The loop interface LOOP+ / LOOP- simultaneously carries a 4~20mA current output and HART communication signal, connecting to the external control system. The power module (DC / DC module power supply + regulator / isolation) includes a DC / DC module power supply and a DAC. The DC / DC module power supply receives the 5V voltage from the loop and outputs 3.3V2 through an LDO (low dropout regulator) to power the ADC. Simultaneously, the power isolation design prevents interference from being conducted to the ADC. The DAC integrates a voltage regulator circuit, outputting 3.3V1 to power the MCU and HART modem circuit, achieving a common power source for multiple modules and simplifying the circuit. The core functional modules include an ADC, MCU, DAC, HART modulation / demodulation circuit, and power protection circuit; the ADC is powered by 3.3V and is responsible for converting the sensor's analog temperature signal into a digital signal (requires a preamplifier circuit). Figure 2(Not shown in the image) is the core component for signal acquisition; the MCU, powered by 3.3V1, is the system control center, bidirectionally connected to the ADC (receives digital signals), DAC (sends digital commands), and HART module (communication interaction) to complete temperature calculation and logic scheduling; the DAC receives digital commands from the MCU, outputs a 4~20mA standard current signal, and simultaneously outputs 3.3V1 to power the MCU and HART module, and is also associated with the DC / DC module power supply and power protection circuit to coordinate power distribution; the HART modulation and demodulation circuit, powered by 3.3V1, interacts with the MCU via a serial port, modulates the digital signal into a HARTFSK signal, and superimposes it onto the current loop output by the DAC to achieve digital communication; the power protection circuit connects to LOOP+ / LOOP- to provide overvoltage and overcurrent protection for the loop power supply, ensuring the safety of internal modules.
[0040] The above setup achieves hierarchical power distribution through "DAC integrated power supply + DC / DC isolated power supply", which simplifies the circuit and suppresses interference through isolation design. At the same time, the MCU serves as the core, connecting the ADC (acquisition), DAC (output), and HART (communication) modules in series to form a closed loop of "acquisition → calculation → output → communication", which is suitable for the reliable operation requirements of industrial sites.
[0041] Furthermore, after the temperature sensor (thermocouple / resistance temperature detector) signal is connected to the instrument, a low-pass filter circuit is first used to filter out external high-frequency interference to ensure stable signal measurement. The analog-to-digital converter chip adopts a high-performance ADC, which is a low-power, low-noise, and highly integrated analog front-end suitable for high-precision measurement applications. It has a built-in low-noise 24-bit Σ-Δ modulator, buffer, reference voltage source, programmable gain amplifier, and on-chip digital filter, mainly used for wide dynamic range, low-frequency signal measurement in applications such as temperature measurement, pressure sensors, and electronic scales. After the sampled data undergoes internal data amplification and analog-to-digital conversion, it communicates with the MCU through an isolated SPI interface. The signal isolation circuit uses a low-power four-channel digital isolator. When refresh is enabled, the static current per channel is 5.6uA; when refresh is disabled, the static current per channel is 0.3uA; and it has strong anti-interference capability, withstands high isolation voltage, and has low pulse distortion.
[0042] For details, please refer to Figure 3As shown, a digital isolator is placed between the ADC and the MCU. The core design utilizes the digital isolator to achieve interference immunity in signal transmission. The ADC is responsible for converting analog signals to digital signals; the ADuM1441 (digital isolator) is a dedicated chip for electrical signal isolation; and the MCU is the core control unit of the system. The four sets of signals between the ADC and the MCU are all transmitted in isolation through the ADuM1441 digital isolator. The specific correspondence is as follows: MCU DIN signal → isolator → ADC DIN_ISO signal; MCU SCLK signal → isolator → ADC SCLK_ISO signal; MCU CS signal → isolator → ADC CS_ISO signal; ADC DOUT_ISO signal → isolator → MCU DOUT signal.
[0043] The above settings achieve signal isolation, communication interaction, low power consumption, and high reliability. Signal isolation: The core function of the ADuM1441 is to block the electrical connection between the ADC and the MCU (avoiding ground interference), while accurately transmitting digital signals, suppressing common-mode interference and electromagnetic interference in industrial environments, and ensuring signal transmission stability. Communication interaction: These four sets of signals are the SPI communication bus between the ADC and the MCU (DIN / DOUT for data transmission / reception, SCLK for clock, and CS for chip select). Isolation retains the SPI communication function while solving the interference conduction problem between different modules. Low power consumption and high reliability: The ADuM1441 is a low-power isolator (quiescent current in the microamp level) that can withstand high isolation voltages, meeting the requirements for long-term stable operation of industrial equipment. This design uses the physical isolation and signal interconnection of the digital isolator to allow the ADC and MCU to complete data communication under interference-resistant conditions, helping to improve the measurement accuracy and stability of the transmitter.
[0044] Furthermore, MCUs such as STM32L476RGT6, GD32F450ZKT6, and CH32V307VCT6 can be selected, offering high reliability and suitability for continuous operation without power interruption. The MCU needs to implement functions such as transmitter measurement type selection, numerical calculation, and external communication. The sampling end ADC converts the analog signal into a digital signal, sends it to the MCU via the SPI communication interface, converts it into a temperature value using a calibration table, and after obtaining the calculated measurement result, the MCU sends the obtained data to the DAC via the SPI communication interface, outputting an industrial standard signal of (4~20) mA. The instrument is an intelligent instrument with HART protocol, communicating with the HART module via a serial interface. Simultaneously, an EEPROM chip is used in the design, communicating with the MCU via an I2C interface, with a storage capacity of 2Kbits, used to store parameters and calibration data. The instrument also includes a configuration port, facilitating the configuration and modification of instrument parameters using a handheld temperature transmitter parameter setting tool.
[0045] For details, please refer to Figure 4 As shown, the basic circuit of the MCU (left side) includes: a reset circuit (RESETB), consisting of DVCC (power supply), a 4.7kΩ resistor, and a 100nF capacitor, which implements the MCU's power-on reset or reset function in case of an abnormality, ensuring system initialization stability; a clock circuit (XTHI / XTHO), which provides a stable operating clock signal to the MCU through an external crystal oscillator circuit composed of a crystal oscillator and capacitors, which is the basis for system timing control; and a debug interface (SWD), including SWCLK (clock), SWDIO (data), and RESETB (reset) pins, which connect to external debugging tools for MCU program burning, debugging, and firmware updates. Regarding the MCU's functional interfaces (right side), the MCU connects to external modules through different interfaces to implement core functions: SPI interfaces (2 groups), connecting to the ADC and DAC, receiving the digital temperature signal converted by the ADC to complete signal acquisition; and sending digital commands to the DAC to control the output of a 4~20mA current signal. UART interfaces (2 sets) connect the HART modulation and demodulation circuit and the user configuration port to realize the transmission and reception of digital communication signals, support the parameter configuration and data interaction of the HART protocol, and provide users with a local parameter configuration channel (such as modifying the sensor division number and range through a handheld device or host computer).
[0046] Through the above settings, the MCU coordinates the entire process of the system, including signal acquisition (ADC), signal output (DAC), communication interaction (HART), and user configuration. At the same time, it ensures its own stable operation with the help of basic circuits and supports development and maintenance with the help of debugging interfaces. It is the "control center" of the entire temperature transmitter.
[0047] Furthermore, the output circuit uses a classic digital-to-analog converter chip. This chip not only outputs 3.3VDC in the power supply circuit but also integrates a 16-bit DAC and current amplifier for digital control of the output loop current (4-20 mA). It can also be used with standard HART® FSK protocol communication circuits without affecting rated performance. The HART FSK signal can be coupled through a capacitor connected to the Cin pin, and Cin can be connected to ground with an external capacitor to achieve output slew rate control.
[0048] Furthermore, the HART module uses a highly integrated chip that integrates all necessary filtering, signal detection, modulation, demodulation, and HART signal waveform shaping functions. Therefore, the chip requires only a few external passive components to meet the functional requirements of the HART physical layer specification. In the design, the HART signal is applied to the ADC_IP pin after being filtered for anti-aliasing by an external filter. An external bandpass filter containing a 200kΩ resistor is used to limit the current to a sufficiently low level to meet intrinsic safety requirements. In this configuration, the input has high transient voltage protection capability, eliminating the need for additional protection circuitry even in demanding industrial environments.
[0049] For details, please refer to Figure 5 As shown, the core of the HART modulation and demodulation circuit is to implement the digital signal modulation (transmission) and demodulation (reception) of the HART protocol. Figure 5 The pins in the middle correspond to connections to external devices, mainly including: power / clock pins such as DVDD (digital power), AVDD (analog power), DVSS / AVSS (ground), XTAL1 / XTAL2 (external crystal oscillator input), etc., providing power and clock for the module; communication control pins such as RTSb / TXD / CD / RXD (connected to the MCU's UART interface), used to receive digital commands from the MCU and send demodulated signals back to the MCU; HART signal pins such as HART_OUT (outputs the modulated FSK signal) and HART_IN (receives the FSK signal from the external loop); and other pins such as REF (reference voltage output), ADC_IP (analog-to-digital converter input), and FILTER_SEL (filter selection). The HART modulation / demodulation circuit internally consists of two links: "transmitting signals" and "receiving signals," coordinated by the control logic. Signal transmission link (modulation) process: The MCU transmits digital instructions to the control logic via TXD → the control logic triggers the modulator to convert the digital signal into a HART protocol FSK signal (1200Hz / 2200Hz) → waveform shaping optimizes signal quality → after processing by a digital-to-analog converter and buffer, it is output from HART_OUT to the external loop (superimposed on a 4~20mA current). Signal reception link (demodulation) process: The FSK signal in the external loop is input from HART_IN → interference is filtered out by a bandpass filter (only the 1200~2200Hz signal is retained) → the analog-to-digital converter converts the analog signal into a digital signal → the digital filter further purifies the signal → the carrier detection and demodulator identifies the digital information corresponding to the FSK signal → the control logic sends the signal back to the MCU via RXD. The HART modulation and demodulation circuit also includes auxiliary module functions, such as: a voltage regulator to provide stable power to the internal circuit; an oscillator to generate a working clock in conjunction with an external crystal oscillator; a reference voltage source to output a precise voltage and ensure the accuracy of analog-to-digital / digital-to-analog conversion; and RESETb to reset the module and ensure initialization stability.
[0050] Based on the above settings, the HART modulation and demodulation circuit is the signal processing center of HART communication. It converts the MCU's digital instructions into HART signals through modulation and converts external HART signals into digital instructions that the MCU can recognize through demodulation, so as to realize bidirectional digital communication between the transmitter and external devices (handheld devices, host computers) and at the same time ensure the signal's anti-interference ability and transmission reliability.
[0051] Example 2: Based on the rail-mounted isolated HART temperature transmitter provided in Embodiment 1, this Embodiment 2 provides a method for operating the rail-mounted isolated HART temperature transmitter.
[0052] refer to Figure 6 As shown, the flowchart of the main program (automatic operation logic for temperature measurement and communication interaction) is mainly divided into two parts: one is signal acquisition and transmission (temperature measurement); the other is the arrival of communication signals from the host computer, triggering interrupts, and identifying and handling communication interrupts (communication interaction). The core is to achieve automated operation of "temperature measurement + communication interaction," and the specific functional logic is as follows.
[0053] I. Startup and Initialization Process (Main Thread on the Left): 1. Main program entry point: The starting point for program startup; 2. System initialization: Complete the initial configuration of hardware (such as ADC, DAC, HART modules) and software parameters (such as sensor calibration table, measurement range) to prepare for subsequent operation; 3. Enable interrupts: Enable system interrupt functions (such as communication interrupts and data acquisition interrupts) to ensure that external commands or scheduled tasks can be responded to in a timely manner; 4. Obtain sensor type: Read pre-stored parameters (such as thermocouple / resistance temperature detector type) to determine the type of signal to be acquired subsequently; 5. Temperature Acquisition Module: Based on the sensor type, it acquires the corresponding analog signal and performs analog-to-digital conversion to obtain digital temperature data; 6. Conversion Output Module: Converts digital temperature data into a 4~20mA standard current signal and outputs it to the external loop; 7. Watchdog module: Monitors the system's operating status. If an abnormality occurs (such as program lag), it triggers a reset to ensure system stability. After execution, it returns to the "Temperature Acquisition Module" to run in a loop, continuously measuring and outputting temperature.
[0054] II. Communication Interaction Flow (Right Branch): During the main loop, if a communication command arrives (such as a configuration instruction sent by a handheld device), the system will interrupt the main flow and execute the communication logic: 1. Receive commands and data: Receive instructions and parameters from external devices via the HART / UART interface; 2. Process the command and data: parse the instruction (such as modifying the sensor type or adjusting the range), and verify the validity of the data; 3. Requirements for executing this command: updating system parameters, reconfiguring hardware modules, etc. 4. Return the data requested by the command and the execution status: send the operation results (such as whether the parameters were modified successfully, the current temperature value) back to the external device; after completion, return to the main loop to continue executing temperature acquisition and output.
[0055] The above process uses continuous temperature measurement as the main line and communication interaction as a branch. The interrupt mechanism enables flexible switching between the main line and the branch, which not only ensures the real-time output of temperature data, but also supports parameter configuration and data reading of external devices, adapting to the needs of automatic monitoring and remote configuration in industrial sites.
[0056] refer to Figure 7 As shown, signal acquisition (temperature measurement) is mainly divided into resistance temperature detector (RTD) signal acquisition and thermocouple signal acquisition (including cold junction and hot junction). Figure 7 The program logic for acquiring temperature signals from two types of sensors, namely resistance temperature detectors (RTD) and thermocouples, is demonstrated. The core of the program is to obtain the temperature value based on the sensor type through A / D conversion, signal analysis, and table lookup calculation. The specific functional logic is divided into two independent processes.
[0057] I. Thermocouple signal acquisition process (left side): For thermocouple sensors (output resistance signal), the process is as follows: 1. Program Entry Point: Enter the dedicated program branch for RTD (Resistor Temperature Detector) data acquisition; 2. Channel Configuration and A / D Conversion Start: Select the corresponding signal channel, configure the analog-to-digital converter (ADC), and start the conversion; 3. Wait for A / D conversion to complete: Determine if the conversion is finished; if not, continue waiting. 4. Record AD conversion code value: After conversion, save the digital code value output by the ADC; 5. Code value to sampling resistance value: Convert the digital code value into the actual resistance value corresponding to the thermal resistor (based on the ADC conversion relationship); 6. Resistance value to temperature value: The resistance value is mapped to the corresponding temperature value by looking up the resistance temperature table using the "binary search method". 7. Assignment and Return: Store the calculated temperature value into a global variable for subsequent output / communication, and then return to the main program.
[0058] II. Thermocouple Signal Acquisition Process (right side): For thermocouple sensors (outputting millivolt voltage signals), the process is as follows: 1. Program entry point: Enter the dedicated program branch for thermocouple data acquisition; 2. Channel Configuration and A / D Conversion Start: Select the corresponding signal channel, configure the ADC, and start the conversion; 3. Wait for A / D conversion to complete: Determine if the conversion is finished; if not, continue waiting. 4. Record AD conversion code value: After conversion, save the digital code value output by the ADC; 5. Code value to millivolt voltage value: Converts digital code values into the actual millivolt voltage values corresponding to the thermocouple (based on the ADC conversion relationship); 6. Cold junction compensation: The millivolt value corresponding to the cold junction temperature is found by binary search (to compensate for the cold junction temperature error of the thermocouple). 7. Total millivolt value to temperature value: The sum of "hot junction millivolt value + cold junction millivolt value" is used to look up the thermocouple calibration table using a binary search method to obtain the final temperature value; 8. Assignment and Return: Store the calculated temperature value into a global variable for subsequent output / communication, and then return to the main program.
[0059] Both processes mentioned above revolve around "A / D conversion + calibration table lookup," but the difference lies in the conversion process: RTDs directly convert resistance to temperature using a resistance-to-temperature meter, while thermocouples require an additional cold junction compensation step (to address errors caused by temperature variations at the thermocouple's cold junction). Ultimately, both processes store the temperature value in a global variable, achieving a universal acquisition logic for both types of sensors.
[0060] refer to Figure 8 As shown, the core of the current output program logic is to convert the calculated temperature value into an industrial standard 4~20mA current signal. The process includes: 1. Start: Enters the current output program's entry point; 2. Calculate the output current value based on the correspondence between temperature and output current: According to the preset "temperature-current mapping rule" (e.g., the temperature range corresponds to the range of 4~20mA), convert the previously collected temperature value into the corresponding target current value (e.g., a certain temperature corresponds to 12mA). 3. Current value to code value: Convert the target current value into a digital code value that can be recognized by the DAC (digital-to-analog converter) (adapting to the DAC's resolution, such as 16-bit code). 4. Start D / A Conversion: Send a code value to the DAC to trigger the digital-to-analog conversion operation, converting the digital signal into an analog current signal; 5. Determine if D / A conversion is complete: Determine if the conversion is complete. If not complete (N), continue waiting; if complete (Y), proceed to the next step. 6. Return: The current output process ends, and the program returns to the main program to continue subsequent operations.
[0061] The core function of the above process is to realize the conversion of "temperature data → standard current signal", and finally output a 4~20mA industrial signal through DAC for external control system to collect, thus realizing the closed loop of "measurement-output" of temperature transmitter.
[0062] refer to Figure 9 The communication software between the MCU and the host computer mainly consists of serial port receive / transmit interrupt subroutines. Each serial port interrupt corresponds to the reception or transmission of one byte. In this communication process, the host computer typically sends a command frame first. After the intelligent transmitter module receives the command frame via the serial port interrupt, the CPU performs the corresponding data processing. Then, the CPU triggers a transmit interrupt, places the content of the response frame to be sent into the transmit buffer, and sends back the response frame, thus completing one command exchange. The communication interaction process between the host and host computers includes: 1. Start: Enter the communication program entry point; 2. Initialize the low-power serial port: Configure serial port parameters (such as baud rate and data bits) to prepare for communication in low-power mode; 3. Generate data command to read transmitter data: Generate a command frame for "read transmitter data" (containing command code, address, and other information); 4. Send data command to read the transmitter: Send the instruction frame to an external device (such as a handheld device or host computer) via serial port. 5. Determine if the CPU has finished receiving data: Wait for the response data from the external device. If it is not finished (N), continue waiting; if it is finished (Y), proceed to the next step. 6. Perform verification and correctness judgment: Verify whether the received data is correct (ensure that the data is not erroneous). If there is an error (N), return to the "Send data command to read transmitter" step and resend; if correct (Y), proceed to the data processing stage. 7. Data Processing: Parse the received valid data (such as configuration commands and parameter requests); 8. CPU Initialize Port Interrupts: Enable serial port interrupts to prepare for sending response data; 9. Prepare the response frame for the input buffer: Generate a response data frame (such as the current temperature value or parameter configuration result) and store it in the transmission buffer; 10. Determine if the CPU has completed sending data: Send the response frame via the serial port. If not completed (N), continue waiting; if completed (Y), proceed to the next step. 11. Perform verification and correctness judgment: Verify whether the sent data is correct. If it is incorrect (N), return to the "CPU initialization port interrupt enable" step and retransmit; if it is correct (Y), end the process. 12. End: The communication interaction process is complete, and the program returns to the main program.
[0063] The above process is a two-way communication closed loop of "sending read command → receiving response → processing data → returning response". It ensures data reliability through checksum verification and adapts the low-power serial port + interrupt to meet the communication efficiency and power consumption requirements of industrial equipment, so as to realize stable data interaction between the transmitter and external devices.
[0064] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A field isolating HART temperature transmitter of the guideway type, characterized in that, It includes a signal pre-processing circuit, an analog-to-digital converter, a microprocessor, a digital-to-analog converter, a HART modem circuit, and a power protection circuit; the power protection circuit is located between the digital-to-analog converter and the external loop, and provides isolated power to the analog-to-digital converter through DC-DC power isolation, and directly powers the digital-to-analog converter, the microprocessor, and the HART modem circuit. The signal pre-processing circuit is used to receive the raw signal input from the sensor and perform pre-processing. The analog-to-digital converter is used to receive the pre-processed analog signal and convert it into a digital signal. The microprocessor receives the digital signal from the analog-to-digital converter through isolated SPI and performs temperature calculation. The microprocessor also communicates with the HART modem circuit through a serial port and interacts with the digital-to-analog converter through SPI. The digital-to-analog converter is used to receive digital instructions from the microprocessor, convert them into analog current signals, and output them to the external loop. The HART modulation and demodulation circuit is used to modulate the digital communication signal of the microprocessor into an FSK signal of the HART protocol or demodulate an external HART signal and transmit it to the microprocessor, and couple the modulated FSK signal to the digital-to-analog converter.
2. The rail-mounted isolated HART temperature transmitter of claim 1, wherein, The power protection circuit is connected to the DC / DC module power supply and the digital-to-analog converter respectively, and the DC / DC module power supply is connected to the analog-to-digital converter. The power protection circuit draws power from the external loop via LOOP+ / LOOP-. One path of power is regulated by a Zener diode to supply power to the DC / DC module, which in turn supplies power to the analog-to-digital converter. The other path of power supplies power to the digital-to-analog converter, which in turn supplies power to the microprocessor and HART modem circuit.
3. The rail-mounted isolated HART temperature transmitter of claim 1, wherein, A digital isolator is provided between the analog-to-digital converter and the microprocessor.
4. The rail-mounted isolated HART temperature transmitter of claim 1, wherein, The microprocessor is equipped with a reset circuit, a clock circuit, and a debugging interface. The microprocessor is connected to an analog-to-digital converter and a digital-to-analog converter through two sets of SPI interfaces, and to a HART modem circuit and a user configuration port through two sets of UART interfaces.
5. The rail-mounted isolated HART temperature transmitter according to claim 1, characterized in that, The HART modulation and demodulation circuit includes a signal transmission link and a signal reception link; The signal transmission link includes a TXD pin, control logic, modulator, waveform shaping, digital-to-analog converter, buffer, and HART_OUT pin. The microprocessor transmits digital instructions to the control logic through the TXD pin. The control logic triggers the modulator to convert the digital signal into an FSK signal of the HART protocol. Then, the signal quality is optimized through waveform shaping. After being processed by the digital-to-analog converter and the buffer in sequence, the signal is output from the HART_OUT pin to the external loop. The signal receiving link includes a HART_IN pin, a bandpass filter, an analog-to-digital converter, a digital filter, a carrier detection demodulator, control logic, and an RXD pin. The FSK signal from the external loop is input from the HART_IN pin. After interference is filtered out by the bandpass filter, the analog signal is converted into a digital signal by the analog-to-digital converter. The digital filter further purifies the signal. Then, the carrier detection demodulator identifies the digital information corresponding to the FSK signal, and the control logic sends the signal back to the microprocessor through the RXD pin.
6. The rail-mounted isolated HART temperature transmitter of claim 5, wherein, The HART modulation and demodulation circuit also includes a voltage regulator, an oscillator, and a reference voltage source. The voltage regulator is used to provide a stable power supply for the internal circuit; the oscillator is used to generate a working clock in conjunction with an external crystal oscillator; and the reference voltage source is used to output a precise voltage to ensure the accuracy of analog-to-digital / digital-to-analog conversion.
7. A method for operating a rail-mounted isolated HART temperature transmitter, applied to the rail-mounted isolated HART temperature transmitter as described in any one of claims 1-6, characterized in that, The automated operation logic includes temperature measurement and communication interaction, among which: The automated operation logic for temperature measurement includes: system initialization, completing the initial configuration of hardware and software parameters; enabling system interrupt function; obtaining sensor type; performing temperature acquisition; performing conversion output; executing the watchdog module; after execution, returning to the temperature acquisition step to run in a loop, continuously performing temperature measurement and output. The automated operation logic of the communication interaction includes: during the main loop operation, if a communication command arrives, the system will interrupt the main process and execute the communication logic in sequence: receive the command and data; process the command and data; execute the requirements of the command; and return the data required by the command and the execution status.
8. The operating method of the rail-mounted isolated HART temperature transmitter according to claim 7, characterized in that, Temperature measurement includes the acquisition process of resistance temperature detector (RTD) signals and the acquisition process of thermocouple signals; The RTD signal acquisition process includes: entering the dedicated program branch for RTD acquisition; selecting the corresponding signal channel, configuring the analog-to-digital converter and starting the conversion; determining whether the conversion is complete, and waiting continuously if not; after the conversion is complete, saving the digital code value output by the analog-to-digital converter; converting the digital code value into the actual resistance value corresponding to the RTD; querying the RTD calibration table using a binary search method to map the resistance value to the corresponding temperature value; storing the calculated temperature value into a global variable for subsequent output or communication, and then returning to the main program. The thermocouple signal acquisition process includes: entering the dedicated program branch for thermocouple acquisition; selecting the corresponding signal channel, configuring the analog-to-digital converter and starting the conversion; determining whether the conversion is complete, and continuing to wait if not; after the conversion is complete, saving the digital code value output by the analog-to-digital converter; converting the digital code value into the actual millivolt voltage value corresponding to the thermocouple; querying the millivolt value corresponding to the cold junction temperature using a binary search method; querying the thermocouple calibration table using a binary search method to obtain the final temperature value by summing the hot junction millivolt value and the cold junction millivolt value; storing the calculated temperature value into a global variable for subsequent output or communication use, and then returning to the main program.
9. The operating method of the rail-mounted isolated HART temperature transmitter according to claim 7, characterized in that, The current output program logic includes: start; calculate the output current value based on the correspondence between temperature and output current; convert the current value into a code value; start the D / A conversion; determine whether the D / A conversion is complete, and if not, continue to wait; if complete, return to the main program to continue subsequent operations.
10. The operating method of the rail-mounted isolated HART temperature transmitter according to claim 7, characterized in that, The communication interaction process between the upper and lower computers includes: Start; Initialize the low-power serial port; Generate the data command to read the transmitter; Send the data command to read the transmitter; Determine if the CPU has completed receiving data, and if not, continue waiting; If completed, perform data verification to determine if it is correct, and if incorrect, return to the step of sending the data command to read the transmitter; If correct, perform data processing; Initialize the CPU port and enable interrupts; Prepare the acknowledgment frame and place it in the input buffer; Determine if the CPU has completed sending data, and if not, continue waiting; If completed, perform data verification to determine if it is correct, and if incorrect, return to the step of initializing the CPU port and enabling interrupts; If correct, end the process.
