Temperature Indicator

Temperature Indicator

Some PIC® Microcontroller Unit (MCU) Devices are equipped with a temperature circuit designed to measure the operating temperature of the silicon die. The circuit’s range of operating temperature falls between of -40°C and +85°C. The output of the circuitry is a voltage that is proportional to the device temperature and is connected internally to the device's Analog to Digital Converter (ADC). A channel is reserved for the temperature circuit output. Depending on the application, the Analog-to-Digital Converter result can be either compared directly against specific trip points, or used to determine the actual temperature by calculation, a look-up table or a combination of both.

The Temperature Indicator circuit may be used as a temperature threshold detector or a more accurate temperature indicator, depending on the level of calibration performed. A single temperature or one-point calibration allows the circuit to indicate a temperature around that calibration temperature. A dual temperature or two-point calibration allows the circuit to sense the entire range of temperature more accurately. The figure below shows a simplified block diagram of the temperature circuit.


The temperature can be calculated per the equation below. The output of the ADC is converted to a temperature based on the operating voltage (Vdd) and the mode selected.


Reference for the above equation:
mode (High Mode) = 4
mode (Low Mode) = 2
where n is the resolution of the ADC; 8 or 10 bits.

ADC Result

The ADC reading of the Temperature is acquired by setting the ADC channel to the Temperature Indicator. The Analog to Digital Result Registers (ADRESH and ADRESL) will contain the result of the temperature conversion. For more detail on the ADC peripheral operation refer to the article on the Analog to Digital Converter (ADC).

A sample output is shown in the chart below with the ADC result plotted against the Temperature.



Temperature Indicator Circuit Operation

The Temperature Indicator circuit, inside many PIC® Microcontroller Unit (MCU) Devices, outputs a proportional voltage relative to the silicon temperature. The proportional voltage output is achieved by measuring the forward voltage drop across multiple silicon junctions inside the device. A voltage across two (low range) or four (high range) silicon junctions can be selected.

The temperature sense circuit is integrated with the Fixed Voltage Reference (FVR) module. The circuit is enabled by setting the Temperature Sensor Enable bit (TSEN) of the Fixed Voltage Reference Control (FVRCON) register. When disabled, the circuit draws no current.


The ideal voltage of a single junction temperature can be calculated per the equation below.

\begin{equation} Vt = 0.659 – (Temperature Degrees C + 40) * (0.00132) \end{equation}

The equations below describe the output characteristics of the temperature indicator where Vt is the voltage across a single silicon junction.

High Range:

\begin{equation} Vtemp = VDD - 4Vt \end{equation}

Low Range:

\begin{equation} Vtemp = VDD - 2Vt \end{equation}

The high range, selected by setting the TSRNG bit of the FVRCON register, provides a wider output voltage. This provides more resolution over the temperature range, but may be less consistent from part to part. This range requires a higher bias voltage to operate and thus a higher VDD is needed.

The low range is selected by clearing the TSRNG bit of the FVRCON register. The low range generates a lower voltage drop and thus a lower bias voltage is needed to operate the circuit. The low range is provided for low voltage operation.

Minimum Operating VDD vs. Minimum Sensing Temperature

When the temperature circuit is operated in low range, the device may be operated at any operating voltage that is within specifications. When the temperature circuit is operated in high range, the device operating voltage, VDD, must be high enough to ensure that the temperature circuit is correctly biased.

The table below shows the recommended minimum VDD vs. Range setting for a PIC16F1825 device. The device data sheet should be reference for the exact range.


The final temperature value is presented as an ADC value per the equation below.

\begin{equation} ADCResult = (Vtemp/VDD) * (2^n-1) \end{equation}

where n is the resolution of the ADC; 8 or 10 bits.

Temperature Indicator Calibration

The temperature indicator output is based on the ideal junction temperature formula below. However, the results can vary slightly from device to device. This is due to the device’s transistor voltage threshold, Vt , which will vary within production allowances. The temperature indicator doesn't have a built in calibration mechanism so external testing may be required if the tolerances are outside the specific applications needs. Typically the temperature indicator works best for single trip points or over-temp applications. For more accurate temperature measurements an external temperature sensor such as the MCP9700 or MCP9800 can deliver the accuracy over a larger range of temperatures.

The ideal voltage of a single junction temperature can be calculated per the equation below.

\begin{equation} Vt = 0.659 – (Temperature Degrees C + 40) * (0.00132) \end{equation}

Some applications can take calibration data during the manufacturing process. For those cases, the temperature indicator can be measured and a calibration value can be calculated and stored in EEPROM or Flash Memory to offset the results of the ideal temperature ADC result equation. This may require single point or dual point calibration where multiple devices are measured. For example, a sample of 12 devices could offer a range of temperature measurements similar to the chart below.




\begin{equation} ADCResult = ((mode*Vt)/VDD) * (2^n-1) \end{equation}

mode (High Mode) = 4
mode (Low Mode) = 2
where n is the resolution of the ADC; 8 or 10 bits.


Single point calibration is done by measuring the device reaction at a single fixed temperature. This can offer an offset value to give a more accurate measurement for a trip point. But variation from device to device may affect any measurement accuracy at higher or lower temperature points around the test point. Therefore, single point calibration is recommended when the temperature indicator is used for a threshold or trip point based on the temperature of the device. Single point calibration can be expressed per the equation below.

\begin{equation} ADC Result calibrated = ADC result – calibration value \end{equation}

With a sample PIC16F1937 device under the following conditions:
• Powered at 5V
• High-range 4Vt operation
• 25°C forced temperature

The measured Analog-to-Digital conversion gives a result of 561 decimal.

Typical Analog-to-Digital conversion result at 25°C is calculated as 554 decimal using equation (2) above.
For single-point calibration, the difference between the conversion result and the ideal A/D conversion result value is the calibration value.

\begin{equation} Calibration Value = ideal – measured \end{equation}
\begin{equation} 554 - 561 = 7 \end{equation}

Consequently, for this device the calibration value would be 7. This value can be stored in nonvolatile program or data EEPROM memory within the device for use when taking temperature measurements.


Calibration is performed at two temperatures from which we can determine calibrated temperature. As a result, this method is more accurate across a larger range of temperatures, but requires two distinctively different temperature calibration measurement points. Those calibration points can be used to develop the parameters of the equation below.

\begin{equation} ADC Result calibrated = A + (B * ADC Result) \end{equation}
\begin{equation} A = (Ideal @ T1 – Ideal @ T2)/(Actual @ T1 – Actual @ T2) \end{equation}
\begin{equation} B = Actual @ T1 - (A * Ideal @ T1) \end{equation}

T1 calibration temperature 1
T2 calibration temperature 2

Calibration Application Note

Note AN1333:
Refer to ""Use and Calibration of the Internal Temperature Indicator” (DS01333) for more details regarding the calibration process.

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.