Skip to content

Foadsf/usb-cable-tester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

USB Cable & Soldering Tester (Raspberry Pi Loopback)

Project Wiring Diagram

A simple, safe, and effective tool to verify USB cable continuity and validate soldering work on USB breakout boards using a Raspberry Pi.

🚀 Overview

This project solves the problem of testing "home-soldered" USB breakout boards without risking damage to a computer's USB port. It uses a Passive Loopback configuration where the Raspberry Pi sends safe 3.3V logic signals through the cable to test all four lines (VBUS, D-, D+, GND) independently.

Key Features:

  • Safety First: Does not use the 5V USB rail; all testing is done at 3.3V GPIO logic levels.
  • Cable Type Detection: Distinguishes between full "Data Cables" and cheap "Charge-Only" cables.
  • Soldering Verification: Identifies specific pins (e.g., D+ or D-) that may have cold solder joints or bridges.

🛠 Hardware Required

  • Raspberry Pi 3 Model B (or compatible Model 3B+/4B/Zero)
  • 1x USB Type-A Female Breakout Board
  • 1x USB Micro-B Female Breakout Board (or Type-C/Mini depending on cable)
  • Breadboard & Jumper Wires
  • The USB cable you want to test

🔌 Wiring (GPIO Pinout)

Connect the breakout boards to the Raspberry Pi GPIO header as follows.

⚠️ WARNING: Do NOT connect the VBUS/VCC pin of the breakout boards to the Pi's 5V or 3.3V power rails. Connect them only to the GPIO pins listed below.

USB Signal Wire Color Sender (Type-A) Receiver (Micro-B)
VBUS Red GPIO 17 (Pin 11) GPIO 27 (Pin 13)
D- White GPIO 22 (Pin 15) GPIO 23 (Pin 16)
D+ Green GPIO 24 (Pin 18) GPIO 25 (Pin 22)
GND Black GPIO 5 (Pin 29) GPIO 6 (Pin 31)

💻 Usage

  1. Clone this repository to your Raspberry Pi.
  2. Connect your hardware according to the diagram.
  3. Plug the USB cable you want to test into both breakout boards.
  4. Run the test script:
python3 test_cable.py 

Interpreting Results

  • ✅ All PASS: The cable is a Data Cable, and your soldering is perfect.
  • ❌ D+/D- FAIL (but VBUS/GND Pass): You have a "Charge-Only" cable (no data wires inside).
  • ❌ All FAIL: Check your breadboard wiring or check for major soldering errors.

📄 License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Copyright (c) 2026 Foad Sojoodi Farimani.

About

A Python-based GPIO tool to test USB cable data capability and soldering continuity.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages