Step-by-step instructions on how to build your first robot from scratch for about R1 000. – By Gordon McComb
For the parts list, FAQ, templates and extra goodies, visit the Build Your First Robot (BYFR) information page, which is kept updated.
Prepare the wiring (see image 1)
Prepare the wiring and electrical components:
Construction goes faster with pre-made jumper wires for the BYFR’s main electrical cables. You want an assortment of five or 10 female-female jumpers, 75 mm long.
There are no circuits to build but you need to solder wires to a speaker, battery leads, and switches. I’ve specified a piezo speaker; don’t use an ordinary 8Ω dynamic speaker. It’ll draw too much current and possibly damage the Arduino.
Breakaway header pins are used to connect the wiring to the Arduino and breadboard. Be sure to get the double-long header pins, which are long on both sides of the centre barrier.
Servo switches (see image 2)
Cut a 300 mm wire servo extension cable so one end is 75 mm long, and the other is 225 mm. Splice the 75 mm length to a 4xAA battery holder — get the kind with 150 mm red/black leads already attached. This is power for the servos.
Use the remaining 225 mm length to wire up two snap-action leaf switches. You want to solder the wires to the common and N.O. (normally-open) contacts.
Construct battery power cable (see image 3)
The Arduino itself is powered by a separate 9-volt battery. Construct its power cable using a battery snap with (minimum) 150 mm red/black leads, and a 2,1 mm barrel power plug.
Assemble the bottom deck, steps 1-2 (see image 4)
The bottom deck of the robot is where the motors, batteries, and servos go:
1. Use (2) 4-40 x 12 mm pan head machine screws and 4-40 nuts to attach a servo motor to a servo mount. The servo flange has four holes; you only need two. Do the same for the other motor and mount, but in mirror image.
2. Use (2) 4-40 x 12 mm pan head machine screws and 4-40 nuts to attach two plastic L brackets to the outside holes of each servo mount. Don’t yet tighten the screws; leave them a bit loose for the next step.
Assemble the bottom deck, step 3 (see image 5)
3. Use two 4-40 x 12 mm flat head machine screws and 4-40 nuts to attach a servo bracket to the bottom deck. The motor shaft should be in the centre of the cut-out. Align the mount so it’s straight, then tighten all the mounting screws. Repeat for the other servo.
Assemble the bottom deck, steps 4-5 (see image 6)
4. Attach the two switches to the front of the robot using 4-40 x 20 mm pan head machine screws and 4-40 nuts. Snip off two 75 mm lengths of 6 mm O.D. (4 mm I.D.) rubber tubing. Gently bend out the switch leaf to make room for added thickness of the tubing.
5. Secure the wheels to the servos. The wheels are held in place with screws, which come with the servo.
Assemble the bottom deck, steps 6-7 (see image 7)
6. The BYFR uses static skids for balance front and back. They’re made with 6-32 x 20 mm machine screws, hex nuts, and cap nuts. Make one skid a little longer than the other, and put it at the front (switch end) of the robot.
7. Use (4) 6-32 x 12 mm pan head screws and 60 mm length female-female standoffs to make the deck risers. The holes are in the corners of the deck. Finger tighten the screws for now, and don’t attach the top deck quite yet.
Assemble the bottom deck, step 8 ( see image 8 )
8. Use a piece of 25 mm square double-sided foam tape to stick the 9-volt battery between the two servos. The wiring should point toward the rear of the bot.
Assemble the bottom deck, step 9 (see image 9)
9. Apply a 25 mm Velcro square to the top-rear of each servo, and attach a 4xAA battery holder (wires point to front). Insert a set of fresh AA batteries into the holder.
Assemble the top deck (see image 10)
The top deck is where all the electronics go:
1. Attach the top deck to the risers using (4) 6-32 x 22 mm pan head screws. Don’t over-tighten.
2. Build the risers for the Arduino microcontroller board using (4) 16 mm long 4-40 thread nylon hex standoffs and 4-40 x 12 mm flat head screws. Don’t yet tighten the screws until after step 4, below.
3. Using a piece of 25 mm square double-sided foam tape stick the speaker in place between the standoffs. The wires should extend to the centre of the deck.
4. Peel the protective tape off the bottom of the mini solderless breadboard and mount the breadboard over the open space adjacent to the Arduino.
5. Use (4) 4-40 x 8 mm pan head screws and plastic washers to mount the Arduino to its standoffs. Do not over-tighten the screws on the top, or it could crack the Arduino board.
Connect all the pieces (see image 11)
What’s left is to attach all the wires in all the right places:
Basic breadboard wiring
Cut jumpers to length and insert into the solderless breadboard. Use 22 gauge solid conductor wire.
Insert three sets of 3 double-long header pins, and insert into the breadboard. Note the broken pin for the servo batteries.
Basic wiring (see image 12)
Connect speaker leads, servo jumpers, and ground (Gnd) connection to the Arduino and breadboard.
Connect servos and batteries
Lead the wires from the batteries and servos through the holes in the top deck, and connect to their breadboard headers.
Attach switch wiring
Lead the wiring from the switches through the holes in the top base, and connect directly to the Arduino using a 3-pin header.
Infrared Receiver (see image 13)
Bend the leads of the IR receiver module, and plug it — dome facing up — into the Arduino.
Finished robot (see image 14)
Get the software
Before you can use the Arduino you must download its programming software from http://arduino.cc/en/Main/Software. The software includes the USB driver your computer needs to communicate with the Arduino. Install this driver before you plug in the Arduino board for the first time.
Try it out
You’re ready to give your robot a test run! Plug the two battery sources into the Arduino and breadboard. Connect the Arduino to your PC, and start the Arduino software, as described on the arduino.cc Getting Started Web page. If you’re just starting out with the Arduino try the Blink example for practice. Again, the ZIP file of extra materials that you downloaded earlier contains the full instructions for this part.
Put your bot on the floor, and touch one of the feeler whiskers. Your robot should make some beep sounds, back up, do a quick turn, and then go forward. Try the other feeler whisker. Stop the robot by momentarily pressing the Arduino’s Reset switch.
Try the remote control function by programming a universe remote to a Sony VCR code. The number buttons control the movement of your bot – forward, reverse, and turns.
Remember that the PM Build Your First Robot is expandable, and ever changeable. Make it do something different just by altering its programming. Don’t be afraid to try new things. If something does work, just reload the demo program, and start again.
For more information on how to build your first robot, read the article, “Build your first robot“, which appeared in PM’s March 2012 issue.