The MCP23017 IO Expansion Board, manufactured by SeenGreat (Part ID: SG IO E017), is a versatile component designed to expand the number of input/output (I/O) pins available for microcontroller projects. Utilizing the MCP23017 chip, this board provides an additional 16 I/O pins via the I2C interface, making it an ideal solution for projects requiring more I/O capabilities than what is available on standard microcontrollers.
Parameter | Value |
---|---|
Operating Voltage | 1.8V to 5.5V |
I/O Pins | 16 |
Communication | I2C (up to 1.7 MHz) |
Current per I/O Pin | 25 mA |
Total Current | 125 mA |
Address Range | 0x20 to 0x27 (configurable) |
Operating Temperature | -40°C to +85°C |
Pin Number | Pin Name | Description |
---|---|---|
1 | GPA0 | General Purpose I/O Pin 0 (Port A) |
2 | GPA1 | General Purpose I/O Pin 1 (Port A) |
3 | GPA2 | General Purpose I/O Pin 2 (Port A) |
4 | GPA3 | General Purpose I/O Pin 3 (Port A) |
5 | GPA4 | General Purpose I/O Pin 4 (Port A) |
6 | GPA5 | General Purpose I/O Pin 5 (Port A) |
7 | GPA6 | General Purpose I/O Pin 6 (Port A) |
8 | GPA7 | General Purpose I/O Pin 7 (Port A) |
9 | GPB0 | General Purpose I/O Pin 0 (Port B) |
10 | GPB1 | General Purpose I/O Pin 1 (Port B) |
11 | GPB2 | General Purpose I/O Pin 2 (Port B) |
12 | GPB3 | General Purpose I/O Pin 3 (Port B) |
13 | GPB4 | General Purpose I/O Pin 4 (Port B) |
14 | GPB5 | General Purpose I/O Pin 5 (Port B) |
15 | GPB6 | General Purpose I/O Pin 6 (Port B) |
16 | GPB7 | General Purpose I/O Pin 7 (Port B) |
17 | VDD | Power Supply (1.8V to 5.5V) |
18 | VSS | Ground |
19 | SCL | I2C Clock Line |
20 | SDA | I2C Data Line |
21 | RESET | Reset (Active Low) |
22 | A0 | I2C Address Bit 0 |
23 | A1 | I2C Address Bit 1 |
24 | A2 | I2C Address Bit 2 |
25 | INTA | Interrupt Output A |
26 | INTB | Interrupt Output B |
#include <Wire.h>
#include "Adafruit_MCP23017.h"
// Create an instance of the MCP23017
Adafruit_MCP23017 mcp;
void setup() {
// Start the I2C communication
Wire.begin();
// Initialize the MCP23017 with the default address (0x20)
mcp.begin();
// Set all pins on Port A as outputs
for (int i = 0; i < 8; i++) {
mcp.pinMode(i, OUTPUT);
}
// Set all pins on Port B as inputs
for (int i = 8; i < 16; i++) {
mcp.pinMode(i, INPUT);
}
}
void loop() {
// Turn on all LEDs connected to Port A
for (int i = 0; i < 8; i++) {
mcp.digitalWrite(i, HIGH);
}
// Read the state of all buttons connected to Port B
for (int i = 8; i < 16; i++) {
int buttonState = mcp.digitalRead(i);
// Do something with buttonState
}
delay(1000); // Wait for 1 second
}
I2C Communication Failure:
Incorrect I/O Pin Behavior:
Address Conflict:
Overcurrent Issues:
By following this documentation, users can effectively integrate the MCP23017 IO Expansion Board into their projects, expanding their microcontroller's I/O capabilities with ease.