Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use Adafruit GPIO Expander Bonnet: Examples, Pinouts, and Specs

Image of Adafruit GPIO Expander BonnetDesign with Adafruit GPIO Expander Bonnet in Cirkit Designer

Introduction

The Adafruit GPIO Expander Bonnet is a versatile and powerful add-on board designed for the Raspberry Pi. This board utilizes the MCP23017 I2C GPIO expander IC to provide an additional 16 GPIO pins, effectively expanding the capabilities of the Raspberry Pi for projects that require more inputs and outputs. It is particularly useful for interfacing with sensors, LEDs, motors, and other electronic components in complex projects.

Explore Projects Built with Adafruit GPIO Expander Bonnet

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 Raspberry Pi 4B-Based Multi-Sensor Interface Hub with GPS and GSM: A project utilizing Adafruit GPIO Expander Bonnet 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.

Open Project in Cirkit Designer
Image of ESP32-Based I2C Communication Hub with Multiplexer and Expander: A project utilizing Adafruit GPIO Expander Bonnet 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.

Open Project in Cirkit Designer
Image of Raspberry Pi 3B-Based Multi-Sensor Monitoring System with I2C Communication and Servo Control: A project utilizing Adafruit GPIO Expander Bonnet in a practical application
Raspberry Pi 3B-Based Multi-Sensor Monitoring System with I2C Communication and Servo Control

This circuit features a Raspberry Pi 3B as the central controller, interfaced with multiple HC-SR04 ultrasonic sensors, servomotors, IR sensors, a TTL Serial JPEG Camera, an I2C LCD display, a SIM800L GSM module, and an IO expander. The Raspberry Pi manages sensor inputs, drives servomotors, communicates with the camera and GSM module via serial connections, and displays information on the LCD. The IO expander is used to extend the number of GPIOs available on the Raspberry Pi, allowing for control and data acquisition from the ultrasonic sensors and potentially other peripherals.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Number Description Notes
1-16 GPIO (0-15) Bidirectional I/O pins
A0 Address Select Pin 0 Used for I2C address selection
A1 Address Select Pin 1 Used for I2C address selection
A2 Address Select Pin 2 Used for I2C address selection
VDD Power Supply Connect to 3.3V
VSS Ground Connect to GND
SCL I2C Clock Connect to SCL on Raspberry Pi
SDA I2C Data Connect to SDA on Raspberry Pi
RESET Reset Pin Active-low; typically left open

Usage Instructions

How to Use the Component in a Circuit

  1. Mounting: Attach the Adafruit GPIO Expander Bonnet directly onto the GPIO header of the Raspberry Pi.
  2. Power Connection: Ensure that the VDD pin of the MCP23017 is connected to the 3.3V supply from the Raspberry Pi, and the VSS pin is connected to ground.
  3. I2C Connection: Connect the SCL and SDA pins of the MCP23017 to the corresponding SCL and SDA pins on the Raspberry Pi.
  4. Address Selection: Set the A0, A1, and A2 pins to the desired logic levels to configure the I2C address if multiple devices are on the same I2C bus.
  5. Software Configuration: Enable I2C on the Raspberry Pi and install necessary libraries to communicate with the MCP23017.

Important Considerations and Best Practices

Troubleshooting and FAQs

Common Issues Users Might Face

Solutions and Tips for Troubleshooting

FAQs

Q: Can I stack multiple GPIO Expander Bonnets on a Raspberry Pi? A: Yes, you can stack multiple bonnets by configuring each MCP23017 with a unique I2C address using the A0, A1, and A2 pins.

Q: How do I control the GPIO pins on the Expander Bonnet? A: You can control the GPIO pins by using I2C commands from the Raspberry Pi to interact with the MCP23017 chip. Libraries such as Adafruit_GPIO can simplify this process.

Q: Is the GPIO Expander Bonnet compatible with all models of Raspberry Pi? A: The bonnet is compatible with any Raspberry Pi model that has a 40-pin GPIO header and supports I2C communication.

Q: What is the maximum voltage and current that can be applied to the GPIO pins? A: The maximum voltage is 3.3V, and the maximum current per pin is 25 mA, with a total chip current of 150 mA.

For further assistance, visit the Adafruit support forums or the Raspberry Pi community forums.


Please note that this documentation is a general guide and may not cover all aspects of the Adafruit GPIO Expander Bonnet. Always refer to the official Adafruit documentation and resources for the most accurate and detailed information.