damage it. Here’s an important
note: The ArdBot uses separate
battery supplies for the Arduino
and the two servos. In order for
everything to function properly,
the ground connections for the
Arduino and the servo battery
supply must be connected
together. This is shown in both
the schematic and pictorial
Make sure to also properly
orient the connectors for the
servos when you plug them
into the board. Servo power
leads are color-coded, but the
colors aren’t universal.
• Ground (–) is typically
black or brown.
• Power (+) is most often
red, and with modern
servos is always in the
• Signal is white, yellow, or
sometimes orange (but
take care — on some
servos the power wire is
FIGURE 14. The wiring schematic for the
Arduino with two servos and separate power
supply for the motors.
When in doubt, check the spec sheet that comes with
your servos. Don’t guess!
Servo Test Sketch
With the ArdBot constructed and the breadboard
wired, you’re ready to test the robot and put it through its
paces. Refer to Listing 1 for a quick servo test sketch.
Start the Arduino IDE, connect a USB cable between
your computer and the Arduino (as noted on the Getting
Started pages of the Arduino website), and type the
program as shown. When done, Verify
(compile) the sketch and look for any
syntax errors. If there are none,
download the sketch to your Arduino.
Once downloaded, put a small
book under your ArdBot to lift its
wheels off the ground. Disconnect the
USB cable, and — in this order — plug
the AA battery connector into the
power to the Arduino power jack. (If you are using an
Arduino Diecimila, be sure to switch over the power
selection jumper from USB to EXTernal.) If everything is
connected properly, the servo motors should go through a
FIGURE 15. Pictorial view of how to
connect the Arduino to the two servo
motors. Note that the Arduino ground
connection is shared with the power for
the servos. This is very important.
SERVO 11.2010 59