Overview

The MCP9808 is a high-accuracy digital temperature sensor manufactured by Microchip Technology. Operating across a wide supply range of 2.7V2.7\text{V} to 5.5V5.5\text{V} DC, it converts temperature to a 16-bit digital word over an I2CI^2C bus.

Featuring a typical accuracy of ±0.25C\pm 0.25^\circ\text{C} from 40C-40^\circ\text{C} to +125C+125^\circ\text{C} (±0.5C\pm 0.5^\circ\text{C} guaranteed maximum), the MCP9808 offers four user-selectable measurement resolutions (0.5C,0.25C,0.125C0.5^\circ\text{C}, 0.25^\circ\text{C}, 0.125^\circ\text{C}, and 0.0625C0.0625^\circ\text{C} default). It includes programmable upper, lower, and critical temperature limit registers with an active hardware ALERT output pin.

Quick reference

Operating voltage (VDD)2.7 V to 5.5 V DC (3.3 V or 5.0 V nominal)
InterfaceI2CI^2C / SMBus (up to 400 kHz)
Default I2CI^2C address0x18 (A0, A1, A2 tied to GND)
Configurable addresses8 distinct addresses (0x18 through 0x1F via 3 address pins)
Typical accuracy (40C-40^\circ\text{C} to +125C+125^\circ\text{C})±0.25C\pm 0.25^\circ\text{C} typical / ±0.5C\pm 0.5^\circ\text{C} max
Default resolution16-bit (0.0625C0.0625^\circ\text{C} per LSB / 1/16C1/16^\circ\text{C})
Conversion time250 ms at 0.0625C0.0625^\circ\text{C} resolution / 30 ms at 0.5C0.5^\circ\text{C} resolution
Operating current200 μA200\ \mu\text{A} active / 0.1 μA0.1\ \mu\text{A} shutdown mode

Pinout (8-Pin MSOP Package & Breakout Header)

text
             ┌───┴───┐
          VDD ─┤ 1    8├─ GND
          SCL ─┤ 2    7├─ A0
          SDA ─┤ 3    6├─ A1
        ALERT ─┤ 4    5├─ A2
             └───────┘
PinNameTypeDescription
1VDDPowerSupply power input (+2.7 V to +5.5 V DC)
2SCLDigital InputI2CI^2C Serial Clock
3SDADigital Input / OutputI2CI^2C Serial Data
4ALERTDigital OutputProgrammable temperature alert output pin (Open-drain)
5A2Digital InputI2CI^2C Address Bit 2 (Default GND)
6A1Digital InputI2CI^2C Address Bit 1 (Default GND)
7A0Digital InputI2CI^2C Address Bit 0 (Default GND)
8GNDPowerGround reference (0 V)

Specifications

ParameterSymbolMinTypMaxUnitConditions
Supply VoltageVDDV_{DD}2.73.3 / 5.05.5VDC
Active Supply CurrentIDDI_{DD}200400µAActive sampling state
Shutdown CurrentIsdI_{sd}0.12.0µASoftware shutdown mode
Accuracy (20C+100C-20^\circ\text{C} \dots +100^\circ\text{C})Tacc1T_{acc1}-0.5±0.25\pm 0.25+0.5°CMax error bound
Accuracy (40C+125C-40^\circ\text{C} \dots +125^\circ\text{C})Tacc2T_{acc2}-1.0±0.5\pm 0.5+1.0°CFull operational spectrum
LSB Resolution (Mode=3Mode = 3)Res3Res_30.0625°C16-bit 2's complement

Data Format & Celsius Math

The ambient temperature register (0x05) returns a 16-bit word formatted as follows:

  • Bit 15–13: Flag bits (Sign, T_CRIT, T_UPPER, T_LOWER).
  • Bit 12: Sign bit (0=Positive,1=Negative0 = \text{Positive}, 1 = \text{Negative}).
  • Bits 11–0: 12-bit temperature value in 0.0625C0.0625^\circ\text{C} steps.

Positive Temperature Calculation

Temperature (C)=Raw Register Value & 0x1FFF16.0\text{Temperature } (^\circ\text{C}) = \frac{\text{Raw Register Value } \& \text{ 0x1FFF}}{16.0}

Negative Temperature Calculation (Sign Bit 12 = 1)

Temperature (C)=256.0Raw Register Value & 0x1FFF16.0\text{Temperature } (^\circ\text{C}) = 256.0 - \frac{\text{Raw Register Value } \& \text{ 0x1FFF}}{16.0}

Wiring

MCP9808 PinArduino / MCUESP32Notes
VDD5V / 3.3V3.3VPower rail
GNDGNDGNDSystem ground
SCLA5GPIO 22I2CI^2C Clock
SDAA4GPIO 21I2CI^2C Data

Example (Adafruit_MCP9808 Library)

cpp
#include <Wire.h>
#include "Adafruit_MCP9808.h"

Adafruit_MCP9808 tempsensor = Adafruit_MCP9808();

void setup() {
  Serial.begin(115200);
  while (!Serial) delay(10);

  Serial.println("MCP9808 High-Accuracy Temperature Sensor Test");

  // Default address 0x18
  if (!tempsensor.begin(0x18)) {
    Serial.println("MCP9808 not found! Check I2C wiring.");
    while (1);
  }

  // Set resolution to Mode 3 (0.0625°C resolution, 250ms conversion)
  tempsensor.setResolution(3);
  Serial.println("MCP9808 initialized.");
}

void loop() {
  tempsensor.wake(); // Wake up sensor

  float c = tempsensor.readTempC();
  float f = c * 9.0 / 5.0 + 32.0;

  Serial.print("Temperature: "); Serial.print(c, 4); Serial.print(" °C | ");
  Serial.print(f, 4); Serial.println(" °F");

  tempsensor.shutdown_modes(1); // Sleep to save power
  delay(2000);
}

Common mistakes

  • Leaving A0, A1, A2 floating: On standalone IC breakout boards, address pins A0, A1, A2 must be pulled to GND or VDD. Floating address pins cause I2CI^2C address changes between 0x18 and 0x1F.
  • PCB thermal conduction: Mount the sensor away from warm power supplies to avoid measuring PCB heat instead of ambient air.

Notes

  • MCP9808 vs TMP117 vs DS18B20: MCP9808 provides ±0.25C\pm 0.25^\circ\text{C} accuracy over I2CI^2C; TMP117 provides ±0.1C\pm 0.1^\circ\text{C} medical-grade accuracy; DS18B20 provides ±0.5C\pm 0.5^\circ\text{C} over 1-Wire.

Assets & downloads