Accuracy in Every Degree: Improving the Internal Temperature Sensor in the AVR® EA Family of Microcontrollers
This post reviews the internal temperature sensor module on the AVR® EA family and how to recalibrate the module for more accurate temperature readings in your applications.

In the AVR® EA family of microcontrollers, the internal temperature sensing module serves as a valuable asset for developers seeking optimal performance and reliability in their embedded systems. One compelling reason to leverage this feature lies in its capability to enable precise thermal management within the system. As these microcontrollers are often employed in diverse applications where environmental conditions may vary, monitoring internal temperature becomes instrumental in preventing overheating and potential damage to the internal circuitry of the microcontroller. Additionally, the internal temperature sensing module empowers users to implement adaptive strategies, dynamically adjusting the microcontroller's parameters based on temperature fluctuations. This not only contributes to energy efficiency but also ensures consistent operation across a spectrum of ambient conditions. The internal temperature sensing module on AVR EA microcontrollers thus emerges as a strategic tool for enhancing system robustness and responsiveness in the face of challenging and dynamic operating environments.
During production, the internal temperature sensor is calibrated at two temperatures: room temperature (~20°C–22°C) and 125°C. The measurements are taken during wafer production, and the temperatures are not expected to be uniform across the wafer. After this, the die is bonded and packaged, which is expected to make factory calibration less accurate. Since there is no measurement taken at cold temperatures, it is expected that the temperature measurements for cold temperatures will deviate more from the actual temperature in that region. To compensate for this, it is possible to do additional calibration of the temperature sensor to get better readings.
The internal temperature sensor module is not directly accessible via an I/O pin; only the Analog-to-Digital Converter (ADC) peripheral can access it. The internal temperature sensor outputs a voltage signal that is internally routed to the ADC module where it is then converted to a digital number. The internal temperature sensor is directly proportional to temperature, meaning it has an increasing output voltage with increasing temperature. The output voltage is linear across the temperature range and an approximation of the output voltage is presented below:
Equation 1: VTSENSE = MV × TSENSE + VOFFSET Where: VTSENSE = Output voltage from the temperature sensor |
![]() Figure 1: ADC Result versus Temperature |
An AVR64EA48 microcontroller was tested in a climate chamber to verify the accuracy of the internal temperature sensor. The temperature range was -40°C to +125°C in steps of 5°C, and each temperature step was held for five minutes to allow the device to adjust to the new temperature. The temperature measurements are plotted below, showing the difference between the actual temperature (the climate chamber was used as reference) and the measured temperature using the AVR64EA48 device:
![]() Figure 2: Internal temperature sensor offset versus known temperature in climate chamber |
For most operating temperatures, -30°C and 100°C, and with this specific microcontroller that was tested, defining a temperature offset of one degree Celsius would provide extremely accurate temperature measurements of the ambient environment from the internal temperature sensor. Because each microcontroller may require a different offset value for the temperature sensor module, this code example explains how to calibrate the internal temperature sensor in your production environment to potentially eliminate an external temperature sensor, like a thermistor, from your system to reduce PCB space and BOM cost. In conclusion, the AVR EA family of microcontrollers offers a robust solution for monitoring device and system health through accurate thermal measurements.
View the code example on GitHub.