Line-Following Robot

by saamiak in Circuits > Arduino

18 Views, 0 Favorites, 0 Comments

Line-Following Robot

PXL_20260409_042855103.jpg

This is a line-following, Arduino Nano-powered robot. We thought it was a cool project to make, and could potentially be used to deliver items from one place to another. Because of the IR sensors, the car is able to follow black lines and reach from point A to point B.

Supplies

Screenshot 2026-03-26 091705.png

Arduino Nano

Chassis (Comes with Motors + Wheels)

L298N Motor Driver

Jumper Wires (All Kinds)

Soldering Iron (+ other materials needed to solder)

Breakout Board for Nano

IR Sensors

Arduino IDE Software (FREE)

Mechanical Tape

Assemble the Chassis

chassis.PNG

Put the parts together as instructed in the QR code provided in the box. Add the wheels and motors, screw the parts onto the frame.

Test the Driver

motors.jpeg

Before implementing the L928N Driver into the robot, we need to test it by itself. Use the circuit diagram below to do the wiring. This is a part of debugging, where each individual system is tested before the entire system is assembled. After doing this, connect the batteries to their respective terminals in front. Using a male to male jumper wire, test to see if the motors are spinning. Make sure to map out which pin controls which direction of motor.

Connect All Electronics

Screenshot 2026-03-26 094412.png
PXL_20260409_041855412.jpg

Connect the LN Driver and motors (using the diagram in Step 2). Keep the battery Pack, but now connect the 5V Terminal to the Nano. Connect all pins to Nano (including sensors and LN Driver). In order to connect the sensors to the Nano, you will need to solder 2 to 1 jumper wires. You will know which pins are connected by the code below. Feel free to modify it to your preference.

Code

Import the following code into Arduino IDE. There are captions next to most of the lines so that it is easier to understand. (OPTIONAL: USE THE BLINK TEST TO SEE IF ALL THE COMPONENTS ARE WORKING). Copy and paste the code into a new sketch.

Downloads

Debugging

PXL_20260409_042542168.jpg

This is the most crucial, and possibly most time-taking step in the project. Make sure your components are not fried and ensure that electrical connections are being made by using a multimeter. Make sure parts are held together by tape, and go step by step.

Testing

PXL_20260409_042602696.jpg

Make a black line on the ground, using tape or any other medium. Turn the switch on your robot, and watch it move!