I have yet to see any build notes on the 'Net for getting this kit up and going, and it does not come with instructions other than the very basic ones at the Makershed store. This is my attempt to fill in that gap. I've tried to read-between-the-lines and figure out the intentions of the manufacturer and put together as close to a "stock" build as possible, so others can plan and implement their own builds. I would welcome corrections from those more in the know. (send to: flippy.qa76 AT gmail DOT com)
The Makershed catalog page for the 2WD kit says you need an Arduino and "Motor Shield" (though it doesn't specify which one) to get it working. Since the only motor shield Makershed carries as of this writing is the Adafruit one, I went with the following materials list:
If you choose, as I did, to give the Arduino a separate power supply from the Motor Shield, you'll also need:
If you want to expand on the 'bot by adding sensors, etc., you will probably also want some extra header pins (breakaway-style). The Motor Shield exposes pins 2 and 14 through 19 of the Arduino, but does so with a solder hole. The header pins will give you something nicer to play with.
A word about power: According to the catalog page for the 2WD kit, each motor is 3-to-6 VDC, with a stall current of 470 mA at 6V and 270 at 3V. The Adafruit Motor Shield can supply a maximum of 600 mA per motor, more than enough to not burn out on those motors. This is another clue it is the intended controller for a stock build. Further, the battery holder that is shipped with the 2WD kit is a 5-cell AA holder. AA NiMH cells are 1.2 volts each; five wired in series gives us 6V total. This tells me the intention is to run the 'bot at 6 VDC. Again, I'm speculating on the manufacturer's intention for the kit, but so far all the pieces are leading to this conclusion.
The catalog page isn't very specific. My version of the kit had:
Attach the motors to the bottom frame piece. Use the long screws with the appropriate nut & washer to attach the motors. You can go ahead and press the wheels on now if you like (I did).
Attach the ball caster to the bottom frame piece. Hopefully it's obvious where that one goes. :)
Install the battery housing over top of the ball caster. There should be two counter-sunk screws for doing this. The frame is pre-tapped to receive them, so no nut required.
I did it later, but now would be a good time to go ahead and solder your wires to the motor leads. Otherwise it'll be harder once you get the top frame piece on. Learn from my pain. :)
I cut the included 2-conductor cable into three roughly-equal lengths, one each for the motors and one for supplying power to the motor shield (more on this later). The cabling worked well with those lengths of wire.
Supposedly the top frame piece comes pre-drilled for everything you need. Mine had two minor problems that required surgery:
(In my final version I also added a clip for a 9V battery, requiring a couple more holes, sized for 4-40 machine screws.)
Follow Lady Ada's instructions. They're good ones.
Put the on/off switch and power jack in the appropriate holes.
Attach the Arduino Uno using the four stand-offs. If using metal standoffs (like I did), be very careful that the stand-offs don't touch anything that looks like a solder point, exposed trace, etc. If they do, you'll need to add an insulating washer between the stand-off and the board. I made some by drilling screw-size holes in a piece of polyethylene scrap, then trimming around the holes until I had a tiny washer.
Plug the Motor Shield on top of the Uno.
I recommend not attaching the boards to the frame until after you wire everything up!
The included wire was stranded, so, to keep the ends from fraying, I melted a little solder on the ends that go in the Motor Shield's screw terminals.
Per Lady Ada's recommendation, I'm going with a dual power supply scheme: the 5-AA pack will power the motors and a 9-volt battery will power the Arduino. For my money, wiring the 9-volt through the Arduino's power plug is the easiest way to go. You'll probably want to include a 2nd on/off switch for the Arduino (the switch included with the 2WD kit will be needed for the motor supply).
(In my latest mods, I swapped out the included switch for one that could handle two separate circuits, so now both the motor shield and Arduino turn on/off from the same switch.)
My recommended wiring setup (for the included 1-circuit switch):
+--------+ | switch | +--------+ | | | <-----+ | +------>to center pin on power jack to EXT_PWR | on shield | | +---[ + 5-AA battery pack - ]--->GND
CHECK AND DOUBLE-CHECK CONTINUITY WITH AN OHM-METER:
The jack I received had three terminals, as looking at it from underneath, in the 9 o'clock, 12 o'clock, and 3 o'clock positions. 9 o'clock is the center pin and should be connected to the positive battery terminal. 12 and 3 o'clock are connected internally and should be used for ground.
Attach the wires from the motors to either the M1 and M2 jacks or the M3 and M4 jacks on the Motor Shield (M1 and M2 have more flexibility).
The vertical supports are pre-tapped for this, so no nuts required.
Here's a basic "move in a square" test program. You'll need to install the AFMotor library to use it.
#include <AFMotor.h> AF_DCMotor m_driver(1, MOTOR12_64KHZ); // driver-side motor AF_DCMotor m_passenger(2, MOTOR12_64KHZ); // passenger-side motor // which way we're facing #define NORTH (0) /* "north" (straight ahead) */ #define EAST (1) /* "east" (right) */ #define SOUTH (2) /* "south" (backward) */ #define WEST (3) /* "west" (left) */ int facing = NORTH; // tweak these values as needed // these are pretty close to values that produce 90-degree turns #define velocity (80) /* how fast the wheels spin */ #define turn_time (1000) /* how long it takes to turn 90-degrees */ #define move_time (2000) /* how long it takes to move forward 1 "space" */ void turn_90_clockwise() { m_driver.run(BACKWARD); m_passenger.run(BACKWARD); delay(turn_time); } void turn_to(int direction) { while(direction != facing) { turn_90_clockwise(); facing = (facing + 1) % 4; } } void forward_one_unit() { m_driver.run(BACKWARD); m_passenger.run(FORWARD); delay(move_time); full_stop(); } void full_stop() { m_driver.run(RELEASE); m_passenger.run(RELEASE); } void move_north() { turn_to(NORTH); forward_one_unit(); } void move_east() { turn_to(EAST); forward_one_unit(); } void move_south() { turn_to(SOUTH); forward_one_unit(); } void move_west() { turn_to(WEST); forward_one_unit(); } void test_squaredance() { // simple square movement pattern move_north(); move_east(); move_south(); move_west(); } void setup() { m_driver.setSpeed(velocity); m_passenger.setSpeed(velocity); // for safety, wait 10 seconds before starting delay(10000); test_squaredance(); delay(15000); full_stop(); } void loop() { }