Adafruit's GPIO Expander Bonnet adds 16 digital I/O pins to a Raspberry Pi using the MCP23017 chip over I2C.
The Adafruit GPIO Expander Bonnet is a small board that plugs onto a Raspberry Pi and adds 16 more digital input/output pins, giving you 16 extra pins for LEDs, sensors, buttons and other devices. The MCP23017 chip converts Python commands into pin instructions, and the board connects to the Pi through the SDA/SCL I2C pins.
The guide covers the pinouts, the MCP23017 chip, the GPIO expansion headers, the STEMMA QT connector, the address select jumpers and the interrupt pins, plus Python usage with the Adafruit_Blinka library and example code for reading a button and lighting an LED.
| Digital I/O pins | 16 |
|---|---|
| I2C address range | 0x20 to 0x27 |
| Maximum total GPIO with 8 boards | 128 |
| Output current per pin | up to 20mA |
| Total chip current limit | under 125mA |
| Logic levels | 5V default, 3.3V optional |
| Interrupt pins | INTA and INTB |
| Default I2C address | 0x20 |
The bonnet adds 16 more digital input/output pins, giving you two 16-pin connectors with a matching ground pin.
Solder closed the address select jumpers to change the address from 0x20 up to 0x27, which allows up to 8 bonnets for 128 total GPIO.
The board defaults to 5V logic. Cut the trace between the top two pads of the 3V/5V jumper and solder the bottom two pads to change it to 3V.
Install the Adafruit_Blinka library, which provides CircuitPython support in Python, then run sudo pip3 install adafruit-circuitpython-mcp230xx.