12-bit 4-20mA loop-powered thermocouple measurement system using Cortex-M3

Publisher:平静宁静Latest update time:2014-10-23 Source: elecfansKeywords:ADI Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  Circuit Function and Advantages

  This circuit uses the ADuCM360 precision analog microcontroller in an accurate thermocouple temperature monitoring application and controls the 4 mA to 20 mA output current accordingly. The ADuCM360 integrates dual 24-bit sigma-delta analog-to-digital converters (ADCs), dual programmable current sources, 12-bit digital-to-analog converters (DACs), 1.2 V internal reference, and an ARM Cortex-M3 core, 126 KB flash, 8 KB SRAM, and various digital peripherals such as UART, timers, SPI, and I2C interfaces.

  In this circuit, the ADuCM360 is connected to a T-type thermocouple and a 100 Ω platinum resistance temperature detector (RTD). The RTD is used for cold junction compensation. The low power Cortex-M3 core converts the ADC reading to the actual temperature value. The supported T-type temperature range is −200°C to +350°C, and the output current range corresponding to this temperature range is 4 mA to 20 mA.

  This circuit provides a complete solution for thermocouple measurements, requires minimal external components, and can be loop powered for loop voltages up to 28 V.

  Figure 1. ADuCM360 with Thermocouple Interface as Temperature Monitor Controller (Simplified Schematic; All Connections Not Shown)

  Figure 1. ADuCM360 with Thermocouple Interface as Temperature Monitor Controller (Simplified Schematic; All Connections Not Shown)
