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

How to Use MCP23017_IO_Expansion_board: Examples, Pinouts, and Specs

Image of MCP23017_IO_Expansion_board
Cirkit Designer LogoDesign with MCP23017_IO_Expansion_board in Cirkit Designer

Introduction

The MCP23017 I/O Expansion Board is a versatile and powerful component that allows users to increase the number of digital input/output (I/O) ports available to a microcontroller, such as an Arduino or Raspberry Pi. Utilizing the MCP23017 integrated circuit from Microchip Technology, this board communicates via the I²C interface, making it an ideal choice for projects that require additional I/O ports without occupying too many pins on the main microcontroller.

Explore Projects Built with MCP23017_IO_Expansion_board

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

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 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 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 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 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 systems
  • Robotics
  • DIY gaming controllers
  • Expanding I/O capabilities for microcontroller projects
  • Prototyping and educational purposes

Technical Specifications

Key Technical Details

  • Operating Voltage: 1.8V to 5.5V
  • Current Rating: 25 mA per I/O pin
  • Temperature Range: -40°C to +125°C
  • Communication: I²C serial interface
  • I/O Ports: 16 additional I/O pins
  • Interrupt Output Pins: Two (one for each port)

Pin Configuration and Descriptions

Pin Number Pin Name Description
1 GPB0 I/O port B0
2 GPB1 I/O port B1
... ... ...
9 VDD Power supply (1.8V to 5.5V)
10 VSS Ground
11 NC No Connection
... ... ...
18 SCL Serial Clock Line for I²C
19 SDA Serial Data Line for I²C
20 RESET Reset input (active low)

Note: This table is a partial representation. Refer to the MCP23017 datasheet for the full pinout.

Usage Instructions

How to Use the Component in a Circuit

  1. Powering the Board:

    • Connect VDD to the power supply (1.8V to 5.5V).
    • Connect VSS to the ground.
  2. I²C Communication:

    • Connect SDA and SCL to the corresponding SDA and SCL pins on the microcontroller.
    • Ensure pull-up resistors are in place for both SDA and SCL lines if not provided by the microcontroller.
  3. Address Selection:

    • The MCP23017 has three address pins (A0, A1, A2) for configuring up to 8 different addresses on the same I²C bus.
  4. Connecting I/O Pins:

    • Connect the desired I/O pins (GPB0-GPB7, GPA0-GPA7) to the peripherals or devices you wish to control.

Important Considerations and Best Practices

  • Always ensure that the power supply voltage is within the specified range to prevent damage.
  • When using multiple MCP23017 boards on the same I²C bus, configure each with a unique address.
  • Use decoupling capacitors close to the power pins to minimize power supply noise.
  • Avoid running I²C lines near high-current traces to prevent interference.

Troubleshooting and FAQs

Common Issues Users Might Face

  • I²C Communication Failure:

    • Check for correct pull-up resistor values on SDA and SCL lines.
    • Verify that the MCP23017 is properly addressed and that there are no address conflicts on the I²C bus.
  • Unexpected Behavior or No Response from I/O Pins:

    • Ensure that the MCP23017 is correctly initialized in your code.
    • Check for proper power supply and ground connections.

Solutions and Tips for Troubleshooting

  • Use I²C scanning code to confirm that the MCP23017 is detected on the bus.
  • Double-check wiring, especially for SDA, SCL, and address pins.
  • Consult the MCP23017 datasheet for detailed information on register configurations and operation modes.

FAQs

Q: Can I use the MCP23017 with a 3.3V system? A: Yes, the MCP23017 operates from 1.8V to 5.5V, making it compatible with both 3.3V and 5V systems.

Q: How many MCP23017 boards can I chain together on a single I²C bus? A: You can chain up to 8 MCP23017 boards on a single I²C bus by configuring each with a unique address using the A0, A1, and A2 pins.

Q: Do I need to use external pull-up resistors for the I²C lines? A: Yes, if the microcontroller does not have built-in pull-up resistors, you will need to add them externally. Typical values are 4.7kΩ to 10kΩ.

Example Code for Arduino UNO

#include <Wire.h>
#include "Adafruit_MCP23017.h"

// Initialize MCP23017
Adafruit_MCP23017 mcp;

void setup() {
  Wire.begin();        // Start I²C bus
  mcp.begin();         // Default address 0x20

  // Set pin #0 to output
  mcp.pinMode(0, OUTPUT);
}

void loop() {
  // Toggle pin #0
  mcp.digitalWrite(0, HIGH);   // Set pin high
  delay(500);
  mcp.digitalWrite(0, LOW);    // Set pin low
  delay(500);
}

Note: This example uses the Adafruit MCP23017 Arduino library. Make sure to install the library before compiling the code.

Remember to keep code comments concise and within the 80 character line length limit.