Community project

Smart Ethernet Tester

Photo of Smart Ethernet Tester
Generated with AI

Randy Orolfo

Published November 24, 2026

The Smart Ethernet Tester diagnoses network cable integrity and connectivity status using an ESP32 microcontroller. It combines an OLED display for real-time feedback, a rotary encoder for user input, and an MCP23017 I/O expander to systematically test all eight conductors in an Ethernet cable across two RJ45 breakout jacks.

This guide provides a complete wiring diagram, parts list, and step-by-step assembly instructions to build a portable tester that checks for open circuits, shorts, and network link status. The included firmware handles cable scanning, Ethernet detection, and DHCP negotiation, displaying results on the small OLED screen.

Wiring diagram

Wiring diagram for Smart Ethernet Tester
Loading diagram…

Gather all the parts

QtyComponent
1

Grove OLED Display 0.66" (SSD1306)

Grove 0.66-inch 64 x 48 monochrome white OLED display on a 20 x 20 mm module, driven by an SSD1306 controller over I2C (address 0x3C, 0x3D selectable). It runs from 3.3 V or 5 V with an onboard regulator and level shifter and connects through the Grove I2C connector on the back.

1

KY-040 Rotary Encoder Module

5-pin incremental rotary encoder breakout with integrated momentary push switch. CLK and DT are the quadrature outputs; SW is the built-in push-button output and should not be modelled as a separate Push Button component.

1

Ceramic Capacitor

100 nF

Through-hole ceramic capacitor bought by value, such as 22 pF, 10 nF or 100 nF (0.1 µF). It is non-polarised, so either lead can go to either net. Its most common job is decoupling: a 100 nF capacitor between an IC's supply pin and ground, placed as close to the chip as possible.

1

MCP23017-E/SP 28-pin DIP

Direct pin connections for offline cable continuity testing.

1

Winford BRKEA8PB-N numbered passive RJ45 breakout

Direct pin connections for offline cable continuity testing.

1

Winford BRKEA8PB-N numbered passive RJ45 breakout

Direct pin connections for offline cable continuity testing.

1

Resistor

1 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

1 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

1 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

1 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

1 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

1 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

1 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

1 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

1 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

1 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

1 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

1 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

1 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

1 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

1 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

1 kΩ

Through-hole resistor (current-limiting in series with an LED)

Assemble it in 4 steps

1. Wire the screen and knob

With USB unplugged, connect OLED SDA to GPIO1 (data) and SCL to GPIO2 (clock). Connect encoder CLK to GPIO15, DT to GPIO16 and SW to GPIO17. Power both from 3V3 and GND. Match the Grove cable labels, not the wire colors.

2. Add the cable-checking chip

Place the MCP23017 across the breadboard gap. With the notch up, pin 1 is top left; count down the left side and then up the right. GPB0–7 are pins 1–8, VDD is 9, VSS is 10, SCL is 12, SDA is 13, A0–A2 are 15–17, RESET is 18 and GPA0–7 are 21–28. Connect according to the wiring diagram and put the 100 nF capacitor close to pins 9 and 10.

3. Label the two offline jacks

Connect each numbered terminal through its own 1 kΩ resistor as shown. Label both breakout jacks OFFLINE ONLY. Leave their shields unwired. Use the Waveshare board's own jack for live link and DHCP checks.

  • Never connect either breakout jack to a router, switch, PoE source, or powered cable. The offline circuit is not protected against network power. Unplug both cable ends from equipment first.

4. Check with a known-good patch cable

Put both ends of a spare straight-through cable into the offline jacks. Turn the knob to Cable map, press to scan, and turn to see the numbered connections. Turning past either end of the map returns to Live port.

Review all connections

1. Connections between "oled" and "ESP32"

FunctionoledESP32
powerVCC3V3
groundGNDGND
i2cSDAGPIO 1
i2cSCLGPIO 2

2. Connections between "knob" and "ESP32"

FunctionknobESP32
powerVCC3V3
groundGNDGND
digitalCLKGPIO 15
digitalDTGPIO 16
digitalSWGPIO 17

3. Connections between "io" and "ESP32"

