DIY Animatronic Pumpkins or Fondly Know As Jack-O and The Lanterns
It all started one dark night when we had a thought, why settle for a lifeless jack o lantern this Halloween, why not blow the neighborhood kids away. So we set out to create a Jack O Lantern with a soul!!! Ok really it is just some pumpkins we can programmed to lip sync, mouth or mimic poetry but it is a whole lot of fun still the same. We used a dev board we developed called Minion to make these pumpkins come to life and be completely mobile. (Minion is our Kickstarter project, check it out here http://www.kickstarter.com/projects/minioncity/minion-the-wireless-enabled-dev-board) We also built some nifty software to bring it all together. The tutorial is below but first here is Jack-O and The Lanterns in action!
Would You Go With Me
So what do you need to replicate the project. Here is a list of supplies
3 Funkins (we opted for fake pumpkins so we could reuse them next year)
4 Minion Dev Boards or Wireless radio boards
3 Battery packs
1 Wire Hanger
3 Small perf boards
5v regulators for powering the servos.
GE Color Effect Lights
We started by carving our faces into the three Funkins (yes that is the real brand name of the fake pumkins we bought). The type of face you carve is totally up to you but the simpler the mouth shape we found the better it works. Be careful to keep the mouth cut out all in once piece.
After the shell of Jack Os are created it is time to create the framework for their motion. The servos that we used were ones that we had around from some RC airplane projects. They were 2 or 3 bucks and only have 1.6 kg of tourge. So in other words quick and not super big. If you use a real pumpkin you will probably need beefier servos. We then attached a piece of bent wire (from the wire hanger) to each servo to act as the radial arm opening and closing the mouth. We then calibrated over the range of motion for each pumpkin with just the wire arm. Because of the shape of the pumpkins it was impossible to have each mouth at the exact same angles and servo positions for open and close. Some would open up 50-60 degrees and others only would open up 30-40 degrees. To resolve this we made the software send a 0-100 percent and the minion code in the pumpkins scale it to the range needed for each pumpkin range. For more information on calibrating the open and close positions see near the end.
We hot glued the servo to the inside face of the pumpkin and hot glued a piece of cardboard to the radial arm and then glued it to the mouth piece of the pumpkin. We found that if we glued a piece of cardboard to the mouth piece it added more range of motion kicking the bottom of the jaw out just enough. It also made the mouth less rigid so there was some give if the mouth closed too quickly.
To power up the minion we just needed any power source because it has it’s own power regulator to drop it down to the 3.3v that the minion runs on. The servos and the GE Lights that we used needed 5v for power but the control signal would take 3.3v just fine. So using a cheap small perf board we created a 5v regulator (LM7805) and a connector for the servo and GE Light. Because the spacing of the minion headers match the .1” spacing of both breadboards and perf boards it was quick to make a circuit for the power that the minion just plugged into.
After attaching the battery pack and connecting the Minion we were set to go. Minion was the board that gave us the capability to tell the servos and Lights what to do. We used 4 Minions to control 3 separate pumpkins. One minion was the master and connected to the computer with its USB connector. It took the commands from the computer software and sent them to the other 3 Minions that were inside of the pumpkins. The best part is because the Minion attached to the computer wirelessly transmits data over its own radio we essentially have unlimited storage for the amount of programed actions we want to run because it is storing the data on the computer. The Minions allowed us to make the pumpkins completely wireless, this only made them look even cooler because they can now be placed inside, outside, on the shelf, on the roof, just about anywhere.
Now it is time to send data and bring these guys to life. We played with a lot of ideas on how to get their mouths to move but in the end we decided we want more control to be able to make it more life like. Coding each position by hand seemed like a nightmare to us so we wrote a piece of software to help make recording and playback simple and quick. Using a USB joystick or gamepad the software maps the y-axis to the mouth of the pumpkin in time and creates a file that maps it in time with an audio file. One of the buttons turns the light on and off. The software then is used to play the audio and motions so when you play it back you get lip syncing Jack Os. Not only is it fun to record but it makes for a great karaoke night extra. For a more detailed description of the software see below. (source code is included)
The pc side software is written with Visual Studio 2010 in C#. The source is below in the downloads section.
We used the SlimDX utility to make reading of joysticks and gamepads simple and easy. Without it they are painful to work with in C#. Why C#? mainly because I made development quick. (The software was written on a saturday, the same Saturday that we made all the pumpkins too).
The software has 2 parts. The first part is recording and the 2nd part is playing back.
The recording screen is shown below.
First you need to make sure that you are connected to the master Minion. The com port will be different on your computer but the baudrate is set to what the Minion master code is set at.
Then you need to load an audio file. UPDATE: It now can also play video files, or any files that windows media player recognizes.
Then you need to either load a mmf (Minion Motion File) or create a new one. A new mmf starts out with only 1 minion. The “Add Minion” button will let you add more minions.
If you are all set and ready to record, hit the play button and start moving the joystick. The Minion Pumpkin will move with the joystick so you can see it as you record. Straight up is closed and all the way forward is open.
The software takes a reading from the joystick 10 times a second. If that reading is different from the last reading it records the position (0-100), the time in the music (to the nearest 1/10 of second) and which Minion is currently selected in the drop down.
If you don’t like how it looked (it takes awhile to get use to the motion and be ready for the parts in the music) you can click the “Clear Minion” button. This button deletes all motion for the selected Minion.
Once you have recorded a section, hit stop or pause and click on the play tab.
In the play tab you can either load a mmf to play back with the “Open Motion File” button or if you just came from the “Record” tab it will play what was just recorded.
Hit the play button and sit back and watch your Minion Pumpkin dance to the music.
Go back and record the next Minion Pumpkin and when you to play it back both will move.
Note* Jumping in time in the music while playback is not supported. You got to watch it from the beginning
While recording Jack-O and The Lanterns we decided that we wanted to have a controllable light inside of the pumpkins. We needed a light that was bright enough to light up the pumpkins and yet simple enough to use. We settled on the GE Color effect lights. Each light bulb is controllable from a microprocessor and the RGB values can be set for a truly controllable light. I had a shorter set that I had been saving to try out with the Arduinos so I cut off a bulb for each Lantern and used the G35Arduino library to control them. See the schematic above for how to hook it up. I then modified the commands that are sent to MinionPumpkins to include light controls. 0-100 is the servo positions, 200 is a reset command to set the servo to the closed position and turns off the light.201-212 changes the colors of the light.
The C# application was also modified to let you choose the color of the light. Hitting the first button on the joystick/gamepad turns on and off the light.
The PC software sends 2 bytes to the Master Minion for each recorded point. It sends the MinionPumpkin number and the position to move to. The Master Minion then takes those 2 bytes and puts it into a radio packet and sends it off to all of the PumpkinMinions. Each Minion then looks at the MinionPumpkin number and if it is their number moves the servo. The position byte is just 0-100. 0 being the minimum position and 100 is the maximum position. The MinionPumpkin then looks at its minimum and maximum positions for the servo and uses the input as a scale between them. This way each MinionPumpkin is responsible for making sure it try to move its mouth too far and break it off.
Calibrating the MinionPumpkins
Most servos have between 100 and 180 degrees of motion. The ones I used had around 160. Before installing the servo into the pumpkin move the servo to find where its min and max is. You can remove the servo control arm and put it back on so that it starts at different angles. When the pumpkins mouth is closed we want the the servos control arm to be to be slightly pointing back into the mouth. This gives us room in software to to set the exact position when the mouth is closed.
Now that we have the control arm in the right position lets load up the calibration software into the minion. All this software does is let you set the position of the servo so you can see where the arm. Now you should have a rough idea of where the open and closed positions are.
Now attach the servo to the pumpkin (I used hot glue).
Once dry and before glueing the mouth on try the positions again.
Now glue the mouth on and check your positions again. Once you are happy with the open and closed positions write those numbers down. They will be used when you program add the MinionPumpkin code.
This is the ID of the MinionPumpkin fromt he PC Software. It is zero based. So the first one in the list is 0, 2nd 1, 3rd 2 etc. This number needs to be changed per MinionPumpkin. If it is the same as another pumpkin they will both move together.
const byte PumpkinId=0;
These are the minimum and max positions for the mouth found while calibrating above.