firmware | ||
kicad | ||
library@e5b0ca3a0f | ||
picture | ||
.gitignore | ||
.gitmodules | ||
.qeda.yaml | ||
bom.ini | ||
CHANGELOG.md | ||
DEVELOPMENT.md | ||
fp-lib-table | ||
KiBOM_CLI.py | ||
LICENSE.txt | ||
Makefile | ||
README.md | ||
sym-lib-table | ||
usb-microbc_cable_tester-mcu.kicad_sch | ||
usb-microbc_cable_tester.kicad_pcb | ||
usb-microbc_cable_tester.kicad_pro | ||
usb-microbc_cable_tester.kicad_sch | ||
version |
The USB micro-B and C cable tester identifies capabilities supported by USB cables and deduces their purpose. It helps figuring out if a USB cable is for charging or to transfer data, and at which speed. It supports type A to micro-B, A to C, and C to C USB cables.


usage
- ensure the tester has a non-empty battery in the CR2032/2025 slot, or is externally powered through the USB power port
- plug one end of the cable in one of the host ports
- plug the other end of the cable in one of the devices ports
- when using a battery, press on the BAT ON button
- the tester will identify the cable's capabilities, on the left side
- the tester will then show the cable's purpose, on the right side
Once I know it's purpose, I mark the cables with a letter:
- USB A to micro-B only with ground and VBUS wires, limiting power transfer to 0.5 since they can't indicate battery charge: P

- USB A to micro-B, with data line shorted internally to indicate 1.5A battery charge (even when not sure the host supports it): C

- USB A to micro-B with data wires, but error prone since not shielded (sufficient for low speed): D

- USB A to micro-B with shielded data wires (good for high speed): S

- USB A to C without data lines but battery charge indication: C

- USB A to C with unshielded data lines: D

- USB A to C with SuperSpeed data lines, and shielded: 3

- USB A to C with SuperSpeed data lines, but unshielded (thus faulty): D

- USB C to C with shielded data lines: S

- USB C to C with electronic marking allowing 5A charging: C

- USB C to C with all features: F

The tester can detect electronically marked C to C cables. Electronically marked mean there is a chip on a least one of the C connectors. This is required in cables supporting 5A/100W charging. Some cable only supporting the default 3A/60W might also include it, but for cost reasons this is not common. But to be sure of the charging capability, one should read the information from the chip. This functionality is not supported by this tester. Full Feature C to C cable also require electronic marking, but could only support 3A charging. Because of that the 3A and 5A indicators are on at the same time (when the marking can be just for the features).
To understand further the capabilities and purpose of a cable, I recommend reading the USB specification, mainly the one for the type-C connector.
Unusual states:
- when some LEDs on the CAPABILITIES side are on, but none on PURPOSE, the cable is missing the ground wire, making it faulty, and should immediately be thrown away.
- on A-C cables, when the VBUS, DATA, and Rp LEDs are on, but it is decoded as faulty. I've seen this on a cables with built-in power display. Trust the decoding as it better measures the resistance in the CC pin. Rp is actually missing. The power monitor circuit in the cable creates a load (~ 50 kOhm) between VBUS and GND, interfering with the simpler Rp capability test.
report
There is a UART output on the debug port. The analysis of the capabilities to the purpose is periodically output on it. You can connect to it and view it using the 115200 8N1 baud rate.
firmware
You can flash or update the firmware using the SWD signals on the debug port, of also use the UART signals and the bootloader. To start the bootloader, press and hold the BL button while shortly pressing the RST button. You can then use stm32flash:
stm32flash -w binray.hex -v /dev/ttyACM0
The compiled binary is available in the release archives.
The source code of the firmware is in the firmware
folder.
design choice
features
do:
- USB micro-B: still wide-spread and popular for charging devices
- USB type-A: still the de-facto host plug
- USB type-C: becoming the standard for battery operated devices
- C to C: often used for high power charging of phones and laptops
- battery operated: it's a very simple device, and this avoids needing to require external power
- power port: in case you have no battery or it runs out
- USB 3.0: because it is hard to identify if C-C cable support SuperSpeed
- purpose: deduce from capabilities for users not knowledgable in USB cables
don't:
- small: no need to build it as compact as possible
- A to micro-B 3.0: the connectors that support it are obvious, and it's rare they are used for anything else than Super-Speed transfer (plus they are less common or problematic)
- Power Delivery capabilities: this requires complex host software communicating with the eMarker chip in the cable
- OTG: even if detecting this functionality is easy, micro-B OTG adapters are not popular anymore
- impedance: only the presence of wires is tester, not their impedance
mode of operation
Most of the tests just verify if the wires corresponding to capabilities are present in the cable. Some additional tests verify the resistances in the plugs. For more details, check the schematic, and refer to type-C specification.
The left side identifies the capabilities. Based on that, a micro-controller (MCU) will map the combination into a purpose on the right side. The left side is independent of the MCU and right side.
limitation
The tester does not:
- verify the resistance of wires, particularly the power ones
- verify the impedance of wires, particularly the differential ones
- verify if the shield(s) is more than just a wire
- read out capabilities from electronically marked cables
- guarantee USB cable compliance or conformity, as this is very complex
You can short the two pads marked BAT ON next to the battery with a solder blob. This will always power the board and does not require you to press on the BAT ON button to do the test, like when powering through the USB POWER port. But this will continuously drain 0.7 mA, emptying a CR2032 coin cell in 24 days.
alternatives
- USB micro-B cable tester: only does micro-B cables
- USB A-C cable tester: only does USB type A to type C cables
- USB C-C cable tester: only does USB type C to type C cables
- DT3 Data Cable Detection Board: does not check shield, battery charging, USB 3.0
- USB Cable Checker 2: too complex and expensive
- USB Cable Tester: only for USB-C and you have to understand and interpret the signals