Rusty the Robot
Line follower and obstacle avoiding robot
Author: Bilciurescu Elena-Alina | Toma Daria-Maria
GitHub Project Link: https://github.com/UPB-FILS-MA/project-ALINA308
Description
This robotics project implements both line following and obstacle avoiding to a robot of relatively small stature. An important part of this project is the use of mathematical algorithms for optimisation in both the line following and the obstacle avoiding functionalities. For the line follower, we are using a PID algorithm instead of a Bang-Bang approach, so that the movements are smoother and more precise. When avoiding obstacles, the robot is calculating the shortest trajectory needed to avoid the said obstacle by using the ultrasonic sensor that is mounted on a 360 degrees servo motor on the top part of he robot. Each of the four DC motors with reducer has a wheel mounted on it and the motors are coordinated by a L293D motor shield.
Motivation
We wanted to combine two of the most useful and widespread robotics projects and optimize them using mathematical algorithms. We also consider that a project that combines these two functionalities has not already been done in the rust programming language, and we wanted to see the differenes between building this type of project in rust and other programming languages. We consider this project a great learning opportunity to develop both new software and hardware skills, while also exploring the challenges and advantages of implementing a multifunctional robotics project in the Rust programming language.
Architecture
The main parts of this robot are:
- line detection module (composed of te two infrared sensors)
- obstacle avoiding module (composed of the ultrasonic sensor and the servo motor it is munted on)
- the power supply (batteries)
- the raspberry pi pico
- the chassis with the 4 wheels and dc motors
Log
Week 6 - 12 May
We finished the KiCad schematic.
Week 7 - 19 May
We finished the hardware and started working on the software.
Week 20 - 26 May
Hardware
- The raspberry pi pico: the "brain" behind the robot.
- The infrared sensors: used for the line detection.
- The ultrasonic sensor: used to detect distances and to avoid the obstacles.
- The 3-6 V dc motors with reducers are used to move and steer the robot.
- The L293D Motor Control Shield: quadruple half h driver, controls the speed and direction of each motor independently (supplies more voltage as well), used instead of the usual dual full h L298N driver that can not control 4 independent motors
- The battery storage case for driver (4 AA batteries) -The battery storage case for the pico (3 AA batteries)
- 4 wheels
Schematics
Bill of Materials
Device | Usage | Price |
---|---|---|
Rapspberry Pi Pico W | The microcontroller | 35 RON |
Ultrasonic sensor HC-SR04 | Obstacle detection and measurement | 6.49 RON |
Infrared IR sensor mode | Obstacle avoidance | 17.56 RON |
L293D Dual Motor Driver Module | Motor control | 15.46 RON |
3V-6V DC motor with reducer 1:48 | Drive motors | 19.28 RON |
Big wheels | Movement | 42.84 RON |
Chassis | Structural support | 42.84 RON |
Battery | Power supply | 39.98 RON |
Mini breadboard | Electrical connections | 2.35 RON |
Wires | Electrical connections | 10 RON |
Micro USB cable | Programming and power connection | 6.95 RON |
Software
Library | Description | Usage |
---|---|---|
infrared | Infrared sensor library | Used for the sensors that will track the line |
ultrasonic | Ultrasonic sensor library | Used for the sensors that will avoid the obstacles |
embassy_rp | Embassy Hardware Abstraction Layer (HAL) for the Raspberry Pi RP2040 microcontroller | Used to program the Pico |
embassy-executor | An async/await executor designed for embedded usage | Used for task execution |
syact | A library for controlling stepper motors, servo motors and more complex assemblies using said motors. | Used for controlling the motor shield |