12-bit 4-20mA loop-powered thermocouple measurement system using Cortex-M3

  Circuit Description

  The following features of the ADuCM360 are used in this application:

  The 12-bit DAC output with its flexible on-chip output buffer is used to control an external NPN transistor, BC548. By controlling the VBE voltage of this transistor, the current through the 47Ω load resistor can be set to the desired value.

  The DAC is 12-bit monotonic, but its output accuracy is typically around 3 LSB. In addition, the bipolar transistors introduce linearity errors. To improve the accuracy of the DAC output and eliminate offset and gain endpoint errors, ADC0 measures the feedback voltage, which reflects the voltage across the load resistor (RLOAD). Based on this ADC0 reading, the DAC output is corrected by the source code. This provides ±0.5°C accuracy for the 4 mA to 20 mA output.

  The 24-bit Σ-Δ ADC has an internal PGA and is set in software to a gain of 32 for both the thermocouple and RTD. ADC1 switches continuously between sampling the thermocouple and RTD voltages.

  The programmable excitation current source drives a controlled current through the RTD. The dual current source can be configured in steps from 0 μA to 2 mA. This example uses the 200 μA setting to minimize errors due to RTD self-heating.

  The ADC in the ADuCM360 has a built-in 1.2 V reference. The internal reference is highly accurate and is suitable for measuring thermocouple voltages.

  External reference for the ADC in the ADuCM360. When measuring the RTD resistance, we use a ratiometric setup with an external reference resistor (RREF) connected across the external VREF+ and VREF− pins. Since the reference in this circuit is high impedance, it is necessary to enable the on-chip reference input buffer. The on-chip reference buffer means that no external buffer is required to minimize the effects of input leakage.

  Bias Voltage Generator (VBIAS). The VBIAS function is used to set the thermocouple common-mode voltage to AVDD/2 (900 mV). Again, this eliminates the need for external resistors to set the thermocouple common-mode voltage.

  ARM Cortex-M3 core. The powerful 32-bit ARM core integrates 126 KB flash and 8 KBSRAM memory to run user code, configure and control the ADC, and use the ADC to convert thermocouple and RTD inputs to final temperature values. It can also use closed-loop feedback control from the AIN9 voltage level and continuously monitor the DAC output. For additional debugging purposes, it can also control the communication on the UART/USB interface.

  The UART is used as a communication interface with a PC host. This is used to program the on-chip flash memory. It also serves as a debug port for calibrating the DAC and ADC.

  Two external switches are used to force the device into flash boot mode. By holding SD low while toggling the RESET button, the ADuCM360 will enter boot mode instead of normal user mode. In boot mode, the internal flash can be reprogrammed through the UART interface.

  The J1 connector is an 8-pin dual in-line connector that interfaces with the USB-SWD/UART board included with the CN0300 support hardware. This application board can be programmed and debugged with the J-Link-Lite board. See Figure 3.

  The signals generated by thermocouples and RTDs are very small, so a programmable gain amplifier (PGA) is needed to amplify these signals.

  The thermocouple used in this application is type T (copper-constantan), which has a temperature range of −200°C to +350°C and a sensitivity of approximately 40ΩV/°C, which means that the ADC can cover the entire temperature range of the thermocouple in bipolar mode with a PGA gain setting of 32.

  The RTD is used for cold junction compensation. The RTD used in this circuit is a 100Ω platinum RTD, model Enercorp PCS 1.1503.1. It is available in a 0805 surface mount package and has a temperature change rate of 0.385Ω/°C.

  Note that the reference resistor, RREF, must be a precision 5.6 kΩ (±0.1%) resistor.

  This circuit must be constructed on a multilayer printed circuit board (PCB) with a large area ground plane. Proper layout, grounding, and decoupling techniques must be used to achieve optimal performance (refer to Tutorial MT-031, Grounding Data Converters and Solving the Mystery of AGND and DGND, Tutorial MT-101, Decoupling Techniques, and the ADuCM360TCZ evaluation board layout). [page]

  The PCB used to evaluate this circuit is shown in Figure 2.

  Figure 2. EVAL-CN0300-EB1Z board used in this circuit.

  Figure 2. EVAL-CN0300-EB1Z board used in this circuit.

  Figure 3. EVAL-CN0300-EB1Z board connected to USB-SWD/UART board and SEGGER J-Link-Lite board.

  Figure 3. EVAL-CN0300-EB1Z board connected to USB-SWD/UART board and SEGGER J-Link-Lite board.

  Figure 3 shows the USB-SWD/UART board. This board acts as an interface board to the USB port of a PC. This USB port can be used to program the device via a UART-based downloader. It can also be used to connect to a COM port (virtual serial port) on the PC. This is required to run the calibration routine.

  The J-Link-Lite plugs into the 20-pin connector of the USB-SWD/UART board. The J-Link-Lite provides code debugging and programming support. It connects to the PC via another USB connector.

  Code Description

  The source code used to test this circuit can be downloaded from the ADuCM360 product page (zip file). The source code uses the function libraries provided with the example code. Figure 4 shows a list of the source files used in the project when viewed using the Keil μVision4 tool.

  Figure 4. Source file viewed in Vision4

  Figure 4. Source file viewed in Vision4

  Calibration section of the code

  The compiler #define values ​​(calibrateADC1 and calibrateDAC) can be adjusted to enable or disable the calibration routines for the ADC and DAC.

  To calibrate the ADC or DAC, the interface board (USB-SWD/UART) must be connected to J1 and a USB port on the PC. A COM port viewer such as HyperTerminal can be used to view the calibration menu and step through the calibration procedure.

  When calibrating the ADC, the source code prompts the user to connect zero-scale and full-scale voltages to AIN2 and AIN3. Note that AIN2 is the positive input. Once the calibration routine is complete, the new calibration values ​​for the ADC1INTGN and ADC1OF registers are stored in the internal flash memory.

  When calibrating the DAC, the VLOOP+ output should be connected through an accurate current meter. The first part of the DAC calibration procedure calibrates the DAC to set the 4 mA output, and the second part calibrates the DAC to set the 20 mA output. The DAC code used to set the 4 mA and 20 mA outputs is stored in flash memory. The voltage measured at AIN9 for the final 4 mA and 20 mA settings is also recorded and stored in flash memory. Since the voltage at AIN9 is linearly related to the current flowing through RLOOP, these values ​​are used to calculate the adjustment factors for the DAC. This closed-loop scheme means that all linearity errors in the DAC and transistor-based circuits can be eliminated by fine-tuning using the on-chip 24-bit sigma-delta ADC.

  The UART is configured with a baud rate of 9600, 8 data bits, no polarity, and no flow control. If this circuit is directly connected to a PC, a communication port viewing program such as "HyperTerminal" can be used to view the results sent by the program to the UART, as shown in Figure 5.

  To enter the characters required by the calibration procedure, type the desired characters into the viewing terminal and the ADuCM360 UART port will receive the characters.

  Figure 5. HyperTerminal output when calibrating the DAC.

  Figure 5. HyperTerminal output when calibrating the DAC.

  The temperature measurement portion of the code

  To obtain a temperature reading, the temperature of the thermocouple and the RTD are measured. The RTD temperature is converted to its equivalent thermocouple voltage using a lookup table (for Type T thermocouples, see ITS-90 from ISE, Inc.). The two voltages are added together to give the absolute value of the thermocouple voltage. [page]

  First, the voltage between the two wires of the thermocouple is measured (V1). The RTD voltage is measured and converted to temperature using a lookup table, which is then converted to its equivalent thermocouple voltage (V2). V1 and V2 are then added together to give the overall thermocouple voltage, which is then converted to the final temperature measurement.

  For thermocouples, a fixed number of voltages corresponding to the corresponding temperatures are stored in an array. The temperature values ​​in between are calculated using linear interpolation between adjacent points.

  Figure 6 shows the error obtained when measuring 52 thermocouple voltages over the entire thermocouple operating range using ADC1 on the ADuCM360. The worst-case total error is less than 1°C.

  Figure 6. Error using the piecewise linear approximation method using 52 calibration points measured by the ADuCM360/ADuCM361.

  Figure 6. Error using the piecewise linear approximation method using 52 calibration points measured by the ADuCM360/ADuCM361.

  The RTD temperature is calculated using a lookup table and is applied to the RTD in the same manner as for a thermocouple. Note that the polynomial describing the relationship between RTD temperature and resistance is different than that describing the thermocouple.

  For more detailed information on linearization and achieving the best performance from the RTD, refer to the AN-0970 Application Note, RTD Interfacing and Linearization Using the ADuC706x Microcontrollers.

  Temperature to Current Output Section of Code

  After the final temperature is measured, the DAC output voltage is set to the appropriate value to produce the desired current on RLOOP. The input temperature range should be −200°C to +350°C. The code sets the output current to 4 mA and 20 mA for −200°C and +350°C, respectively. The code implements a closed-loop scheme as shown in Figure 7, where the feedback voltage on AIN9 is measured by ADC0 and this value is then used to compensate the DAC output setting. The FineTuneDAC(void) function performs this correction.

  For best results, the DAC should be calibrated before beginning performance testing of this circuit.

  Figure 7

  Figure 7. Closed-loop controlled 4 mA to 20 mA DAC output.

  For debugging purposes, the following string is sent to the UART during normal operation (see Figure 8).

  Figure 8

  Figure 8. UART strings for debugging

  Common changes

  For a standard UART to RS-232 interface, the FT232R transceiver can be replaced with a device such as the ADM3202, which requires a 3 V supply. For a wider temperature range, a different thermocouple can be used, such as a type J. To minimize cold junction compensation errors, a thermistor can be placed in contact with the actual cold junction instead of on the PCB.

  For cold junction temperature measurement, an external digital temperature sensor can be used to replace the RTD and external reference resistor. For example, the ADT7410 can be connected to the ADuCM360 through the I2C interface.

  For more details on cold junction compensation, refer to Analog Devices’ Sensor Signal Conditioning, Chapter 7, “Temperature Sensors.”

  If isolation is required between the USB connector and this circuit, the ADuM3160/ ADuM4160 isolation device must be added.

