

The Adafruit MCP23017 I2C GPIO Expander Breakout (Part ID: 5346) is a versatile and easy-to-use module that allows you to expand the number of GPIO pins available to your microcontroller. It provides 16 additional GPIO pins via the I2C interface, making it ideal for projects that require more input/output options than your microcontroller can natively support. Each pin can be configured as an input or output, and the module supports features like internal pull-up resistors and interrupt capabilities.








The following table outlines the key technical details of the Adafruit MCP23017 I2C GPIO Expander Breakout:
| Specification | Details |
|---|---|
| Manufacturer | Adafruit |
| Part ID | 5346 |
| GPIO Pins | 16 (configurable as input or output) |
| Communication Interface | I2C (up to 1.7 MHz) |
| Operating Voltage | 1.8V to 5.5V |
| Maximum Current per Pin | 25 mA |
| Total Maximum Current | 125 mA |
| Internal Pull-Up Resistors | Configurable (100 kΩ typical) |
| Interrupt Pins | 2 (INTA and INTB) |
| Addressing | 7-bit I2C address (configurable via 3 address pins, up to 8 devices on bus) |
| Dimensions | 25.5mm x 18mm x 2mm |
The MCP23017 breakout board has the following pin layout:
| Pin Name | Description |
|---|---|
| VCC | Power supply input (1.8V to 5.5V). |
| GND | Ground connection. |
| SDA | I2C data line. Connect to the SDA pin of your microcontroller. |
| SCL | I2C clock line. Connect to the SCL pin of your microcontroller. |
| A0, A1, A2 | Address pins for configuring the I2C address (connect to GND or VCC). |
| INTA, INTB | Interrupt output pins for Port A and Port B. |
| GPA0-GPA7 | GPIO pins for Port A (can be configured as input or output). |
| GPB0-GPB7 | GPIO pins for Port B (can be configured as input or output). |
| RESET | Active-low reset pin. Pull low to reset the MCP23017. |
VCC pin to your microcontroller's power supply (1.8V to 5.5V) and the GND pin to ground.SDA and SCL pins to the corresponding I2C pins on your microcontroller.A0, A1, and A2 pins to configure the I2C address. Each pin can be tied to GND (0) or VCC (1), allowing up to 8 unique addresses.INTA and/or INTB pins to your microcontroller to handle interrupts from the MCP23017.Below is an example of how to use the MCP23017 with an Arduino UNO to control LEDs and read button inputs.
VCC to the Arduino's 5V pin and GND to GND.SDA to the Arduino's A4 pin and SCL to A5.GPA0 and GPA1 with appropriate resistors.GPB0 with a pull-up resistor.#include <Wire.h>
#include "Adafruit_MCP23017.h"
// Create an MCP23017 object
Adafruit_MCP23017 mcp;
void setup() {
// Initialize I2C communication
mcp.begin(); // Default address is 0x20
// Configure GPA0 and GPA1 as outputs for LEDs
mcp.pinMode(0, OUTPUT); // GPA0
mcp.pinMode(1, OUTPUT); // GPA1
// Configure GPB0 as input for a button
mcp.pinMode(8, INPUT); // GPB0
mcp.pullUp(8, HIGH); // Enable internal pull-up resistor on GPB0
Serial.begin(9600);
}
void loop() {
// Read the button state
bool buttonState = mcp.digitalRead(8); // Read GPB0
if (buttonState == LOW) {
// Button pressed, turn on LED on GPA0
mcp.digitalWrite(0, HIGH);
} else {
// Button not pressed, turn off LED on GPA0
mcp.digitalWrite(0, LOW);
}
// Blink the LED on GPA1
mcp.digitalWrite(1, HIGH);
delay(500);
mcp.digitalWrite(1, LOW);
delay(500);
}
A0, A1, and A2 pins.I2C Communication Failure
A0, A1, and A2 pins.GPIO Pins Not Responding
Interrupts Not Triggering
INTA or INTB pin to a valid interrupt-capable pin on your microcontroller and configure it correctly.Can I use multiple MCP23017 modules on the same I2C bus?
A0, A1, and A2 pins.What is the maximum current I can draw from the GPIO pins?
Can I use the MCP23017 with 3.3V microcontrollers?
Do I need external pull-up resistors for the GPIO pins?