

The Adafruit MCP23017 STEMMA QT (Part ID: 5346) is a 16-channel I/O expander designed to provide additional GPIO pins for microcontrollers. It communicates via the I2C protocol, making it an excellent choice for projects requiring multiple input/output pins without consuming additional microcontroller resources. The inclusion of STEMMA QT connectors simplifies integration with other sensors and devices, enabling quick and solder-free prototyping.








The MCP23017 STEMMA QT has the following pin layout:
| Pin Name | Description |
|---|---|
| GPA0-GPA7 | General-purpose I/O pins (Port A). |
| GPB0-GPB7 | General-purpose I/O pins (Port B). |
| Pin Name | Description |
|---|---|
| VIN | Power input (1.8V to 5.5V). |
| GND | Ground. |
| SCL | I2C clock line. |
| SDA | I2C data line. |
| INTA | Interrupt output for Port A. |
| INTB | Interrupt output for Port B. |
| Connector | Description |
|---|---|
| STEMMA QT | Two connectors for chaining I2C devices. |
Below is an example of how to use the MCP23017 with an Arduino UNO to toggle an LED connected to GPA0:
#include <Wire.h>
#include "Adafruit_MCP23X17.h"
// Create an MCP23017 object
Adafruit_MCP23X17 mcp;
void setup() {
Serial.begin(9600);
while (!Serial) {
delay(10); // Wait for Serial Monitor to open
}
// Initialize the MCP23017
if (!mcp.begin_I2C()) {
Serial.println("Failed to initialize MCP23017. Check connections!");
while (1);
}
Serial.println("MCP23017 initialized!");
// Set GPA0 as an output pin
mcp.pinMode(0, OUTPUT);
}
void loop() {
// Toggle the LED on GPA0
mcp.digitalWrite(0, HIGH); // Turn LED on
delay(500); // Wait 500ms
mcp.digitalWrite(0, LOW); // Turn LED off
delay(500); // Wait 500ms
}
MCP23017 Not Detected on I2C Bus:
GPIO Pins Not Responding:
Interrupts Not Triggering:
Multiple MCP23017 Modules Not Working:
Q: Can I use the MCP23017 with 3.3V microcontrollers?
A: Yes, the MCP23017 is compatible with both 3.3V and 5V systems.
Q: How many MCP23017 modules can I connect to a single I2C bus?
A: Up to 8 modules can be connected by configuring unique I2C addresses.
Q: Do I need external pull-up resistors for the GPIO pins?
A: No, the MCP23017 has internal pull-up resistors, but you can enable or disable them as needed.
Q: Can I use the STEMMA QT connectors with other Adafruit devices?
A: Yes, the STEMMA QT connectors are designed for seamless integration with other Adafruit STEMMA QT-compatible devices.