Bluetooth Talking Unicorn Head
Since at least the advent of the original singing mounted fish – and probably much earlier – society has gotten a collective chuckle and/or groan out of unexpected animatronic performances. Such devices are inexpensive and simple enough to be prime hacking targets, and when creator Brian Lough saw a plush unicorn head for sale, he decided it needed an upgrade.
As explained in the video below, this magical horned horse is fairly simple inside, with a speaker to play songs, and a motor that opens the mouth. Unlike other such devices, the setup doesn’t simply spin and move the mouth open and shut repeatedly, but only opens when power is applied. It’s a neat trick, but as Lough didn’t entirely disassemble the unicorn, the mechanics are something of a black box, or perhaps magically rainbow-colored, given its unicorn theme. The unicorn also features LED lighting, and a motion sensor, which could eventually come in handy, but were not used here.
For control, Lough is using an ESP32 module, which is configured via a library to act as an I2C Bluetooth speaker. An FFT library breaks out audio frequencies into different bands, and when a threshold is exceeded the unicorn opens its mouth along with the input via a MOSFET. The setup (overall code) works really well for spoken word-only content, though things get a bit more complicated when musical accompaniment is added into the mix.