














































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!















































Content
In the early phase of our project, we took time to review past work on line-following robots. This helped us understand the main approaches used in both hardware and software. Out of all the material we found, two papers stood out and really helped shape our prototype. One was focused on traditional sensor-based robots, while the other explored computer vision in challenging lighting conditions. Design and Implementation of Conventional Line-Following Robots The first paper we relied on was âA Line Follower Robot from Design to Implementationâ by Pakdaman, Sanaatiyan, and Rezaei (2010). It discusses a robot named TABAR, designed for university competitions in Iran. The system used infrared sensors, an ATmega16 microcontroller, analog-to-digital converters, and an L298 motor driver. One of the key takeaways was how important sensor placement is to detect black lines on white surfaces. The sensors read the reflectance difference, and the microcontroller uses this data to control the motors using PWM signals. They also describe how the robot navigates curves and intersections. This paper helped us understand how a typical robot is built in modules. Sensors serve as inputs, the microcontroller processes data, and the H-bridge drives the motors. It also made us aware of the limits of using only hardware logic in complex environments. Improving Vision Systems Under Variable Lighting Conditions The second paper, âVision Enhancement of Line Following Robot in Variable Lighting Environmentsâ by AbouElela, Hafez, and Elewa (2014), focused on using computer vision to handle inconsistent lighting. This is a common problem indoors, where lighting can change depending on the source. They used image processing techniques like color correction (Gray-World, Max-RGB, Gray-Edge), converting to HSI color space, contrast enhancement, noise filtering, and morphological operations to fix line breaks. Their setup used a webcam and a laptop running MATLAB, which sent control signals to an Arduino board. This approach was especially useful for our project since we also use a camera and real-time image processing. The paper showed us how to improve line segmentation and keep the system stable under sudden lighting changes. Integration of Approaches Even though the two papers used different methods, both were important in shaping our final design. From the first, we used the classic robot structure with motors, a microcontroller, and PWM control. From the second, we adopted computer vision as the main input for navigation. By combining these ideas, we created a hybrid system. Our robot includes gear motors, a PWM controller, and a Raspberry Pi Zero 2W. It processes camera input in real time, cleans up images,
and runs a TensorFlow Lite model for inference. This setup helped us deal with real-world challenges like lighting shifts and partially visible lines in an efficient and modern way.
The line follower robot is a mobile machine that can detect and follow a line drawn on the floor. Usually, the path is already defined and can be clearly visible, like a black line on a white surface with strong color contrast, or it can be invisible, such as a magnetic field (Pakdaman, 2010). One method to detect the line is to use different colors with high contrast for the line and the background so the robot can recognize which is which. However, this has a lot of variation depending on the color and brightness of the surrounding light, and it may change during movement, therefore the sensors cannot detect the line as it should. Shadows, reflections, and objects nearby can also change the way light is reflected. Another variation the type of light, for example a place with fluorescent lighting might not perform the same in an area that uses incandescent lighting, since these light types create different effects on how colors are seen by the sensors (AbouElela, 2014). To solve this problem, it is important to create a stronger and reliable system that improves the robot's ability to understand its environment. A good option is to use computer vision and artificial intelligence. These technologies will help the robot to process visual data in a more flexible and correct way. This project focuses on building a mobile robot that can follow a black line by itself in different lighting conditions. It uses artificial vision with machine learning methods. The robot will take pictures in real time, change them into binary images to get the main details of the line, and use a convolutional neural network (CNN) to decide the correct movement. Then, it will send PWM signals to move the motors. The performance of the robot will be tested in many types of environments to see how strong and flexible it is. Some changes in the AI model and control settings will also be done to make the robot work better.
Line-following robots are simple robots. These robots are generally designed to perform a single task: follow a line marked on the ground. Usually, this line is black on a white background to provide a high contrast. To achieve this task, line-following robots use sensors that interact with the processing unit. The components implemented in the following line of this project are the ones shown below.
o Material: Both the casing and the gears are made of ABS plastic, which reduces weight and cost without compromising functionality. Figure 1. DC motor.
Figure 4. Raspberry Pi Zero 2 W. Technical Specifications: o Processor: Broadcom BCM2710A1, a quad-core ARM Cortex-A53 SoC running at 1 GHz, similar to the one used in the Raspberry Pi 3. This architecture allows for multitasking such as image processing and system logic control. o RAM: 512 MB LPDDR2, sufficient for basic vision and control operations in a linefollowing robot. o Wireless Connectivity: Includes Wi-Fi 802.11 b/g/n and Bluetooth 4.2 BLE, useful for remote debugging, data transfer, or external control. o Available Ports: o Mini HDMI port for direct monitor connection during testing or visualization. o Micro USB (OTG) for both power supply and peripheral connection via adapter. o CSI-2 port for connecting a compatible camera with high video transmission efficiency. o 40 - pin GPIO header for controlling motors, line sensors, and other components. o Storage: Uses a microSD card to store the operating system and project files. o Power Consumption: While relatively moderate, the Raspberry Piâs power demand is high enough in this project to require a dedicated 5V power source. The shared battery system cannot reliably power both the Raspberry Pi and the motors simultaneously without compromising performance.
o Compatibility: Fully compatible with the libcamera library and other development environments used in computer vision. o Lighting Conditions: Available in IR-filtered (standard) and NoIR (no infrared filter) versions, allowing appropriate selection based on the operating environment's lighting conditions. o Compact Size: Its lightweight and compact design makes physical integration into the robot chassis easy without adding significant weight. Figure 5. Raspberry Pi Camera Module 3
13 Output 4 Connected to the other side of Motor B. 14 Input 4 Control input for Output 4. 15 Enable 3,4 Enables outputs 3 and 4 (must be HIGH to activate right H-bridge). 16 VCC1 (Logic Supply) Logic power supply (typically 5V for microcontroller compatibility).
Computer vision works similarly to human vision, except that humans have the advantage of a lifetime of context to understand how to distinguish objects, their distance, movement, or whether something is wrong in the image. The three main uses of computer vision are:
The goal of image processing is to compensate for deficiencies when capturing an image with a camera. These deficiencies may be related to contrast, brightness, or other visual aspects. To correct them, preprocessing algorithms are applied, performing basic operations such as filtering, level adjustment, normalization, and others. In particular, preprocessing is applied to images with dimensions MĂN and 256 grayscale levels per pixel. In this context, a value of 0 represents pure black, while 255 represents pure white. (Chang,
The main goal of preprocessing is to facilitate later stages such as segmentation, feature detection, or pattern recognition.
Thresholding is a fundamental technique in image processing that allows calculating or modifying a threshold value based on the uniqueness of the evaluated environment or context. (Alvear, 2018) This method is key for image segmentation. Through thresholding, a grayscale image can be converted into a binary image composed of only two color levels: black and white.
Among the most prominent techniques used in segmentation is:
AI allows the robot to learn complex patterns from data. In a line-follower robot, a computer vision model can be trained to recognize the line in an image and predict the correct movement (turn, go forward, etc.). Unlike PID or fuzzy logic, AI does not require explicit rules, as it learns from examples (with labeled images and associated actions). This enables more robust and adaptive control, although it requires more processing power and prior training.
A convolutional neural network (CNN) is a type of artificial neural network designed to process data with image-like structure. These networks are especially useful for computer vision tasks, as they can automatically identify visual patterns and features from image data (DataScientest, s.f.). A CNN is composed of an input layer, an output layer, and several intermediate hidden layers. Each of these layers is responsible for extracting different types of features from the images. Initially, the layers detect basic elements such as edges or contrast, and as the information progresses through the network, more complex patterns are recognized, helping to identify shapes or objects. In this project, a CNN was implemented to enable the robot to autonomously follow a black line. The images captured in real time by the camera were first binarized to facilitate processing. The neural network then processed these images through several layers:
The following flow chart shows the core hardware elements of the robot; the lines show the data flow through the elements. First, the camera records the path that is in front of, then the raspberry makes all the processing, so its output is the input to the L293D driver, this component handles the power for the motors which is the element we want to control. Figure 7: Hardware diagram.
Figure 8: Electrical Wiring
Figure 9: Neuronal Network Flowchart