So, I tried to automate as many of these small tasks as possible in the simplest design I could think of - a USB cable tester PCB.
Please share your thoughts, ideas, criticism - I'm looking forward to hearing any feedback from the HN community!
Real world board designs usually have critical placement, mechanical, EMI, test, assembly, anti-RE, supply-chain or other business-level constraints.
Without evolving the fundamental requirements definition to a language that holistically allows the parametric expression of these factors, generated designs are unlikely to meet real world needs in most real world (non-trivial) use cases.
To address a few points and how software-defined electronics actually does make sense for it:
> critical placement You can use a `place` command to exactly place things wherever you want.
> mechanical Use board outline functions, `place` commands, arbitrary shapes, 3D component shapes, etc. to meet these needs. You can export a STP and send to your mech team for validation.
> supply-chain Parametric search query function allow designers to specify only as much information as they need about a component (e.g. 0402 10k, but not MPN) and the system can pick the best component at compile time that is in stock with necessary quantity available.
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.
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.
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-.
Pick a switch footprint and add diode footprint to it, save as new footprint.
can the script bundle the LEDs together to make it easier to visually grok the results? e.g. this bundle of LEDs lit up means it's a usb3 compliant cable, this bundle lit up means the cc resistors are proper, etc
the brightness may be a good thing, if you add a faceplate to diffuse the LEDs (and add proper labels/branding). I've been meaning to find a good application for a PCB faceplate... https://hackaday.com/2022/08/17/circuit-less-pcb-featured-as...
First pass would be to bundle the LEDs based on their type - just change the ordering from an ordering based on physical position to an ordering based on the logical meaning of each connection.
In the second pass, you could have a separate LED bank with LEDs marked USB3, USB2, etc. Hook those up to a couple of logic gates so that the LED turns on when it detects the USB3, USB2, etc. configuration.
In my experience, the paradigm of programmatically generating PCBs is not always practical. Even as a hobbyist, I eventually switched to manual design after experiencing issues with automated tooling. If you are serious about PCB design, you need to do things manually. There are other teams depending on the information and it needs to be guaranteed to be correct.
this will not always be the case, you know.
I hate that this blog post is effectively an HTML commercial for the product they are selling, but I have to admit that they are headed in the right direction.
Prior to tools like KiCad, "serious" users did tapeout by hand. Prior to the transistor, "serious" electronic engineers used vacuum tubes.
Do you have some feedback about what we could change about this article to make it less like a commercial?
I've enjoyed the jump to "code-first" PCB design but can understand your point - any thoughts on a UI that would allow these programmatic constructs interleaved with more classical EDA workflow?
https://docs.kicad.org/7.0/en/pcb_calculator/pcb_calculator....
The complexity certainly does not require a board with two or more layers. Here is how it is made up:
Positive pole goes to the pins of the connector on the left-hand side, negative pole to the ground fill (look closely to the right connection at the battery and you will see how it connects to the area with the lighter shade of green on the board - this is a copper area shining through the green solder mask).
On the right hand side, the different pins of the connector are wired to the test points, resistors and diodes which at the other end connect to the ground fill. Now if a cable is plugged in both sockets and if there is a connection on a particular pin of that cable, the circuit for the respective LED is closed and it lights up.
The other side of the board is pretty boring - just a ground plane and a couple traces. Like others said, this whole thing could be done on a single layer if you wanted.
But it is much simpler than that. Right above photo there is a gif showing that all the pins for one connector are connected to battery, while other connector connects to LEDS and afterwards ground.