Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use MCP23017 IO Expansion Board I2C Interface 16 I/O Pins Expands: Examples, Pinouts, and Specs

Image of MCP23017 IO Expansion Board I2C Interface 16 I/O Pins Expands
Cirkit Designer LogoDesign with MCP23017 IO Expansion Board I2C Interface 16 I/O Pins Expands in Cirkit Designer

Introduction

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.

Explore Projects Built with MCP23017 IO Expansion Board I2C Interface 16 I/O Pins Expands

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
MCP23017-Expanded I/O Interface with ADS1115 ADC and ESP32 Control
Image of door and window sensors: A project utilizing MCP23017 IO Expansion Board I2C Interface 16 I/O Pins Expands in a practical application
This circuit features two MCP23017 I/O expanders interfaced with multiple switches, allowing for the expansion of input capabilities. The MCP23017s are connected via I2C to an Olimex ESP32-EVB microcontroller, which likely manages the input states from the switches. Additionally, an Adafruit ADS1115 16-bit ADC is included, suggesting that some analog inputs are being monitored, with the ADC also interfaced with the ESP32 via I2C.
Cirkit Designer LogoOpen Project in Cirkit Designer
I2C-Controlled Relay Switching with ESP32 and MCP23017 for Home Automation
Image of Vloerverwarming: A project utilizing MCP23017 IO Expansion Board I2C Interface 16 I/O Pins Expands in a practical application
This circuit appears to be a control system utilizing two MCP23017 I/O expanders interfaced with an Olimex ESP32-EVB microcontroller via I2C communication, as indicated by the SDA and SCL connections with pull-up resistors. The MCP23017 expanders control an 8-channel relay module, allowing the microcontroller to switch various loads, potentially for home automation or industrial control. Additionally, there is an Adafruit ADS1115 16-bit ADC for analog signal measurement, and several heating actuators and a thermostat are connected, suggesting temperature control functionality.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO with MCP23017 IO Expansion and TTP233 Touch Sensors Interface
Image of Touch design for any app: A project utilizing MCP23017 IO Expansion Board I2C Interface 16 I/O Pins Expands in a practical application
This circuit utilizes an Arduino UNO microcontroller to interface with two MCP23017 I/O expansion boards via I2C communication, expanding the number of input pins available. Four TTP233 touch sensors are connected to the input pins of the MCP23017 boards. The Arduino monitors the state of these touch sensors and outputs a serial message when a touch event is detected on any sensor.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based I2C Communication Hub with Multiplexer and Expander
Image of Lights: A project utilizing MCP23017 IO Expansion Board I2C Interface 16 I/O Pins Expands in a practical application
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.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with MCP23017 IO Expansion Board I2C Interface 16 I/O Pins Expands

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 door and window sensors: A project utilizing MCP23017 IO Expansion Board I2C Interface 16 I/O Pins Expands in a practical application
MCP23017-Expanded I/O Interface with ADS1115 ADC and ESP32 Control
This circuit features two MCP23017 I/O expanders interfaced with multiple switches, allowing for the expansion of input capabilities. The MCP23017s are connected via I2C to an Olimex ESP32-EVB microcontroller, which likely manages the input states from the switches. Additionally, an Adafruit ADS1115 16-bit ADC is included, suggesting that some analog inputs are being monitored, with the ADC also interfaced with the ESP32 via I2C.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Vloerverwarming: A project utilizing MCP23017 IO Expansion Board I2C Interface 16 I/O Pins Expands in a practical application
I2C-Controlled Relay Switching with ESP32 and MCP23017 for Home Automation
This circuit appears to be a control system utilizing two MCP23017 I/O expanders interfaced with an Olimex ESP32-EVB microcontroller via I2C communication, as indicated by the SDA and SCL connections with pull-up resistors. The MCP23017 expanders control an 8-channel relay module, allowing the microcontroller to switch various loads, potentially for home automation or industrial control. Additionally, there is an Adafruit ADS1115 16-bit ADC for analog signal measurement, and several heating actuators and a thermostat are connected, suggesting temperature control functionality.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Touch design for any app: A project utilizing MCP23017 IO Expansion Board I2C Interface 16 I/O Pins Expands in a practical application
Arduino UNO with MCP23017 IO Expansion and TTP233 Touch Sensors Interface
This circuit utilizes an Arduino UNO microcontroller to interface with two MCP23017 I/O expansion boards via I2C communication, expanding the number of input pins available. Four TTP233 touch sensors are connected to the input pins of the MCP23017 boards. The Arduino monitors the state of these touch sensors and outputs a serial message when a touch event is detected on any sensor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Lights: A project utilizing MCP23017 IO Expansion Board I2C Interface 16 I/O Pins Expands 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.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Home Automation: Control multiple devices such as lights, fans, and sensors.
  • Robotics: Manage multiple sensors, actuators, and motors.
  • Industrial Automation: Interface with various industrial sensors and actuators.
  • Prototyping: Expand I/O capabilities for complex prototypes.
  • Educational Projects: Ideal for learning and experimenting with I2C communication and I/O expansion.

Technical Specifications

Key Technical Details

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 Configuration and Descriptions

MCP23017 Pin Configuration

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

Usage Instructions

How to Use the Component in a Circuit

  1. Power Supply: Connect the VDD pin to a power supply (1.8V to 5.5V) and the VSS pin to ground.
  2. I2C Communication: Connect the SCL (clock) and SDA (data) lines to the corresponding I2C pins on your microcontroller.
  3. Address Configuration: Set the I2C address by connecting A0, A1, and A2 to either VDD or VSS. The default address is 0x20.
  4. I/O Pins: Connect your devices to the GPA0-GPA7 and GPB0-GPB7 pins.
  5. Interrupts (Optional): Connect INTA and INTB to your microcontroller if you want to use interrupt functionality.

Important Considerations and Best Practices

  • Pull-up Resistors: Ensure that the I2C lines (SCL and SDA) have appropriate pull-up resistors (typically 4.7kΩ).
  • Current Limitation: Do not exceed the maximum current rating of 25 mA per I/O pin and 125 mA total.
  • Debouncing: Implement debouncing for mechanical switches connected to the I/O pins to avoid false triggering.
  • Address Conflicts: Ensure that the I2C address does not conflict with other devices on the same bus.

Example Code for Arduino UNO

#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
}

Troubleshooting and FAQs

Common Issues Users Might Face

  1. I2C Communication Failure:

    • Solution: Check the connections for SCL and SDA lines. Ensure pull-up resistors are in place.
  2. Incorrect I/O Pin Behavior:

    • Solution: Verify the pinMode settings in your code. Ensure that the pins are correctly configured as input or output.
  3. Address Conflict:

    • Solution: Ensure that the I2C address set by A0, A1, and A2 does not conflict with other devices on the bus.
  4. Overcurrent Issues:

    • Solution: Ensure that the current drawn by each I/O pin does not exceed 25 mA and the total current does not exceed 125 mA.

Solutions and Tips for Troubleshooting

  • Check Connections: Ensure all connections are secure and correctly placed.
  • Use a Multimeter: Measure voltages and continuity to diagnose issues.
  • Consult Datasheets: Refer to the MCP23017 datasheet for detailed information on register settings and configurations.
  • Use Serial Monitor: Utilize the Serial Monitor in Arduino IDE to print debug information and track the flow of your program.

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.