This project is sponsored by JLCPCB - Printed Circuit Board Factory.


The use of sensors programmed by means of Arduino in Arduino robot is present in several competitions known as competitions for line follower robot, and this article refers to the development of a circular-shaped Arduino robot that uses two sensors programmed by means of Arduino Uno.

Among some specific rules for each competition, there is a limitation of the electronic devices that can be used, as well as the microcontrollers involved in the signal processing.

In these competitions, the competitors develop a small Arduino robot capable of following a specified trajectory through a lane, guiding it from the starting line to the finish line.

Depending on the Arduino robot competition, the rules may only allow the use of sensors and a processing platform, or may even allow the implementation of advanced programming through PID controllers (proportional, integrative, and derivative), which is a tool capable of correcting almost instantly the route the line follower robot is taking.

For the automatic detection of the trajectory, an electronic device capable of emitting different wavelengths (which characterizes each color of the rainbow) is used, thus allowing it to be guided as long as the route meets some necessary configurations.

In this way and by means of Arduino and other electronic devices, the line follower robot will be able to correct its trajectory automatically, and for the previous detection of any obstacle in front of the Arduino robot, an ultrasonic sensor was also implemented.

Figure 1 illustrates a line follower robot model using some electronic devices.

CarroCircular v4.png

In the development of this didactic Arduino robot, the line follower infrared sensor (IR) was used, the ultrasonic sensor, two dc motors as well as their wheels, two casters, the motor drive, and the Arduino Uno.

The structure of the Arduino robot was designed in order to support the infrared (IR) sensor module, which will emit a signal if there is variation between white and black, which depending on the path configuration, one will be the color of the strip describing the path, and the other will be the color of the outer region.

After that, Arduino will be responsible for driving the right or left motor drive when there is a curve, or when the car leaves the path. And If something is blocking the robot's path, the ultrasonic sensor will be responsible for detecting it.

In addition, the casters ball will be responsible for maintaining the balance of the Arduino robot, helping it to move.

In this article, you will understand the assembly of the Arduino robot, as well as know its mechanical structure, which was fixed by means of the set nut bolt, in its specific fittings.

Therefore, through this article you will learn:

Now, we will start the full presentation of the development of the Arduino Line Follower Robot.

Line follower Robot development process

This project consists of presenting a didactic robot from a line follower robot car using basically the sensor modules, the ultrasonic sensor among other components, as well as the assembly of its mechanical structure.

The project is basically constituted by a physical structure of circular shape responsible for supporting the electronic components, which will process the signal to make the robot move according to the path it must follow. Figure 2 illustrates the robot's internal region.


In its internal structure, it is possible to observe the two IR sensor modules on the base of the Arduino robot, the motor drive, the motors, and their wheels.

Fittings designed for M3 nuts and bolts were designed to fix the structure. For the engine base to be flat, keeping the yellow wheels and the caster's level, it was necessary to tilt the engines by 6.5º, as shown in Figure 3.


The two IR sensor modules were placed in the central region of the base of the robot, spaced apart in such a way that it was possible to have greater coverage of the ground where the route will be indicated by means of a strip.

This type of sensor is digital, that is, it acts through detection and sends a low or high logic level signal, and the Arduino robot will react according to the implemented programming. Figure 4 illustrates the arrangement of line-sensing IR sensor modules.


The motor driver is the electronic device Motor Driver Module bridge-H-L298N, which is responsible for regulating the electric current intended for operation.

This driver can control from the speed of the Arduino robot wheels through the PWM pins of the Arduino, up to the direction of rotation, being able to control up to two DC motors, or a stepper motor. The driver was fixed to the vertical surface of the rear region, in order to optimize the space. Figure 5 illustrates the driver's layout on the circular Arduino line follower robot.


In addition to the line follower IR sensor modules, the ultrasonic sensor was also implemented, responsible for detecting the presence of objects that are in front of the robot.

Through this sensor, it will be possible to make the Arduino robot deviate its path if an obstacle is detected, as this sensor emits sonic bursts that when in contact with an object, this signal is reflected back to the sensor, and through this, the sensor sends a signal to the Arduino, which through its programming, it is possible to program an appropriate reaction for the line follower robot.

Figure 6 illustrates the position of the ultrasonic sensor in the circular line follower robot.


The Arduino is basically responsible for two purposes: to perform the signal processing coming from the line-sensing IR sensor modules, the ultrasonic sensor, and to make the necessary settings to control the motors through the motor driver through a control programming.

For a better layout, the Arduino was positioned in the upper region of the line follower robot.

For this project, we'll use the JLCPCB Arduino Compatible printed circuit board presented below.

You can obtain the Arduino JLCPCB compatible PCB for your projects for $2 in your first order with the link: Earn my PCBs Arduino Compatible.

Access the link and download the Gerber files of the JLCPCB Arduino Compatible Printed Circuit Board.

Next, we'll see how the programming logic works to control the mobile robot.

Mobile Robot Logic Programming

The operating principle of the Arduino robot is based on line follower sensors, which, depending on the configuration of the runways, will detect the presence or absence of a black or white band.

The IR sensor modules will detect the range, and when the Arduino robot moves out of the path described by the range, the sensors will send a signal to the Arduino indicating the variation in the detection of the black, or white color, which will be the color of the range.

When this happens, the Arduino will start the necessary engine so that the path is completed as quickly as possible.

When the path has courses, the IR sensor modules will work in the same way, decelerating one of the engines, so that it is possible to turn in the necessary direction.

The ultrasonic sensor in front of the circular line follower robot is necessary to detect the presence of any obstacles along the way and if it does, a signal will be sent to the Arduino, and through its programming, the correct correction will be made in the path to deviate from the object.


Therefore, from the development of the circular line follower robot, it was possible to analyze its mechanical structure, optimizing the available spaces. The robot's structure was modeled with M3 fittings and screws for its fixation, and thus, creating better mechanical stability.

All its development was done with the purpose of making it as didactic as possible for its subsequent assembly with the electronic part.

With that, we conclude that each part of the structure was checked and analyzed, in order to better understand the importance of correct assembly, observing the function (according to the structure where it was fitted) of each component.

Download Robot Parts

We want to thank the support of JLCPCB for the development of this project. You can purchase your board 5 units of your Arduino board to assemble your robot for $2.

If you want the laser cut files to assembly your Arduino robot, send me an email to