Introduction: Autonomous Robot Racer: Analog Mode (no Microcontroller Needed)

About: Tompkins County Public Library (Ithaca, New York), founded in 1864 by Ezra Cornell, serves the 104,926 residents of Tompkins County and is the Central Library for the Finger Lakes Library System, serving libra…

In this project, you'll learn how to make an autonomous wall-detecting robot. This robot is completely analog and does not use a microcontroller. The Tompkins County Public Library uses this robot to hold weekly robot racing events. This is one of several autonomous robot racers developed at TCPL. More robot Instructables coming soon!

Made and developed by Joah Tang, Teen Service Library Assistant at TCPL.

Supplies

Laser Cut Files:

3D Print File:

Electronics and Other Parts:

Tools

  • Hot Glue Gun
  • Phillips-head Screw Driver
  • Plastic Nippers
  • Wire Stripper

Note: The links to the electronics and other parts will yield two of these robots.

Autonomous Analog Robot Racer Chassis

Atonomous Analog Robot Racer Wheels

Autonomous Analog Robot Racer Breaks

Step 1: Wire DC Motors

At TCPL we have developed a way to attach wires to the DC motors without the need for solder. This was done to streamline repairs during races. If you are comfortable using solder attach the wires that way.

  1. Take two M-to-M wires and cut them in half and strip each end without a pin.
  2. Twist the wire brush into a tight wrap and slide it into DC motor input. See the second picture for an example.
  3. Once the brush is secure in the DC motor input lightly pull it down the side of the motor bell and glue it in place. Be careful not to get glue on the motor input of the shaft. See the third picture for an example.
  4. Repeat the process for the other DC motor input so there are two wires attached to it.
  5. Tightly wrap the electrical tape around the bell of the motor to cover the exposed wire brushes.
  6. Repeat this process for the second motor.

Step 2: Laser Cut and 3D Print Parts

At TCPL we are privileged to have access to an Epilogue Laser and Prusa 3D printers. Please check your local Makerspace or Library for public-access laser cutters and 3D printers.

  1. Download the Laser Cut Files in the Supplies section from Tinkercad as an SVG file.
  2. Upload files to your favorite vector software. TCPL uses Inkscape. Prepare the files based on the requirements of the laser you are using.
  3. Laser cut the parts on a 12x12 1/8 inch plywood board.
  4. Once the parts are cut out hot-glue matching wheel pairs together. You should be able to make 3 pairs in total.
  5. Stretch a rubber band over each wheel.
  6. Once the wheels are done attach a mini breadboard to the front of the chassis. See the fourth picture for an example.
  7. Download the 3D Print File in the Supplies section from Tinkercad as an STL file.
  8. Import the STL in your favorite slicer. Make sure to set the infill to 15% and supports on.
  9. Once the print is complete clean off the supports.

Note: If you are unable to access a laser you can print the SVG files out and use a scroll or coping saw and drill to cut out the parts.

Step 3: Power Circuit

The power circuit is made using an H-bride L298n motor driver. To learn more about this driver see this link.

  1. Make sure there are two clips over the ENA and ENB pins of the L298n motor driver. If the pins are without these clips bridge them with F-to-F breadboard wire. If these pins are not bridged the robot will not drive. See pictures 1 -3 for examples.
  2. Take an orange and a brown M-to-M breadboard wire and cut them each in half.
  3. Strip the ends without pins on one of the orange and brown wire halves. You will only need one orange and one brown half for this step.
  4. Twist the wire brushes tight on both the orange and brown wire.
  5. Take the red wire from the 9volt battery case and insert it into the 12v port on the L298n motor driver. Screw port shut.
  6. Take the black wire from the 9volt battery case and insert it with the brushed end of the brow wire half into the GND port on the L298n motor driver. Screw port shut.
  7. Take the orange wire half and insert the brush end into the 5V port on the L298n motor driver. Screw the port shut.
  8. Attach the L298n motor driver to the chassis with m3 screws and nuts. See the ninth picture for an example.
  9. Insert the brown and orange wire as shown in the tenth picture.
  10. Hot glue the 9volt battery case to the chassis behind the L298n motor driver. See the last picture for the orientation of the 9volt battery case.

