Add Voice and Lights to Haslab Unicron
by savall21 in Circuits > Microcontrollers
1158 Views, 2 Favorites, 0 Comments
Add Voice and Lights to Haslab Unicron
Make the Chaos Bringer speak! I recently purchased a Haslab Unicron. It’s awesome but I wanted to recreate some of the iconic Orson Welles Unicron quotes. So, I decide to add sound and lights to Unicron. I’m using a combination of a Circuit Playground Bluefruit, DFPlayer mini and a WS2812B strip to get it done. The end result has Unicron maw light in sequence to sound clips played to the movie. The whole thing is controlled via BLE on an iPhone or Apple Watch.
Here’s a video of it in action:
Supplies
Circuit Playground Bluefruit
DFPlayer Mini
Speaker (3” , 8 ohm, 4 watt)
Wire
3D printed Haslab Unicron Upgrade Kit
Power bank USB battery pack (any will do as long as it fits on the frame and preferably black to blend in)
USB Micro cable
Electronics & Code
The system works by triggering sound files to be played on the DFPlayer min and then controlling the WS2812B brightness based on the sound level coming in through the Circuit Python Bluefruit (CPB) microphone. I use BLE to control it via the Adafruit Bluefruit Connect app. The code for the CPB is written in Circuit Python. I used a number of existing code examples for the BLE control and the sound reactive lights. I also found a Circuit Python library to control the DFPlayer. That way I can use a serial UART connection for more flexibility in playback.
The CPB uses the default TX/RX connections to connect to the corresponding RX/TX connections on the DFPlayer. The DFPlayer pull its ground and 3.3v power from the CPB. The DFPlayer mini is in turn connected to the speaker via pins SPK1 & SPK2. There are three wires for the WS2812B. The WS2812 strip gets its 5v power and ground from the CPB. My code designates A3 as the signal connection to the LEDs. Lastly power for the whole system is provided by a standard cell phone power bank that connects vis USB mini to the CPB. You can see the whole setup in this video:
You can get the code from my site https://cchobbyfun.com/blogs/news/haslab-unicron-...
To help the LEDs blend into the body, I resin printed a transparent resin ring. The ring is 1.39" in diameter and .39 tall. The LEDs sit in this and it allows you to press fit them in Unicron's maw.
Separate Planet and Robot Mode
In order to install the electronics you need to make room in planet mode Unicron by separating robot from planet mode. There is a detailed tutorial on doing this:
br>
Then you will need to either purchase or 3D print the Upgrade Kit. Here’s a detailed video on installing it but its pretty easy:
Installation
When the battery pack is plugged in the CPB will power up and advertise itself in the Adafruit Bluefruit Connect app. Connect to it and select the Controller. Then you will be able to play Unicron sound files by selecting the numbers or up down buttons. You can scroll through all of the sound files by either pushing the left or right buttons.
If you are interested in a kit let me know at cchobbyfun.com