

The Adafruit MCP9808 (Manufacturer Part ID: 5027) is a high-accuracy digital temperature sensor designed for precision temperature monitoring. It communicates via the I2C interface and provides temperature readings with a resolution of 0.0625°C. The sensor also features an adjustable alert function, allowing users to set temperature thresholds for automated monitoring and control.








The following table outlines the key technical details of the Adafruit MCP9808:
| Parameter | Value |
|---|---|
| Supply Voltage (VDD) | 2.7V to 5.5V |
| Temperature Range | -40°C to +125°C |
| Temperature Accuracy | ±0.25°C (typical) |
| Resolution | 0.0625°C |
| Communication Protocol | I2C (up to 400 kHz) |
| Current Consumption | 200 µA (typical) |
| Alert Function | Programmable temperature alert |
The Adafruit MCP9808 breakout board has the following pin layout:
| Pin Name | Description |
|---|---|
| VIN | Power supply input (2.7V to 5.5V) |
| GND | Ground |
| SCL | I2C clock line (connect to microcontroller SCL) |
| SDA | I2C data line (connect to microcontroller SDA) |
| ALERT | Optional alert output for temperature threshold |
VIN pin to a 3.3V or 5V power source and the GND pin to ground.SCL pin to the I2C clock line and the SDA pin to the I2C data line of your microcontroller.ALERT pin to a GPIO pin on your microcontroller.Below is an example of how to connect the MCP9808 to an Arduino UNO:
VIN → 5VGND → GNDSCL → A5 (Arduino I2C clock line)SDA → A4 (Arduino I2C data line)ALERT → Optional (connect to a digital pin if needed)The following Arduino sketch demonstrates how to read temperature data from the MCP9808:
#include <Wire.h>
#include "Adafruit_MCP9808.h"
// Create an MCP9808 object
Adafruit_MCP9808 tempsensor = Adafruit_MCP9808();
void setup() {
Serial.begin(9600);
Serial.println("MCP9808 Temperature Sensor Test");
// Initialize the sensor
if (!tempsensor.begin(0x18)) { // Default I2C address is 0x18
Serial.println("Couldn't find MCP9808! Check wiring.");
while (1);
}
// Set resolution to 0.0625°C (highest resolution)
tempsensor.setResolution(3);
}
void loop() {
// Read temperature in Celsius
float tempC = tempsensor.readTempC();
// Print temperature to the Serial Monitor
Serial.print("Temperature: ");
Serial.print(tempC);
Serial.println(" °C");
delay(1000); // Wait 1 second before the next reading
}
0x18, but it can be changed by configuring the address pins (A0, A1, A2) on the breakout board.Sensor Not Detected
Inaccurate Temperature Readings
Alert Pin Not Functioning
setAlertTemp() function in the Adafruit MCP9808 library to configure the alert thresholds.Q: Can the MCP9808 operate at 3.3V?
A: Yes, the MCP9808 operates within a voltage range of 2.7V to 5.5V, making it compatible with both 3.3V and 5V systems.
Q: How do I change the I2C address?
A: The I2C address can be changed by connecting the A0, A1, and A2 pins on the breakout board to VIN or GND. Refer to the Adafruit MCP9808 datasheet for the address configuration table.
Q: What is the maximum I2C clock speed supported?
A: The MCP9808 supports I2C clock speeds up to 400 kHz.
Q: Can I use the MCP9808 for outdoor applications?
A: While the MCP9808 is accurate, it is not weatherproof. For outdoor use, ensure the sensor is housed in a protective enclosure.