Keywords:ADI Reference address:12-bit 4-20mA loop-powered thermocouple measurement system using Cortex-M3

Previous article:Based on ARM core AT75C220/its application in fingerprint recognition system
Next article:STM32 Relearning - SPI in the Eyes of Engineers

Recommended ReadingLatest update time:2024-11-15 16:28

24 GHz Radar System-Level Prototype Explained
24 GHz silicon-based millimeter wave radar technology is enabling a new generation of real-world, contactless smart sensors that are increasingly used in mass-market applications such as automotive, drones, pan-industrial and consumer applications. ADI's new 24 GHz radar products offer outstanding performance and hig
[Automotive Electronics]
24 GHz Radar System-Level Prototype Explained
ARM Cortex-M3 Study Notes (4-6)
I'm studying ARM Cortex-M3 recently, and I found a book called "An Definitive Guide to The ARM Cortex-M3" which is considered a classic. This series of study notes is actually the reading notes I made while studying this book. Mutually exclusive access to memory Cortex-M3 provides three pairs of instructions for mut
[Microcontroller]
How to achieve higher power thermoelectric cooling using Peltier devices
summary This article provides the thermoelectric cooler (TEC) concepts that must be understood before designing higher power TECs, explains the key Peltier characteristics that limit the cooling capabilities of thermoelectric coolers, and shows how to design around these limitations. Some driver exa
[Analog Electronics]
How to achieve higher power thermoelectric cooling using Peltier devices
Where does ADC noise come from?
  Although interleaved ADC has advantages such as excellent speed and bandwidth performance, it still has some problems and shortcomings.   These questions mainly revolve around the source of ADC noise. When evaluating the specific situation of ADC noise, the way the noise enters the ADC is the most valuable referen
[Analog Electronics]
CTSD Precision ADCs—Part 4: Driving ADC Inputs and References with Ease
CTSD Precision ADCs—Part 4: Easily drive ADC inputs and references to simplify signal chain design This article focuses on one of the most important architectural features of the new continuous-time sigma-delta (CTSD) precision ADCs: the ease with which they can drive resistive inputs and references. The key to achi
[Analog Electronics]
CTSD Precision ADCs—Part 4: Driving ADC Inputs and References with Ease
KWIK Circuit FAQ Driver Design Considerations for 15Msps 18-Bit ADC
FAQ: What factors should be considered when designing input drivers for 15Msps 18-bit ADCs Introduction ADC drivers are a key building block in data acquisition signal chain design. ADC drivers are used to perform many critical functions such as input signal amplitude scaling, single-ended to differential convers
[Analog Electronics]
KWIK Circuit FAQ Driver Design Considerations for 15Msps 18-Bit ADC
Stepper Motor Control System Based on Cortex-M3 Processor
The control method of the stepper motor is to convert the electrical pulse signal into angular displacement. When not overloaded, the speed and position of the stepper motor depend on the pulse frequency and the number of pulses respectively. Stepper motors are easy to control and are widely used in many industries, s
[Microcontroller]
Stepper Motor Control System Based on Cortex-M3 Processor
ADI: Towards an Electric Vehicle Future
The automotive supply chain of decades past no longer exists. New automakers, such as those in Silicon Valley and China, are entering the market with entirely new vehicle architectures and business models to meet the changing needs and demographics of our society. Existing OEMs are sharing vehicle platforms, developin
[Automotive Electronics]
ADI: Towards an Electric Vehicle Future
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号