I was unsure what direction to take my pet trick originally. I started with the light alarm (mentioned in an earlier post) and considered just adding a speaker. From there, I was stuck between two ideas: a model elevator, or another idea that will be manifest in a future project (altered bubble machine). With some help, I was convinced that I could make an elevator model.
This involved several trips to Home Depot, and also a trip to CVS (who knew that Sewing kits with spools were so hard to come by?) My materials included:
3 2×6
Numerous nails
Hot Glue
String, and later elastic material (THANK YOU IVANA!)
1 sheet of metal (I thought it was Zinc, turns out it was galvanized steel…not good for soldering)
2 cans of frosting spray ( I broke one, and in my obsessiveness needed to make another last minute trip to Home Depot)
3 Lightbulbs
3 LEDS stolen from Christmas Lights
2 DC motors (stolen from a used old VCR found on the street)
Wire / solder
I decided the frame would be 9.5″ x 11″ x 24″ which allowed for a shaft of 8″ x 9.5.” These dimensions were based on an initial desired height of 2′ followed by reasoning through logical use of the remaining material. This is one side of the frame.
Materials round up (and the other side of the frame).
Measuring for the original elevator. My initial design had an elevator 3″ x 3″ x 6″ but with the small size of the motors, my limited material, and my inability to get it quite right the first time (and therefore not enough material) I instead went with an elevator that was 1.5″ x 1.5″ X 2.5.”
Besides the unused elevator design, this picture also shows my first test attempts at wiring the DC motors. I did not know about the H-bridge (often used to control the DC motors), but I figured that I could flip the pins on the board myself. I would just use one side as ground and the other on, flipping these two when I desired it. It worked in small scales for a short time, but the arduino was less than pleased when I tried to use this method, which also was a result of the lack of current for each pin port (40 mA). I solved both problems by just electing to wind the motors one way (up) and letting gravity handle the other way (down). Also using multiple digital pin ports connected in Parallel worked quite well not only to create enough amperage to move the motors, but by turning some of the pins off, I can balance the elevator at whatever level.
Two DC motors, one on each side pull the elevator up. The white foam is supposed to act as a guard to contain the winding material only on the thread spool, but the motors would often overcome them and wrap around the pin of the motor anyway (this is still a problem). Two things in this picture were later removed: the stationary point for the elevator cable ( the nail on the left) and the actual elevator cable material (the string). The first was removed because of the material of the elevator and my way of attaching it. Originally I thought that I would be able to run the string from a stationary point, down through the elevator, and then up to the winding motor. Ideally when the motor spun, it would pull the string from the stationary point, raising the elevator evenly spread across the material as it flowed through the holes. There was no flowing, probably because the holes were punched through metal and sharp. The string would get caught on the hole, and refuse to budge, or begin to unwind. Both of these caused the string to be ditched for elastic material (again, THANKS IVANA!).
Suspended elevator and the beginnings of the wiring.
New elastic material and a button to control the motors
Wiring up the LEDS on top of the elevator.
Here is my code:
const int motorPin = 2;
const int motorPin1 = 3;
const int motorPin2 = 4;
const int motor2Pin = 5;
const int motor2Pin1 = 6;
const int motor2Pin2 = 7;
const int analogInPin = 0;
const int LEDdown = 10;
const int LEDstay = 11;
const int LEDup = 12;
int sensorValue = 0;
void setup(){
Serial.begin(9600);
//motor pins
pinMode(motorPin, OUTPUT);
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
pinMode(motor2Pin, OUTPUT);
pinMode(motor2Pin1, OUTPUT);
pinMode(motor2Pin2, OUTPUT);
//LED pins
pinMode(LEDdown, OUTPUT);
pinMode(LEDstay, OUTPUT);
pinMode(LEDup, OUTPUT);
}
void loop(){
//read the sensor value
sensorValue = analogRead(analogInPin);
Serial.println(sensorValue);
if ((sensorValue > 300) && (sensorValue < 700)){ //motors turn on, but with only enough current to hold place
digitalWrite(motorPin, HIGH);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
digitalWrite(motor2Pin, HIGH);
digitalWrite(motor2Pin1, HIGH);
digitalWrite(motor2Pin2, LOW);
digitalWrite(LEDstay, HIGH);
digitalWrite(LEDup, HIGH);
digitalWrite(LEDdown, LOW);
}
else if (sensorValue >= 700){ //motors move the elevator
digitalWrite(motorPin, HIGH);
digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, HIGH);
//motor two turn on
digitalWrite(motor2Pin, HIGH);
digitalWrite(motor2Pin1, HIGH);
digitalWrite(motor2Pin2, HIGH);
digitalWrite(LEDup, HIGH);
digitalWrite(LEDdown, LOW);
digitalWrite(LEDstay, LOW);
} else { //motors are off, "down" LED is on
digitalWrite(motorPin, LOW);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
digitalWrite(motor2Pin, LOW);
digitalWrite(motor2Pin1, LOW);
digitalWrite(motor2Pin2, LOW);
digitalWrite(LEDdown, HIGH);
digitalWrite(LEDstay, LOW);
digitalWrite(LEDup, LOW);
}
}
Each motor has three pins to generate enough current. When the force sensor is pushed down hard enough (beyond 700) the elevator rises and the “up” LED goes on. If the force sensor is pushed between 300 and 700, the elevator holds it place (owning to the motor still spinning but not having enough power to raise the heavy elevator) and the “stay” LED goes on. If there is little force on the sensor ( less than 200) the “down” LED comes on and the elevator takes advantage of no upward force and gravity. One final modification I plan to make before presenting this project is to add my spray glossed broken incadescent lightbulbs over the LEDs to add one more touch in the hopes of that ancient elevator feel. Also, there is no door which greatly helped during construction and allowed for the current rider (a rubber finger puppet from Party City. (THANKS AVERY and JAMIE!).
Walaa! Sideways though it is, I needed to get both the lights (though dim) and the full elevator shaft in the video. (THANKS WILL!)
Stupid Pet Trick = complete (almost). I get to show it off in class tomorrow/today. I will add a final picture plus lightbulbs and a video including the fun finger puppet tomorrow after class.




Nice explanation of the process. The videos and pics help. Next step: work on making the interaction more detailed. How can you give the user an interface to choose direction, floor, etc?