Ferrari Line Follower and Obstacle Avoider Car
A smart Ferrari-inspired autonomous car that navigates and avoids obstacles with precision.
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
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.
Bill of Materials
Device | Usage | Price |
---|---|---|
Rapspberry Pi Pico W | The microcontroller | 35 RON |
L298N Motor Driver | the motor | 11,5 RON |
IR Sensor | Infrared Sensor - obstacle avoidance | 8,78 RON |
Kit Sasiu | KIT SASIU SMART CAR 4WD | 75,05 RON |
Motor | Powering the circuit | 4,82 RON |
SERVOMOTOR SG90 360 GRADE, CONTINUU | Micro servomotor | 11,90 RON |
SUPORT SENZOR ULTRASUNETE HC-SR04 | suport | 3,95 RON |
Senzor Infraroșu Reflectiv Pololu QTRX-HD-06A | IR sensors | 29,99 RON |
Senzor ultrasonic HC-SR04 | distance sensors | 6,49 RON |
Software
Library | Description | Usage |
---|---|---|
embassy-executor | Asynchronous executor for Rust embedded systems | Used for task scheduling and asynchronous programming |
embassy-time | Time management library | Used for time-based operations |
embassy-rp | Peripheral access library | Used for initializing and interacting with peripherals |
log | Logging facade | Used for logging messages |
embassy-usb-logger | USB logger implementation for embassy | Used for logging messages over USB |
gpio | GPIO manipulation | Used for interacting with GPIO pins |
pwm | Pulse-width modulation | Used for controlling the distance sensor |