Mcp23017 on esp32 not working (I2C Scanner can't find address)

Hi guys.
I have been using the mcp23017 for quite a while now, but now I can't get it to work for some reason. I tried everything I know, maybe you can help me.

  • ESP32
  • mcp23017
  • Breadboard + Jumper Cables
  • 4k7 resistors
  • Platform IO on VS Code
  • I2C Scanner (code on the bottom)
    Address pins on mcp are Low, so there should be address 0x20. SDA & SCL are pulled up to 3.3V with 4k7 ohm resistors. VSS is connected to Ground, VDD is connected to 3.3V as well as RESET. I checked all connections for continuity with my multimeter, no problems there. I used 3 different mcp's already, still, nothing works.
    I'm going crazy because I used them quite successfully before and now I can't even get the I2C Scanner to work. If you have any ideas please let me know. Thank you!

Wiring Picture:

Blue->SDA | Yellow->SCL | Gray->GND | Orange->3.3V

I2C Scanner:

#include <Arduino.h>

  Rui Santos
  Complete project details at  

#include <Wire.h>
void setup() {
  Serial.println("\nI2C Scanner");
void loop() {
  byte error, address;
  int nDevices;
  nDevices = 0;
  for(address = 1; address < 127; address++ ) {
    error = Wire.endTransmission();
    if (error == 0) {
      Serial.print("I2C device found at address 0x");
      if (address<16) {
    else if (error==4) {
      Serial.print("Unknow error at address 0x");
      if (address<16) {
  if (nDevices == 0) {
    Serial.println("No I2C devices found\n");
  else {

The lower pull up resistor doesn’t seem to be connected to anything.

It is, just bent to the side, it‘s actually connected.

I fixed it, such a stupid little mistake. I used 47 ohm pull-up resistors instead of 4k7 ohm. Of course, it doesn't work, I basically shorted the signal lines

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.