Introduction

This application note describes how to calibrate and compensate the temperature measurements from the Atmel® ATtiny25/45/85. It can also be used on other AVR® microcontrollers with internal temperature sensors. The temperature measurement is based on an on-chip temperature sensor that is coupled to a single ended ADC channel. The sensor is a diode that produces a temperature dependent voltage. This voltage is measured with the ADC. The voltage has a linear relationship to temperature and the result has approximately a 1 LSB/°C correlation to temperature.

The diode voltage is highly linear, but due to process variations the temperature sensor output voltage varies from one chip to another. Also, the internal voltage reference used as the ADC reference voltage varies with temperature. The typical accuracy of temperature measurements over the full temperature range of the AVR is ±10°C after offset calibration and compensation.

Figure 1. ADC Output Error in ADC Noise Reduction Mode, Two-point Calibrated