Skip to content
Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

219 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Autonomous Robot Project for WRO - Future Engineers Category

πŸ€– About the Competition

The World Robot Olympiad (WRO) is a prestigious international competition that challenges students from around the globe to solve problems through creative, functional, and technically sound robotic solutions. One of its most engaging categories is Future Engineers, which focuses on developing advanced technologies to tackle real-world challenges, encouraging innovation, critical thinking, and collaborative work.

This year's challenge in the Future Engineers category is particularly exciting: to design and build an autonomous vehicle capable of making intelligent decisions and adapting to a dynamic environment. The challenge offers a unique opportunity for young engineers to explore the fundamentals of modern robotics, including motor control, sensor processing, and autonomous navigation.


πŸš— Project Description

This repository documents the hardware and software architecture developed to build an autonomous vehicle designed to compete in the Future Engineers category of the WRO. The system has been carefully designed to address two specific challenges defined by the competition:

  1. Open Challenge: The vehicle must complete three laps on a closed track, where inner walls are randomly placed each run. The robot must avoid collisions through accurate obstacle detection.

  2. Obstacle Challenge: Along the route, the robot will encounter colored pillars acting as traffic signals. Red pillars indicate the robot should drive on the right, while green pillars indicate it should drive on the left. The vehicle must navigate without knocking over these signals, and at the end of the route, it must detect a parking zone and autonomously perform parallel parking.

The design integrates multiple technologies: ultrasonic sensors, a gyroscope, a Pixy2 camera, DC motors, and an H-bridge, all controlled by an Arduino Uno microcontroller. The system includes a voltage regulator and capacitors to protect sensitive components and ensure safe, stable operation. This documentation serves as a technical guide for the development process and as a reference for future teams participating in similar robotics challenges


🎯 Project Objective

The goal of this project is to design, build, and program an autonomous robot using open-source hardware, environmental sensors, and adaptive motion algorithms. The robot dynamically perceives its surroundings and makes decisions based on sensor feedback, enabling efficient navigation and autonomous obstacle avoidance.

Core development goals:

  • Strengthen real-world engineering skills such as problem-solving and teamwork.
  • Apply sensor-based motion control for precise navigation.
  • Develop an optimized autonomous driving strategy for robotics challenges.
  • Contribute to the open-source robotics community by documenting the solution for future teams.

🧩 Components Used

Quantity Component Image Description
1 Arduino UNO - ATmega328P microcontroller
- Operating voltage: 5V
- 14 digital pins (6 PWM)
- 6 analog inputs
- Memory: 32 KB flash, 2 KB SRAM, 1 KB EEPROM
- Communication: USB, UART, I2C, SPI
- Main system control, sensor reading, PWM signal generation, external communication
- Power supply: 7-12V
- Easy programming via Arduino IDE
1 Protoboard - 830 solderless connection points
- Enables rapid prototyping
- Temporary connections between components
- Side rails for power (Vcc and GND)
- Compatible with standard cables and pins
- Plastic body with internal metal contacts
- Ideal for testing circuits without soldering
2 DC Engine - Nominal voltage: 6–12V
- No-load current: ~300 mA
- Brushed DC motor
- Provides rotational motion
- Controlled via H-bridge for direction and speed
- Adequate torque for small vehicles
- Compact and lightweight
1 Servo Motor - Operating voltage: 4.8–6V
- Max current: ~500 mA
- Rotation angle: 0Β° to 180Β°
- Micro servo with plastic gears
- Precise angular position control via PWM
- Used for moving sensors or steering
- Compact and lightweight
2 Ultrasonic Sensors - Operating voltage: 5V DC
- Range: 2 cm to 400 cm
- Accuracy: Β±3 mm
- Ultrasonic frequency: 40 kHz
- Pins: Trigger and Echo
- Measures distance for obstacle avoidance
- Fast response time
- Detects objects in a straight line
1 HG7881 H-Bridge - Operating voltage: 2.5–12V
- Max current: 800 mA per channel
- Dual channel motor driver
- Controls motor direction and speed via PWM
- Includes internal protection diodes
- Compact and efficient for small projects
1 MPU-6050 Gyroscope - Power supply: 3.3V–5V
- 3-axis gyroscope and 3-axis accelerometer
- I2C communication
- High precision for orientation and balance
- Used for stabilization and motion tracking
- Low power consumption
1 Pixy2 Camera - Operating voltage: 5–10V DC
- Communication: SPI, UART, I2C
- Smart sensor for object detection and tracking by color
- Internal image processing
- Sends processed data for decision making
- Used for advanced navigation and tracking
1 Voltage Regulator - Input voltage: 7–12V DC
- Fixed output: 5V DC
- Max current: typically 1A
- Provides stable and filtered voltage
- Overvoltage and thermal protection
- Protects sensitive components
3 Capacitors - Electrolytic polarized capacitors (100ΞΌF, 10ΞΌF)
- Filters electrical noise and voltage spikes
- Stabilizes power supply
- Temporary charge storage
- Placed near regulators and modules
- Improves system stability and performance