FunctionioESP32
powerVDD3V3
groundVSSGND
i2cSDAGPIO 1
i2cSCLGPIO 2
powerRESET3V3
groundA0GND
groundA1GND
groundA2GND
digitalGPA0 → Resistor P1EXT
digitalGPB0 → Resistor P1EXT
digitalGPA1 → Resistor P1EXT
digitalGPB1 → Resistor P1EXT
digitalGPA2 → Resistor P1EXT
digitalGPB2 → Resistor P1EXT
digitalGPA3 → Resistor P1EXT
digitalGPB3 → Resistor P1EXT
digitalGPA4 → Resistor P1EXT
digitalGPB4 → Resistor P1EXT
digitalGPA5 → Resistor P1EXT
digitalGPB5 → Resistor P1EXT
digitalGPA6 → Resistor P1EXT
digitalGPB6 → Resistor P1EXT
digitalGPA7 → Resistor P1EXT
digitalGPB7 → Resistor P1EXT

4. Connections between "bypass" and "ESP32"

FunctionbypassESP32
power13V3
ground2GND

5. Connections between "r1" and "ESP32"

Functionr1ESP32
digitalP2 → Winford BRKEA8PB-N numbered passive RJ45 breakout 1EXT

6. Connections between "b1" and "ESP32"

Functionb1ESP32
digitalP2 → Winford BRKEA8PB-N numbered passive RJ45 breakout 1EXT

7. Connections between "r2" and "ESP32"

Functionr2ESP32
digitalP2 → Winford BRKEA8PB-N numbered passive RJ45 breakout 2EXT

8. Connections between "b2" and "ESP32"

Functionb2ESP32
digitalP2 → Winford BRKEA8PB-N numbered passive RJ45 breakout 2EXT

9. Connections between "r3" and "ESP32"

Functionr3ESP32
digitalP2 → Winford BRKEA8PB-N numbered passive RJ45 breakout 3EXT

10. Connections between "b3" and "ESP32"

Functionb3ESP32
digitalP2 → Winford BRKEA8PB-N numbered passive RJ45 breakout 3EXT

11. Connections between "r4" and "ESP32"

Functionr4ESP32
digitalP2 → Winford BRKEA8PB-N numbered passive RJ45 breakout 4EXT

12. Connections between "b4" and "ESP32"

Functionb4ESP32
digitalP2 → Winford BRKEA8PB-N numbered passive RJ45 breakout 4EXT

13. Connections between "r5" and "ESP32"

Functionr5ESP32
digitalP2 → Winford BRKEA8PB-N numbered passive RJ45 breakout 5EXT

14. Connections between "b5" and "ESP32"

Functionb5ESP32
digitalP2 → Winford BRKEA8PB-N numbered passive RJ45 breakout 5EXT

15. Connections between "r6" and "ESP32"

Functionr6ESP32
digitalP2 → Winford BRKEA8PB-N numbered passive RJ45 breakout 6EXT

16. Connections between "b6" and "ESP32"

Functionb6ESP32
digitalP2 → Winford BRKEA8PB-N numbered passive RJ45 breakout 6EXT

17. Connections between "r7" and "ESP32"

Functionr7ESP32
digitalP2 → Winford BRKEA8PB-N numbered passive RJ45 breakout 7EXT

18. Connections between "b7" and "ESP32"

Functionb7ESP32
digitalP2 → Winford BRKEA8PB-N numbered passive RJ45 breakout 7EXT

19. Connections between "r8" and "ESP32"

Functionr8ESP32
digitalP2 → Winford BRKEA8PB-N numbered passive RJ45 breakout 8EXT

20. Connections between "b8" and "ESP32"

Functionb8ESP32
digitalP2 → Winford BRKEA8PB-N numbered passive RJ45 breakout 8EXT

Deploy the firmware

