The circuit shown in Figure 1 is a complete loop-powered thermocouple temperature measurement system that uses the PWM function of a precision analog microcontroller to control a 4mA to 20mA output current.
This circuit integrates most of the circuit functions on the precision analog microcontroller ADuCM360 , including a dual-channel 24-bit Σ-Δ ADC, an ARM Cortex™-M3 processor core, and a 4-channel controller for controlling loop voltages up to 28 V. The PWM/DAC feature of the mA to 20 mA loop provides a low-cost temperature monitoring solution.
In it, the ADuCM360 is connected to a T-type thermocouple and a 100Ω platinum resistance temperature detector (RTD). RTD is used for cold junction compensation. A low-power Cortex-M3 core converts ADC readings into temperature values. The supported T-type thermocouple temperature range is −200°C to +350°C, and the output current range corresponding to this temperature range is 4mA to 20mA.
This circuit is similar to the circuit described in circuit note CN-0300 , but this circuit has the advantage of driving a 4mA to 20mA loop with higher resolution PWM. PWM based output provides 14-bit resolution. For more information on interfacing temperature sensors to ADCs, as well as linearization techniques for RTD measurements, see Circuit Note CN-0300 and Application Note AN-0970 .
The circuit is powered by the ADP1720 linear regulator , which regulates the loop power supply to 3.3 V, providing power for the ADuCM360 , operational amplifier OP193 , and optional reference voltage source ADR3412 .
temperature monitor
This part of the circuit is similar to the temperature monitor circuit described in CN-0300 , using the following features of the ADuCM360:
communication
The 4 mA to 20 mA loop is controlled by the ADuCM360 on-chip 16-bit PWM (Pulse Width Modulation). The duty cycle of the PWM is software configurable to control the voltage across the 47.5 ΩR LOOP resistor, thereby setting the loop current. Please note that the top of R LOOP is connected to the ground of the ADuCM360. The bottom end of R LOOP is connected to the loop ground. For this reason, the output current of the ADuCM360, ADP1720, ADR3412, and OP193, plus the current set by the filtered PWM output, flows through R LOOP .
The junction voltage of R1 and R2 can be expressed as:
V R12 = (V RLOOP + V REF ) × R2/(R1 + R2) − V RLOOP
After the loop is established:
V IN = V R12
Since R1 = R2:
V IN = (V RLOOP + V REF )/2 − V RLOOP = V REF /2 − V RLOOP /2
V RLOOP = V REF − 2V IN
Full-scale current flows when V IN = 0, where VRLOOP = V REF . Therefore, the full-scale current is V REF R LOOP , or ≈24 mA. When V IN = V REF /2, no current flows.
The OP193 amplifier impedance at V IN is very high and will not load the PWM filtered output. The amplifier output changes only slightly, about 0.7 V.
Performance at the range boundaries (0 mA to 4 mA and 20 mA to 24 mA) is not critical, so op amp performance at the supply rails is not critical.
The absolute values of R1 and R2 are not important. However, the matching of R1 and R2 is important.
ADC1 is used for temperature measurement, so this circuit note applies directly to the ADuCM361 which has only one ADC . The EVAL-CN0319-EB1Z evaluation board includes a voltage measurement option labeled VR12 points using the ADC0 input channel on the ADuCM360. This ADC measurement can be used as feedback to the PWM control software to adjust the 4 mA to 20 mA current setting.
Programming, debugging and testing
Code description
The source code link used to test the circuit is in the CN-0319 Design Support package: http://www.analog.com/CN0319-DesignSupport The source code used to test this circuit can be downloaded from the ADuCM360 and ADuCM361 product pages (zip compressed file ). The source code uses the function library provided with the sample code.
Figure 2 shows the list of source files used in the project when viewed with the KeilμVision4 tool.
temperature monitor
ADC1 is used for temperature measurement on thermocouples and RTDs. The code in this section is copied from circuit note CN-0300. See this circuit note for details.
communication part
The PWM filter output needs to be adjusted to ensure a 4mA output at minimum temperature and a 20mA output at maximum temperature. Provides a calibration routine that can be easily included or removed using the #defineCalibratePWM parameter.
To calibrate the PWM, the interface board (USB-SWD/UART) must be connected to J1 and the USB port on the PC. You can use a COM port viewing program such as "HyperTerminal" to view the calibration menu and perform the calibration procedure step by step.
When calibrating PWM, the VLOOP+ and VLOOP– outputs should be connected to an accurate ammeter. The first part of the PWM calibration procedure adjusts the DAC to set the 20mA output, and the second part adjusts the PWM to set the 20mA output. The PWM code used to set the 4mA and 20mA outputs is stored in flash memory.
The UART is configured for baud rate 19200, 8 data bits, no polarity, and no flow control. If this circuit is directly connected to a PC, you can use a communication port viewing program such as HyperTerminal or CoolTerm to view the results sent by the program to the UART, as shown in Figure 3.
To enter the characters required for the calibration procedure, type the required characters into the viewing terminal and the ADuCM360UART port will receive the characters.
After calibration, the demo code turns off the UART clock, further saving power.
The calibration coefficients are saved in flash memory, so the calibration routine does not have to be run every time the board is powered up unless the VLOOP level changes.
The code flow chart is shown in Figure 4.
Blockdiagram
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet