Only single LED lights up on the Unicorn Hat



I received a Unicorn Hat, and only one light would light up, though I have an ample power supply. After emailing support, the replacement unit also lights up one light. (The top right corner, closest to the Pi board lights) I’ve tested with the Python2/3 scripts.

Has this happened to anyone else? What’s the best debugging strategy?


I don’t suppose you have an Arduino to hand? You could connect it to the DIN/VCC/GND on the side of the Unicorn Hat and run the NeoPixel Library examples to see what happens.

Did you also try running the unicorn executable, from here?

Two HATs both doing the same thing seems unlikely, and the common factor here is your Pi- so it’s worth trying an alternate if possible.


Thanks I’ll try the executable,

I have an A+ in the mail, it should arrive in a few days. If that doesn’t work, I’ll try a different Raspbian image. (Is there a Raspbian image that’s verified as working with the Unicorn Hat for download somewhere?)

The B+ I’m currently using seems to have problems outputting sound via the headphone jack. Is that symptomatic of something?
Regardless, I’ll debug and share with the community.


So, the C lib only activates a single LED as well, though a Pibrella works just fine on this board.


The headphone jack could indeed be symptomatic of something- from recollection the PWM hardware responsible for generating sound is also used for driving the Unicorn Hat. I could be wrong, but it’s an interesting coincidence!


You’re absolutely right @gadgetoid! The audio output on the Pi uses the same GPIO we’re using to drive Unicorn HAT. It’s possible you have a fault on the Pi if both your audio and UnicornHAT are not functioning correctly.

Have you tried a completely fresh Raspbian install?


So my A+ arrived, I used the same Raspbian image on it and saw a similar behavior.

Then I plugged in headphones and ran Pianobar. I received static audio and saw this effect in the LEDs. I wonder what’s happening under the hood?

Currently downloading a fresh Raspbian image.


So I downloaded a new Raspbian image and the Unicorn Hats started working properly. I’m wondering if it had something to do with the raspi-config overclocking settings on the old image?


Glad you got it fixed! I don’t see how it could have had an effect; but you could try overclocking and see if it breaks it again.

I think it’s more likely something to do with older versions of the Raspberry Pi firmware, perhaps, had you tried an “rpi-update” before re-imaging?


Hmm, no I did apt-get upgrade which took a while.

I overwrote the old image but perhaps we should add that to the docs?


Hi there, took me some time to find the reason for a similar error: My unicorn hat from time to time showed a single or a few randomly colored LEDs. Eventually (when I started some of the unicorn hat examples) all the LEDs were showing random colors and would change in some unforeseen order.

My raspberry controls a robot. So I have some other hats on it, too (servo controller, motor controller). I assumed that they did not work together properly. But after a while I found the real reason: Whenever I develop the robot software, I boot it with a HDMI screen attached. But when the robot should drive around etc, I boot it without HDMI display. The error occured only when the raspi was booted without HDMI display. After a few searches in the WWW I found the reason: The sound driver (snd-bcm2835) usually uses HDMI audio output. But when HDMI is not connected, it falls back to GPIO Pin12 (BCM 18) audio, so this is when the unicorn hat did not work.

Solution was to remove (or comment out) the driver “snd-bcm2835” in /etc/modules.