πŸ”„ Relationship Between Electromechanical Components

  • 🧠 The Arduino UNO acts as the brain of the vehicle, receiving data from sensors and sending control signals to actuators to coordinate movement.

  • πŸ“ The ultrasonic sensors send distance information to the Arduino about side obstacles, allowing adjustment of direction and speed to avoid collisions.

  • πŸŒ€ The MPU-6050 gyroscope provides orientation and angular velocity data to the Arduino, which uses it to stabilize and correct the vehicle’s trajectory.

  • πŸŽ₯ The Pixy2 camera complements the system’s vision by detecting objects and helping the Arduino follow routes or identify specific targets.

  • βš™οΈ The HG7881 H-Bridge receives commands from the Arduino to control the direction and speed of the DC motors, enabling forward, backward, and turning movements.

  • πŸ”© The DC motors execute the commands received from the HG7881, converting electrical energy into physical movement to drive the vehicle.

  • πŸ”Œ The voltage regulator supplies stable and safe voltage to the Arduino, sensors, servo, and HG7881 controller, protecting the electronic components.

  • β†ͺ️ The servo motor adjusts steering or sensor orientation based on control signals from the Arduino, improving maneuverability and environmental scanning.

  • πŸ”‹ The capacitors filter electrical noise and stabilize voltage, ensuring sensors, Arduino, and HG7881 operate without interference.

  • 🧩 The protoboard facilitates physical connections and distribution of power and signals among all components, allowing organized and flexible assembly without soldering.

Each component depends on the information or energy it receives and transmits to others, creating a coordinated system where sensors detect the environment, the Arduino processes information, and actuators like motors and servos execute the necessary actions for the vehicle’s proper operation.


πŸš— Strategy and Code Deployment for Autonomous Vehicle Project

The designed strategy combines mechanical, electronic, and perception components to simulate an intelligent vehicle that autonomously navigates a route under conditions similar to a controlled urban environment. The key elements to meet the challenges are:

  • βš™οΈ Motorization and Steering:
    An electric motor drives the rear wheels of the vehicle, while a servo motor on the front axle allows left and right steering maneuvers, imitating a real car's steering system.

  • πŸŽ₯ Vision and Perception:
    A front-mounted camera enables detection of obstacle distances and traffic light colors (red or green), a critical decision factor to deviate either right or left. This visual component acts as the main perception system for the frontal environment.

  • πŸ“‘ Side Sensors:
    Two ultrasonic sensors located on the vehicle's sides measure the distance to obstacles on each side. Based on this data, the system determines the safest side to turn when detecting an obstruction or needing to take a curve.

  • 🧭 Orientation System:
    A gyroscope allows the vehicle to recognize its spatial orientation, record the initial position, and ensure that at the end of the route it parks parallel at the same starting position. This component is essential to meet the precise navigation requirements of the competition.


🧠 General Code Structure

This project is divided into functional modules that manage the behavior of an autonomous robot. Below is an overview of the main components of the code:

1. πŸ“š Library Imports

Essential libraries are included to:

  • Control the servo motor.
  • Enable I2C communication.
  • Interface with the MPU6050 gyroscope sensor.

These libraries simplify hardware interaction and keep the code modular.

2. 🧩 Pin and Object Definitions

Microcontroller pins are assigned to the motors, ultrasonic sensors, and servo. Objects are also created for the servo and gyroscope to manage their operation.

3. βš™οΈ Variables and Constants

Constants define decision thresholds (e.g., safe distances to avoid obstacles), and global variables are used to store values like rotation and timing.

4. πŸ”§ Initial Setup

In the setup() function:

  • Pins are configured.
  • I2C communication is initialized.
  • The MPU6050 sensor is initialized and tested.
  • The servo motor is attached.

The serial monitor confirms whether sensors are functioning correctly.

5. πŸ“ Ultrasonic Sensor Readings

Functions are included to measure distance using ultrasonic sensors on the left and right. This helps the robot detect obstacles and make directional decisions accordingly.

6. πŸš— Movement Functions

Basic movement functions are defined:

  • Move forward
  • Move backward
  • Stop

These directly control the motor pins and determine the robot's mobility.

7. πŸ” Main Loop (loop)

The core of the program:

  • Gyroscope data is captured.
  • Rotational velocities are integrated to calculate orientation angles.
  • Data is printed to the serial monitor for debugging or tuning.

There is also commented-out logic that could enable obstacle-avoidance behavior using the ultrasonic sensors.This modular structure makes it easy to scale the system, such as adding more sensors, a camera, or other peripherals without overcomplicating the main codebase.


πŸ’» Code Compilation and Upload Process

βš™οΈ Development Environment Installation

To work on this project, you need the appropriate environment. It is recommended to use the Arduino IDE, preferably version 1.8.19 or higher, to ensure compatibility with all the libraries used and to avoid compilation errors.

πŸ“š Required Libraries:

  • Servo.h: Enables control of servo motors.
  • Pixy2.h: Provides functions necessary to communicate with the Pixy2 vision sensor.

These libraries can be easily installed from the Arduino IDE Library Manager or manually downloaded from their respective repositories.

πŸ—‚ Project Structure

The source code must be organized properly to ensure correct functionality. All .ino files should be located within the same folder, which must be named exactly as the main file (usually main.ino). This structure is required by the Arduino IDE to properly compile the different modules of the project.

βš™οΈ Compilation Process

Before compiling the code, configure the environment as follows:

  1. Go to Tools > Board, and select the appropriate board model β€” in this case, Arduino UNO.
  2. In the same menu, select the COM port to which your device is connected.
  3. Once configured, click the Verify button (βœ”οΈ) to compile the code. This action translates the source code to machine language and detects syntax errors or library issues.

πŸš€ Uploading the Program

Once the code is compiled:

  1. Connect the Arduino UNO board to your computer via USB cable.
  2. Press the Upload button (➑️) in the IDE to load the program into the microcontroller’s memory.
  3. After upload completes, you can monitor the system behavior using the Serial Monitor accessible from Tools > Serial Monitor, which is especially useful for debugging and data flow verification

πŸ‘₯ Authors

This project was developed by the Neo Engineers team for the WRO 2025 competition.
Participants:

  • Nelson Figueroa
  • Gabriela Cisnero
  • Jesus Alfonzo

About

Repositorio en el que se participo para las olimpiadas de la WRO 2025

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages