Hacker News new | ask | show | jobs
by spuz 1123 days ago
Nice project. I'm interested in the cable tester itself. Why does each line require a different resistor? Also, in the gif at the top of the page, it looks like some of your cables only light up 5 LEDs. Are some cables out there really that bad?
4 comments

If an LED fries out, then the current will change across the other ones. If they're all going through a single current limiting resistor, then the current across the other LEDs will change, potentially frying them all out due to overcurrent scenarios. This is the case for many different areas of PCB design.

Further, all LEDs have different responses to current (as LEDs are non-linear components and thus ohm's law doesn't apply) and thus usually require different current limiting resistors to achieve similar brightness or in some cases color.

Also, switching LEDs on an off will affect the cathode net and anything connected to it, so it'd also affect the other LEDs in parallel depending on which are on and off at any given point.

Each LED has a different response for how much light you get out based on how much current goes in. To get the same brightness you have to compensate for that. (Default behavior is one super dim LED, and one that is like staring at the sun.)

Code for the LEDs is here: https://github.com/JITx-Inc/jitx-cookbook/blob/main/usb_c_ca...

And yeah, cables are that bad. Can't tell you how much time is lost to figuring out why your device won't enumerate on USB and then finding the cable was the culprit.

> Are some cables out there really that bad?

Some cables just connect the bare minimum for USB connectivity - +5V/GND. I've seen that one on vape charger cables. Others go a bit further and add the USB 2.0 D+/D-.

If LEDs share a resistor then they dim as more LEDs are turned on.
I meant to say why does each LED require a different resistor value?
Because different colors usually mean different semiconductor material and thus different forward voltage of the junction which in practical terms leads to different brightness if the same resistor value is used.
Different color have different forward voltage and luminosity per mA.

Or if it is connected to some live signal the signal itself might be with different voltage range