Line Following Car

by ary_verma_01 in Circuits > Arduino

45 Views, 1 Favorites, 0 Comments

Line Following Car

Arduino Car---Final Lid Picture.jpg

Our team (Peyten, Skye, Paige, Ivan & Aryan) made a vehicle that follows a black line using gear motors and line following sensor. This project follows 4H rules, making it perfect for younger students who have less arduino experience to learn about circuits.

Supplies

  1. Sparkfun Arduino Kit: Includes the following
  2. Gear Motors
  3. H-Bridge Motor Driver
  4. Wires
  5. Battery Pack
  6. Arduino Board & Breadboard
  7. Swivel Wheel
  8. Line Following Sensors
  9. 4 AA Batteries
  10. Extension Wires
  11. 3D Printed Files (attached below)
  12. Tape/Glue

If 3D models can't be printed, drawings of the dimensions are included so it can be made out of cardboard. All dimensions are in mm.

Wiring

ME_208_MB2B_Arduino_Board.png
  1. Attach the TB6612 motor driver to the breadboard across the center gap.
  2. Attach the two pushbuttons to the breadboard on the right side.
  3. Connect the motors to the breadboard/motor driver area so the wires can reach the driver.
  4. Connect Arduino 5V to VCC on the motor driver.
  5. Connect Arduino GND to GND on the motor driver.
  6. Connect VM on the motor driver to the 5V pin.
  7. Connect STBY on the motor driver to 5V.
  8. Connect PWMA on the motor driver to Arduino digital pin 11.
  9. Connect AIN1 on the motor driver to Arduino digital pin 12.
  10. Connect AIN2 on the motor driver to Arduino digital pin 13.
  11. Connect the first motor wires to AO1 and AO2 on the motor driver.
  12. Connect BIN2 on the motor driver to Arduino digital pin 10.
  13. Connect PWMB on the motor driver to Arduino digital pin 6.
  14. Connect the second motor wires to BO1 and BO2 on the motor driver.
  15. Connect one side of the first button to Arduino A0.
  16. Connect the other side of the first button to GND.
  17. Connect one side of the second button to Arduino A2.
  18. Connect the other side of the second button to GND.


Code

Upload the following code using Arduino IDE into the Arduino Uno

Attaching Swivel Wheel

Media.jpg

Attach the swivel wheel using tape or glue as shown. This allows turning to be smooth, as the wheel is a ball bearing

Attaching Motors

Media (1).jpg
  1. Connect the wheels to the motors
  2. Attach the motors to the slots as shown

Battery Pack

Media (3).jpg

Tape the battery pack on the bottom as such. This allows for the power source to be easily accessible

Insert Arduino Board

Media (4).jpg

Flip around the base and insert the arduino board into the box as such

Sensor Positioning

Media (2).jpg

On the bottom, tape the sensors so that they are facing outwards towards the front, this will detect the line

Attach Lid

Arduino Car---Final Lid Picture.jpg

Attach the lid to the top and fasten it with tape. Make sure the wires are going through the given holes.