Step 4: Attach Motors

  1. Attach both motors to the chassis using two rubber bands for each side.
  2. Starting on the left side of the robot take the top wire of the DC motor and insert it into the OUT4 port on the L298n motor driver. Screw port shut.
  3. Insert the left motor's bottom wire into the OUT3 port on the L298n motor driver. Screw port shut.
  4. On the right motor insert the top wire into OUT1 and the bottom wire to OUT2 ports on the L298n motor driver. Screw ports shut.

Step 5: Attach Sensors

  1. Take two IR Object Avoidance sensors
  2. The right sensor will have a red M-to-F wire attached to its VCC pin, a black M-to-F wire attached to its GND pin, and an F-to-F wire of any color attached to its OUT pin. I used a purple wire for the OUT pin.
  3. The left sensor will have an orange M-to-F wire attached to its VCC pin, a brown M-to-F wire attached to its GND pin, and an F-to-F wire of any color attached to its OUT pin. I used a green wire for the OUT pin.
  4. On the chassis, there are slits on each end of the motor driver. To keep the wiring clean I will use these slits to wrap the wire around to shorten it. See pictures 3-4 for examples.
  5. Attach both sensors to the chassis with m3 screws and nuts. See image two for the orientation of the sensors. You can attach the sensors to any of the slits at the front and along the side of the robot. Make sure to angle the sensors out for the best performance.
  6. Insert the left sensor's orange wire on the breadboard under the orange wire coming from the L298n motor driver.
  7. Insert the left sensor's brown wire on the breadboard under the brown wire coming from the L298n motor driver.
  8. Insert the remaining wire of the left sensor into the IN1 pin on the L298n motor driver.
  9. Insert the right sensor's black wire under the left sensor's brown wire on the breadboard.
  10. Insert the right sensor's red wire under the left sensor's orange wire on the breadboard.
  11. Insert the remaining wire of the right sensor into the IN4 pin on the L298n motor driver.

The sensors act as switches when they detect an object. If the right sensor sees a wall it will turn the left motor off using the IN4 pin on the L298n motor driver causing the robot to turn left. For more information on how these sensors work see this link.

Step 6: Add Wheels and Breaks

  1. Choose a matching pair of wheels and slide them onto the motors.
  2. Choose one or a bunch of breaks and slide them into the slits at the front of the robot.

Step 7: Modify for Performance

The wheel size will change the speed of the robot. The breaks will also alter the speed of the robot and change the terrain it can travel over. Experiment to see which combination works best for your robot and track. The motors can be slid up and down along the side of the robot to change the weight displacement. This displacement will dictate how fast it will turn around a corner. The sensors can also be adjusted by orientation and sensitivity. To change orientation unscrew the sensor and attach it to another slit or adjust its angle. You can also take a screwdriver and turn up and down the sensitivity of the sensor. These sensor adjustments will define when the car enters and leaves a turn.

Step 8: Make a Track

You can make track out of almost anything as long as it's a surface that doesn't fully absorb light. The sensors detect the walls by receiving IR signals reflected off a surface. At TCPL we use a combination of recycled cardboard and foam to make the track. There is no official measurement for each track piece.

For straight pieces, I will cut a length of material between 6 - 15 inches long and about 2.5 inches tall. I then cut a roughly 2.5x2.5 square and hot glue it to the back of the piece so to make a stand. See the fourth picture for an example.

When it comes to curves I will bend the material into shape and that causes it to stand without needing anything glued to it. See the last two pictures for examples.

The distance between the outer and inner walls should always be 15 inches or more. This is due to the sensor's max range of 30cm. If both sensors see a wall the robot will stop.

Once the track is set up I will place some painter's tape to mark the finish/starting line. You can find the app TCPL uses to capture lap times here: Apple or Android.

TCPL runs a very simple time attack event where participants and/or teams get 3 laps to set a personal best time. The participant and/or team with the fastest time wins for that week. TCPL will change the track layout weekly to keep things interesting.