Over the years, I have purchased many USB micro cables and USB iPhone charging cables. Some of these have been at the famous Shenzhen Electronics Markets, where you can find them stacked up high:
Many of us touring there wondered if we could design up a simple cable tester, sop we could check the cable quality before purchasing the cable. I know you can buy them, but I wanted to make my own PCB for this. The other day I was mindlessly swimming some laps and out of nowhere a design for placing a cable under various loads popped into my mind. It made for a wonderful swim.
The idea is, that a processor will measure the USB battery voltage and current coming into the PCB. It will then be routed out to the USB cable under test and the other end will be plugged into the board and the voltage at the other end will be measured as well. Therefore, I know how much current is flowing through the cable and the voltage drop across the cable, so Ohms Law says R = V/I, so I now know the cable resistance.
This initial design is what I call an Engineering prototype, so I have various testing points across the board and I can switch in three different loads through the cable. I can also connect the USB battery directly onto the three loads, so hopefully I can test the battery load capacity as well. If this all works out well, I can then minimise the resistor load and change the ESP32-WROOM-32D processor board to something cheaper, as this project doesn't really need to be WiFi or Bluetooth enabled!
However, it's a buyer beware market. Size and looks count for nothing. One year, just to prove a point I purchased three fat USB cables all 'Good Quality' or so I was told. Back at the Shenzhen Steamhead Makerspace, I cut them open and yes, as expected, I found that all of them had very thin internal wires inside - coated with a fat layer of silicone plastic. USB Cable Power Tester
Re: USB Cable Power Tester
Three manufacturing days and 20 shipping days and the JLCPCB was in my hands. I laser cut a plastic stencil for the PCB and hand picked and placed the components before hotplate soldered it up. There was a bit of excess solder, but solder wick made a short work fix for it:
After writing an Arduino program in Visual Source Code/ProgramIO, I noticed that the Loads where not properly switched on or off. This is the faulty KiCAD schematic design for the PCB, with 5V coming in on the top LH wire (the RH 5V goes off the the various Loads): I didn't notice my design error until I went and measured the MOSFET gate voltage and was surprised to find it at 5V. In my head I was thinking it should be GPIO 3.3V. A quick look at the circuit diagram with fresh eyes and yes, I could see that it would be 5V on the GPIO line when the MOSFET was switched off. I realised I should have used a N-MOSFET in front of the P-MOS to pull the P-MOS gate low and isolate the GPIO line from the 5V: I had lots of room on the PCB to retro-fit a dead-bug style extra SOT-23 MOSFET and 0603 10K resistor. The 0603 component just fits beautifully in-between the SOT-23 Gate and Source pins! I found that the USB out and USB in connectors where 3mm too close, as one of my test cables could not fit, so that will be fixed as well. At least I could write up most of the program to run the board and it gives me a chance to experiment with various load resistor combinations: Time to design up the next version of the PCB.
Next up was testing the PCB. Initially I couldn't load a program via the Rx/Tx serial port lines, but upon close examination, I found that the Tx 0603 resistor has a dry contact. A quick stab with a hot solder iron and it was good to go.
After writing an Arduino program in Visual Source Code/ProgramIO, I noticed that the Loads where not properly switched on or off. This is the faulty KiCAD schematic design for the PCB, with 5V coming in on the top LH wire (the RH 5V goes off the the various Loads): I didn't notice my design error until I went and measured the MOSFET gate voltage and was surprised to find it at 5V. In my head I was thinking it should be GPIO 3.3V. A quick look at the circuit diagram with fresh eyes and yes, I could see that it would be 5V on the GPIO line when the MOSFET was switched off. I realised I should have used a N-MOSFET in front of the P-MOS to pull the P-MOS gate low and isolate the GPIO line from the 5V: I had lots of room on the PCB to retro-fit a dead-bug style extra SOT-23 MOSFET and 0603 10K resistor. The 0603 component just fits beautifully in-between the SOT-23 Gate and Source pins! I found that the USB out and USB in connectors where 3mm too close, as one of my test cables could not fit, so that will be fixed as well. At least I could write up most of the program to run the board and it gives me a chance to experiment with various load resistor combinations: Time to design up the next version of the PCB.
Re: USB Cable Power Tester
I used the revamped board to test a number of USB-Micro cables at the April 2021 SW Makers meeting. Based on feed back from that, I have modified the design a bit and a second revision is currently being manufactured at JLCPCB.
I also compared my boards readings against a milli-ohm meter cable measurements:
Of course, my board is only measuring the VBUS wire inside the cable. The next revision should measure both VBUS and the Ground wire in series. It's interesting to find that a lot of cables measured quite high readings and that very few cables had a reading of under 300 milli-Ohms.
Re: USB Cable Power Tester
The next revision of the cable tester PCB arrived last week and I assembled the board yesterday. So far, the connector spacing is ok and it's working well.
After a few false starts, I found a nice Apple Lightning connector on LCSC, P/N: C168722 URL: https://lcsc.com/product-detail/USB-Con ... 68722.html that works well on a PCB. Googling around, I found some suggested termination resistors that activated the USB Lightning cable:
I found that it appears to work ok, although, I seem to get a 1-2 ohm cable resistance reading. Maybe that's the long 1.5m cable + the built in in-line IC resistance?
With the PCB design working well, next up is to make the PCB a bit smaller so that it comfortably sits in the palm of a hand and make it a bit more ergonomic. Maybe flip the display and user buttons onto the back of the PCB?
During the wait for the above PCB to arrive, I realised I can use the design to act as a USB voltage-current-power monitor. Of course, it's a lot larger than ones you can find on-line, however it's an extra feature of the PCB with no extra hardware costs.
you can find the PCB design files and example code here: https://gitlab.com/parkview/USB-Cable-Power-Tester
After a few false starts, I found a nice Apple Lightning connector on LCSC, P/N: C168722 URL: https://lcsc.com/product-detail/USB-Con ... 68722.html that works well on a PCB. Googling around, I found some suggested termination resistors that activated the USB Lightning cable:
I found that it appears to work ok, although, I seem to get a 1-2 ohm cable resistance reading. Maybe that's the long 1.5m cable + the built in in-line IC resistance?
With the PCB design working well, next up is to make the PCB a bit smaller so that it comfortably sits in the palm of a hand and make it a bit more ergonomic. Maybe flip the display and user buttons onto the back of the PCB?
During the wait for the above PCB to arrive, I realised I can use the design to act as a USB voltage-current-power monitor. Of course, it's a lot larger than ones you can find on-line, however it's an extra feature of the PCB with no extra hardware costs.
you can find the PCB design files and example code here: https://gitlab.com/parkview/USB-Cable-Power-Tester