Help for universal tester

Hello everyone,

I’m working on a universal cable tester project using an ESP32 DevKit V1, a MCP23017 (I2C) expander, a ST7735 TFT display (128×160), and a rotary encoder.
My goal is to detect cable connections (40 Pins tester) by scanning continuity between the pins (GPA ↔ GPB). I start with 8 pin so with only one MCP for test

Here is my current wiring setup on the breadboard:

  • ESP32 to TFT ST7735:
    • CS → GPIO27
    • DC → GPIO26
    • RST → GPIO25
    • MOSI → GPIO13
    • SCLK → GPIO14
    • VCC → 3.3V
    • GND → common ground
  • ESP32 to MCP23017 (I2C):
    • VDD → 3.3V
    • VSS → GND
    • SDA → GPIO21
    • SCL → GPIO22
    • A0, A1, A2 → GND (→ I2C address = 0x20)
    • RESET → 3.3V through 10 kΩ resistor
    • 0.1 µF capacitor between VDD and GND (close to the chip)
    • GPB0–GPB7 connected to GPA0–GPA7 (simulating cable links)
    • 10 kΩ pull-ups from each GPB pin to 3.3V
  • Rotary encoder:
    • A → GPIO4
    • B → GPIO2
    • SW → GPIO15
    • C → GND
    • The last Pin → GND

All components are powered from the ESP32’s 3.3 V rail.
The wiring has been double-checked and there are no shorts.


I tried several sketches, including the following I2C + MCP23017 diagnostic code (see below).
It initializes I2C on GPIO 21/22, scans the bus, and attempts a raw I2C read from address 0x20 before running Adafruit’s MCP23017 library.
However, the scan always returns:

*** NO DEVICES FOUND! ***
Check: Pull-ups, address pins, RESET, power, etc.

I2C errors such as
I2C hardware NACK detected
also appear repeatedly in the serial monitor.

I’ve verified wiring, used external 4.7 kΩ pull-ups on SDA/SCL, and tried 100 kHz I2C clock speed. Still nothing is detected.

Here’s the sketch I used:

#include <Arduino.h>
#include <Wire.h>
#include <Adafruit_MCP23X17.h>

Adafruit_MCP23X17 mcp;
const uint8_t MCP_ADDR = 0x20; // A0=A1=A2=GND

void setup() {
  Serial.begin(115200);
  delay(500);
  Serial.println("\n\n========== I2C DIAGNOSTIC START ==========");

  Wire.begin(21, 22);
  Wire.setClock(100000);
  delay(100);

  int found_count = 0;
  for (uint8_t addr = 1; addr < 127; addr++) {
    Wire.beginTransmission(addr);
    byte error = Wire.endTransmission();
    if (error == 0) {
      found_count++;
      Serial.printf("Found device at 0x%02X\n", addr);
    }
  }

  if (found_count == 0) {
    Serial.println("*** NO DEVICES FOUND! ***");
    while (1) delay(1000);
  }

  if (!mcp.begin_I2C(MCP_ADDR)) {
    Serial.println("*** LIBRARY INIT FAILED @0x20 ***");
    while (1) delay(1000);
  }

  Serial.println("MCP23017 OK!");
}

void loop() {}

Does anyone have an idea why the MCP23017 isn’t detected at all on the I2C bus?

The next step, once it's working, is to multiply the MCP23017 to create sides A and B with 40 pins on each, and to be able to make a universal tester in which we will create adapters by making breakboards

Thank you! :folded_hands:

Using words to describe a circuit is not the best idea. Simply draw by hand where each wire goes, the boards etc then take a photo of it.

The choice of microcircuit for the device is unclear. The PCF8575 will give you 16 lines, but there can be 8 of these microcircuits on one bus.

Why isn't it being detected? Is the address incorrect or is it malfunctioning? Check with a scanner, does it find your device?

if I run the code of post 1 on a ESP32 with a MCP23017 using ESP32 core 3.3.2 I get

========== I2C DIAGNOSTIC START ==========
Found device at 0x20
MCP23017 OK!

could you have a power supply problem?

EDIT: running I2Cdetect

#include <Wire.h>
#include <i2cdetect.h>

#define I2C_SDA 21
#define I2C_SCL 22

void setup() {
  Wire.begin(I2C_SDA, I2C_SCL);
   Wire.setTimeout(0);//3000);// /* us /, true / reset_on_timeout */); // 
   Wire.setClock ( 400000L ) ; 
  //Wire.begin();
  Serial.begin(115200);
  Serial.println("i2cdetect example\n");
  Serial.print("Scanning address range 0x03-0x77\n\n");
  
}

void loop() {
  i2cdetect();
  delay(2000);
}

I get

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Could it be an MCP23S17 ? as that is a SPI device. (note the S instead of 0)

I'd like to know your verification method. Short wires carefully soldered or chained jumper wires running here and there with breadboard in the middle?

1 Like

Quick update on my progress! > Thanks to the previous advice (especially regarding the battery charging), I have now finalized the schematics for my ESP32 cable tester.

To make the mechanical assembly easier, I decided to split the design into two separate PCBs connected by a 2x10 IDC ribbon cable:

1. Main Board (Controller & Power):

  • ESP32, 3.5" TFT Screen (SPI) and ADS1115.
  • Proper Load Sharing / Power Path circuit (DMP1045U p-mosfet + SB220 diode) combined with the TP4056 and MT3608 boost converter.
  • A constant current source using an MCP6002 Op-Amp for precise measurements.

2. Multiplexer Board (The Array):

  • 6x MCP23017 (I2C) driving 6x CD74HC4067 analog multiplexers. (Note: I used the BOB-09056 breakout module footprint for the multiplexers due to stock shortages of the DIP packages).

Since this is the final step before I generate the Gerbers for JLCPCB, I would highly appreciate a quick sanity check from the community. Does everything look correct, particularly the power path and the I2C/SPI routing?

Main Board:


carte2.pdf (366,8 Ko)
( its say that its the card 2 but its 1, I inverse ... )

Multiplexer Board:

carte1.pdf (949,9 Ko)

Thanks again for the help!

Don't know if this will affect your project but it's :

not advised to use A7, B7 as inputs

I haven't encountered any problems with those pins, maybe I was just lucky...