Overview
The MCP9808 is a high-accuracy digital temperature sensor manufactured by Microchip Technology. Operating across a wide supply range of to DC, it converts temperature to a 16-bit digital word over an bus.
Featuring a typical accuracy of from to ( guaranteed maximum), the MCP9808 offers four user-selectable measurement resolutions (, and 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) |
| Interface | / SMBus (up to 400 kHz) |
| Default address | 0x18 (A0, A1, A2 tied to GND) |
| Configurable addresses | 8 distinct addresses (0x18 through 0x1F via 3 address pins) |
| Typical accuracy ( to ) | typical / max |
| Default resolution | 16-bit ( per LSB / ) |
| Conversion time | 250 ms at resolution / 30 ms at resolution |
| Operating current | active / 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
└───────┘
| Pin | Name | Type | Description |
|---|---|---|---|
| 1 | VDD | Power | Supply power input (+2.7 V to +5.5 V DC) |
| 2 | SCL | Digital Input | Serial Clock |
| 3 | SDA | Digital Input / Output | Serial Data |
| 4 | ALERT | Digital Output | Programmable temperature alert output pin (Open-drain) |
| 5 | A2 | Digital Input | Address Bit 2 (Default GND) |
| 6 | A1 | Digital Input | Address Bit 1 (Default GND) |
| 7 | A0 | Digital Input | Address Bit 0 (Default GND) |
| 8 | GND | Power | Ground reference (0 V) |
Specifications
| Parameter | Symbol | Min | Typ | Max | Unit | Conditions |
|---|---|---|---|---|---|---|
| Supply Voltage | 2.7 | 3.3 / 5.0 | 5.5 | V | DC | |
| Active Supply Current | — | 200 | 400 | µA | Active sampling state | |
| Shutdown Current | — | 0.1 | 2.0 | µA | Software shutdown mode | |
| Accuracy () | -0.5 | +0.5 | °C | Max error bound | ||
| Accuracy () | -1.0 | +1.0 | °C | Full operational spectrum | ||
| LSB Resolution () | — | 0.0625 | — | °C | 16-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 ().
- Bits 11–0: 12-bit temperature value in steps.
Positive Temperature Calculation
Negative Temperature Calculation (Sign Bit 12 = 1)
Wiring
| MCP9808 Pin | → | Arduino / MCU | ESP32 | Notes |
|---|---|---|---|---|
VDD | 5V / 3.3V | 3.3V | Power rail | |
GND | GND | GND | System ground | |
SCL | A5 | GPIO 22 | Clock | |
SDA | A4 | GPIO 21 | 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,A2floating: On standalone IC breakout boards, address pinsA0,A1,A2must be pulled to GND or VDD. Floating address pins cause address changes between0x18and0x1F. - 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 accuracy over ; TMP117 provides medical-grade accuracy; DS18B20 provides over 1-Wire.
Assets & downloads
- datasheetdatasheet
- product-pagereference