Makey – My RobotThis project first appeared on the pages of MAKE magazine
Author: Kris Magri
Description: Makey Robot
Assembly Time: 2-3 weekends
Skill Level: Difficult
Makey is an autonomous robot that has a fully enclosed chassis and uses tank steering that has been programmed to follow objects and avoid obstacles. It has separate DC motors that power each of the 2 drive wheels.
An Arduino controls Makey, and the use of a servomotor moves his head that carries a single ultrasonic rangefinder. Turning its head constantly left to right to acquire different range data, Makey is constantly adding to his personality.
With different programming the hardware would support other activities and mapping. With a few hardware modifications, Makey could even morph into its own mini-sumo.
Step 1 – Make The Robot Body
- 2 sheets of aluminum are used for the body. Cut, drill and bend both pieces at one time to minimize switching tool stations (Step 5)
- The Makey template can be downloaded at http://makezine.com/19/makey. File must be printed at full size.
- Cut out the base cutting template and holes in the blank area of each panel. Tape the template to the aluminum sheet with double-stick tape on the back and regular tape over the holes.
- With a band saw, cut the aluminum roughly to size around the template and then cut the perimeter just outside the lines.
CAUTION: Always wear protective eyewear when cutting metal.
Step 2 – Prepping for Drilling
- Use a center punch to punch through the template at the 17 crosshairs and at the corners of the rectangles around the large holes. This will prepare you for drilling in the next step.
- Drill the holes at the crosshairs following the sizes marked on the template. Remove but don't discard the paper first, to line up on the punch marks more accurately.
- Clamp the metal tightly onto scrap wood. For cleaner holes use the unibit wherever possible. The unibit makes cleaner holes in thin metal than a twist drill.
- For the starter holes inside the rectangles, you may need to adjust the diameter smaller or larger to reach the rectangle edges.
Step 3 – Finishing The Cuts
- Finish rectangular holes with the nibbler tool, cutting away until a rectangle appears and file the edges until smooth. To see the rectangles more clearly, you can always re-tape the template.
- Remove burrs from the metal's edges with a deburring tool.
Step 4 – Bending Template
- Cut out the base bending template and attach it to the other side of the aluminum with double-stick tape, aligning the holes and rectangles.
- Insert the metal in the brake with a new template facing up, and make all indicated bends at 90°.
- Start with bending the tabs on each long side of the metal, then bend the sides of the body.
- Go up gradually with each bend and use a drafting square between small bends to check the angle.
Step 5 – Complete The Chassis
- Repeat Steps 1-4 using the top cutting and bending templates for the body's top cover.
- The perfect chassis any robot would be proud to wear.
Step 6 – Placing Motor for The Robot
- Using 4-40 x 1" screws through the small holes mount the drive motors in the base. The motor shafts should poke out of the larger holes.
- Secure the screws with lock washers and nuts on the motor side. You may need needlenose pliers for tightening since the base is so small.
Step 7 – Making The Robot Wheels
- Use a 2" hole saw in a drill press to cut wheels out of some scrap wood. Go slowly to avoid stalling the drill press.
- Center a wheel hub on each wooden wheel and use a nail to mark the hole locations. Drill through with a 1/8" drill.
- Paint the wheels and try not to get too much paint in the mounting holes.
Step 8 – Snap in Wheels
- Drill through 2 opposing holes in the hub with a #43 drill, then use a 4-40 tap to create threads in each hole.
- Don't over tighten. Use two 4-40 x 1" screws to attach the wheels to the hubs from the outside.
- With the larger diameter facing out install tires on the wheels and snap each wheel assembly into its motor shaft.
Step 9 – Skidder Attachment
- Attach the skidder to the bottom of the base using the screws, nuts, and the thinner of the 2 spacers it comes with.
Step 10 – Power and Control
- Following the mounting template (Step 1) cut a plate out of hard plastic. Punch and drill as indicated and test-fit the plate into the body, resting on the motors. File as needed for a snug fit.
- Use two 4-40 x 3/8" screws to fasten the Arduino board to the plate from the underside. Be sure to secure it with nuts on top. The USB connector should line up with the notch in the tab.
- Battery holders, pop-rivet into the body through the holes in the left side tabs. So the ugly side of the rivet faces the battery, rivet from the outside.
Step 11 – Setting The PhotoShield (Soldering Required)
- Following the manufacturer's instructions, linked at http://makezine.com/19/makey, solder together the ProtoShield.
- Slice off the board's BlueSMiRF header, using the band saw, which connects to Bluetooth wireless modules. The header won't fit in the robot and we don't use it.
- Stick the mini breadboard onto the ProtoShield and plug the ProtoShield onto the Arduino. If you are using a Diecimila, set its power jumper to EXT.
Step 12 – Build The Robot Face with Sensor and Servo
- This project uses the shorter of the 2-arm horns that come with the HS-55 servo. Use a 5" bit to drill out the outermost holes in this horn.
- From the front press-fit the metal pieces of the 2 Du-Bro Mini E/Z Connectors into the servo horn holes. Now secure them in back with the black rubber pieces.
- Thread the control rods from the Du-Bro Aileron System through the connectors and screw them down using the included screws.
Step 13 – Getting Tricky
- Now the tricky part; time to plug the servo extension wire into the Ping sensor board. The control rods need to be bent from the horn in opposite directions 90°, to reach mounting holes at opposite corner of the board.
- The rods will point up from the servo, allowing room for the extension plug, and the sensor should face out.
- Slip the pushrod housing that came in the Du-Bro package over the rods to avoid short-circuiting the sensor, then secure the rods to the board using the connectors from the aileron control kit.
Step 14 – Threading Wires
- Through the rectangular cutout in the body's top piece, thread the wires from the servo and sensor down through the rectangular cutout.
- Fit the servo in the cutout, and fasten using two 1-72 x 1/4" screws and nuts through the holes on either side. Make sure to clip the excess control rod length.
- Time to screw the horn onto the servo. Use a small screwdriver to adjust it so that Makey's eyes are facing forward.
Step 15 – Connect and Test The Drive Motors
- Remove the motors and Arduino board from the robot body.
- Cut 2 red and 2 black 12" leads out of the stranded wire and strip 1" off an end of each. Without soldering, wrap each red/black pair around the round back end of the motor (for strain relief), then run the wires along the top and stick them on with a sandwich of double-stick foam tape. Make sure to leave holes for the mounting nuts and not to cover any of the holes in the motor body.
- Capacitor leads – thread and solder through the holes in each motor's connector tabs. Making a strong joint, solder the motor wires to the capacitor leads, not the motor connectors. Clip all extra lead lengths. With black tape cover the capacitor and the wrapped-around wires and use more foam tape to cover the pointy bits.
- Twist the free ends of the motor wire pairs together to reduce noise on the circuit and mark the motors Left and Right.
- TIP: Contact tabs on inexpensive motors are fragile, so their connections must be strong and vibration-proof.
Step 16 – Testing the Drive Motors
- Solder and heat-shrink short solid-core jumper wires to the drive motor and battery snap leads (this lets you plug them into the breadboard). Route the motor wires through the big holes in the plastic mounting plate.
- Plug the motor driver over the central trench of the breadboard and wire it to the drive motors and one battery, following the schematic. (Recall that on each side of the trench, holes in the same row are connected.) Use short jumpers to keep the wires close to the breadboard, as big loopy wires won't fit inside the robot.
- Download and install the Arduino software from arduino.cc and download the 5 project test programs from http://makezine.com/19/makey. Hook the Arduino to your computer via USB, and if it's a Diecimila, move its power jumper to USB.
- To test the motors, run the program 01_Test_Motor_Rotation. The left motor should run forward and back, followed by the right motor. If not, check your wiring. Next, run 02_Test_Motor_Speed. The motors should start slow, speed up, and then reverse direction. Otherwise check wiring to pins D11 and D3.
Step 17 – Assembling Motor and Arduino to The Body
- Replace the motors and Arduino assembly in the robot body. Plug a 3-pin right-angle header into the breadboard, plug the servomotor cable into it, and wire the servo: black to GND, red to +5V, and yellow to Arduino pin D10.
- Plug the other 3-pin header into the breadboard and then plug in and wire the rangefinder:
- Black to GND, red to +5V, and white to Arduino pin D9
Step 18 – Program Testing
- Run the program (03_Test_Servo_Center) which centers the servo. Unscrew and realign the servo horn as close to center as possible. You won't be able to get it exactly in the middle, because the teeth on the shaft won't allow it, but you can nudge it later.
- Run (04_Test_Servo_Sweep) which should make the servo slowly rotate from one side to another.
- Run (05_Test_Sensor_Distance) to test the sonar rangefinder and then click on the serial monitor icon in the Arduino software. You should see distance readings spitting out. If you move your hand in front of the sensor, the readings should change.
Step 19 – Connecting Arduino Power To The Robot Body
- Unpack the Arduino. To add the on/off switch, solder the unused battery snap's red wire to one side of the switch and a solid red wire to the other. Also solder a solid black wire to the battery's black wire.
- Thread the wires out through the rectangular hole in the side of the robot body, and then press in the switch. Orient the switch with the "1" label at the top and fit it through the hole. It's a tight fit and you may need pliers.
- Wire the red lead from the switch to the RAW pin on the ProtoShield, which connects to Vin on the Arduino, and the black lead from the battery snap to the ProtoShield's GND pin. If you're using the Diecimila, move its Power jumper back to EXT.
Step 20 – Finishing Makey Robot
- Now that all is working, put everything back into the body. Install the batteries and prop the robot up on something that won't run off an edge. Make sure the USB programming jack lines up with the cutout in the body.
- Reload and run the test program (01_Test_Motor_Rotation). Note: the front of the robot is where the USB jack and skidder are. If the motors rotate the wrong way, check your wiring to pins. You may also need to reverse the motor connections.
- AOut1, AOut2, BOut1, BOut2, AIn1, AIn2, BIn1, and BIn2.
- Rerun the other test programs and when satisfied, fold up the servo and sensor wires and tuck them into the base. Slide the top cover on, and install 4 sheet metal screws to hold it on.
Click here for a list of all the parts used in this project.
When you're done building, you're done building – but you're never done programming. Now it's time to get creative!
You control the motors by using the digitalWrite and analogWrite functions to pass values to pins on the motor driver, 3 for each motor. One pin takes a number 0–255 and sets the current sent to the motor, which determines its speed. The other 2 pins take binary values that set each motor contact to either high or low voltage. When only one contact is high, this sets the motor's direction. (``void Forward())
Write similar routines for the more basic motions, such as:
- Backward (both motors backward)
- Spin_Left (right wheel forward, left wheel back)
- Arc_Left (right wheel forward, left wheel stopped)
Object avoidance, which runs the loop:
- Move forward a bit, then take a distance reading. If the object is too close, take evasive action, such as back up and turn. Repeat.
2 autonomous robots are placed in a ring painted black with a white border in a Mini-Sumo match. With narrower wheels, Makey would fit within the maximum size and weight allowable for a Mini-Sumo (10cm-square footprint and 500 grams). You will need another sensor pointed down to see the ring, but be assured, the Arduino has room for several more inputs.