Unicorn HAT + GPIO cable


#1

Hello friends!

I just got my hands on a new Unicorn HAT, a GPIO cable, and a box header for my Raspberry Pi 2. I (think I’ve) got it all set up, however I don’t get any LED output when plugged in to the GPIO cable. When the HAT is plugged directly into the Pi things work as expected. Any thoughts?

(Just FYI, in case anyone’s interested, the way I’ve got this set up is the HAT is command-stripped to the back of a MacBook Pro lid and is outputting lights through the Apple logo. The reason I’d like to use the cable is that the Pi doesn’t sit flush on the hat because of its thickness.)


#2

Presumably this is because the GPIO cable is reversing the pins.

You would have to plug the Unicorn HAT into the top of the GPIO cable - obviously physically impossible - for the rows of pins to be the right orientation. Or the GPIO cable into the top of the Unicorn HAT … also physically impossible, but hopefully picturing this will show you what might be amiss.


#3

Ok, thanks for the reply. Is there anything I can do about it besides those impossible solutions or do I just have to deal with it?


#4

you only need a few links, why not use discrete cabling rather than a 40-way?


#5

To be honest, it’s because I’m not very experienced with electronics. If I knew how, I totally would. Is there any easy way to do that, or would it require soldering? (which I should probably learn anyways, however)

EDIT: Just found out about jumper wires. These seem to be the way to go. Any objections?


#6

jumper wires would work, at least to test out. How to secure them is another matter, if you post a pic of your idea/design I might be able to give you my take on how to go about it in my view.


#7

Here’s a link to an imgur album featuring the setup. In order from top to bottom:

  1. The setup on the wall
  2. A view from behind
  3. Back of setup taken down from wall
  4. A view of the “issue” (which, frankly, isn’t an issue because the setup still works, but I can’t imagine this situation is any good for the Pi or the HAT)
  5. My view of a better setup (sans jumper cables because they’re on the way from Amazon)

Thoughts? Can this work?


#8

honestly, your current setup is pretty OK. If you have the space though, you could just use one of those:

alternatively, with the boxed header you bought and a few jumper cables it’s a straightforward job… will try to emulate it then post a pic for ya!


#9

Thanks! I actually just bought some Male to Female jumper cables. Is that ok? I’m assuming that I wouldn’t need the boxed header in that case.


#10

I think if you want a secure way to hook up the HAT to the pi you’ll need the header box and a basic soldering job! I’ll be right back!


#11

using jumper cables alone, this would work:

you need 5v from pin 2 (or 4), ground from pin 9, and PWM from pin 12 (BCM18).

… when you get your cables I think you’ll see the problem, namely that the jumper cables sitting in the HAT are too loose to be secured in position long term.

I’ll try to post a possible permanent solution over the weekend if you’re not afraid to get your soldering iron out!


Resistance between +5V and Ground on Unicorn pHat
#12

there you go (I was bored), custom made cable by itself, then clipped on HAT and Pi!


I tend to use female to female jumpers for those type of jobs, it’s easy to unsleeve their terminal and they give you a nice solid anchor to soak solder into.


#13

Hey, thanks again so much for all of the help! I’ll definitely keep this in mind. Unfortunately, I lack soldering skills (and an actual soldering gun, as a matter of fact), so this might prove difficult. I’ll see if I can keep the wires in there on their own if possible, but if not I’ll definitely refer to these pictures etc.

On a slightly related note, how do I know which wires to solder? I don’t have a fancy case with labels for the GPIO pins like you do, how can I tell which pins are which?


#14

you can use http://pinout.xyz

… to an extend at least, @gadgetoid and I are currently discussing how to document power and, easier said than done, ground idiosyncracies.


#15

actually @pianogamer5 , pop me your address in a PM and I’ll send you the cable I knocked off for the demonstration ;-)


#16

Wow, thanks a lot! PM sent.


#19

I tried pins 4+6+18, it took aeons to figure out why it wouldn’t work.
Why MUST it be pin 9?
I know it hardly matters, but ground is ground, why the specific pin?


#20

Because the PCB assumes a Raspberry Pi as host, and traces are routed as most practical for the board. I agree it makes things harder for less common applications but that’s the reality.


#21

Unicorn HAT has a big fat isolated ground trace running from this pin to part of the slow-start circuit. This circuit uses a transistor and capacitor to slowly allow current into Unicorn HAT to charge the dozens of capacitors on the board without the inrush current browning out the Pi instantly. I didn’t design the board, so I don’t know exactly why there’s a dedicated trace for this, but it’s there!


#22

Goodness! All far too terribly scientific for my head.
But thanks for the explanations guys. :)