Autonomous Robot Racer: Analog Mode (no Microcontroller Needed)
3706 Views, 30 Favorites, 0 Comments
Autonomous Robot Racer: Analog Mode (no Microcontroller Needed)
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:
- 9volt Battery
- 9volt Battery Case with Switch
- 2x DC Motors with Gearbox
- L298N Motor Driver
- Mini Breadboard
- 4x 10mm M3 Screw and Nut
- 2x IR Obstacle Avoidance Sensor
- 10cm Assorted Breadboard Jumper Wire
- 30mm Rubberbands
- Electrical Tape
- 12 x 12 1/8 inch plywood board
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
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.
- Take two M-to-M wires and cut them in half and strip each end without a pin.
- Twist the wire brush into a tight wrap and slide it into DC motor input. See the second picture for an example.
- 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.
- Repeat the process for the other DC motor input so there are two wires attached to it.
- Tightly wrap the electrical tape around the bell of the motor to cover the exposed wire brushes.
- Repeat this process for the second motor.
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.
- Download the Laser Cut Files in the Supplies section from Tinkercad as an SVG file.
- Upload files to your favorite vector software. TCPL uses Inkscape. Prepare the files based on the requirements of the laser you are using.
- Laser cut the parts on a 12x12 1/8 inch plywood board.
- Once the parts are cut out hot-glue matching wheel pairs together. You should be able to make 3 pairs in total.
- Stretch a rubber band over each wheel.
- Once the wheels are done attach a mini breadboard to the front of the chassis. See the fourth picture for an example.
- Download the 3D Print File in the Supplies section from Tinkercad as an STL file.
- Import the STL in your favorite slicer. Make sure to set the infill to 15% and supports on.
- 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
The power circuit is made using an H-bride L298n motor driver. To learn more about this driver see this link.
- 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.
- Take an orange and a brown M-to-M breadboard wire and cut them each in half.
- 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.
- Twist the wire brushes tight on both the orange and brown wire.
- Take the red wire from the 9volt battery case and insert it into the 12v port on the L298n motor driver. Screw port shut.
- 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.
- Take the orange wire half and insert the brush end into the 5V port on the L298n motor driver. Screw the port shut.
- Attach the L298n motor driver to the chassis with m3 screws and nuts. See the ninth picture for an example.
- Insert the brown and orange wire as shown in the tenth picture.
- 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
- Attach both motors to the chassis using two rubber bands for each side.
- 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.
- Insert the left motor's bottom wire into the OUT3 port on the L298n motor driver. Screw port shut.
- 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
- Take two IR Object Avoidance sensors
- 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.
- 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.
- 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.
- 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.
- Insert the left sensor's orange wire on the breadboard under the orange wire coming from the L298n motor driver.
- Insert the left sensor's brown wire on the breadboard under the brown wire coming from the L298n motor driver.
- Insert the remaining wire of the left sensor into the IN1 pin on the L298n motor driver.
- Insert the right sensor's black wire under the left sensor's brown wire on the breadboard.
- Insert the right sensor's red wire under the left sensor's orange wire on the breadboard.
- 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
- Choose a matching pair of wheels and slide them onto the motors.
- Choose one or a bunch of breaks and slide them into the slits at the front of the robot.
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.
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.