O
5-MINUTE DRAWBOT PROJECT
With two continuous rotation servos, you can start
making robots. Figure O shows a drawbot made
from two servos, a 9V battery, a small breadboard,
an Adafruit Boarduino (Arduino clone), a Sharpie
marker, and a couple of plastic discs.
The circuit is the same as for the pan-tilt head,
and all the parts can be held together with hot glue.
For wheels, any disc that’s 1"– 3" in diameter should
work, such as plastic screw-top lids. To increase traction, wrap the wheel edges with duct tape.
The servos are set up as before. The sketch uses
variables that contain the experimentally determined
zero values to stop the motors. (Your zero values will
be different.) The logic of this sketch runs one motor
in one direction for a period of time, then switches to
the other motor. The result is a Spirograph-like shape
(Figure P).
#include <Servo.h>
Servo servoL;
Servo servoR;
int servoLZero = 83; // experimentally found to stop
L motor
int servoRZero = 91; // experimentally found to stop
R motor
boolean turnleft = false;
void setup() {
servoL.attach( 9);
servoR.attach( 10);
servoL.write(servoLZero); // start out not moving
servoR.write(servoRZero); // start out not moving
}
void loop() {
turnleft = !turnleft;
if( turnleft ) {
servoL.write( servoLZero - 10 );
servoR.write( servoRZero );
delay(1000);
} else {
servoL.write( servoLZero );
servoR.write( servoRZero + 10 );
delay(4000); // turn more one way than the other
}
}
P
NOTE: The Sharpie is a permanent marker, so
be sure to run the drawbot on top of cardboard
or layers of butcher paper, or substitute water-soluble markers.
RESOURCES
» Hobby People ( hobbypeople.net) is a good
U.S.-based vendor of servos.
» HobbyKing ( hobbyking.com), formerly HobbyCity,
is a China-based servo vendor with a huge selection.
» Adafruit ( adafruit.com) carries Arduino and
Boarduino microcontrollers, and Parallax
continuous servos.
» Trossen Robotics ( trossenrobotics.com) carries
Parallax continuous servos and many other neat
robot things.
» Oomlout SERB robot ( oomlout.com/serb.html)
is an open source robot base that uses continuous
servos.
» Servo hacks on Instructables ( instructables.com):
Do a search for “servo” to see many more servo
projects.
Tod E. Kurt ( todbot.com/blog) is co-founder of ThingM, makers of the BlinkM Smart LED ( blinkm.thingm.com), and author of
Hacking Roomba ( hackingroomba.com), an introductory robotics course disguised as a set of vacuum cleaner hacks.
147 Make: