How to Design a Custom GPIO Cable

Hi folks,

now, as I am already doing final assembly of my project, I 'vefound out that I will have to make someone custom-make a GPIO cable for my Raspi 3B, as the quasi-standard GPIO cable with a 2×20 pin plug on one side and 40 jumper cables on the other side (like this cable) has proved too long and too inflexible.

Now I’d like to design a cable tailored to my particular needs in Fritzing, but I have no clue on how to do this resp. whether there is a possibility to define such a cable design by using the well-known standard wires (which would normally be jumper wires in the “real world”). Just to demonstrate how complicated my GPIO config has already become:

Of course I won’t use a breadboard for the final design, but a PCB and a couple of breakout boards. I must find a way to connect the PCB and breakouts to the Pi’s GPIO header, though.

Any hints?

My first hint is to clean up breadboard. If you are intending to actually breadboard this first, cleaning up will make that easier. Here is a partial reproduction of your breadboard

followed by how I would change it

Here the 3.3V wires are all orange (so you can see at a glance where 3.3V, 5V and GND are) they connect in an organized fashion to the breadboard and connect to an open pin on the breadboard (not directly to the part which works in Fritzing but won’t in real life!) 5V is red GND is black and the signal wires should be different colors to make it obvious where a connection goes. Now on to your actual question about a GPIO cable. There isn’t an easy way in Fritzing to make such a cable, in breadboard individual wires (routed sensibly!) will do. Assuming the breakout boards will all connect to the pcb (the ones here all should) then what I would suggest is use two 20 pin headers to duplicate the GPIO connector (or better yet use this part which will allow you to route traces between pins in pcb which a standard header will not!)

It works like this (with only two wires done)

which in pcb looks like this

with the Raspberry PI outside the gray pcb area it will not appear on the pcb but will connect in breadboard and schematic. The Raspberry PI then connects via a 40pin IDC ribbon cable to the headers on the pcb. Alternately you can make your board in to a Hat which will plug directly in to the GPIO connector (again I would use the above header part rather than a standard header.) Hope this helps.

Peter

Please don’t care about the breadboard as I have already finished this part of my work, so it’s all about PCBs and flex cables now.

The 40-pin ribbon cable is the most trivial solution in case of one single PCB, but in my particular case, I can’t solve my problem this way, as I will have two PCBs plus a relay module I can’t place on a board. And the interior of my enclosure is quite cramped, so that I’ve gotta avoid unnecessarily long cables.

An IDC cable can have multiple connections and since there is only one GPIO (I assume anyway) that shouldn’t be a problem. Space and layout however may be. Another option would be to run the GPIO in to the first board then run the necessary signals and ground out another (probably smaller) IDC cable to the relay module or headers and jumpers (although that produces potential connector issues) or via wires soldered to the header pcb pads assuming the various modules don’t need to be disconnected often or at all.

Peter

If I had more (PCB) space, I could have done it this way (most connectors run to the first PCB anyway). This is not the case, though. :frowning:

The only other thing I could suggest is 2mm/1.27mm/1mm headers to save board space (won’t work on the GPIO connector though without an adapter cable which would likely be a problem.) There are at least 2mm crimp headers (and maybe 1.27mm or 1mm) that could be used to make cables (including from the GPIO cable to a smaller pitch I expect) that I have used to convert 0.1in headers to 2mm. Milmax makes some very expensive (~$2/pin) solderables that I have used for 0.1in to 1.27mm jumper cables (not having found any elsewhere.)

Peter

Peter