Step 4: Motor Circuit

Getting the motor running is pretty simple because of the motor control shield. Its just a matter of getting wires plugged in the right places.

Start by attaching leads to your motor if this hasn't been done already. These don't need to be really long, a few inches, but it is easier to cut them shorter than longer later, so err on the side of caution. With the motor shield attached to your Arduino, place one of the motor leads into the MA1 slot and the other into the MA2 slot on the motor shield. Grab one of your 9V (or otherwise if needed) battery clips and place the black, ground, wire in the GRD slot on the shield and the red, positive, wire into the Vcc slot, again on the board. That's it, quick and painless, or so it seems so don't celebrate until you've ran the test program below or developed your own.

Attached is an Arduino program to test the functionality of your motor. The program simply runs the motor in one direction for 5 seconds, waits for 3 seconds, reverses the motor for 5 seconds, and waits 3 more seconds and repeats this ad nauseum. If your motor control shield is different you probably will have to rewrite the motor controls in all the sketches. My shield came with a library, I don't know if this library is universal or if it is specific to the L239D chipset. Also attached is the necessary library if you want to give it a try (It's the zip file).
<p>hi</p><p>You can use encoder for position</p>
<p>You sure could.</p>
<p>Is there any way that I can implement an iOS equivalent of this software?</p>
<p>I assume you mean the Android side and not the Arduino code?</p><p>Yes there is a way but I don't know the specifics and it will involve more work.</p><p>Your best bet would probably be to look up some Bluetooth-Apple projects on the site and see how they handle it or ask the creators.The more open nature of the Android environment means most people probably gravitate towards it for projects like this so you may have to look at a few to find one that uses Apple.</p><p>Alternatively try to find a generic Bluetooth serial app and use it to directly type and send the numbered codes.</p><p>If you really did mean the Arduino code then there is nothing OS specific about it. Just go to www.Arduino.cc and download the IDE for your operating system.</p>
Have you finished the gate/door
I never did get to that. In the end the fact that it was out of the way in a room that doesn't get used much meant there wasn't much incentive to roll it up and down. Now we're planning on moving soon so it's all got to come out anyways. I may do an updated version in the new house though.
Excellent instructable... I like how you used the shaft directly on to the rod...great article!
Thank you, glad you like it! It worked pretty well for the resources I had but I think access to a 3D printer could really kick it up a notch. Some day I may do a second version that's a little less, &quot;prototype-y&quot;, if you know what I mean.
Wow, this is very impressive, I noticed we have the same bluetooth dongle and it's making me wish I had a projector so I could build this myself, sadly I don't have a drop ceiling so I'd have to make it look even more pretty and bolt it directly to the ceiling, I take my hat off to you sir this is a very impressive ible.
Thanks! That Bluetooth module is pretty awesome. It was one of the easiest parts of the project to get working. I'll definitely be using it again.

About This Instructable




Bio: Why buy when you can DIY? Educated a Mechanical Engineer and trained as a classical cellist I consider myself a bit of a jack-of-all-trades, dabbling ... More »
More by bwrussell:Laser Engraved QR & NFC WiFi Access Card 3-Ingrediant Taco Meat Battery Monitor - LinkIt One Code Bite 1 
Add instructable to: