Skip to main content

Ferrari Line Follower and Obstacle Avoider Car

A smart Ferrari-inspired autonomous car that navigates and avoids obstacles with precision.

info

Author: Ionescu Maria-Magdalena
GitHub Project Link: https://github.com/UPB-FILS-MA/project-IonescuMariaMagdalena

Description

This project combines the functionality of both line following and obstacle avoidance. The car utilizes sensors to detect both lines on the ground and obstacles in its path, allowing it to make real-time decisions to follow a drawn path while avoiding collisions. The Ferrari Line Follower and Obstacle Avoider Car is a robotic vehicle designed to autonomously follow a specified path marked by lines on the ground while avoiding obstacles encountered along the way. It integrates sensors, actuators, and a microcontroller to achieve this functionality. The car's ability to dynamically adapt its behavior based on environmental cues sets it apart as an autonomous agent. Whether faced with sudden changes in terrain or obstacles, the car recalibrates its trajectory in real-time. The car employs a combination of line following algorithms and obstacle detection techniques to navigate its environment effectively.

Motivation

The motivation behind the Ferrari Line Follower and Obstacle Avoider Car project is to craft an intelligent autonomous agent. This car possesses the ability to dynamically adapt its behavior in response to its surroundings, a feat that sets it apart as in robotics. Whether traversing diverse terrains or encountering different obstacles, the car demonstrates agility, recalibrating its trajectory in real-time to navigate with precision. By engaging in this project, I want to explore the frontiers of autonomous robotics and contribute to the advancement of technology in meaningful and impactful ways. Also, I've always been a huge fan of cars, especially Ferraris and it's a chance to show my DIY skills and dive into the world of robotics and electronics.

Architecture

A prototype of architecture Architecture diagram

The architecture should sort of look like this. I will be using a white cardbox with a black line for the path and different objects as obstacles. This project is a smart car using a Raspberry Pi Pico W and various sensors and components. It has the following strucure:

  • The Raspberry Pi Pico W is a microcontroller board based on the RP2040 microcontroller chip developed by Raspberry Pi, that manages the project's operations, controlling the servo motor, processing sensor data, and handling other components.
  • HC-SR04 ultrasonic distance sensor + mounting bracket: This sensor emits ultrasonic pulses and measures the time it takes for the pulses to bounce back from obstacles, allowing the car to detect objects in its path. The mounting bracket holds the sensor in a fixed position, ensuring accurate readings.
  • SG90 Servo motor: The servo motor is responsible for controlling the steering mechanism of the car. It can rotate to specific angles, allowing the car to change direction based on input from the microcontroller.
  • Two IR sensors FC-123: These infrared sensors detect infrared light reflected off surfaces, enabling the car to follow a predefined path by detecting lines or markings on the ground.
  • Pololu QTRX-HD-06A Reflective IR Sensor: This reflective IR sensor detects contrasts in reflectivity, aiding in line following or edge detection tasks.
  • L298N Motor Driver: The motor driver controls the speed and direction of the motors, converting signals from the microcontroller into power outputs for the motors.
  • Active Buzzer Module: The buzzer module produces audible alerts or tones, which can be used for signaling purposes, such as indicating when an obstacle is detected.

Log

Week 6 - 12 May

I uploaded the project documentation. Then, I received the order for the parts and started working on the car. Also, I began working on the Kicad schematic.

Week 7 - 19 May

I finished the car, I soldered wires to the motors, connected the pico with the other parts and added the driver, Mr. Duckerson. Furthermore, I started to work at the software.

Week 20 - 26 May

I worked very hard for the software, I barely finished and build it on 25th and I flashed it on the PICO. The car follows the line and detects obstacles. I created the route for the car and now Mr. Duckerson can drive in his Ferrari Car, following the black car.

Hardware

Rapspberry Pi Pico W, Four wheels, Four TT Motors, Four AA batteries (1.5V) + mounting device, HC-SR04 ultrasonic distance sensor + mounting bracket, SG90 Servo motor, Two IR sensors FC-123, Pololu QTRX-HD-06A, Reflective IR Sensor, L298N Motor Driver, Mini Breadboard, Active Buzzer Module, Male-female, male-male, female-female wires, Switch l Insulating electrical tape, Double-sided adhesive white tape, Connectors and screws, Chassis, Pin headers.

Photo1 Photo2 Photo3 Photo4 Photo5

Schematics

Place your KiCAD schematics here.

Schematic

Bill of Materials

DeviceUsagePrice
Rapspberry Pi Pico WThe microcontroller35 RON
L298N Motor Driverthe motor11,5 RON
IR SensorInfrared Sensor - obstacle avoidance8,78 RON
Kit SasiuKIT SASIU SMART CAR 4WD75,05 RON
MotorPowering the circuit4,82 RON
SERVOMOTOR SG90 360 GRADE, CONTINUUMicro servomotor11,90 RON
SUPORT SENZOR ULTRASUNETE HC-SR04suport3,95 RON
Senzor Infraroșu Reflectiv Pololu QTRX-HD-06AIR sensors29,99 RON
Senzor ultrasonic HC-SR04distance sensors6,49 RON

Software

LibraryDescriptionUsage
embassy-executorAsynchronous executor for Rust embedded systemsUsed for task scheduling and asynchronous programming
embassy-timeTime management libraryUsed for time-based operations
embassy-rpPeripheral access libraryUsed for initializing and interacting with peripherals
logLogging facadeUsed for logging messages
embassy-usb-loggerUSB logger implementation for embassyUsed for logging messages over USB
gpioGPIO manipulationUsed for interacting with GPIO pins
pwmPulse-width modulationUsed for controlling the distance sensor
  1. example of a car
  2. video of constructing a car
  3. soft help