Orientation for ribbon cable and enviro phat

Might seem like a stupid question, but I’m trying to work out exactly how to connect my gpio ribbon cable to the enviro phat. I’m struggling because I’m not sure how the input pins from the ribbon cable match up to the output pins. Sure, I know the white wire shows where the power lines are but there is nothing to stop me accidentally swapping them round and the lack of a simple picture on the internet is really bugging me out, please help! Is the proposed setup in the attached picture correct?

Thats actually the correct way to do it. If you use a male header on both.
Pin 1 on the Pi GPIO will have a square solder pad.
And Pin 1 on the pHats GPIO will have a square solder pad.
The trick is to solder your male header on the pHat on the top not the bottom.
On the side with the stripe it will be
00000…
X0000… > X being pin one
And on the phat it should be the same
00000…
X0000…

1 Like

Brilliant thank you!

I’ve seen so many people switch the female header for a male header, but solder it on the bottom. That flips the pins around if you use a ribbon cable. Pin 1 goes to pin 2, pin 2 to pin 1 etc. Thats not good and usually lets the magic blue smoke out. You did good to ask first when unsure. It sucks when things go poof. Been there done that. =(

Yeah I can imagine. I’ve misplaced my multimeter and don’t have any electronics kit lying about to test it. It would be nice if pimoroni supplied a diagram with the ribbon cable, and even nicer if they sold a ribbon cable that was made for soldering underneath. The ribbon sticking out the top looks pretty ugly for some HATs.

Anyway, thank you very much for the timely response, off to start soldering now!

The two ribbon cable connectors just mirror each other pin for pin. You could turn it around 180 degrees with the stripe on the other side, and it will still be fine. You could even plug both connectors in from the bottom.
Things only get crossed up if one connector is pointing up and one down. Or you put a twist in the cable and the white strip changes sides on its way from the Pi to the Hat or pHat.
The cable you want would have one connector pointing up and the other down. With no folds in the cable.I think?

The ribbon cable is actually more for the Mini Black Hat Hack3r


and pHat stack

I have several of the Mini Black hat boards. I put female headers on the back side of Pi Zeros’ so I can plug them in and skip using the ribbon cable. Some times I even use a 90 degree header on the Zero so I can plug two pHats in

Yeah I got that impression. I wanted the ribbon cable so that heat from the Pi doesn’t mess with the Enviro pHAT’s temperature sensors.

I had a feeling that was why. I have the same problem with my Sense Hat. The temperature reads high as a result of heat given off by the Pi’s SOC / CPU. I put a proto hat with a stacking header in the middle between the Pi and the Sense Hat. It blocked the heat and added some space between the two. It worked OK until I put it all in a case. I ended up switching to a BME680 remote mounted on the outside of my case I hooked it up with female to female jumper wires.

You could have went the jumper wire way. But looking at the pinout and all the ground pins in use.
https://pinout.xyz/pinout/enviro_phat#
The ribbon cable will look neater and cleaner. IMHO anyway.

Thanks, this is great advice.

In my case though, I bought a pHat already with a female header on it (SparkFun Qwiic pHAT v2.0 for Raspberry Pi - DEV-15945 - SparkFun Electronics).

The ribbon cables I found are female-female I wouldn’t be able to connect this would I? Even if I bought a set of male-male connectors, it would not create the correct ordering of pins would it?

Anyone know of a female-male ribbon cable that would effectively extend the GPIO so I can attach Hats from outside the case?

Plugging a male to male on the end of the female to female ribbon cable won’t work. Pins get swapped around in the process, this should work though.