Skip to main content

Rusty the Robot

Line follower and obstacle avoiding robot

info

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 architecture

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

hardware1 hardware2 hardware3 hardware4

Schematics

kicad

Bill of Materials

DeviceUsagePrice
Rapspberry Pi Pico WThe microcontroller35 RON
Ultrasonic sensor HC-SR04Obstacle detection and measurement6.49 RON
Infrared IR sensor modeObstacle avoidance17.56 RON
L293D Dual Motor Driver ModuleMotor control15.46 RON
3V-6V DC motor with reducer 1:48Drive motors19.28 RON
Big wheelsMovement42.84 RON
ChassisStructural support42.84 RON
BatteryPower supply39.98 RON
Mini breadboardElectrical connections2.35 RON
WiresElectrical connections10 RON
Micro USB cableProgramming and power connection6.95 RON

Software

LibraryDescriptionUsage
infraredInfrared sensor libraryUsed for the sensors that will track the line
ultrasonicUltrasonic sensor libraryUsed for the sensors that will avoid the obstacles
embassy_rpEmbassy Hardware Abstraction Layer (HAL) for the Raspberry Pi RP2040 microcontrollerUsed to program the Pico
embassy-executorAn async/await executor designed for embedded usageUsed for task execution
syactA library for controlling stepper motors, servo motors and more complex assemblies using said motors.Used for controlling the motor shield
  1. PID Controller based Line Following and Obstacle Avoidance Two Wheeled Robot
  2. Two wheeled Line Follower using PID ...