Autonomous Robot Racer: Analog Mode (no Microcontroller Needed)

by TCPL in Circuits > Robots

3706 Views, 30 Favorites, 0 Comments

Autonomous Robot Racer: Analog Mode (no Microcontroller Needed)

IMG_20230621_192720470_HDR.jpg
Autonomous Robot Racer: Analog Mode Example

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

IMG_20230621_182644434.jpg
IMG_20230621_183511249.jpg
FJVG7ZOLJ5ZD136.jpg
IMG_20230621_183636381.jpg
IMG_20230621_184210949.jpg

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.

Wire DC Motors

IMG_20230621_183901363.jpg
IMG_20230621_183939344.jpg
IMG_20230621_184028344.jpg
IMG_20230621_184130953.jpg
IMG_20230621_184306824.jpg
IMG_20230621_184501298.jpg

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.

Laser Cut and 3D Print Parts

FZQTDU5LJ5ZD12A.jpg
IMG_20230621_184625697.jpg
IMG_20230621_184725825.jpg
IMG_20230621_185215870.jpg
IMG_20230621_185255049.jpg

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.

Power Circuit

IMG_20230621_185336915.jpg
IMG_20230621_185357415.jpg
IMG_20230621_185431850.jpg
IMG_20230621_185648161.jpg
IMG_20230621_185940443.jpg
IMG_20230621_190032709.jpg
IMG_20230621_190100702.jpg
IMG_20230621_190117655.jpg
IMG_20230621_190330890.jpg
IMG_20230621_190403363.jpg
IMG_20230621_190439323.jpg

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.

Attach Motors

IMG_20230621_190626116.jpg
IMG_20230621_190857072_HDR.jpg
IMG_20230621_191035786.jpg
  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.

Attach Sensors

IMG_20230621_191237324.jpg
IMG_20230621_191523395.jpg
IMG_20230621_191610954.jpg
IMG_20230621_191621573.jpg
IMG_20230621_191706275.jpg
IMG_20230621_191723005.jpg
IMG_20230621_191742207.jpg
IMG_20230621_191830030.jpg
IMG_20230621_191835553_HDR.jpg
IMG_20230621_191857229_HDR.jpg
  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.

Add Wheels and Breaks

IMG_20230621_191954326.jpg
IMG_20230621_192011782.jpg
IMG_20230621_192029634.jpg
  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.

Modify for Performance

IMG_20230621_192156963.jpg
IMG_20230621_192324621.jpg
IMG_20230621_192707925_HDR.jpg

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.

Make a Track

IMG_20230622_101709529.jpg
IMG_20230622_100335043.jpg
IMG_20230622_100448115.jpg
IMG_20230622_100614691.jpg
IMG_20230622_100630268.jpg
IMG_20230622_100416108.jpg
IMG_20230622_100420747.jpg

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.