How to Use Arduino Internal Temperature Sensor


In this article we learn How to Use Arduino Internal Temperature Sensor, Arduino enthusiasts might be surprised to learn that many Arduino models come equipped with an internal temperature sensor embedded in the processor. This feature is present in ATmega 168A, 168P, 328, and 32P (found in Arduino Uno and Nano), as well as Atmega32U4 (used in Arduino Leonardo). However, it’s worth noting that the ATMega2560, the processor in Arduino Mega, does not include this internal temperature sensor.

The sensor’s accuracy is somewhat limited since it resides within the processor and is influenced by its own heat. The temperature readings can be affected by the processor’s workload and the current flowing through its outputs. With proper calibration, the Arduino’s internal sensor can provide a basic measurement of ambient temperature with an accuracy of around 2ºC. It’s important to allow the processor to cool for at least 10 minutes after powering it off for more reliable results.

Despite its inherent limitations, the internal temperature sensor proves to be intriguing as it enables measurements without the need for external sensors. This feature can be particularly useful for assessing the processor’s status, conducting quick tests on a board, or engaging in temperature measurement projects where low precision and extended intervals between measurements are acceptable.

Hardware Required

Components#Buy From Amazon
Arduino UNO1Buy Link
USB 2.0 cable type A/B1Buy Now
Breadboard1Buy Link

Installing Arduino IDE Software

First, you will require to Download the updated version of Arduino IDE Software and Install it on your PC or laptop. if you Learn How to install the Arduino step-by-step guide click on How to install Arduino


Here are some Steps for How to Use Arduino Internal Temperature Sensor:

  1. Examine the Arduino board’s chip to identify the presence of the internal temperature sensor.
  2. Connect the Arduino to your computer system.
  3. Upload the Arduino code designed for the internal temperature sensor.
  4. Retrieve the temperature reading from the Arduino Serial Monitor.


//For more Projects:
// Internal Temperature Sensor
// Example sketch for ATmega328 types.

void setup()

  Serial.println(F("Internal Temperature Sensor"));

void loop()
  // Show the temperature in degrees Celcius.

double GetTemp(void)
  unsigned int wADC;
  double t;

  // The internal temperature has to be used
  // with the internal reference of 1.1V.
  // Channel 8 can not be selected with
  // the analogRead function yet.

  // Set the internal reference and mux.
  ADMUX = (_BV(REFS1) | _BV(REFS0) | _BV(MUX3));
  ADCSRA |= _BV(ADEN);  // enable the ADC

  delay(20);            // wait for voltages to become stable.

  ADCSRA |= _BV(ADSC);  // Start the ADC

  // Detect end-of-conversion
  while (bit_is_set(ADCSRA,ADSC));

  // Reading register "ADCW" takes care of how to read ADCL and ADCH.
  wADC = ADCW;

  // The offset of 324.31 could be wrong. It is just an indication.
  t = (wADC - 324.31 ) / 1.22;

  // The returned temperature is in degrees Celcius.
  return (t);

Serial Monitor Output


For sensor calibration, perform the following steps:

  1. Take multiple measurements with the sensor.
  2. Allow the sensor to remain off for a duration of 30 minutes.
  3. Compare the obtained measurements with those from a calibrated sensor.
  4. Adjust the values in the expression, specifically 324.31 and 1.22.


  1. Climate Monitoring in DIY Projects: Utilize the Arduino internal temperature sensor for basic climate monitoring in do-it-yourself projects, providing a cost-effective solution for hobbyists.
  2. Energy-Efficient Temperature-Triggered Systems: Employ the internal sensor to create energy-efficient systems that respond to temperature changes, such as activating cooling mechanisms or adjusting device behavior.
  3. Greenhouse Temperature Control: Implement the Arduino’s internal sensor in greenhouse setups for monitoring and regulating temperature conditions, ensuring optimal growth conditions for plants.

Leave a Comment