Line Following & More Using Arduino UNO

by nshafford in Circuits > Arduino

125 Views, 2 Favorites, 0 Comments

Line Following & More Using Arduino UNO

FSX0R0ZLU18T6BY.jpg

In this project you build a car that has separate modes controlled by an IR remote. The three modes are line following, roombah, and DPad mode. The line following mode uses IR sensors to track and follow a black line. The roombah mode has the car drive forward until it meets an object then it will turn to avoid that object and continue forward. The DPad mode allows the user to control the car (forwards, back, left, and right) with the corresponding buttons on the remote. Follow the steps below to build the car yourself!


Supplies

Circuit Supplies:

  • 1 Arduino Uno 
  • 1 Breadboard 
  • 1 Ultrasonic Distance Sensor 
  • 1 IR remote 
  • 1 IR sensor 
  • 3 line sensors 
  • 2 DC motors 
  • 1 DC motor driver 
  • 1 battery holder 
  • Batteries 
  • Lots of jumper cables

Car Supplies:

  • Pencil Box
  • 2 Wheels
  • 3D Printed Parts
  • Hot Glue Gun
  • Rubber band

Assemble the Car

Before you can begin assembly of the car a part must be printed for the frame. After this, we will put holes into our plastic pencil box for the motor wires to go through, and the other four sensors. Now warm your hot glue gun and glue the box to the frame, and the piece of plastic to the front portion of the frame as pictured. Using a rubber band to hold the line sensors to this piece will allow for minor adjustments based on the width of your line. Now you can begin to wire your circuit, which will fit within the pencil box.

Build the Circuit

Group_project_Car_design.png

Attached is a picture of the circuit diagram needed for the car. This step can get messy very easily, just take your time and go one component at a time. Make sure to route the cables for the ultrasonic distance sensor, line sensors, and the DC Motors through the cutouts made in the previous step.


The motor driver on the diagram is not the same motor driver we used on our car. Also, The line sensor is not available on tinker cad the software used to make the diagram so temp sensors are used and are wired how the line sensors should be wired.

Program the Arduino

Attached is the .ino file used to run the car, commented to give context on what each line does. If you would like to tinker with the code and troubleshooting is needed it's recommended to test each action(roombah, line following) separately before combining with the overall code.

Demo

DEMO - ROOMBA MODE
DEMO - REMOTE
DEMO - LINE FOLLOWER