Introduction: Raspberry Pi GPIO Expansion Cable From a Used IDE Cable
Rev B of the raspberry Pi ships with a 26 pin GPIO port and my first dilemma after bringing up my Pi was, how was I going to break out the PI’s GPIO pins so that I could easily access them for design work? I searched on-line and found several solutions but all of them already did too much. I did not want someone else’s interface to their set of hardware and I did not want to use someone else’s buffer design. Then while searching through a drawer of parts, I had in my hand a solution – an old unused 40 pin IDE hard drive cable. I could plug one of the existing cable headers onto my Pi GPIO port and plug a custom header into my powered breadboard.
For more info. please visit http://www.raspberryproject.com/a-gpio-expansion-cable-from-a-used-hd-cable/.
Notes: There is some bad information floating around about the Raspberry Pi GPIO and a IDE cable.
1. Some people are claiming that using this cable will damage the GPIO port because per the IDE standard, some of the pins are shorted together. It's true that some of the pins are shorted together but this is at the IDE hardware & not in the cable. The cable is just wired straight through.
2. Some people are claiming that using this cable will damage the GPIO port because every second conductor is grounded. This is only true with the newer IDE standard that uses a 80 pin ribbon cable. A cable built under the older IDE standard is perfectly safe and it's easy to tell which one you have - just count the wires (ridges) in the cable. The cable you want to use will have only 40 wires, not 80 wires.
Step 1:
First you need to find a used IDE 40 pin hard drive cable. And it’s important that you use a 40 & not a 80 pin cable.
Step 2:
Cut the cable apart between the center connector & the connector on the shortest end & cut on the short cable side of the connector. I used an exacto knife but you can also use a good pair of scissors.
Step 3:
You should have a clean cut like this picture.
Step 4:
When done you should be able to spread the end out like this picture. You can also see where I cut off the other 14 wires I won’t need after figuring out which end of the cable will plug onto the GPIO header.
Step 5:
Because the connector is 40 pins and the Pi GPIO is 26 pins, you will have some overhang off the end of the board. You can’t cut the overhang off the end of the connector because if you do the connector will come apart.
Also, you should peel away & cut off the unused 14 ribbon conductors like I have shown above.
You can see here how the wires will map perfectly. GPIO pin 1 to the first wire, GPIO pin 2 to the second wire, etc.
Step 6:
For the header end I started with a Radio Shack P/N 276-170 board.
Step 7:
Look at the bottom of the board and you’ll see rows of 0.10″ spaced pads joined together. When assembled right, this makes the ideal single row header.
Step 8:
I cut the start of my custom header out of a section of this board. The cut out piece is 26 pins wide, just like the header pin count on the Pi
Step 9:
Then I inserted & soldered a header strip all the way down one side.
Step 10:
Here is a view of the solder side of the header strip.
Step 11:
Next step is to strip the ends of the ribbon cable wires.
Step 12:
And then insert each wire through holes in the header strip, paying special attention to the order. The first wire to pin one, second to pin 2, etc.
Step 13:
Solder the wires one at a time as you insert them into the header strip, paying close attention so that you don’t short any adjacent pins together.
Step 14:
When done the solder side will look like this.
Step 15:
And the header pin side will look like this.
Step 16:
Next you need to check the entire assembly for opens and shorts with an ohm-meter.
Step 17:
And only after the cable tests out OK, plug your new expansion cable into your Raspberry Pi GPIO port and power back on. Just make sure your Pi power is unplugged first.
Step 18:
And plug the other end into your breadboard.
Step 19:
And here’s my final set-up. The pins are conveniently numbered from 1 to 26 straight down the header and it’s going to be easy to mock-up designs on my breadboard!
Just don’t forget that your Pi’s logic levels are 3.3V & not 5V and the outputs are not buffered! And this just means that any good design should start first with proper level translation and when needed, isolation to protect your Raspberry Pi.
For more info. please visit http://www.raspberryproject.com/a-gpio-expansion-cable-from-a-used-hd-cable/.
16 Comments
8 years ago on Introduction
people, take it from an engineer who has worked extensively with ribbon cables, every other line in the cable SHOULD be grounded. when signals go between one end and the other at higher frequencies, the ribbon cable takes on the characteristics of a transmission cable. If a ground DOES NOT exist between signal lines, what happens is undesirable capacitive coupling can and does occur at certain frequencies. in order to ensure that the signaling is correct, it is best to follow the practice of making every other line grounded in the IDE cable. When you look at the header that means use lines 1,3,5,... for signaling and lines 2,4,6,... for ground.
so this is just a big FYI to those who are trying to talk to their raspberry pi, beaglebone black, seeeduino arch, ect.
If people need further assistance to do it right the first time, i do consult.
contact me for assistance.
Cheers
Reply 6 years ago
I belive the 40pin/80wire cables are the ones that have the internally connected grounds that you mention.
Reply 8 years ago on Introduction
All depends on how fast you are driving the cable. The speed you will be driving the Pi's GPIO ports will not cause an issue!
6 years ago
Same idea, but I cut down black plastic, wonder if will work? Other
thing , I left red first ribbon cable and cut from the other end??
Reply 6 years ago
It should work as long as he wiring is still the same - pin for pin.
Reply 6 years ago
Other end is cut end wires goes to screw terminals relay board.
Reply 6 years ago
OK, so instead of going to a prototyping board you are using the ribbon cable to wire directly to a relay board? Should work as long as what you are driving is rated for 3.3 volts.
7 years ago
Thanks for the idea. God instructable. I have a B+ with 40 pins. I made my breakout cable from an old 40 pin IDE cable. I dug out the blanked pin socket. I preferred not to use a breakout board, instead I just use dupont wires at the outer end. I will label the pins by sticking a printed label on either side of the connector end. Haven't done that yet. Here's some pics of the cable.
Reply 7 years ago
I have Pi 3. there also 40 pins, but actual IDE cable has 39, thanks for idea to drill another one hole, just was going to cut it off the pin.
8 years ago on Introduction
I spend a lot of time and energy on searching for a gpio cable for my pi. So i feel i should share some info so others don't have to do it as well. I'll provide some info on IDE cables and
Using an old IDE cable is definitely the cheapest way(my observation. Most rPi gpio cables were more expensive than an ide cable).
IDE cable is best for B+/A+ model while it can be used for earlier versions as well, Only problem being lots of unused pins which WILL hang off your board.
IDE background info
Some info on IDE cables. They have 40 pins in total but some have 40 pin 40 conductor ribbon and some have 40 pin 80 conductor ribbon. The difference is just there to improve on I/O speeds (Every second conductor is grounded, hence space b/w each conductor is increased, thus increasing speed).
Check the pin outs here https://en.wikipedia.org/wiki/Parallel_ATA
You'll see that some pins are ground. Now the thing here to note is that some cables have all the grounds shorted and some do not.
Sometimes the cables will have one pin closed. This is done to make sure you insert it the right way(i think, though there's a groove on one side too)
What you need to buy?
What you want for the pi is a 40 pin 40 conductor with grounds not connected in the cable itself. You should also make sure the cable you buy doesn't have the grounds shorted. Make sure all the pins are open. You don't want any pin closed.
40 conductors can be identified easily by just counting the numbers of wires in the ribbon. If they're 40, it's 40 conductor, if 80, then 80 conductor. Buy only the 40 conductor one.
Checking for shorted grounds can only be done by inserting into the pins and checking for shorts.
In all, 40 pin, 40 conductor, all pins open, and grounds not shorted.
That's awfully specific, what if i can't find one like it or already have a cable but it's a different one?
Fret not, i bought a cable with 80 conductors, one hole closed, and grounds shorted. Still managed to turn it into a usable one. Here's how.
1. Closed hole: You can just drill into it. I didn't had a drill so i just used a pointed screw driver and a nail to make the hole. Turned out it was only covered with plastic, there was actually a pin connected through the ribbon cable.
2. Shorted grounds: You can open the connectors and remove the plate that connects the grounds. Ask me to write an instructable for that if you want me to, because i couldn't find any info on it and ended up ruining one of the 3 connectors that are on the cable(wasn't gonna need three connectors anyway :P ).
3. 80 connectors: Not really a problem. I just have 40 unused connectors in my ribbon cable. The rest are connected in a regular fashion.
Note: I did NOT test it out on the rPi, but all the logic in me tells me this should work. If it does not, i'll update it here.
9 years ago on Introduction
Just be careful, some IDE cables do have internal shorts, even 40pin ones. You can often split the header off each end and remove the center plate that does the pin shorting leaving a standard header that's then fine to use.
10 years ago on Introduction
Thanks for posting this. It was the first result on Google for "Raspberry Pi IDE cable on GPIO". The first step was the answer to my problem! Hey, don't use the 80 pin cable. Mine hung on the rainbow boot screen. Swapping it out for a 40 pin cable works fine.
Unfortunately, all the cables I have at the house are keyed (pin 19 is filled). Now to carve them out so they're usable.
Reply 10 years ago on Introduction
Thanks for the feedback. The reason you can't use the 80 pin cable is every other wire is connected together in the connector headers. In their original use the wires are shorted to ground to reduce cross talk - this is one of the tricks used to speed up hard drive access before drive technology switched to SATA.
Reply 10 years ago on Introduction
Ya, as soon as I saw the 80 pin reference I realized what my dumb mistake was. I found a 40 pin cable in a junk computer to cannibalize. A little bit of time cutting out the stupid key pin (on the cable, not on the RPi), and I'm golden.
I have an audio jack based oscilloscope tied to the IDE cable, and a little script showing me pwm waveforms right now. It's wonderful.
10 years ago on Introduction
I know how to dish the cable, to cut the end so that the outer wires are longer. But my goal was to break out the GPIO port so I could do some work on my breadboard & the cable won't be moving around. I saw some other work where someone soldered up a header that kept the same double row order & then plugged the header into his breadboard, but that did not make since to me because every other pin is on the left side & covered by the incoming cable.
This instructable and the post to my new www.raspberryprojects.com web site were actually an after thought - I decided to share the idea because it was easy to build from parts laying around & I was up and running in less than an hour.
Thanks, Tom
10 years ago on Introduction
That PVC insulation is terrible to work with isn't it? I know it is! You haven't discovered the trick to working with ribbon cable yet. When you cut it you have to dish the cable concave fashion. Because the outer wires need to be longer than the inner ones need to be. It took me a long time to fully develop the technique myself. When done right there is less strain on the wires though. It looks a lot neater too.
I also usually hot glue the wires down, that doesn't always look too neat, but it stops wires from breaking a lot.