Introduction: Intelligent Talking Skull -- Vinnie
This project is one of many that supports our annual Halloween display. For the full background, if you haven't read it, see the Instructable for an overview of what we do. Its not necessary but it may provide some context and shares some important lessons learned as we developed our props.
Adding some talking and singing skeletons has been on the list for years. We weren't content with store bought laughter and blinking red led eyes. (Although we did buy one and take it apart). We needed something that fit the theme and was a home-built project. Meet Vinnie. He is the prototype and basis for our future skulls and skeletons.
Vincent or Mr. Price is probably a more appropriate way of addressing him but Vinnie is easier. This prop is a recording of Vincent Price reading Edgar Allen Poe's "The Raven". Its about a 2 1/2 minute MP3 file that is processed live; there are no pre-programmed or scripted movements of the skull. As the file plays, the sound is processed and converted into appropriate movements of the skull's jaw. The better part of it is that the program starts with a default range of motion and records highs and lows the first time the file plays. It then re-calibrates the best range of motion for the file and loops 2 and on have a better accuracy and representation. Is he perfect? No, but he is hitting believable and appropriate motion at 90% or better.
In addition to the famous poem, Vincent Price did a movie of the same title in the 60s so that linked it nicely to the overall theme. More importantly, there is minimal background effects on this clip which allowed the sound processor to react mainly to his spoken voice. Key to any related implementation is clear vocals without background music or effects. Don't expect lip syncing to a song; there is no way to differentiate the music and voice. To the processor, its just something in the frequency band. The second video is a live radio broadcast of the Nationals at Cubs on August 12 2018. There is a little more flutter from the crowd noise and it needs some tweaking to improve, but still a pretty good effect overall.
We stared by building our own band pass filter to zero in on the voice range and then found a chip (of course) which had seven filters on it so we could work on seven different ranges. Then we found a board which implemented the chip and voila.
The basic theory here is that the spoken voice will fall in a predictable range of frequency. Deeper voices like Vincent Price in lower ranges and higher voices in higher frequencies. Of the seven ranges (there is overlap - see the spec sheet if interested) roughly four have significant voice activity. We ran the file through many times to see where the activity was. The sound processor returns 14 voltages (7 bands x left and right stereo) and we map that to a servo angle which opens and closes the jaw. We added some code to make the movement appear more natural and reduce flutter. The sound can be processed much faster than the servo can get to position so we slowed the sampling down again for a more natural look. Enjoy.
Step 1: Collect the Materials
Skull or Skeleton. These are lower end, not the more expensive Bucky you can find on-line. We’re talking 4 for $20 bucks at Target. $40 for the full skeleton which uses the same skull. Costco and Home Depot (probably others) sell essentially the same thing. Last year Costco’s version was a pirate and had only one eye but was otherwise the same.
Arduino Uno or compatible.
9V Power Supply for the Uno.
Jumper Wires. Mainly use 3" but 6" is ok too. Space is limited and you want to keep wires clear of the servo.
Capacitor We settled on 470 micro farad. This really helps smooth out the current draw when the servo activates which gave us better results when sampling the frequency bands. We did not do the math to figure out what the best size to use might be. These are relatively small, we had them around, they worked, and it was consistent with some discussions we found on-line. Larger will work but they take more room and space is tight. No idea how small you can go.
Breadboard. You need a small one that fits on top of the Uno.
Radio Shack Standard servo or equivalent. Analog 180 degree is all you need. Note: If you use a different servo you may need to change the code mapping to servo angles. This is a counter clockwise rotation servo. As it goes from 0 to 180 it rotates counter clockwise. This means 0 is jaw closed and 100 is fully open. If you use a clockwise servo, you will need to change the code.
Items from eBay or Amazon
- WT588D Sound Module
- MSGEQ7 Breakout Board. We got ours here . This is a great board. Clean, well put together and far easier than building it yourself. We used the stereo board for compatibility across other projects and to support future two-skull conversations. If you want to save 5 bucks, get the mono version.
- 3.5mm Stereo Audio Female to Terminal Block. Small breakout from a standard 3.5mm audio connector to a 3 wire terminal block. Makes life easier to interface with speakers, audio cables, and the breakout board. Might need one of each or use two male connectors.
- 3.5mm Stereo Audio Male to Terminal Block. Male version of above. Need one or two of these.
- Servo mount. 3D print it. This was much easier to work with than trying to rig up something. Have a few made; you’ll want them around. This is not our design; here is the link https://www.thingiverse.com/thing:299636
Speaker. Old computer speakers will do it. The sound module can drive a 3W 4/8Ohm speaker but that wont cut it.
Hinge. Home Depot; smallest they have is ¾”. Hobby shops may have smaller. To attach the piece of the skull you cut out.
- 2/56 Ball Linkage – we used Du-Bro 181. Look on-line or at a local R/C hobby shop.
- E/Z Connector. This attaches to the servo horn. We used Du-Bro 121.
- .072” rod. Connects the servo horn from the easy connector to the ball linkage. Look on-line or at a local R/C hobby shop. Do not get the fully threaded rod; use only unthreaded or the version where the first inch is threaded.
Block of wood to mount the servo. 1x2 is perfect. Just cut a 1” piece off and the servo fits perfectly on it.
Step 2: Prepare the Skull
If the skull is part of a full skeleton, you can leave it attached or remove it and put it back later. Our first one we worked on was bought as a separate skull and we removed a skull from a skeleton and attached the one we were working on.
About 2/3 of the way back, across the top of the skull is a faint production seam from the molding process. Find where it intersects the bone plates on the left and right side. Using tape or a marker, draw a straight line across the back of the skull.
Using a hack saw or Dremel tool, cut the back of the skull along your tape or line. Cut along the production seam down to the back cut.
Use sand paper or a file to remove the plastic burrs.
Step 3: Prep the Jaw
The graphic box is 2.4” square. That will generate an accurately sized template when you print it. Print the template on regular or slightly stiff paper. The underside of the upper jaw has many contours. It doesn’t need to conform 100% but it can’t be rigid either.
Remove the lower jaw. Line the template up with the underside of the upper jaw area below the left eye. The hole to drill is approximately 1 ¼” from front and side of upper jaw. Drill ¼” hole for the control rod.
On the left side of the lower jaw, Mark a spot ½” along a line from point to point. Drill a 5/64" hole for the ball socket. Attach the ball but not the socket. The ball goes on the inside of the jaw. It will thread itself into a 5/64” hole but attach the nut on the outside anyway. Reattach the jaw.
Step 4: Setup the Servo
If using a skull already attached to a skeleton, the top of the spine comes through the molded mark here. Everywhere we talk about the molded mark, reference the hole if you took the skull off or the top of the spine. Use the molded mark as a reference; if attaching to a skeleton, that is where the spine should be. If mounting on something else, that’s where it comes through. The servo will mount just forward and to the left of that molded mark.
Attach the servo mount to the block of wood with 4 6 x 1/2” flat head wood screws.
Attach the servo to the mount with 4 6-32 x 1/2” machine screws. The servo should be outside the U shaped part of the mount.
Attach an E/Z connector to the servo horn. Attach the horn to the servo so the E/Z connector is about at the 4 o’clock position when the servo is at 0 degrees.
Attach the ball socket to the threaded end of the .072 wire or solder the brass coupler to unthreaded wire and then attach the ball socket. The threads self tap into the plastic socket.
Cut the .072 rod so the distance from the ball socket to the end is about 3 ¾”. The wire cuts with typical sheet metal shears.
Attach the rod assembly to the servo horn through the E/Z connector.
The servo horn should be about the 4 o'clock position on the shaft which will align with the jaw being fully closed.
Place a mark on the underside of the skull approximately 1 1/2 inches forward of the molded mark and to the skulls left. This is not critical. By holding the servo assembly in place inside the skull you will be able to see and feel where to drive the screw.
Position the servo assembly inside the skull so the back right corner of wooden block just touches the molded mark. Fish the ball socket through its hole towards the jaw but don't connect it.
Drive a #6 x 3/4” wood screw through the bottom of the skull into the block to secure it.
Loosen the threaded set screw on the EZ connector so the rod slides smoothly.
Attach the ball coupler to the ball on the jaw.
Close the jaw, allowing the rod to slide through the EZ connector. Tighten the set screw.
Step 5: Load Your Sound Files
This build uses a Waytronics WT588D sound module. As we said in the Halloween overview, its pretty good but a little quirky. There are multiple Instructables as well as lots of other references to how to use them. Here are a few highlights:
- You need a special programmer unless you get the 28 pin version which has a USB port
- You need to use Waytronics software to load files
- It uses WAV files for its audio source
- Since its mono, only one speaker port should connect to the audio in on the MSGEQ7 board
Use Audacity to play with the files. Lower sampling rates reduce file size but affect quality. Use what sounds good and fits on the module. Test the module before you put everything together. You can test the files in the programmer simply by attaching a speaker to the programmer and pressing the black buttons which correspond to play keys. Or give it power, speakers and drop the KEY pins to ground.
Step 6: Build the Circuit
This is a lot of wires in the smallest space you can get it. A small breadboard is preferable to letting everything hang and is essential if you use the capacitor,
The table show the relevant connections between the components. A small breadboard (we used a 300 pin, 5x30x2) that its on the Uno is a must. Alternatively, use a screw shield or proto shield to help keep the wiring under control.
Wire the capacitor in parallel with the power to the servo.
In the pictures, you can see the green/black screw terminal adapters we mentioned in materials. They are a huge help when going from .2.54mm wiring to audio components. The female jack allows you to plug a standard 3.5mm audio plug into it and the male version connects easily to the MSGEQ7 (not needed if you ordered the MSGEQ7 without the audio jack).
Remember, however you physically lay it out, it needs to fit inside the skull and not interfere with the servo.
TIP: Servos typically come wired with a GRD, VCC, Signal female connector. We build a matching male connector coming off the board so there is only 1 plug per servo to connect. That and color conventions will minimize the risk of bad connections.
If you change up pins on the Arduino, remember to change the pin assignments in the code.
Step 7: Light Up Your Display
This step is so optional we aren't currently using it but the capability was built and the code for it is still in the next step so we will go over it. What we wanted to do was have a bottom lighting effect that turned on and off when Vinnie was speaking. We opted instead to just keep him illuminated at all times while he sits in his chair. We kept the code but stopped connecting a lamp to the Arduino with no ill effects.
KISS was the over-riding protocol on this one. For spot illumination, we use cheap LED headlamps. They can be bought in 3 packs for about 9 dollars. Some are multicolor, we went with a Home Depot Defiant version that is white only. For constant illumination, just turn them on to the mode you want, position, and walk away. They all even come with batteries.
They all pretty much work on the same principal; as you press the On/Off button, it causes the interior circuit to drop to ground which cycles it to the next mode. Ours has 3 modes (center light, outside lights, and all lights on) so 4 presses of the button cycles from Off through the 3 lit modes and back to off.
Depending on what you use, the specifics will vary but the principal is the same. Open the back panel to get to the battery compartment. Remove the batteries. Under the batteries are small screws which hold the battery compartment to the frame. Remove the battery holder and you should see the circuit board. You'll the trace lines that connect to ground and to the blob IC that controls the lamp.
In order to control the button press process with an Arduino, simply solder a wire to one side of the button and connect this to a digital pin on the Arduino. (We had to remove the small rubber button cover and ran our wires through that gap). The other side of the button is ground and gets connected to ground on the Arduino. Simulate pressing the button by cycling the connected pin to ground and its done. If you end up with a single mode light, there is no issue; cycle to ground turns it on and off. With multiple modes, you need to tell it how many to times to push it to get to the mode you want. Depending on the mode you chose then determines the number of times to press the button to cycle to off. That's what the lite_On and lite_Off code handles.
Totally optional but its a handy trick to have available. TIP: As the batteries weaken, the cycle performance drops off. Fresh batteries solves the problem.
Step 8: The Code
This code uses a counter clockwise rotation servo. Use care and adjust accordingly if using a CW servo. See our note in the main Halloween Instructable.
Portions of our code are derived from sample code available with the breakout board and includes their copyright and redistribution notice.
The basic logic here is pretty straight forward:
- Start the sound module
- Read each frequency band in-turn
- If its the ONE that controls the servo, map the returned voltage to a degree setting and move the servo to open the jaw.
- Move the servo back to almost close the jaw
- Repeat at 2
We are also doing some additional processing first time through. The code has default mappings for what constitutes a fully open jaw and a fully closed. Lots of variables affect how well they work. So first time through a sound clip, it records highs and lows and re-scales the mapping with iteration two and on. This presupposes a single file is running or that multiple files have similar sound characteristics.
The code can execute and the sound processor can run much faster than the servo can adjust. Too fast and the jaw will simply shake open and closed slightly as it gets new commands before it has reached a target setting. If you need to adjust the degree settings, do it gradually and test. The jaw can move from fully open to fully closed in about 90 degrees of servo rotation. The servo can push the jaw so wide that the jaw pins will pop out of the skull.
We achieved much better results with the added capacitor for the servo and encourage its use with servos. See the note in our Halloween Instructable.
Feel free to ignore the light code.
Step 9: Put It All Together
Attach the removed skull section with a small hinge. As you can see in the picture, it doesn't take much. Although it kind of sticks out in the picture, the hinge is not noticeable from the front and since the display operates at night you get the added cover of darkness. Cover with tape or a little paint if you'd like. Since the cuts were made on seams, the skull piece will stay closed and not be visible when he is running.
If you removed the skull from a skeleton. you'll need to reattach. While you can slip it back over the knob at the top of the spine, we recommend using a 1/4" bolt and fender washer but its up to you. The spine is in two pieces and is hollow. Loosen the screws to separate the halves and insert a bolt if thats what you desire. See the picture for how we set it up, You can use a similar system if putting it on a post, pike, or similar object. However you attach it, make the connection at the molded mark/spine entry point. That will provide balance for the skull, stay clear of your servo and allow freedom of movement of the jaw.
We zip tied a small speaker inside Vinnie's breast plate. Its connected into the skull with a small 3.5mm audio cable. Put your speakers wherever makes sense. Ideally, a speaker inside the skull would be great but we haven't cracked the code for how to have a small, amplified speaker that sounds good.
Insert the assembled Arduino and breadboard into the skull. TIP: We zip tie the breadboard to the UNO. Connect 9V power to the Uno, a 3.5mm audio jack to the speakers and soundcard, and lastly the servo.
Participated in the
Halloween Contest 2018