Introduction: Step Motor Elevator
This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com).
Make Course video: https://youtu.be/VQK9tUTn_xs
The idea of an elevator came to me when I was considering to do something similar to freestanding drop towers (like those in theme parks). The concept was bringing a certain object to a determined height and then drop it. Then I thought of buttons to action this movement, and eventually transitioned to building an elevator that would move between at least two floors.
This elevator is different (in concept) to real life elevators when you consider that the motor is not at the top. It is inside the box and has the help of two pulleys at the ceiling to pull the car. I decided to use a step motor instead of a DC Motor because this is my first project (if you think of Arduino and electronics), and I wanted to work mainly with the components that came with the Make Course Kit. The step motor is very easy to configure for this specific project, considering that a certain number of steps will make you move from a certain height.
-------------------------------------------
Brief explanation of how the elevator works: The elevator moves from one floor to another when the Stepper Motor starts rotating. The motor will rotate either clockwise or counterclockwise based on how you want the elevator to move. There is a pulley attached to the motor, and as it rotates, the pulley either rewinds or releases some of the string that is also attached to the elevator.
To keep track of where the elevator is: There is a photocell on each floor. When the elevator gets to one of the floors, the photocell that is on that floor will receive less light. This way the Arduino knows where the elevator currently is, and uses the display to show the current floor.
Step 1: Planning
First, planning the specifics for your elevator. Here are some considerations you should make before starting. These are just some ideas to keep in mind.
- Decide the number of floors you will have.
- Decide how tall these floors will be (this will also be the height of the elevator cart).
I was first working with two floors, hence the yellow column. Here are the specifics of my elevator:
- Three floors.
- The "usable" height of each floor is 7cm.
- The columns that I ended up using are 27cm, the three floors only used 21cm. This is because I reserved the rest of that space for the thickness of each floor/"roof" (where you would stand) and for the pulleys that are attached to the ceiling.
Step 2: Parts
-------------------------------------------
Parts for the "Building"
-------------------------------------------
DC-47P DC Series Heavy Duty Electronics Enclosure - http://www.polycase.com/dc-47p
They provide the 3D model in case you want to modify it and print it (I also provide the one I modified).
See STL file box.stl
Main pulley
Think of a recoil pulley. This is the one that is attached to the step motor. It rewinds or releases some string. This is a 3D printed part. The spaces next to the hole in the middle are to keep the string inside with a knot. This makes it easy to replace the string, and is just better practice than gluing it (as I did with my first prototypes).
See Inventor file pulley_for_motor_bigger.ipt
Low friction steel pulleys - http://www.mcmaster.com/#3434t23/=uzf6ep
You can also print your own. These are more than what you need, but guarantee that it will work. Pulleys printed in ABS work just fine too.
See Inventor file pulley_bigger.ipt
Stainless Steel U-bolts - http://www.mcmaster.com/#8896t118/=uzf67p
These hang the pulleys from the top. You can also print an "arm" like the one posted with the other Inventor files.
See Inventor file arm.ipt
Support rods for elevator (Wood/Bamboo)
These are an option, and are cheap: http://www.amazon.com/Darice-9162-01-Unfinished-N...
You can also try going to a nearby Michaels store (or any arts and crafts store)
Columns
The ones that I am using are 3D printed because I needed to make them hollow. This allowed me to pass the cables through the inside to hide these. However, you can also use Wood Dowels like with the support rods, but with a bigger diameter or simply a squared one.
See Inventor files column.ipt and column2.ipt
Floors
Also 3D printed, but my first prototypes were done with foam boards and balsa because these are easy to cut and work with. Attaching the photocell to these alternatives is not hard.
See Inventor files 1st_floor_roof.ipt and 2nd_floor_roof.ipt
Screws
I am using flat-head #10 screws to secure the parts that I designed. These have worked great: http://www.homedepot.com/p/Everbilt-10-x-3-4-in-Ph...
-------------------------------------------
Electronic Components
-------------------------------------------
Arduino UNO (Rev 3) - http://www.adafruit.com/products/50
The micro controller, of course.
5V Step Motor - http://www.adafruit.com/products/858
This is the one I used. It came with the Make Course Kit and was also enough to suffice the project. There also is a variety of stepper motors you can choose from.
Step Motor Controller (ULN2003 Driver Test Module Board)
This is the controller that comes with the Make Course Kit.
NOTE: You can use this tutorial for an alternative to this module: https://learn.adafruit.com/adafruit-arduino-lesso...
Momentary Pushbutton/Switch- https://learn.adafruit.com/adafruit-arduino-lesso...
I used these buttons for the final assembly. You can use any.
NOTE: Just make sure it is Momentary and NOT On/Off.
Photocell (Photo resistor) - https://learn.adafruit.com/adafruit-arduino-lesso...
Cheaper alternative: https://learn.adafruit.com/adafruit-arduino-lesso...
4 Digit 7 Segment LED Display
I am using this display to show the current floor. Also, I only need to use the 4th digit considering the number of floors that I am using. Since you will only use one digit, you can get something like this: https://www.sparkfun.com/products/9191
-------------------------------------------
*I have included links to adafruit.com because I believe they offer very useful tutorials for most of the components they sell. However, you can also find cheaper alternatives for these components by just searching the web for them.
Step 3: Parts - Inventor Files (+ Others)
These are the Inventor files for all my 3D parts. There is a .STL file for the box that I modified.
There is also a .STP for the 4 Digit 7 Segment LED Display that I got from http://grabcad.com/library/4-digit-7-segment-led-...
*These parts were designed in Autodesk Inventor Porfessional 2015 - STUDENT VERSION
Attachments
Step 4: Setting Up the Circuit
Here you can see a Fritzing diagram of my breadboard circuit and a circuit schematic of it. This is for you to have a reference on how to set it up. There is also a picture of the first fully working prototype.
Some details:
- Resistors connected to the buttons and to the display have a resistance of 220 Ohms.
- Resistors connected to the photocells have a resistance of 10 KOhms. These are pull-down resistors.
Step 5: Putting the "Building" Together
----------------------------------------
Holes you need to drill
-----------------------------------------
For the Columns:
- You need 4 holes in the base (Inventor file base.ipt) to screw the columns in. See image 1.
- You need 4 holes in the roof (Inventor file roof_top.ipt) to screw the columns in. See image 5 (the screws in each corner).
For the U-bolts that support the pulleys:
- You need 4 holes in the roof (Inventor file roof_top.ipt) to screw the U-bolts in. You can see this in the third image of this step.
For the wooden rods that support the elevator (This is to keep the rods and the "up and down" motion fixed):
- You need 2 holes in the middle of the base (Inventor file base.ipt). You can see this in the image 1; there is tape in the middle so that the rods do not go all the way through.
- You need 2 holes in the middle of the roof (Inventor file roof_top.ipt). You can see this in image 4; two yellow pieces sticking out.
For the cables that go through one column:
- You need two holes facing towards the interior of the building (not to the side). One on each floor. See image 3.
-------------------------------------------
Securing the parts:
-------------------------------------------
The Columns, the roof, the floors (roofs), and the base:
This is when those openings on the corners of each floor come into place.
- Screw 3 columns to the base.
- The 4th column is the one through which your cables are passing, and it will stay put with the other "fasteners" (the roof and the floors).
- Slide the first floor's roof (Inventor file 1st_floor_roof.ipt) through the columns that are in place.
- Now slide the second floor's roof (Inventor file 2nd_floor_roof.ipt) through the columns that are in place.
- Slide the fourth column through its respective entry.
- Screw all 4 columns to the top roof (Inventor file roof_top.ipt). See image 5; this is how the roof looks now.
The U-bolts that support the pulleys:
- Screw the U-bolts through the holes you drilled on the top roof (Inventor file roof_top.ipt).
- Pass the thin metal plate that came with the U-bolts through the U-bolts.
- Screw the washers to secure the U-bolts (and the pulleys) at a certain height. See image 4 and 5.
The rods that support the elevator:
- Pass the rods through the two holes you made at the top and align them to reach the two holes at the middle of the base.
Step 6: The Box
Now that your circuit is ready, the next step is to put it inside the box and then close it with the base (that now holds the whole building).
TIP: I used velcro to retain the Arduino, the motor controller and the motor itself to the box. This way it was easier for me to interchange the location of these components if needed. You can also use a glue gun or similar methods.
-------------------------------------------
The motor
-------------------------------------------
Here you can see the stepper motor attached to the Main Pulley (Inventor part pulley_for_motor_bigger.ipt). You can also see that there are two yellow parts around it. Since you really need to make sure that both the pulley and the motor are fastened, you need something that keeps these in place. I recycled the yellow parts from one of my prototypes for the elevator (the car) and used these as fasteners.
-------------------------------------------
The photocells
-------------------------------------------
If you see image 1, you will notice 4 soldered cables. These cables connect the Arduino to the 2 photocells in the upper floors.
-------------------------------------------
The breadboard and the display
-------------------------------------------
I used the smaller breadboard so that my components could fit inside the
box. If you go back to Step 4, and see image 2, you will notice this breadboard.
If you see image 2 of this step, you will also notice that the display is already wired and ready to be attached to the box.
Step 7: The Arduino Sketch
This sketch is my work but it is for you to use and modify, and build awesome elevators with it!
Parts of this code are based on sketches written by Dr. Rudy Schlaf. Thank you Dr. Schlaf.
-------------------------------------------
Things to keep in mind:
- You set the number of steps based on the height you choose.
- The thresholds for the readings of the photocells are also hard coded. You can change this depending on how dark the environment is.
Suggestions/Future improvements:
- The elevator needs to behave more autonomously. If you work on this, try creating a function that gets the readings from both sensors multiple times and calculates an average of the "light" these are receiving. Something of this nature.
- A reset function for the elevator (in case power is lost, or something similar)
- I was going to use a Proximity Sensor to measure how far the elevator was from the first floor for my first prototype and with that determine the current floor. Try it! Sensor should go inside the box and remember that you need a minimum distance for it to work.
21 Comments
8 years ago on Introduction
please help wheen i compiled this project i have error
C:\ARDO\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -IC:\ARDO\Arduino\hardware\arduino\cores\arduino -IC:\ARDO\Arduino\hardware\arduino\variants\standard C:\Users\acer\AppData\Local\Temp\build1197334783793492924.tmp\FJGBBHQI3H7AR3W.cpp -o C:\Users\acer\AppData\Local\Temp\build1197334783793492924.tmp\FJGBBHQI3H7AR3W.cpp.o
FJGBBHQI3H7AR3W.ino: In function 'void setSegments(int, int)':
FJGBBHQI3H7AR3W:6: error: 'numbers' was not declared in this scope
FJGBBHQI3H7AR3W:6: error: 'segments' was not declared in this scope
FJGBBHQI3H7AR3W:7: error: 'segments' was not declared in this scope
FJGBBHQI3H7AR3W.ino: In function 'byte readSwitch(int, long int)':
FJGBBHQI3H7AR3W.ino:21: warning: comparison between signed and unsigned integer expressions
FJGBBHQI3H7AR3W.ino: In function 'void Step_A()':
FJGBBHQI3H7AR3W:38: error: 'stepperPin1' was not declared in this scope
FJGBBHQI3H7AR3W:39: error: 'stepperPin2' was not declared in this scope
FJGBBHQI3H7AR3W:40: error: 'stepperPin3' was not declared in this scope
FJGBBHQI3H7AR3W:41: error: 'stepperPin4' was not declared in this scope
FJGBBHQI3H7AR3W.ino: In function 'void Step_B()':
FJGBBHQI3H7AR3W:44: error: 'stepperPin1' was not declared in this scope
FJGBBHQI3H7AR3W:45: error: 'stepperPin2' was not declared in this scope
FJGBBHQI3H7AR3W:46: error: 'stepperPin3' was not declared in this scope
FJGBBHQI3H7AR3W:47: error: 'stepperPin4' was not declared in this scope
FJGBBHQI3H7AR3W.ino: In function 'void Step_C()':
FJGBBHQI3H7AR3W:50: error: 'stepperPin1' was not declared in this scope
FJGBBHQI3H7AR3W:51: error: 'stepperPin2' was not declared in this scope
FJGBBHQI3H7AR3W:52: error: 'stepperPin3' was not declared in this scope
FJGBBHQI3H7AR3W:53: error: 'stepperPin4' was not declared in this scope
FJGBBHQI3H7AR3W.ino: In function 'void Step_D()':
FJGBBHQI3H7AR3W:56: error: 'stepperPin1' was not declared in this scope
FJGBBHQI3H7AR3W:57: error: 'stepperPin2' was not declared in this scope
FJGBBHQI3H7AR3W:58: error: 'stepperPin3' was not declared in this scope
FJGBBHQI3H7AR3W:59: error: 'stepperPin4' was not declared in this scope
FJGBBHQI3H7AR3W.ino: In function 'void step_OFF()':
FJGBBHQI3H7AR3W:62: error: 'stepperPin1' was not declared in this scope
FJGBBHQI3H7AR3W:63: error: 'stepperPin2' was not declared in this scope
FJGBBHQI3H7AR3W:64: error: 'stepperPin3' was not declared in this scope
FJGBBHQI3H7AR3W:65: error: 'stepperPin4' was not declared in this scope
FJGBBHQI3H7AR3W.ino: In function 'void forward()':
FJGBBHQI3H7AR3W:72: error: 'delaytime' was not declared in this scope
FJGBBHQI3H7AR3W.ino: In function 'void backward()':
FJGBBHQI3H7AR3W:83: error: 'delaytime' was not declared in this scope
Reply 1 year ago
im getting the same errors. please need urgent help in it. if anyone find solution of it or another same project please notify me
Reply 7 years ago
i am also recieving the same errors, Have u found any solution of these errors
Reply 6 years ago
Did u find any solution to the problem?
Question 2 years ago
你好!我透過你的程式碼下去安裝,發現有錯誤,請問有正確的程式碼嗎?
8 years ago
I am am elevator mech, and I'm going to tell you I'm impressed. What you have we call a 2 to 1 elevator basement drive. Very good. You have even gone kind of in the future with the photocell. Because we will go digital one day. Awesome job
Reply 8 years ago on Introduction
Thank you! Glad you liked it.
Reply 4 years ago
sir i have an issue in your coding....plz can u send it in my email.aurangzaibbaig143@gmail.com.plz
5 years ago
it's great
5 years ago
Can you share your code, please?
5 years ago
hola solucionaron el problema del codigo es que igual a mi me aparece ?.
6 years ago
I'm having some problems with the code
this; 'setSegments' was not declared in this scope
Thanks..
6 years ago
I'm having some problems with the code
6 years ago
Hey im getting the same error. Is there any way to fix this?
7 years ago
diego,i want to ask you about the size of the 1st and 2nd floor ? because my inventor program didn't work and there is notification "error rse stream"
7 years ago on Introduction
Where Arduino code
7 years ago
Great job!!
7 years ago
Great job!!
8 years ago
this is great !
8 years ago on Introduction
this is a wonderful idea! do you have more photos to accompany this Instructable?