Candy Tossin Coffin
Major parts include:
4.5 rpm motor #155821 Jameco.com
1.8 rpm motor #176050 Jameco.com
Two shaft couplers #162270 Jameco.com
Servo motor #358635 Jameco.com
Arduino microcontroller #2121105 Jameco.com
Four limit switches #275-0016 Radio Shack
One Toggle Switch #275-652 Radio Shack
Three diodes 1N4004
Two Red LED's
Five White LED's
Wood, wire, screws
3 feet aluminum trim channel for 1/4" plywood (or something else stiff for the ghost spine)
If you choose to build without the "candy flinging arm," you can eliminate the microcontroller and servo motor (everything to the left and above the red line on the schematic).
4.5 rpm motor #155821 Jameco.com
1.8 rpm motor #176050 Jameco.com
Two shaft couplers #162270 Jameco.com
Servo motor #358635 Jameco.com
Arduino microcontroller #2121105 Jameco.com
Four limit switches #275-0016 Radio Shack
One Toggle Switch #275-652 Radio Shack
Three diodes 1N4004
Two Red LED's
Five White LED's
Wood, wire, screws
3 feet aluminum trim channel for 1/4" plywood (or something else stiff for the ghost spine)
If you choose to build without the "candy flinging arm," you can eliminate the microcontroller and servo motor (everything to the left and above the red line on the schematic).
Using 1" x 2" wood, assemble the base. Top and bottom pieces are 18" long. The widest spot is 24" wide. Use a piece of 1/4 inch wood rod and glue to attach the joint between the upper and lower pieces.
Add 11 1/2 inch upright pieces (using wood screws and glue) to form the shell of the box.
Install a cross board to support the motor, 7 1/2 inches from the end.
Mount the motor on the cross board.
Drill two 3/32 inch holes in the coupling shaft and create threads for 4-40 screws with a tap.
Note that I used a yardstick for the ghost spine. This worked for a while, until (during testing) the yardstick failed to contact a limit switch and the torque from the motor split the yardstick into pieces. I suggest using some sort of aluminum channel or angle for the upright piece (I used trim channel).
Attach the shaft coupler to the spine.
Note that I used a yardstick for the ghost spine. This worked for a while, until (during testing) the yardstick failed to contact a limit switch and the torque from the motor split the yardstick into pieces. I suggest using some sort of aluminum channel or angle for the upright piece (I used trim channel).
Attach the shaft coupler to the spine.
Cut a 12 inch long section from a yardstick. Attach a piece of aluminum angle in the center and drill the angle to bolt to the "spine" of the ghost. At the end of this arm, using double sided tape, attach a servo motor.
Attach this arm to the spine. (Remember, I started with a wood spine and wound up with an aluminum one--I strongly recommend aluminum).
Solder the LED's together (as shown in the schematic), then insert them in a 6" diameter foam ball. Push the end of a yardstick into the ball as a "neck." Glue (white glue) the stick to the foam ball. I used the wood neck even when I changed to an aluminum spine--wasn't sure how to glue aluminum to foam.
Take an 18 inch by 6 1/2 inch (sloping at the sides) piece of 1/4 inch plywood and mount the DPDT switch in the center close to the edge.
25 inches from the bottom, place another cross board. On this board, mount one of the limit switches (in the center).
Mount a "switch pusher" to the spine at the right place to operate the toggle switch.
Create another assembly using a 21" long piece of yard stick and the 4.5 rpm motor. This will be the lid lifter.
Because the yardstick is perpendicular to the base (and the motor support board is not--it is mounted to the angled side boards), the lower limit switch for the lid lifter can be mounted to the motor support board.
When working with the limit switches, I had to slightly enlarge the switch's mounting holes with a drill bit as I could not locate screws with a small enough diameter to work.
When working with the limit switches, I had to slightly enlarge the switch's mounting holes with a drill bit as I could not locate screws with a small enough diameter to work.
Mount the upper limit switch at a point that prevents the yardstick from standing straight up.
Cut two pieces of wood about two inches long and mount the roller type limit switch to one side. Run a rubber band through the roller ball and over to a screw on the second piece of wood. By adjusting the tension and position of the rubber band (by means of screw placement and switch mounting), you can control when the switch (S3, close delay) activates.
This is an important switch in that it prevents the lid from closing until the ghost is almost at rest--but allows the lid motor to operate before the lower ghost switch disables all power.
This is an important switch in that it prevents the lid from closing until the ghost is almost at rest--but allows the lid motor to operate before the lower ghost switch disables all power.
Wire things together and run a test.
When power is applied (by flipping the DPDT switch), the ghost motor is energized and the ghost begins to rise. Power flows through D2, the lid motor and S1 causing the lid arm to rise quickly. When the lid arm reaches the upper position, S1 opens and stops power flow through the lid motor. The ghost motor continues moving the ghost upward (the LED's on the ghost head are forward biased and on). When the ghost spine contacts the DPDT switch and throws it, power is reversed and the ghost motor starts to lower the ghost. The LED's are back biased and turn off. Although power could get through D1, the lid motor and S2, it can't get through the still open contact of S3 (close delay switch). When the ghost spine is mostly reclined, power passes through D1, the lid motor, S2 and S3 and the lid is lowered. S2 opens when the lid lever has reached its lower limit. Shortly after that, S4 opens and power to the ghost motor is removed.
When power is applied (by flipping the DPDT switch), the ghost motor is energized and the ghost begins to rise. Power flows through D2, the lid motor and S1 causing the lid arm to rise quickly. When the lid arm reaches the upper position, S1 opens and stops power flow through the lid motor. The ghost motor continues moving the ghost upward (the LED's on the ghost head are forward biased and on). When the ghost spine contacts the DPDT switch and throws it, power is reversed and the ghost motor starts to lower the ghost. The LED's are back biased and turn off. Although power could get through D1, the lid motor and S2, it can't get through the still open contact of S3 (close delay switch). When the ghost spine is mostly reclined, power passes through D1, the lid motor, S2 and S3 and the lid is lowered. S2 opens when the lid lever has reached its lower limit. Shortly after that, S4 opens and power to the ghost motor is removed.
Take a 7 inch long piece of 1/4" wood rod and wire it to the servo motor horn.
Drill a hole and attach a small plastic cup piece or container to the end of the arm.
Code
Mount the Arduino and wire it as indicated on the schematic.
Code for the Arduino is:
#include <Servo.h>
Servo myservo;int valm=0;
void setup (){myservo.attach(5);
}void loop ()
{myservo.write(90);
valm=analogRead(0);if (valm>800) {
myservo.write(85);delay (1000);
myservo.write(80);delay (1000);
myservo.write(75);delay (1000);
myservo.write(70);delay (1000);
myservo.write(65);delay (1000);
myservo.write(60);delay (1000);
myservo.write(55);delay (1000);
myservo.write(50);delay (1000);
myservo.write(45);delay (1000);
myservo.write(40);delay (1000);
myservo.write(35);delay (1000);
myservo.write(30);delay (1000);
myservo.write(25);delay (1500);
myservo.write(20);delay (1500);
myservo.write(15);delay (1500);
myservo.write(10);delay (1500);
myservo.write(5);delay (1500);
myservo.write(0);delay (1500);
myservo.write(90);delay (30000);
}else {
delay (1000);}
}
The arm should work as shown in the movie.
Code for the Arduino is:
#include <Servo.h>
Servo myservo;int valm=0;
void setup (){myservo.attach(5);
}void loop ()
{myservo.write(90);
valm=analogRead(0);if (valm>800) {
myservo.write(85);delay (1000);
myservo.write(80);delay (1000);
myservo.write(75);delay (1000);
myservo.write(70);delay (1000);
myservo.write(65);delay (1000);
myservo.write(60);delay (1000);
myservo.write(55);delay (1000);
myservo.write(50);delay (1000);
myservo.write(45);delay (1000);
myservo.write(40);delay (1000);
myservo.write(35);delay (1000);
myservo.write(30);delay (1000);
myservo.write(25);delay (1500);
myservo.write(20);delay (1500);
myservo.write(15);delay (1500);
myservo.write(10);delay (1500);
myservo.write(5);delay (1500);
myservo.write(0);delay (1500);
myservo.write(90);delay (30000);
}else {
delay (1000);}
}
The arm should work as shown in the movie.
Build a coffin "skin" of cardboard and paint it black.
The cardboard "lid" to the coffin is attached with clear packaging tape. This makes a simple low friction hinge.
The cardboard "lid" to the coffin is attached with clear packaging tape. This makes a simple low friction hinge.
Take about a yard of flimsy white cloth and drape it over the structure, trying to stay out of the way of wires and switches.
Load the candy "hand," flip the switch and watch it go.
Load the candy "hand," flip the switch and watch it go.