Things to check on a Unicorn HD HAT

Hi all,

Just got round to putting my HD HAT on my new Pi. Appears dead as a doornail - no obvious errors, but no lights when running the demos. What can I check? I2c should be enabled, anything else?


Bit of checking - looks like it just uses pin 18 and PWM anyway. But anything else I could look at before sending it back?

Pinout is here,
Have to ask the obvious, you ran the correct one line installer right?

curl | bash

Firmly pressed down on the GPIO header?

I have one on the way, I won’t see it until next week some time though. Only just ordered last Friday.

I suspect you’ve installed the Unicorn HAT library and not the Unicorn HAT HD one? Common mistake! But they are fundamentally different despite having confusingly similar names. (there was no easy way to consolidate them since they’re so very different)

Follow the install instructions that @alphanumeric posted above and that should put you on the right track.


Thanks for replying. Yes, I did that.

Best regards,

Ah - right. Will have a check. I think I have the right one though (I do have a non-HD HAT too, which works fine). Sorry to stick another question in - how are efforts going to allow us to run these without root access. Just doesn’t sit right with me as a generally security paranoid person :)


It’s fundamentally impossible to run Unicorn HAT without root- it’s accessing the hardware/memory directly in order to prep a buffer of pixel data and copy it via DMA into the PWM hardware to modulate the signal. You can create a daemon that runs as root and handles the IO, which would lower your attack surface, but on a Pi by default you can elevate with passwordless sudo so it’s kind of pointless.

Unicorn HAT HD uses SPI, and doesn’t require root at all since it works in a completely different way.

Ah - didn’t realise how differently they worked. Works now - I was indeed missing the PyPi library for the HD version.


Just received my Unicorn Hat HD, haven’t powered it up yet, but looking forward to playing with it. Maybe latter today if things go as planned.

What would be the best example file to run to check if every LED is working?
Demo and test py light up every pixel but make it hard to tell if maybe one element ( a red or a green or a blue)isn’t working? Something that lights them all up Red, then Green, then Blue, maybe?

We test they all work before we ship 'em out- but that’s not always 100% reliable of course :D

I thought we hae an example, but apparently not!

Using unicornhathd.set_all() to set each colour in turn would suffice as a quick ‘n’ simple method.

Ok, thanks. Will have a go next time I boot that Pi up. The tech in my wants to verify any new hardware is fully functional before the 30 day return runs out. ;) I haven’t had anything DOA from you guys as far as I know. You just hate to stumble on something broken months down the road and wonder when or how it happened etc.
The swirling patterns in the demo are impressive / cool looking. But seeing one part ( a R or G or B) of one LED thats not working wouldn’t be easy.

We’re usually pretty easy-going if something fails :D But I can’t blame you for wanting to be thorough.

That worked a treat, all check as good. =)

#!/usr/bin/env python

import time

import unicornhathd

unicornhathd.set_all(255, 0, 0)


unicornhathd.set_all(0, 255, 0)


unicornhathd.set_all(0, 0, 255)