Take a crappy toy and make it less crappy, using an Arduino, LEDs, a servo, and minimal tools. In my case, the toy-in-question is a late 90's vintage Jabba the Hutt. It's been sitting in my office for some time and frankly, I never really liked it. I'm pretty sure I picked it up cheap back in my "buy everything Star Wars that wasn't nailed down" days. The likeness is based on the previously-deleted-but-now-restored scene in Star Wars: A New Hope that features a computer-generated Jabba talking to Han Solo in the Millenium Falcon hanger. The bad CGI alone qualifies this for "crappy toy" status.
I'm going to use a servo to move the head back and forth and animate the eyes with two red LEDs.
Jabba main body is two molded plastic halves joined together with adhesive (or maybe heat-welded). I used a hammer, screwdriver, and scratch awl to work my way into the seam and gradually split it open. In the process I broke some internal supports as well. Just go slow -- I bloodied at least one knuckle getting it apart. Remove the head and then split it open as well. Remove the tail and the connecting "ropes" that make the tail move when the head is rotated.
(Originally I'd hoped to keep the tail and have it animated along with the head but I stripped the gears on a servo when I tried this, so the tail was eliminated from the final product.)
Once the body is "gutted", hot glue the halves back together. Electrical tape may also be useful here (hey, I'm not paid extra for pretty).
I bent two small red LEDs as shown in the picture and soldered their negative leads (the short ones) together. To each of the positive leads I soldered a 330-ohm resistor.
Then I soldered a long piece of jumper wire to the (combined) negative terminals that will connect to the system's common ground. I did the same to the other lead of each resistor, for a total of three jumper wires coming out of the head.
I drilled a small hole in the head's base and ran the wires out of it.
I used hot glue to secure the LEDs in place, then put the two head-halves back together with hot glue.
I attached the 2-blade servo mount to the servo, securing it in place with the included very-tiny screw. I used the other two screws to attach the servo mount to the bottom of the head's swivel base.
I cut a small piece of foam-core posterboard the size of the "hold" where Jabba's neck used to be and hot-glued it to the body. The base of the servo is hot-glued to the foam-core.
Use the following connections to the Arduino:
In this phase of the build, the head swivels from side to side and the eyes "blink" without any external control. The Arduino code is below.
In this part, I add the following:
I found a scrap piece of clear acrylic (also known as Plexiglass) and cut it using a hacksaw to be approximately 1 inch wide by 1.5 inches long. I drilled a hole in one end large enough to through-mount a pushbutton and then hot-glued the whole thing to a convenient spot (see the picture).
You know that spot where Jabba's tail used to be? Yep, it's perfect for adding a potentiometer. I had to cut a slot out of the top for the shaft to stick through (see picture). The whole thing is, again, secured with hot glue.
The potentiometer's middle lead is connected to analog pin 5 (A5). One outside lead is connected to +5; the other is connected to GND. (At this point, I'm running out of GND pins on the Arduino itself so I've jumpered across to a breadboard to add more GND connections. It is also helping me to organize other connections now, too.)
One lead of the button is connected to ground, the other to Arduino digital pin 3.
The code for this phase of the project is below:
In this part, I add a light sensor and use it to make Jabba "nervous" when something gets closer to him.
Step 3.1: Build the light sensor
I took a photoresistor and soldered a piece of red jumper wire to one lead, a piece of green jumper wire and a 100K-ohm resistor to the other lead, and a black jumper wire to the other lead of the resistor.
The photoresistor is an analog sensor, so the red wire is connected to +5V, the green wire to analog pin 0, and the black wire to GND.
Now, in response to varying light levels, Jabba's eyes blink slower or faster. Exciting, huh?