Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use Adafruit MCP9808: Examples, Pinouts, and Specs

Image of Adafruit MCP9808
Cirkit Designer LogoDesign with Adafruit MCP9808 in Cirkit Designer

Introduction

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.

Explore Projects Built with Adafruit MCP9808

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-Based I2C Communication Hub with Multiplexer and Expander
Image of Lights: A project utilizing Adafruit MCP9808 in a practical application
This circuit features an Olimex ESP32-EVB microcontroller unit (MCU) for processing and connectivity, interfaced with an MCP23017 I/O expander and an Adafruit TCA9548A I2C multiplexer to expand the number of I/O lines and allow multiple I2C devices to communicate with the MCU over the same bus. Pull-up resistors are connected to the I2C lines for proper bus operation, and both the MCP23017 and TCA9548A have their reset lines pulled high, likely for normal operation without external reset control.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Smart Light with Proximity Sensor and OLED Display using Adafruit QT Py RP2040
Image of lab: A project utilizing Adafruit MCP9808 in a practical application
This circuit is a portable, battery-powered system featuring an Adafruit QT Py RP2040 microcontroller that interfaces with an OLED display, a proximity sensor, an accelerometer, and an RGB LED strip. The system is powered by a lithium-ion battery with a step-up boost converter to provide 5V for the LED strip, and it includes a toggle switch for power control. The microcontroller communicates with the sensors and display via I2C.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Smart Sensor Hub with Adafruit QT Py RP2040
Image of wearable final: A project utilizing Adafruit MCP9808 in a practical application
This circuit features an Adafruit QT Py RP2040 microcontroller interfaced with an APDS9960 proximity sensor, an MPU6050 accelerometer and gyroscope, and an OLED display via I2C communication. It also includes a buzzer controlled by the microcontroller and is powered by a 3.7V LiPo battery with a toggle switch for power control.
Cirkit Designer LogoOpen Project in Cirkit Designer
Raspberry Pi 4B-Based Multi-Sensor Interface Hub with GPS and GSM
Image of Rocket: A project utilizing Adafruit MCP9808 in a practical application
This circuit features a Raspberry Pi 4B interfaced with an IMX296 color global shutter camera, a Neo 6M GPS module, an Adafruit BMP388 barometric pressure sensor, an MPU-6050 accelerometer/gyroscope, and a Sim800l GSM module for cellular connectivity. Power management is handled by an MT3608 boost converter, which steps up the voltage from a Lipo battery, with a resettable fuse PTC and a 1N4007 diode for protection. The Adafruit Perma-Proto HAT is used for organizing connections and interfacing the sensors and modules with the Raspberry Pi via I2C and GPIO pins.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Adafruit MCP9808

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Lights: A project utilizing Adafruit MCP9808 in a practical application
ESP32-Based I2C Communication Hub with Multiplexer and Expander
This circuit features an Olimex ESP32-EVB microcontroller unit (MCU) for processing and connectivity, interfaced with an MCP23017 I/O expander and an Adafruit TCA9548A I2C multiplexer to expand the number of I/O lines and allow multiple I2C devices to communicate with the MCU over the same bus. Pull-up resistors are connected to the I2C lines for proper bus operation, and both the MCP23017 and TCA9548A have their reset lines pulled high, likely for normal operation without external reset control.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of lab: A project utilizing Adafruit MCP9808 in a practical application
Battery-Powered Smart Light with Proximity Sensor and OLED Display using Adafruit QT Py RP2040
This circuit is a portable, battery-powered system featuring an Adafruit QT Py RP2040 microcontroller that interfaces with an OLED display, a proximity sensor, an accelerometer, and an RGB LED strip. The system is powered by a lithium-ion battery with a step-up boost converter to provide 5V for the LED strip, and it includes a toggle switch for power control. The microcontroller communicates with the sensors and display via I2C.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of wearable final: A project utilizing Adafruit MCP9808 in a practical application
Battery-Powered Smart Sensor Hub with Adafruit QT Py RP2040
This circuit features an Adafruit QT Py RP2040 microcontroller interfaced with an APDS9960 proximity sensor, an MPU6050 accelerometer and gyroscope, and an OLED display via I2C communication. It also includes a buzzer controlled by the microcontroller and is powered by a 3.7V LiPo battery with a toggle switch for power control.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Rocket: A project utilizing Adafruit MCP9808 in a practical application
Raspberry Pi 4B-Based Multi-Sensor Interface Hub with GPS and GSM
This circuit features a Raspberry Pi 4B interfaced with an IMX296 color global shutter camera, a Neo 6M GPS module, an Adafruit BMP388 barometric pressure sensor, an MPU-6050 accelerometer/gyroscope, and a Sim800l GSM module for cellular connectivity. Power management is handled by an MT3608 boost converter, which steps up the voltage from a Lipo battery, with a resettable fuse PTC and a 1N4007 diode for protection. The Adafruit Perma-Proto HAT is used for organizing connections and interfacing the sensors and modules with the Raspberry Pi via I2C and GPIO pins.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Environmental monitoring systems
  • Industrial temperature control
  • HVAC systems
  • Data logging and weather stations
  • IoT devices and smart home applications

Technical Specifications

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

Pin Configuration

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

Usage Instructions

Connecting the MCP9808 to a Microcontroller

  1. Power the Sensor: Connect the VIN pin to a 3.3V or 5V power source and the GND pin to ground.
  2. I2C Communication: Connect the SCL pin to the I2C clock line and the SDA pin to the I2C data line of your microcontroller.
  3. Optional Alert Pin: If using the alert function, connect the ALERT pin to a GPIO pin on your microcontroller.

Example Circuit

Below is an example of how to connect the MCP9808 to an Arduino UNO:

  • VIN → 5V
  • GND → GND
  • SCL → A5 (Arduino I2C clock line)
  • SDA → A4 (Arduino I2C data line)
  • ALERT → Optional (connect to a digital pin if needed)

Arduino Code Example

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
}

Important Considerations

  • Pull-Up Resistors: Ensure that the I2C lines (SCL and SDA) have pull-up resistors (typically 4.7kΩ). Many breakout boards, including the Adafruit MCP9808, include these resistors by default.
  • I2C Address: The default I2C address is 0x18, but it can be changed by configuring the address pins (A0, A1, A2) on the breakout board.
  • Power Supply: Ensure the power supply voltage matches the sensor's operating range (2.7V to 5.5V).

Troubleshooting and FAQs

Common Issues

  1. Sensor Not Detected

    • Cause: Incorrect wiring or I2C address mismatch.
    • Solution: Double-check the wiring and ensure the I2C address in the code matches the sensor's configuration.
  2. Inaccurate Temperature Readings

    • Cause: External heat sources or poor ventilation around the sensor.
    • Solution: Place the sensor in an environment with stable airflow and away from heat sources.
  3. Alert Pin Not Functioning

    • Cause: Alert thresholds not configured correctly.
    • Solution: Use the setAlertTemp() function in the Adafruit MCP9808 library to configure the alert thresholds.

FAQs

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.