#include <Arduino.h>
#include <Wire.h>
#include <SPI.h>
#include <Ethernet.h>
#include <U8g2lib.h>
U8G2_SSD1306_64X48_ER_F_HW_I2C oled(U8G2_R0,U8X8_PIN_NONE,2,1);
uint8_t mac[6], mapRow[8];
bool cable=false, scanned=false, ioError=false, shorted=false, leased=false;
int row=0, ticks=0, prevAB;
uint32_t nextNet=0;
char net[3][17]={"Live port","Checking",""}, last[4][17];
bool reg(uint8_t r,uint8_t v){Wire.beginTransmission(0x20); Wire.write(r);Wire.write(v);return Wire.endTransmission()==0;}
int readReg(uint8_t r){Wire.beginTransmission(0x20);Wire.write(r);if(Wire.endTransmission(false)||Wire.requestFrom(0x20,1)!=1)return -1;return Wire.read();}
void scan(){
 scanned=true;shorted=false;
 ioError=!(reg(0,255)&&reg(1,255)&&reg(0x0c,255)&&reg(0x0d,255)&&reg(0x14,0)&&reg(0x15,0));
 for(int bank=0;bank<2&&!ioError;bank++) for(int i=0;i<8;i++){
   if(!reg(bank,255^(1<<i))){ioError=true;break;}
   delay(4);int a=readReg(0x12+bank), b=readReg(0x13-bank);
   bool released=reg(bank,255);
   if(a<0||b<0||!released|| (a&(1<<i))){ioError=true;break;}
   if((uint8_t)~a!=(1<<i))shorted=true;
   if(!bank)mapRow[i]=(uint8_t)~b;
 }
 reg(0,255);reg(1,255);
}
void network(){
 if(Ethernet.hardwareStatus()==EthernetNoHardware){strcpy(net[1],"No Ethernet");return;}
 if(Ethernet.linkStatus()!=LinkON){leased=false;strcpy(net[1],"Link down");net[2][0]=0;return;}
 if(!leased){leased=Ethernet.begin(mac,1500,500)==1;}
 else {int r=Ethernet.maintain();if(r==1||r==3)leased=false;}
 strcpy(net[1],leased?"Link + DHCP":"Link; no IP");net[2][0]=0;
 if(leased){auto ip=Ethernet.localIP();snprintf(net[2],sizeof net[2],"%u.%u.%u.%u",ip[0],ip[1],ip[2],ip[3]);}
}
void draw(){
 char s[4][17]={};
 if(!cable){for(int i=0;i<3;i++)strcpy(s[i],net[i]);strcpy(s[3],"Turn: cable");}
 else {
  strcpy(s[0],"Cable map");strcpy(s[3],"Push: scan");
  if(!scanned)strcpy(s[1],"Offline only");
  else if(ioError)strcpy(s[1],"Wiring/I2C err");
  else {
   bool straight=true, open=false;for(int i=0;i<8;i++){straight &= mapRow[i]==(1<<i);open |= !mapRow[i];}
   strcpy(s[1],shorted?"Short found":open?"Open wire":straight?"Straight OK":"Pins swapped");
   snprintf(s[2],sizeof s[2],"%d> ",row+1);
   if(!mapRow[row])strcat(s[2],"open");
   for(int i=0;i<8;i++)if(mapRow[row]&(1<<i)){size_t n=strlen(s[2]);s[2][n]='1'+i;s[2][n+1]=0;}
  }
 }
 if(memcmp(last,s,sizeof s)==0)return;memcpy(last,s,sizeof s);
 oled.clearBuffer();oled.setFont(u8g2_font_4x6_tr);for(int i=0;i<4;i++)oled.drawStr(0,8+i*12,s[i]);oled.sendBuffer();
}
int ab(){return digitalRead(15)*2+digitalRead(16);}
void setup(){
 pinMode(15,INPUT_PULLUP);pinMode(16,INPUT_PULLUP);pinMode(17,INPUT_PULLUP);prevAB=ab();
 Wire.begin(1,2);oled.begin();draw();
 uint64_t id=ESP.getEfuseMac();mac[0]=2;for(int i=1;i<6;i++)mac[i]=id>>(8*(i-1));
 pinMode(14,OUTPUT);digitalWrite(14,HIGH);pinMode(9,OUTPUT);digitalWrite(9,LOW);delay(2);digitalWrite(9,HIGH);delay(10);
 SPI.begin(13,12,11,14);Ethernet.init(14);Ethernet.begin(mac,IPAddress(0,0,0,0));
}
void loop(){
 static const int8_t q[]={0,1,-1,0,-1,0,0,1,1,0,0,-1,0,-1,1,0};
 int v=ab();ticks+=q[prevAB*4+v];prevAB=v;
 if(abs(ticks)>=4){int d=ticks>0?1:-1;ticks=0;if(!cable){cable=true;row=d>0?0:7;}else{row+=d;if(row<0||row>7){cable=false;row=0;nextNet=0;}}}
 static bool raw=HIGH, stable=HIGH;static uint32_t edge=0;bool b=digitalRead(17);
 if(b!=raw){raw=b;edge=millis();}if(raw!=stable&&millis()-edge>25){stable=raw;if(!stable){if(cable)scan();else nextNet=0;}}
 if(!cable&&(int32_t)(millis()-nextNet)>=0){network();nextNet=millis()+1500;}
 draw();delay(1);
}

Remix this project

Make it yours in one click

Open a full copy of this project in your own Schematik workspace, diagram, code, parts, and assembly steps included. Swap the sensor, add features, or redesign the whole thing with AI. The author's original stays untouched.

Open in Schematik