Introduction: Arduino Controlled Animatronic Skeleton Rock Band - in Progress
For Halloween this year, I decided to build an animatronic skeleton rock band. It's a work in progress at this point, but I'm pretty happy with how it's coming along. Most everything is made from materials I had on hand (I'm a bit of a hoarder) and old static props that I modified for my purposes. The brains of the system are 2 Arduinos. I'm using an Arduino UNO with an SD shield for the audio playback, and an Arduino Mega 2560 with an 8-channel relay module for all other controls. I wanted to keep the music on a separate board to keep as much memory available as possible. I haven't tried it with only one board, but it should work. The light show consists of ten 12 volt LEDs controlled by a CD4017 decade counter and a 555 timer. There's a potentiometer to control the speed of the lights. This is my first experience with Arduino or any micro-controller, so bear with me. I'm learning as I go along.
The show starts when someone steps on the welcome mat. Music plays and Boo Frighters come to life, so to speak. Grave Grohl plays his guitar and sings while his eyes flash along to the music, and Impaler Hawkins plays his drums while the bass drum head lights up with a flashy light show. When the song is over, the show shuts off until the mat is stepped on again and the process repeats. The servo controlling the jaw is wired to the left audio channel, which is only the vocal track. The right channel is both music and vocals and is sent to the speakers. This allows the mouth to move only when there's singing.
I'm hoping to build a bass player, but I have to see what parts I can find in the basement of doom. If not there, then the attic of atrocity may have something I could use.
I am loving playing around with the Arduino, but I can imagine adding a Raspberry Pi to this project would be lots of fun, too.
Things I'm still working on include:
- a new vocal track over Monkey Wrench to make it more Halloween-ish
*****- adding additional music tracks to be played in a random order when triggered***** - DONE
- add more band members as parts become available
- more lights
- build a stage
I'll be editing and adding to this instructable as time goes by, so check back often.
If there's any mistakes, I apologize. I have a hard time focusing and writing isn't my thing.
Step 1: Build Some Band Members - Part 1: Drummer (Impaler Hawkins)
The only thing I purchased for this piece was the geared motor. I got it on ebay for a few dollars. Everything else is from the basement of doom and the closet of terror.
This guy is made from an old vacuum cleaner for the body, which is fully height adjustable, a styrofoam block with some plywood pieces for the shoulders, a coffee can lid for the pivot point, 2 syringes; 1 for the neck, and 1 to attach the shoulders to the vacuum body, an old ground-breaker plastic skeleton prop, hard drive spindle and platters, coat hangers, and a rod from an old low voltage track light.
The motor is attached to the hard drive platters by a coat hanger rod. The platters are drilled to clamp the horizontal track lighting rod into place. The front platter also has a hole drilled to attach the vertical coat hanger to the motor. Both ends of the horizontal rod have grooves which I looped the end of a coat hanger around to connect to the hands. The motor is mounted to a 2 1/2" strip of 3/4" plywood. This is screwed (pocket holes) to a larger plywood base.
The styrofoam block is 16" x 5 1/2" x 2" thick. I cut 4 pieces of 1/4" plywood (5 1/2" x 2") to create mounting points for the head and body. The top and bottom pieces are drilled to accommodate the syringe mounts. The other 2 pieces are inserted into the foam block and the top and bottom are screwed into them. The arms are just poked into the top corners of the block. His right arm kept falling off the spike so I secured it with a piece of wire drilled through it. I looped the coat hangers from the motor through the wrists to bring it all together. The drum sticks are held in place with rubber bands. The skull has a hole in the base that I widened to accept the neck syringe.
I held the vacuum upright with a piece of wire wrapped around the shaft and base. (This also makes a nice musical instrument by plucking the wires and changing the tension by moving the shaft.)
Step 2: Build Some Band Members - Part 2: Guitar Player/Singer (Grave Grohl)
This whole project started when I came across an old printer carriage. I thought there had to be some way to make it work for my skeleton rock band idea for this Halloween. He is an old hanging plastic skeleton prop that is only the head and arms with fabric draped over it. I hung the skeleton and the guitar from a microphone stand. The printer carriage is attached to the guitar neck using zip-ties. The motor is wired to 2 relays which will reverse the polarity to the motor every time the relay is activated. This sends the carriage up and down the neck. With a piece of stiff wire, a rubber band, and a skeleton glove, it becomes the skeletons fretting hand. The video shows my very first version of this setup using micro-switches, a 555 timer, and a 12 volt form C relay. Now the Arduino replaces them all. Since the jaw is hinged, I thought he should sing as well. I attached a servo to the base of the skull using an old metal coffee can that I formed into shape with tin snips and a hammer. The servo horn is connected to the back of the jaw bone with a stiff wire so that when the servo moves, it opens and closes the mouth. The servo is wired to terminal 9 of the Mega. The code monitors the Left Channel voice only output of the audio file and translates it into servo movement. The eyes light up and flash along to the music with two 12 volt LEDs (T10 automotive LEDs). These are wired through an NPN transistor so that the PWM output of the Arduino can control the brightness of the 12 volt LEDs. (Note: the diagram in the photos shows it wired to terminal 13 of the Uno. In my setup it is going to terminal 10 of the Mega, which is the right music channel.)
Step 3: Bass Drum Light Show
I started this before I even thought about using an Arduino, so it is pretty much self contained. It consists of ten 12 volt T10 automotive LEDs wired to a CD4017 decade counter chip and a 555 timer. There is a variable resistor to control the speed of the flashes. The Arduino controls this by activating a relay which sends 12 volts to this setup.The diagram shows resistors for each of the LEDs (R2 - R11), but since I'm using the 12 volt T10's, these are not needed.
The setup is just a light chaser circuit. Position the LEDs in the order you want them to flash and your show is ready to dazzle. The nice thing is that changing the design of the show just requires moving the wires on the breadboard. I like the pattern I have now, but you can choose any pattern you like. You can add more LEDs if you link up another CD4017. 2 decade counters would give you 18 LEDs. I learned a lot from this link http://www.brighthubengineering.com/diy-electronics-devices/87667-build-an-interesting-light-chaser-circuit-by-cascading-4017-ics/
You can also check out this instructable by jensenr30 at https://www.instructables.com/id/16-Stage-Decade-Counter-Chain-Using-two-4017-Chi/.
Step 4: Arduino UNO - Sound Board
I'm using the Uno to play the music file(s) through an SD shield. I'm using the SimpleSDAudio library to play the ASF stereo files through PWM outputs 9 and 10. I found an old headphone jack that I soldered connecting terminals onto. This is the audio output to connect the powered speakers to. It plugs into the breadboard and is wired to outputs 9 and 10 through some resistors and capacitors as shown in the SimpleSDAudio Base Minimum example. Pin 9 ---100 uF capacitor ---10k resistor---Right Channel input on jack---1k resistor---GND. Pin 10 is wired the same way to the Left Channel input on the jack (if you want to monitor the voice only track).
Pin 2 is set as an output and wired to input pin 50 of the Mega.
Pin 7 is configured as an input_pullup and wired through the button to ground (to be replaced with a welcome mat switch)
The sketch is based on a modified version of the Bare Minimum example included with the SimpleSDAudio library.
The first version of this sketch, "BooFrightersAudioUNO", plays a file on the SD card called "skel.asf". You can either name your file skel or change line 26 to the correct file name.
The new version, BooFrightersRandAudioUNO", selects a song randomly from the SD card. All of the file names are numbers. For example, I renamed "skel.afs" to "1.afs", the next song is "2.afs", and so on. Line 31 in the sketch has to be changed to determine the number of files to choose from. Right now I have 2 songs for testing purposes. Line 31 reads:
fileToPlay = random(1,3);
1 is the first number of the random sequence and 3 is the highest number plus 1. If you have 10 files to choose from, the second number would be 11.
The next line of code converts the number into a string and adds the file extension.
sprintf(AudioFileName, "%d.afs", fileToPlay);
The next line sets the file name to play.
I am using random seed from analog pin 0 to have a truly randomized play order.
Step 5: Arduino Mega 2560: the Everything Else Board
This board is triggered on pin 50 by the UNO when it plays music. The relays are activated and the animation starts.
The pins are configured as follows:
0 = analog pin used to connect the music input
10 = output for eye LEDs
22 = output for relay 1 - light show power
23 = output for relay 2 - fret hand motor power
24 = output for relay 3 and 4 (tied together so they activate simultaneously) polarity reversal for the fret hand motor
26 = output for relay 5 - servo power
27 = output for relay 5 - drummer motor power
50 = input from UNO board
My board has the pin 13 smd LED on when powered up, so I just turn it off in the sketch by setting it as an output and writing it low.
Both motors are powered off of a single 12 volt power supply with a variable resistor in-line to control the speed. The LEDs are powered off of their own 12 volt power supply.
Polarity reversing relays 3 and 4 are wired as follows:
- 12 V GND to common relay 3 (wired through relay 2 N/O to shut off the power)
- 12 V POS to common relay 4
- N/O relay 3 to N/C relay 4
- N/O relay 4 to N/C relay 3
- N/C relay 3 to 12 V GND to motor
- N/C relay 4 to 12 V POS to motor
The sketch takes care of the timing for the polarity reversal.
I randomized the polarity reversal interval so the fret hand moves in a more natural fashion, and I also added relays 7 and 8 on random activation to control more lights.
Step 6: Music File Preparation
For separating the vocal channel from the music, I edited it in Adobe Audition, but any audio editor should be able to work. I just highlight the parts of the left channel with no vocals and mute those sections. The right channel stays untouched. I then save this file as a WAV file with the following format:
8,000 kHz, 16 Bit, Stereo 31 kB/sec
This file is then processed using the tools in the SimpleSDAudio library. Download the SimpleSDAudio library in step 4. In the tools directory, there are 3 folders and a readme file. Open the "Arduino with 16 MHz" folder and copy the file, "FullRate@16MHz_Stereo.bat". Go back to the "tools" folder and paste it into the "sox_win" directory. Now open the "sox_win" folder. You can drag your WAV file into the "FullRate@16MHz_Stereo.bat" file to start the conversion process. If all goes well, it will prompt you to press a key. It places the converted file into a folder called "converted". Copy the new .ASF file to the root of your SD card. Be sure to delete the "converted" folder before the next conversion or you will get an error.
The attached video is one of the songs I re-wrote for the occasion. It's a Halloween version of the Foo Fighters song, "The Best of You". This version is called "At Rest in My Tomb".
Step 7: Enjoy the Show!
Once the band members are assembled, the boards are wired, and the sketches are uploaded, you can sit back and enjoy the show. Just press the button and watch as things go as smoothly as possible... or not, as you can see in some of these out-takes. The last video is the full show. Have fun!