Projects‎ > ‎CatBot‎ > ‎

Build Notes: 2WD Arduino Compatible Mobile Platform


My CatBot project is built atop the 2WD Arduino Compatible Mobile Platform.  I have yet to see any build notes on the 'Net for getting the 2WD 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 it carries as of this writing is the Adafruit one, I went with the following materials list:
  • the 2WD kit itself
  • Arduino Uno (the Uno was released after the 2WD kit, but as far as I can tell is form-factor compatible with earlier Arduino USB devices)
  • Adafruit Motor Shield
  • a couple extra scraps of wire
  • 4 stand-offs & screws
  • 5 NiMH AA batteries. (Get the highest mA rating you can find.)
If you choose, as I did, to give the Arduino a separate power supply from the Motor Shield, you'll also need:
  • 9-volt battery
  • 9-volt battery clip
  • 2.1 mm round male power plug
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.


  • small screwdriver
  • drill press
  • soldering iron
  • wire stripper
  • multi-meter
  • patience and time!

Contents of the 2WD Kit

The catalog page isn't very specific.  My version of the kit had:
  • 2-piece metal frame (top & bottom).  The vertical supports are one piece with the bottom frame and were shipped pre-bent into position.  One of the supports on mine had a crease about 1/3 of the way up, but I easily bent it back into shape.
  • Several smaller frame pieces to use for mounting sensors, etc.  These are optional to install.
  • 2 wheels
  • ball caster
  • 2 motor/gear assemblies, "DFRobot 6V,180rpm Micro DC Geared Motor with Back Shaft"  I originally thought these were Solarbotics GM2 gearmotors, but the output shaft is smaller.  I know this because I bought GM2-compatible wheels for another project and they did not fit these motors.
  • on/off switch
  • female power jack
  • battery holder with 5-AA capacity
  • short length of 2-conductor cable
  • Many assorted screws, washers, nuts

Assembling the 2WD Kit

Step 1: Attach the motors

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).

Step 2: Install the ball caster

Attach the ball caster to the bottom frame piece.  Hopefully it's obvious where that one goes.  :)

Step 3: Install the battery housing

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.

Step 4: Wire the motors

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.  On both motors I soldered the red wire to the top terminal and the black wire to the bottom terminal.  If you assume the red wire is positive, this wires one motor to run in the opposite direction from the other -- except that it is physically rotated already so now both are moving in the same direction with respect to the 'bot.  In the end it doesn't matter, since the motors are reversible, I just though it would be handy later.  I'd rather set my orientation correctly in hardware than fix it later in software.

Step 5: Prepare the top frame piece

Supposedly the top frame piece comes pre-drilled for everything you need.  Mine had two minor problems that required surgery:
  • The hole for the on/off switch was just a little too small for the included switch.  Presumably the switch sent with mine was a slightly different model than the one they used when designing the kit.  I reamed it out a bit on the drill press and it worked fine.
  • The Arduino Uno has four holes for attaching stand-offs, but only three lined up with holes on the frame.  I don't know if this is a design flaw or manufacturing oversight.  Anyhow, I very carefully marked the position of the fourth hole and then drilled it.

Step 6: Assemble the Motor Shield

Follow Lady Ada's instructions.  They're good ones.

Step 7: Assemble the top frame piece

Put the on/off switch and power jack in the appropriate holes.  In the picture below, the switch is at the top left, with the power jack just below it.

Attach the Arduino Uno using the four stand-offs.  Mine are a little tall -- I was just using what I had.  You may want to use shorter ones.  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.

Even though I show the top attached to the bottom in this picture, I recommend not attaching them until after you wire everything up.

(I have an extension frame piece attached in this photo.  As I said before, it's optional.  I have other nefarious purposes for it...)

Step 8: Wiring

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).

CAUTION: This wiring set-up is particular to the parts they sent me.  Assume you will get whatever variants they were able to source when they packed your kit.  Check and double-check the continuity of terminals with a ohm-meter before proceeding.

I assumed the power jack included with the 2WD kit was for recharging the AA batteries, so it is wired in parallel with the battery holder (see diagram below).  The on/off switch is between the power jack and the Motor Shield so as to isolate the shield from the battery charger.  (Probably overkill, but it doesn't hurt to be safe.)  Run the third piece of 2-conductor cable from the switch (red/positive conductor) and ground (black/negative conductor) to the PWR_EXT jack on the motor shield.  CHECK AND DOUBLE-CHECK CONTINUITY WITH AN OHM-METER:
  1. Make sure the battery pack's positive terminal (red) is ultimately connected to the positive of PWR_EXT.
  2. Make sure the battery pack's negative terminal (black) is ultimately connected to the negative of PWR_EXT.
  3. Make sure the on/off switch does indeed break the path from the battery pack's positive terminal to PWR_EXT's positive terminal.
  4. Make sure the switch does not break continuity to the power jack.
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.

(I just had a thought -- I could have wired the toggle switch such that it breaks the power jack's connection when the 'bot is "on".  I may need to do some re-soldering...)

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).

Step 9: Attach the top frame piece.

The vertical supports are pre-tapped for this, so no nuts required.

Step 10: Program It

Here's a basic "move in a square" test program.  It is also available as a .pde file attached to this page.

Test Code

#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()

void turn_to(int direction)
  while(direction != facing)
    facing = (facing + 1) % 4;

void forward_one_unit()

void full_stop()

void move_north()

void move_east()

void move_south()

void move_west()

void test_squaredance()
  // simple square movement pattern

void setup()
  // for safety, wait 10 seconds before starting

void loop()


Lewis Baumstark,
Oct 20, 2010, 7:31 PM