Unicorn Hat and Used Pins


Ciao Everyone!

I’m quite new to Raspberry Pi and Unicorn Hat but I was able to set it up and play with the example codes a little bit.

Does the Unicorn Hat use all the pins? In other words can I use some pins to add other hardware while keeping the Unicorn Hat working as expected?

I’m quite a newbie, thanks for you help!


It uses a sum total of one pin; GPIO 18. This is the data pin, it also uses 5V and GND but since they’re not IO pins it doesn’t matter. You can take the hat right off the Pi and drive it from an Arduino if you wanted.

If you want to drive it from the Pi you can probably use 3 jump wires; make sure you plug them into the header and not the little breakout contacts on the side of the HAT though. Unicorn Hat has logic level conversion for the Pi onboard.


Apologies for hijacking this thread, but it seems like an appropriate place to ask. Which of the pins are used/not used on the dot3k? Are the sca and sdl pins free? Or could one piggyback onto them anyway?


I think your question is relevant, somewhat anyway!

By “sca and sdl” do you mean the Clock and Data lines for I2C? http://pi.gadgetoid.com/pinout/i2c

You can connect multiple I2C devices to these pins, as long as their addresses don’t conflict with the SN3218 chip on the Display-o-Tron- 0x54.

Dot3k and UnicornHat could, in theory, run from the same Pi.

I’ve added the Joystick pins that Dot3k uses to Pinout, here: http://pi.gadgetoid.com/pinout/dot3k


Yep, those are the ones. That’s what I suspected re. multiple devices running off those pins, but thought I’d double check. Cheers!!


I followed your suggestion and gave it a try.

I used three jump wires:

Pin#2 - Power 5v
Pin#12 - GPIO18
PIN#14 - Ground

Nothing happened when I launched a test script.
As you wrote I used the Unicorn HAT header and not the contacts on the side.

I’m afraid I’m not familiar enough to grasp all the hidden rules when working with wires and Pi.


I’ll try and whip up more precise instructions for you! It should be doable ( it’s no different from putting it straight on the Pi ) but you need to connect the right wires to the right places for it to work.


I’m very new, but have a question. This thread makes it sounds like I can run the Unicorn Hat via wires. Would I be able to run multiple Unicorn Hats from one Pi by connecting them all to the same pin on the Pi? Looking to have a little fun in my office at work! My coworkers have been spending hundreds of dollars on Hue lights. Unicorn Hat seems cooler!!!


Yes, you could run multiple Unicorn Hats by connecting them all to the same pin.

I’m not sure exactly how many you could connect together before tricksy electrical mischief made the signal basically degrade into useless mush, but certainly a few!



Have you had a chance to think about my question?
I’m still stuck to wiring the Unicorn HAT to the Pi…



I have had success driving it from the following pins:

Pin 2: 5V
Pin 5: GND
Pin 6: GPIO 18

What I have not been able to do use only pi pin 6 for the data signal and use external 5V power for extra juice.


You can do this, but you must have GND and GPIO 18 connected!


Spot on. I grounded the external supply to the pi on pin 3, connected the 5V straight to pin 2 on the unicorn, pulled ground from pin 9 on the pi, and fed data from pin 12. Worked like a charm

The external power makes a huge difference when the brightness is at 1.0 and most of the display is lit up. Before when I was displaying white at full bright, it was more of a yellow, now it is very white.


That looks good. Are you using semi-transparent white tape to diffuse the LEDs?


I’m sorry to be such a bother but I’m still not able to make it work.

You used:

Pin 2: 5V
Pin 5: GND
Pin 6: GPIO 18

As far as I know Pin 2 is 5V (correct), Pin 5 is GPIO3 and Pin 6 is GND.
GPIO 18 is pin 12. Now I’m completely lost…

Can you take a picture of the Pi’s pin board and Unicorn Hat with the wires attached. I don’t need to use an external 5V for this particular project.

To test the result I’m using the preinstalled python examples. They work with the Unicorn Hat attached directly to the Pi.

Thanks once again…


Ground should be pin 9. I’ll put together the circuit and take a pic right now.

Passthru pins on Unicorn HAT?

Just some white paper taped to the board. Still looking for a more elegant solution, but this is saving my eyesight for the time being.


Thanks! Now everything is clear!



I also need to connect two unicorn hat. Which pins?


Unicorn HAT only runs from Pin 18 using some highly specific signal generation code- the Pi is technically not capable of pushing this sort of signal out on any other pin. You can connect two to this pin, but they will display the same thing.

The normal way of connecting multiple devices with these kind of LEDs is to “daisy chain” them, one after the other. The trouble is, we’ve not provided an “OUT” on the Unicorn HAT so you can’t easily do this.