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

75B3D62D-F199-440C-BC73-75B2FC14C406.png
5F16D901-A7A3-4FDA-9104-8AF972C38CC2.jpeg
6C4D4E16-6AE6-4B63-864D-E6C38062E8A1.jpeg
B0D6441B-B85C-439F-BEA6-B87F4DA9C9A9.jpeg

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

D1E653B3-70E7-4D13-BE9E-CCE9D7DBE424.jpeg
CDABA2E4-C616-4C11-AB58-02BCA4F44D3E.jpeg

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

C7C4CEEF-D937-48DA-B147-EE29828A2EE1.jpeg

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

E56DC1B6-D134-49C0-8A54-FB7AAA25EB99.jpeg
F9FD98F4-4BD0-4B5F-9466-5A45A1A79F81.jpeg
D559A4A3-A5CF-44E9-B75D-E55CD35A2629.jpeg
After separating planet and robot modes you are ready to install the electronics. You need to remove the panel on the back of Unicron’s maw. This will reveal the open maw and you can press fit the LED strip inside. Run the LED strip wires out the side of the panel and screw it back on. They you just need to glue the speaker on the Upgrade Kit frame and place the other electronics inside. The USB mini cable for battery pack runs down the back of the black support frame. You can Velcro the battery pack on the frame and that’s it.

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