Blog about Web Programming and Electronics
💬 👤
back Back to blog
Arduino & Electronics

How a Cable Tester Works?

ikona

A cable is one of the most common things that breaks in a network and electronics — yet the last one we suspect. A broken or incorrectly assembled cable can cause an internet outage, intermittent data transmission errors, or even damage to a device. In this post, let's look at what a cable tester actually checks and how such a tester works from the inside.

What a Cable Tester Checks

A simple tester basically checks three things: whether the conductor carries current, short circuits, and whether the conductors are connected in the correct order. More advanced testers add cable length measurement and signal quality assessment.

  1. Continuity — each conductor must carry current from start to end
  2. Short circuit — conductors must not touch each other
  3. Crossed pairs — the order of the wires must match the standard
  4. The most common error — the cable works, but slower or with lost packets

Operating Principle on a Microcontroller

A tester built around a microcontroller (for example an Arduino) works on a simple principle. Each cable pin on the transmitting side is switched to the HIGH state, while all the others stay LOW. On the receiving side we watch which pin detects voltage. If the signal arrives at the correct pin, the connection is right. If it arrives at the wrong one, we have a crossed conductor. If it doesn't arrive anywhere, it is broken.

// Simple testing of one pair of pins
int transmittingPin = 2; // GPIO output
int receivingPin = 10; // GPIO input

void setup() {
    Serial.begin(9600);
    pinMode(transmittingPin, OUTPUT);
    pinMode(receivingPin, INPUT_PULLUP);
}

void loop() {
    digitalWrite(transmittingPin, HIGH);
    if (digitalRead(receivingPin) == HIGH) {
        Serial.println("Conductor is OK");
    } else {
        Serial.println("Error: conductor does not carry current");
    }
    digitalWrite(transmittingPin, LOW);
    delay(1000);
}

Pin Layout for RJ45

An RJ45 network cable has eight conductors, divided into four pairs. The T568B standard defines the exact order of colors we follow when assembling the cable. The tester checks each conductor separately and tells you precisely which one is broken or crossed.

Pin number Wire color (T568B) Pair
1 Orange-white Pair 2
2 Orange Pair 2
3 Green-white Pair 3
4 Blue Pair 1
5 Blue-white Pair 1
6 Green Pair 3
7 Brown-white Pair 4
8 Brown Pair 4

Important Detail: Safety When Testing

One common mistake when building your own tester is wiring power pins to the cable contacts. If the cable is broken and has a short circuit between power and ground, we can damage the microcontroller. Therefore all test pins are connected to GPIO outputs, and the receiving side to GPIO inputs with an internal pull-up resistor. This way even a broken cable cannot destroy anything.

  1. Never connect 5V or GND directly to the test contacts
  2. All test pins are GPIO outputs on the transmitting side
  3. The receiving side uses INPUT_PULLUP mode
  4. Test one pin at a time, never all at once

Such a tester is not hard to build at home — a few sockets, a microcontroller and some patience with the wires. And it is precisely this combination of electronics and programming that makes such projects interesting.

back Back to blog