Method for carrying out digital communication on two-wire system 4-20mA current loop
By superimposing digital modulation power supply voltage and control current variation on a two-wire 4-20mA current loop, combined with a microcontroller and digital-to-analog converter, low-cost digital communication function is realized, solving the problems of high cost and limited speed in traditional digital communication technology, while maintaining analog signal compatibility.
Patent Information
- Application Number
- CN202510822221.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-11-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technologies make it difficult to implement digital communication functions at low cost on a two-wire 4-20mA current loop, and are incompatible with traditional analog signal transmission, resulting in increased hardware complexity and cost, and limited communication speed.
By superimposing a digitally modulated power supply voltage on the transmitter side and recovering the signal by voltage division on the sensor side, the current change is controlled in the current loop to transmit digital signals. Combined with a microcontroller and a digital-to-analog converter, automatic switching between digital and analog signals is achieved.
It enables the near-zero-cost addition of digital communication functionality to traditional industrial sensors, significantly improving communication speed while retaining analog signal compatibility, making it suitable for remote configuration and calibration.
Smart Images

Figure CN120915330A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of digital communication technology, in particular to a method for digital communication on a two-wire 4-20mA current loop. BACKGROUND
[0002] The two-wire 4-20mA current loop technology is widely used in industrial field and has long been a standard scheme for sensor analog signal transmission. However, it is difficult for traditional technology to realize digital communication function on the existing current loop at low cost. Although mainstream solutions such as HART protocol support digital communication, they need to integrate a special modem circuit at the sensor end, which significantly increases hardware complexity and cost. At the same time, due to the limitation of its physical layer modulation principle, the communication rate has inherent bottlenecks and cannot meet the demand of high-speed data interaction. In addition, most digital communication solutions need to occupy an independent channel or modify the original line, which cannot be compatible with traditional 4-20mA analog signal transmission, resulting in high cost of upgrading and maintaining field devices. Therefore, there is an urgent need for a technical solution that can directly reuse the existing two-wire current loop, add digital communication function at almost zero cost, and not destroy the compatibility of the original analog signal. SUMMARY
[0003] The main purpose of the present application is to provide a method for digital communication on a two-wire 4-20mA current loop, which can effectively solve the problems mentioned in the background art.
[0004] To achieve the above purpose, the technical solution adopted by the present application is as follows: A method for digital communication on a two-wire 4-20mA current loop, comprising the following steps: S1, downlink digital signal transmission step: ①At the transmitter side, convert and superimpose the first digital communication signal RX from the host computer, 0~3.3V level, onto the power supply voltage supplied to the sensor, to form a power supply voltage signal with digital modulation characteristics, ranging from 10~24V; ②At the sensor side, receive the power supply voltage signal with digital modulation characteristics and process it by voltage division to restore the second digital communication signal RX with 0~3.3V level, which is input to the microcontroller of the sensor; S2, uplink digital signal transmission step: ①At the sensor side, when the microcontroller needs to send the third digital communication signal TX with 0~3.3V level: Control its digital-to-analog converter DAC to output a fixed voltage of 0V; Output the third digital communication signal TX to a modulation resistor R4; ② Through the 4-20mA current loop controller, according to the voltage signal on the modulation resistor R4, the loop current is controlled to generate a current variation of 0~9mA corresponding to the third digital communication signal TX; ③ On the transmitter side, the variation of the loop current is detected and converted back to the fourth digital communication signal TX of 0~3.3V level, which is transmitted to the host computer.
[0005] Preferably, the method further comprises an analog signal transmission mode step: ① On the sensor side, when the microcontroller needs to output an analog current signal on the 4-20mA current loop: the pin for outputting the third digital communication signal TX is set to a high resistance state; the digital-to-analog converter DAC is controlled to output an analog voltage corresponding to the required analog signal; ② Through the 4-20mA current loop controller, according to the analog voltage output by the DAC, the loop current is controlled to output a standard 4~20mA analog current signal; ③ On the transmitter side, the standard 4~20mA analog current signal is obtained by measuring the voltage on the sampling resistor.
[0006] Preferably, S1 is specifically: the RX signal 0~3.3V is amplified and boosted to the range of 10~24V by the amplifier U3 on the transmitter side, and is transmitted as the power voltage of the sensor; the received 10~24V power voltage is divided by the voltage dividing resistor R1, R2 network on the sensor side, and is restored to the RX signal of 0~3.3V for the microcontroller to receive.
[0007] Preferably, the detection of the current variation in S2 is specifically: the variation of the loop current is converted into a voltage signal by the sampling resistor Ri on the transmitter side, and then the voltage signal is converted into the TX signal of 0~3.3V level by the comparator U4.
[0008] Preferably, the superimposed current variation of 0~9mA in S2 is obtained by setting the resistance value of the modulation resistor R4, so that the TX signal of 0~3.3V output by the microcontroller can be linearly mapped to the current variation of 0~9mA.
[0009] Compared with the prior art, the present application has the following beneficial effects: The application is characterized in that the downlink digital signal is transmitted by using the power supply voltage fluctuation of the two-wire 4-20mA current loop, the uplink digital signal is transmitted by modulating the current change amount of the loop, and the digital communication and analog signal transmission are automatically switched in dual mode based on the pin state of the microcontroller and the output of the digital-to-analog converter. The digital communication function is added to the traditional industrial sensor at very low cost, the transmission rate is significantly improved, and the original analog signal compatibility is retained, which is suitable for remote configuration, calibration and maintenance scenarios. BRIEF DESCRIPTION OF DRAWINGS
[0010] Figure 1 The communication circuit schematic diagram of the application is shown. DETAILED DESCRIPTION
[0011] In order to make the technical means, creative features, purposes and effects of the application easy to understand, the application will be further described below in combination with specific embodiments.
[0012] As shown in the communication circuit schematic, the following detailed embodiment is described. Figure 1
[0013] 1. System hardware composition (1) Transmitter side circuit Amplifier U3: A high-voltage output operational amplifier (such as LM7321) is used, the positive input end is connected to the digital communication signal output end (RX, 0~3.3V level) of the host computer, the inverting input end is connected to the same phase amplifier, and the output end is directly connected to the positive line (V+) of the two-wire current loop. The RX signal is linearly amplified to the range of 10~24V as the sensor power voltage superimposed with digital modulation.
[0014] Principle explanation: when the host computer sends high level "1" (3.3V), U3 outputs 24V; when it sends low level "0" (0V), U3 outputs 10V. The voltage fluctuation range is compatible with the conventional power supply requirements of industrial sensors.
[0015] Sampling resistor Ri: The resistance value is 51Ω (accuracy 0.1%), which is connected in series between the negative line (V-) of the current loop and the system ground. Its function is to convert the current change amount of the loop into a voltage signal (51mV voltage is generated per 1mA current).
[0016] Comparator U4: A rail-to-rail operational amplifier (such as MCP6001) is selected, the same phase input end is connected to the high potential end of the sampling resistor Ri, the inverting input end is connected to the 0.241V reference voltage, and the output end is connected to the digital signal input end (TX) of the host computer. The current signal is restored to 0~3.3V digital level.
[0017] Example: When the loop current > 4.73 mA (Ri voltage > 0.241 V), U4 outputs 3.3 V (logic "1"); when the current < 4.73 mA (Ri voltage < 0.241 V), output 0 V (logic "0").
[0018] (2) Sensor-side circuit Voltage division resistors R1, R2: R1 = 6.65 kΩ, R2 = 61.9 kΩ (voltage division ratio 1:10.3), connected in series between the current loop positive line (V+) and the sensor system ground (GND). The voltage division node is output to the RX pin of the microcontroller U1, dividing the 10~24V power supply voltage into a 0~3.3V digital signal.
[0019] Calculation verification: When V+ is 24V, the voltage division value = 24V x 6.65k / (61.9k+6.65k) ≈ 2.33V; when V+ is 10V, the voltage division value ≈ 0.97V, both within the recognizable range of the MCU.
[0020] Microcontroller U1: Select an MCU with a built-in 12-bit DAC (such as STM32G071), with its RX pin directly connected to the R1 / R2 voltage division node to receive the downstream signal; the TX pin is connected to the modulation resistor R4 to send the upstream signal.
[0021] 4-20mA current loop controller U2: Use XTR116 chip, its current control terminal (IIN) is connected to the DAC output pin of U1 through a resistor R3 (15kΩ), and at the same time, it is connected to the TX pin of U1 through a modulation resistor R4.
[0022] Modulation resistor R4: Resistance 37.4kΩ (precision 1%), as the key element for current modulation of upstream digital signals.
[0023] 2. Dual-mode collaborative control process (1) Digital communication mode Downstream transmission (host computer → sensor): The host computer sends a binary sequence "1010" → U3 converts the 0~3.3V signal to a 10~24V square wave → transmitted through the current loop V+ line → R1 / R2 voltage division to 0~3.3V square wave → RX pin of U1 receives and decodes.
[0024] Signal fidelity design: U1's RX pin has a built-in Schmitt trigger, recognizing 0.97V as "0" and 2.33V as "1", effectively resisting noise interference.
[0025] Upstream transmission (sensor → host computer): U1 set DAC output 0V → TX pin output "1101" sequence (0~3.3V) → R4 convert voltage signal to current (0~9mA) → transmitter Ri sample voltage (0~0.46V) → U4 compare and restore to 0~3.3V digital signal.
[0026] (2) Analog signal transmission mode Switching operation: U1 set TX pin to high impedance (disconnect digital signal path) DAC output target analog voltage (example: need to output 16mA, V_DAC=16mA / 100x15kΩ=2.4V) U2 accurately output 16mA according to V_DAC control loop current Transmitter processing: Measure the voltage across Ri = 16mA x 51Ω = 0.765V → converted to digital quantity by ADC for the host computer to read.
[0027] 3. Mode switching timing example plaintext Time axis | 0-10ms | 10-20ms | 20-30ms Mode | Digital uplink | Analog output | Digital downlink U1_TX pin | Output TX signal | High impedance | No operation U1_DAC | 0V | 2.4V | Maintain previous state Loop current | 0mA→9mA jump | Stable 16mA | Fluctuate with downlink voltage Application scenario: complete analog signal acquisition within 20ms → switch to digital mode to receive calibration instructions → switch back to analog output after calibration data.
[0028] 4. Verification Cost control: only three resistors (R1 / R2 / R4) are added to the sensor side (total cost <0.3 yuan), eliminating the need for a dedicated modulation chip required by HART protocol (cost >20 yuan).
[0029] Speed advantage: measured error rate <10 at 38400bps communication rate -6 (HART limit is 1200bps).
[0030] Compatibility guarantee: Downlink signal voltage fluctuation (10~24V) is within the standard power supply range of industrial sensors; Uplink current (<=9mA) is compatible with traditional transmitter range.
[0031] The embodiment realizes the core target of "nearly zero cost adding digital communication" by three-level technical means of signal conversion design (voltage division / current modulation), dual-mode switching logic (TX pin state + DAC cooperation) and safety boundary control, while retaining complete analog signal transmission capability.
[0032] The above shows and describes the basic principles and main features of the present application and the advantages of the present application. Those skilled in the art should understand that the present application is not limited to the above embodiments, and the above embodiments and descriptions in the specification are only to illustrate the principles of the present application. Without departing from the spirit and scope of the present application, various changes and improvements can be made to the present application, and these changes and improvements all fall within the scope of the claimed present application. The scope of protection of the present application is defined by the appended claims and their equivalents.
Claims
1. A method for digital communication over a two-wire 4-20 mA current loop, characterized by: The method comprises the following steps: S1, downlink digital signal transmission step: ①At the transmitter side, convert and superimpose the first digital communication signal RX from the host computer, 0~3.3V level, onto the power supply voltage supplied to the sensor, to form a power supply voltage signal with digital modulation characteristics, ranging from 10~24V; ②At the sensor side, receive the power supply voltage signal with digital modulation characteristics and perform voltage division processing to restore it to a second digital communication signal RX at 0~3.3V level, which is input to the microcontroller of the sensor; S2, uplink digital signal transmission step: ①At the sensor side, when the microcontroller needs to send a third digital communication signal TX at 0~3.3V level: Control its digital-to-analog converter DAC to output a fixed voltage of 0V; Output the third digital communication signal TX to a modulation resistor R4; ②Through a 4-20mA current loop controller, control the loop current to generate a current variation of 0~9mA corresponding to the third digital communication signal TX according to the voltage signal on the modulation resistor R4; ③At the transmitter side, detect the variation of the loop current and convert it back to a fourth digital communication signal TX at 0~3.3V level, which is transmitted to the host computer.
2. The method of claim 1, wherein the method is characterized by: The method further comprises an analog signal transmission mode step: ①At the sensor side, when the microcontroller needs to output an analog current signal on the 4-20mA current loop: Set the pin used to output the third digital communication signal TX to a high-impedance state; Control its digital-to-analog converter DAC to output an analog voltage corresponding to the required analog signal; ②Through a 4-20mA current loop controller, control the loop current to output a standard 4~20mA analog current signal according to the analog voltage output by the DAC; ③At the transmitter side, obtain the standard 4~20mA analog current signal by measuring the voltage on the sampling resistor.
3. The method of claim 1, wherein the method further comprises: In S1, the RX signal 0~3.3V is amplified and boosted to the range of 10~24V by the amplifier U3 on the transmitter side, serving as the power supply voltage for the sensor; the received 10~24V power supply voltage is divided by the voltage dividing resistor R1, R2 network on the sensor side to restore it to a RX signal at 0~3.3V for the microcontroller to receive.
4. The method of claim 1, wherein the method is characterized by: In S2, the detection of the current variation is as follows: the variation of the loop current is converted into a voltage signal by the sampling resistor Ri on the transmitter side, and then the voltage signal is converted into a TX signal at 0~3.3V level by the comparator U4.
5. The method of claim 1, wherein: the two-wire 4-20 mA current loop is a two-wire 4-20 mA current loop for a process control loop. The current variation of 0~9mA generated in S2 is achieved by setting the resistance value of the modulation resistor R4, so that the TX signal of 0~3.3V output by the microcontroller can be linearly mapped to a current variation of 0~9mA.