Introduction: YourDuino: Basic Arduino-Compatible Collision-Avoiding Robot
How to build a Basic Arduino-Compatible Collision-Avoiding Robot
Note: See the available Arduino Software Test Sketches and Collision-Avoidance Software HERE (Click)
Note: Later you will need to have the Arduino "IDE" software development system installed on your computer and working.
We have a detailed page on doing this if you have not used Arduino before. See it here:
We tried to design a simple robot which would be low cost ($40-50)
Here are the parts you will need. These are widely available on Ebay, Sparkfun, Adafruit etc. Links to YourDuino.com are included and show details and how-to on individual parts.
- YourDuino Robo1 (Arduino compatible Microcomputer: Robot Brain) or equivalent
- Robot chassis with 2 DC motors and wheels
- Battery pack for 6 AA batteries (Suggest rechargable)
- Motor Driver Board (Controls motors speed and direction)
- Ultrasonic distance sensor (Looks for things in the way)
- ServoMotor (Points the Distance Sensor in different directions)
- 40-wire Rainbow cable (Connect the parts)
- Pin strips (Connect the parts)
- USB Cable (For uploading software to the YourDuino Robo1)
Step 1: Small Parts of the Robot Base Chassis
- Caster Wheel. This swivels around to allow robot movement in any direction. When you assemble this later make sure you use the 4 screws with large heads. (see photo)
- Encoder discs (2) Not Used in this kit. These can be used with more complex software to measure the wheel rotation.
- 3mm (Millimeters) size 30mm long machine screw (4) use to assemble to motors and brackets.
- Power Switch (optional): This may be difficult to push into place in the rectangular cutout in the chassis. Wiring details later.
- Motor Mounting Brackets (4) will hold the motors to the chassis.
- Assorted 3mm diameter machine screws and nuts.
- 12mm long brass metal standoffs (4). These are threaded inside so screws can be used to hold the Caster Wheel in place at the right level.
Step 2: Robot Chassis and Wheels
- Robot chassis: Laser-cut clear plastic. NOTE: This has a stick-on paper covering, and this is a good time to remove it if you want the clear plastic to be shown.
- Wheels (2). NOTE: The wheels have a hole with two flat sections. Make sure you line this up with the motor shafts later when you attach them.
- DC Gear Reduction Motor (2). Note these have 2 wires attached. Later when you assemble them to the chassis, make sure the wires go toward the center of the robot.
Step 3: Assembling the Robot Base Chassis and Attaching the Parts
You will attach these parts to the robot chassis and then connect them electrically:
- Motor Driver Board
- Yourduino Robo1
- Drive Motors
- Ultrasonic Distance Sensor
- Battery Case
Step 4: Attaching the Switch to the Chassis
CHASSIS: If you plan to use the power switch, line it up with the rectangular hole in the center of the chassis and PUSH it down into position . This may take a strong person with strong fingers! NOTE: The switch has a red dot showing the ON position. We suggest you point it toward the front (wide end) of the robot..
NOTE: If you need to drill the holes in the chassis yourself, a .JPG file that will give you an accurate layout if you print it 300DPI is available HERE.
Step 5: Assembling Your Robot
- MOTOR DRIVER BOARD: Attach the Motor Driver Board to the chassis using 4 of the shorter 3mm machine screws. (See photo for hole location. Orient the black heatsink toward the front.)
- ROBO1: using 2 of the longer 3mm machine screws and nuts. (See the photos)
- MOTORS: Locate the 4 Motor Mounting Brackets. Use 2 at a time to assemble the motors to the chassis.
- A bracket is inserted in the center slot and a second bracket goes in a slot on the outer edge of the chassis.
- Turn the chassis over and insert the long machine screws through the outer brackets, through the holes in the motor, and the inner bracket.
- Attach two nuts and tighten snugly but not real tight.
- Install the second motor on the other side.
- NOTE: Make sure the wires go towards the center of the robot
Step 6: Caster Wheel
Check out the holes by placing the caster wheel on the bottom of the chassis to see which 4 holes line up with it.Now, attach the 4 metal 'standoffs' by putting 10mm long machine screws from the top of the chassis, through the 4 holes and into one end of the standoffs. Hold the standoffs and tighten the screws with a small Phillips screwdriver.Line the caster wheel holes up with the 4 standoffs and attach it with the 4 small screws that have large flat heads.We suggest you wait until later to attach the wheels. It's easier to test the wiring and software when the robot can't try to escape :-)
Step 7: Connecting the Wires From the Robo1 to the Components
Note: If you are using a regular Arduino UNO or Duemilanove etc. you will need to add pins from the Pin Strips to the end of the wires to make them plug into the sockets for the Arduino I/O pins.
Step 8: Important Wiring Notes
There are two jumper blocks on the motor driver connected to the ENA and ENB Pins which must be removed. They are pointed to by the yellow arrows in the photo on the right. You can pull them straight up off the pins using tweezers or your finger nails.
Step 9: Wiring the Motors
The black and red wires from the motor on the Right cross over and are connected on the Left side of the Motor Driver and vice versa! The ends of the "Rainbow" flat cable have black plastic ends over metal terminals. To connect wire ends to screw-type terminal strips, you need to remove the plastic parts as shown in the photos above. Look closely at the wire ends. There is a very small plastic "latch" that you can pry up with a pushpin or other small sharp object. When the latch is bent up the plastic end can be pulled off leaving the metal connector.
Step 10: Connecting Power to the Motor Driver Board
- Strip off another section of ribbon cable with just black and white wires.
- Remove the black plastic part of the connector on one end of the black - white wires (See photo above)
- Connect that end to the terminal strip of the Motor Driver Board.
- Black to VCC
- White to GND
- White to GND
- Black to VIN
Step 11: Connecting the Ultrasonic Sensor
Attach 4 wires from the rainbow cable, (we used purple, grey, white and black) to the base of the ultrasonic sensor like this:
This is the way they connect to the 3-pin connectors labelled 5 and 6 on the Robo1:
- Cable Purple - Pin 5 - Red (Voltage)
- Cable Grey - Pin 5 - White (Trigger)
- Cable White - Pin 6 - White (Echo)
- Cable Black - Pin 5 - Black (Ground)
Step 12: Attach the Servo Arm
- Attach the white arm to the top of the servo as shown in the photo.
- Lightly push the white servo arm onto the servo shaft
- Carefully turn the arm counter-clockwise until it stops
- Remove the arm and reposition it so that it is oriented at right angles (as shown)
- Push the arm firmly in place and secure it with the smallest screw from the servo package
Step 13: Attach the Ultrasonic Sensor to the Servo
Now you can attach the ultrasonic sensor on top of the servo. Split the cable (with 2 wires on each side) going to the Ultrasonic Sensor for a short distance in the center. Place the opening in the cable over the servo arm from each side and rearrange it as in the photo. Now add some masking or other tape to secure the Ultrasonic Sensor and cable on the servo arm.
Step 14: Wire the Servo to the Robo1
Now wire the servo to the Robo1. The servo connector simply plugs onto the Robo1 3-pin connector labeled 11. (Brown wire connects to black pin, red to red pin, yellow to white pin)
If you have a regular Arduino you will need to use a 3-pin strip and an added 3-wire section of rainbow cable to connect the +5V, Gnd and Arduino Pin 11
Step 15: Attaching the Wheels
Carefully push the wheels onto the motor axles. Hold the motor securely with one hand as you push the wheel in place. Here's the way your complete robot will look!
Step 16: Arduino and Robot Software
Now we are going to program the ROBO1 to test some different parts of the robot and then install the more complex software which uses all the parts to run the robot around and avoid obstacles.
First you need to have the Arduino "IDE" software development system installed on your computer and working. We have a detailed page on doing this if you have not used Arduino before. See it here:
You should have the Arduino IDE installed, the YourDuino ROBO1 on your robot connected to your computer with the USB cable and the "Blink" Program successfully uploaded and run.
Uploading Test and Collision Avoidance software
The Arduino software for this project is on a separate page HERE.
Step 17: Robot Kit Available at YourDuino.com
PLEASE email questions, updates, comments to firstname.lastname@example.org