My project is a fairly simple idea: I wanted to make a 'dispenser' that could place items on my hand whenever I wanted to. It would also give me a place to put away some items that I would prefer not to lose, such as my school ID or some winter gloves.
Before I began with the engineering aspect of this project, my first step was connecting my particle argon to amazon Alexa. To do this, I used https://ifttt.com/explore. This website makes it really easy, all you have to do is make an 'applet' using a custom command to call a function ( more on the function part later). For example, I used "Alexa Trigger Dispenser" as my command. Only when I say that phrase, the dispenser will work, which is perfect for my project!
TheCode
The function is located on line 13, "MichaelHA". That is what you put under into the applet. It should also ask for a function input, and to be quite honest, I'm not sure if you need that but just to be safe, I put "startStepper" on it, the same as in line 13. After that, you're set as far as connecting Alexa to your Argon.
A very important step is to add the stepper library to your code. On the particle web IDE, traverse to the left side of your screen, and hover over a rectangular shaped badge, with a triangle indentation at the bottom of it. Type 'stepper' on the search bar, and it should be the first option. Add it to your code, and it should appear on the first line as it does on the screenshot above in my code.
Lines 21-36 is really just the stepper motor tilting the dispenser forward and back. For me, I used 500 steps forward and back, but this may vary in however comfortable you feel the dispenser should be angled at. Make sure to set voice command to false at the very end, otherwise, you'd only be able to call the dispenser once. Then, I decided to give the code a go.
The EngineeringI found a really convenient place on my shelf to do this project on.
I did not want to hot glue cardboard to a shelf, and neither should you (unless you really want to do that I guess). I measured out the width and height to make a stable cardboard base. No need to glue or tape anything, it should simply slide in if the measurements are precise enough. Here's how that looks:
After I cut that out, I need a place where my stepper motor could go, so I came up with this system: I had two Styrofoam blocks around my house and I hot-glued that into the cardboard base like so. Then, using the width and curvature of the stepper motor, I made a horseshoe-like shape that the stepper motor would settle on top of. I messed up a few times on the horseshoe bit, you don't want the stepper motor to be loose/not fit on it. Make sure it's tight and secure. I then hot-glued the ends of the horseshoe onto the two styrofoam blocks. Lastly, I taped the sides of the stepper motor to the horseshoe.
The next part took the longest time, because my design for the dispenser was flawed. Don't worry, everything up to this point should be ok. I wanted to use a long rectangular styrofoam block for the dispenser but this failed badly for a variety of reasons.
As you can see the desperate attempts of poked holes, toothpicks, tape, anything I could come up to make my dispenser work, didn't. There was two major problems. The first was that you can't simply just stick the shaft of a stepper motor on styrofoam, it "gives way". So as the stepper motor turns, the styrofoam block loosens and loosens until it falls off. The next thing was the block might as well be a dispenser for ants; the dispenser couldn't hold anything. The most it could hold was maybe a mask (barely), but eventually, the block itself would fall off. So I had to improvise.
I had a shoe box. A shoe box, as the name implies, is naturally an open faced rectangular prism if you cut the cover off. I took full advantage of this, and I cut the box into what would be my dispenser. I also measured and cut out a barrier for one side. Here's what it looks like.
The next step was to cut a hole through one side, so you can fit the shaft of the stepper motor in it. I choose the longer wide side, because aside from being just that, it had three layers of thin cardboard on it. This would help for security. Now to cut the hole, you would have to measure the length and width of the stepper motor shaft. It is a small measurement, but it's actually critical for the hole to be even smaller than the size of the shaft. The goal is to slightly force the shaft of the stepper motor onto the hole, so the dispenser doesn't slide off.
After that, once I fit the stepper motor through the dispenser, I taped the shaft of the stepper motor to both sides of the dispenser. Without this, the dispenser would slide off. Use as much tape as necessary. Also make sure to tape down the wires from the stepper motor down to the base. If the stepper motor leans a bit forward, -you guessed it-, tape it at an angle to where it leans back. This is what it looks like by now.
By now, or probably before, you should test out the project. You can do this two ways: Using the skill you taught Alexa, or going to Particle IDE -> Console -> Devices -> (Your argon) -> Bottom right to where it says "call function".
WARNING: Do not overly test the limits of this dispenser. Slowly build up in weight. I started out with my school ID, then that with a pair of gloves, and then that with a mask. It could probably hold more but I don't dare to go further. After all, you're not going to put model plane on this thing.
If the dispenser can consistently hold items, drop them when turning, and not fall of the stepper motor, congrats! You're almost there.
I added one more thing to help the stability of the dispenser because it does lean at an angle. I really don't know how to describe it, but it's a little flap that goes underneath the dispenser. It's very important that this flap goes before the middle of the dispenser, otherwise it cannot physically turn down to drop your desired items. You'll see what I mean in a minute.
For reference, this is how it's supposed to look like:
After this, test out the dispenser a few times, with items and without. If everything works, you're finished! Now this is optional, but I added a cardboard box over all my electronics. If you do this, just make sure you carve out a hole where you're mini-usb from your argon fit through and near a place with an outlet. Here's the finished product and voice and video.
Afewnotes: With this being a prototype, it's far from perfect. Here are some things that can be improved.
- My dispenser leans at an angle toward the ground, although it still holds my desired items well.
- Maybe attempt this project that has a stepper motor with a larger shaft, maybe like an axle system that turns the dispenser similar to one you would see in a car.
Comments