My daughters and I decided to automate an elevator on their's LOL surprise dolls three floor hotel which we made few months ago. Shortly after, they realized that manual elevator is not so attractive. I found out that might be great oportunity for my first experiences with Arduino writing code, not just reusage of other's.
Main part is NEMA 17 stepper motor. Since we can control motor position, I did not implement any sensor which in real elevators detect position. Here, elevator position will be defined with stepper position.
There are three push buttons and three LEDs on each floor. By pressing the push button you are calling elevator, and when elevator reaches targeted floor, LED will turn on. During elevator moving, LEDs are OFF.
After assembly all parts, be careful when starting test for first time. Make sure that initial positions for 2nd and 3rd flor are underestimated, i.e. lower that it might be. I had a starting test in program that makes one revolution clockwise and one counter clockwise, just to check the initialization, and see how much this moves the elevator. Then you can multiply it and estimate postitions for 2nd and 3rd floor in few iterations.
So far at the turn on, position is initialized to zero, so when you turn off the system, it must be on first flor. I'm looking to solve this in next upgrade.
Shortly after we made first version, which worked only with push buttons, my dauthers wandered why we do not support control by mobile phone :)
There was option using wi-fi or bluetooth. I decided to use bluetooth, since the toys will not be limited with wifi router. I used HC-05 bluetooth contoler. It needs only power 5V, GND, and serial TxD and RxD.
So far I did not develop any of mobile application, but I found very simple online tool for Android applications, MIT app inventor on http://ai2.appinventor.mit.edu/. You can donwnload my application on http://ai2.appinventor.mit.edu/b/bmgw , and if you want to build it by yourself, here is a screenshot of design and block screen. At design screen you set and configure blocks, and in block screen you connect blocks and configure actions.
I just created three buttons, where on click each one is sennding text 1, 2 or 3, depending of which flor should be called.
Another improvement I made, was blinking LED on flor where elevator will stop. My initial plan was just to make a function for blinking LED which is called in function GotoFlorX. But, this is not possible since Arduino does not support multi threads. So I added blinking LED part within For loop which is sending pulses to stepper motor. In fact I turn LED on/off every n/7 steps, where n is number of steps that that stepper motor need to run. It is a bit more complicated, but final efect is OK. If anyone has better idea, please let me know!
Comments
Please log in or sign up to comment.