# NEDrobotics – WRO Future Engineers 2025 This repository documents the work of **Team NEDrobotics** for the **World Robot Olympiad (WRO) 2025 Future Engineers** category. Our team consists of three members: - [Nicat Vəliyev](https://www.linkedin.com/in/nicat-vəliyev-2816b3269) - [Elnur Məmmədov](https://www.linkedin.com/in/elnurmammadovv) - [Davud Məmmədov](https://www.linkedin.com/in/davud-məmmədov-383a292a7) We designed, built, and programmed an autonomous vehicle capable of competing in the WRO Future Engineers challenges. This README explains our hardware, electronics, software modules, and the process to build and upload code to our robot. The goal is to make our work **clear, reproducible, and useful for other teams.**
--- ## 📋 Contents - 👀 [Project Overview](#project-overview) - 🏎️ [Hardware and Chassis Design](#hardware) - 🔧 [3D Print The Parts](#3dparts) - ⚡ [Electronics and Components](#electronics) - 🔋 [Li-ion Battery and Li-Po Battery](#li-ion-and-li-po) - 🖥️ [Arduino Mega 2560](#arduinomega2560) - 👁️ [HC-SR04 Ultrasonic Sensors](#hc-sr04) - ⚙️ [L298N Driver and LM2596 Regulators](#l298n-and-lm2596) - 🛞 [Lego Wheels](#wheels) - 📷 [HuskyLens Pro](#huskylens) - 🔄 [MG90 Servos and DC Motor](#servos-and-motor) - ⚙️ [Lego Differential](#differential) - 🛠️ [Wiring and Integration](#wiringandintegration) - 🔋 [Power Management](#powermanagement) - 🤖 [Arduino Pins](#arduinopins) - 👨💻 [Software and Control Architecture](#software) - 🖥️ [Arduino Code (Low-Level Control)](#arduino) - 📷 [Vision and AI Processing](#vision) - 🏎️ [Obstacle and Race Management](#obstacle) - 🧠 [The robot's operating logic and code sequence](#logic) - ⚙️ [Pseudo code](#pseudo) - 💵 [Bill of Materials](#billofmaterials) - 📦 [Component Costs](#components) - 🖨️ [3D Printing Cost](#printingcost) - 🔩 [Other Materials (Screws, Nuts, Jumpers, Heat shrinks)](#othermaterials) - 💵 [Total Costs](#totalcosts) - 📷 [Photos and Media](#media) - 🏁 [The robot's mission rounds](#mission) - 🖼️ [Photos of the robot](#photosofrobot) - 📝 [The robot's electronic schematic](#schematic) - 🖼️ [Photos of the team](#photosofteam) - 🛠️ [Changes and Improvements](#changes) - 🔮 [Reproducibility and Future Work](#future) - 📏 [Techinal Specifications](#techinal) - 📑 [Conclusion](#conclusion) --- ## 👀 Project Overview Team NEDrobotics joined the WRO Future Engineers challenge with the goal of creating a reliable and intelligent self-driving robot. The competition requires designing a car that can: - Drive autonomously on a race track - Detect and avoid obstacles - Handle turns, walls, and markers - Demonstrate efficient use of sensors and algorithms Our design integrates **Arduino Mega 2560** for control, **HuskyLens Pro camera** for color recognition of traffic signs, **ultrasonic sensors** for distance detection from various targets. We combined **3D-printed parts, 12V DC motor, and servo-based steering** to create a modular, flexible and upgradable robot. --- ## 🏎️ Hardware and Chassis Design - **🔧 Chassis:** Built with 3D-printed parts for structure and flexibility - **🔧 Custom 3D Parts:** Hold electronics, motor, and sensors in place - **🔧 Motor:** One 12V DC motor for precise speed and torque control - **🔧 Drive train:** Differential drive and steering system with LEGO parts - **🔧 Steering:** One MG90 180° servo motor with Lego gears - **🔧 Stability:** Low center of gravity increases balance during turns |
| Details |
| ------------------------------------------------------------------------ | ------- |
|**Dimensions:** 100x266mm |**Filament Type:** PLA |
The final build is **strong, lightweight, reliable, and modular**.
---
## ⚡ Electronics and Components
### 🔋 Li-ion Battery and Li-Po Battery
|
|
|
| ----------------------------- | -------------- |
|**Model:** Li-ion 18650 Battery |**Model:** 2s Li-Po Tattu Battery |
|**Voltage:** 3.7v |**Voltage:** 7.4v |
|**Weight:** 45g |**Weight:** 31g |
|**Discharge Rate:** 2C |**Discharge Rate:** 95C |
|**Functions:** Power the motors/leds |**Functions:** Power the modules
|**Capacity:** 2600mAh |**Capacity:** 500mAh |
---
### 🖥️ Arduino Mega 2560
|
| Details |
| ------------------------------------------------------------------ | ------- |
|**Microcontroller:** ATmega2560 |**SRAM:** 8KB |
|**Operating Voltage:** 5V |**EEPROM:** 4KB |
|**Input Voltage:** 7-12V (recomd.) |**Memory:** 256KB |
|**Digital I/O Pins:** 54 |**Clock speed:** 16 MHz |
|**PWM Pins:** 15 |**Weight:** 37g |
|**Current Draw:** 50mA |**Dimensions:** 102x53x30mm|
---
### 👁️ HC-SR04 Ultrasonic Sensors
|
| Details |
| ---------------------------------------------------------------------- | ------- |
|**Model:** HC-SR04 |**Min range:** 2cm |
|**Operating Voltage:** 5V |**Max range:** 4m |
|**Ultrasonic Frequency:** 40Hz |**Measuring Angle:** 15 degree |
|**Weight:** 8.5g |**Dimensions:** 45x20x15mm |
|**Current Draw:** 15mA |**Accuracy:** 0.3cm (3mm) |
---
### ⚙️ L298N Driver and LM2596 Regulators
|
|
|
| ------------------------------------------------------------------------ | ------- |
|**Driver Model:** L298N 2A |**Model:** LM2596 Buck Converter |
|**Driver Chip:** Double H Bridge L298N |**Input Voltage:** 4V-35V |
|**Logic Voltage:** 5V |**Output Voltage:** 1.23V-30V |
|**Driver Voltage:** 5-35V |**Output Current:** 3A (max) |
|**Weight:** 25g |**Weight:** 11g |
|**Idle Current:** 36mA|**Idle Current:** 5mA
---
### 🛞 Lego Wheels
|
| Details |
| ---------------------------------------------------------------------- | ------- |
|**Part Number:** 56145c01 |**Model Number:** 11218 |
|**Size:** 43.2x22mm |**Rim Size:** 20.66mm (0.79inches) |
|**Weight:** 59g |**Wheel Size:** 22mm |
---
### 📷 HuskyLens Pro
|
| Details |
| ---------------------------------------------------------------------- | ------- |
|**SKU:** SEN0336 |**Camera:** OV5640 5.0MegaPixel |
|**Functions:** Face Recognition, Object Tracking, Object Recognition, Line Tracking, Color Recognition, Tag Recognition, Object Classification, QR Recognition, Barcode recognition | **Weight:** 40g |
|**Current Draw:** 320mA @3.3V, 230mA @5.0V | **Dimensions:** 52x44.5mm |
---
### 🔄 MG90 Servos and DC Motor
|
|
|
| -------------------------------- | ----------------------------------- |
|**Operating Voltage:** 4.8V to 6V (Typically 5V) |**Motor:** RS-280 |
|**Gear Type:** Metal |**Operating Voltage:** 6V – 12V |
|**Stall Torque:** 1.8kg/cm (4.8V) |**Body diameter:** ~24mm |
|**Max Stall Torque:** 2.2kg/cm (6V) |**Shaft diameter:** ~2.0mm
|**Weight:** 13.4g |**Weight:** 55g (appr.) |
|**Rotation:** 0°-180° | **Torque:** 4.46mNm |
|**Rated Current:** 250mA | **Rated Current:** 280mA |
|**Stall Current:** 850mA | **Stall Current:** 1.5A |
---
### ⚙️ Lego Differential
|
| Details |
| ------------------------------------------------------------------------------ | ------- |
|**Part Number:** 62821 |**Gear Type:** 28-tooth bevel gear |
|**Weight:** 2.8g (appr.) |**Color:** Dark Bluish Gray |
---
## 🛠️ Wiring and Integration
### 🔋 Power Management
- **2S 18650 (Main) → XL6009 Voltage regulator (12V) & (LM2596 - B) → L298N Driver → DC Motor & LEDs**
- **2S Li-Po (Other) → (LM2596 - A) & (LM2596 - C) & (Arduino)**
- **LM2596 - A → Ultrasonic Sensors**
- **LM2596 - B → Servo**
- **LM2596 - C → HuskyLens Pro**
### 🤖 Arduino Pins
- **D8~ → 🛞 Motor Driver ENA**
- **D9~ → 🛞 Motor Driver ENB**
- **D22 → 🛞 Motor Driver IN1**
- **D23 → 🛞 Motor Driver IN2**
- **D24 → 🛞 Motor Driver IN3**
- **D25 → 🛞 Motor Driver IN4**
- **D11~ → 🔄 Servo PWM**
- **D16 → 📷 HuskyLens RX Pin**
- **D17 → 📷 HuskyLens TX Pin**
- **D44 → ⬅️ Left Ultrasonic Echo Pin**
- **D45 → ⬅️ Left Ultrasonic Trig Pin**
- **D46 → ➡️ Right Ultrasonic Echo Pin**
- **D47 → ➡️ Right Ultrasonic Trig Pin**
- **D48 → ⬆️ Front Ultrasonic Echo Pin**
- **D49 → ⬆️ Front Ultrasonic Trig Pin**
- **D53 → 🚩 Start Button**
- **🚩 Start Button → GND**
###### ( ~ ) = PWM Pins
###### ( D ) = Digital Pins
---
## 👨💻 Software and Control Architecture
### 🖥️ Arduino Code (Low-Level Control)
- Runs on Arduino Mega
- Handles motor control, servo steering, ultrasonic readings
- Uses PWM and smooth acceleration
### 📷 Vision and AI Processing
- Managed by HuskyLens Pro
- Detects colors of the traffic signs
- Sends data to Arduino for decisions
### 🏎️ Obstacle and Race Management
- State-machine logic with behaviors:
- START
- DETERMINE DIRECTION
- EXIT PARKING LOT
- REPEAT UNTIL 3 LAPS COMPLETED:
- DETECT COLOR OF THE TRAFFIC SIGN
- TURN LEFT AND FOLLOW LEFT WALL / TURN RIGHT AND FOLLOW RIGHT WALL
- DETECT COLOR OF THE NEXT TRAFFIC SIGN AND MAKE SUITABLE CORNER TURN
- PARK
- FINISH
### 🧠 The robot's operating logic and code sequence
- **PID wall-following**
- The robot uses a classic PID loop to maintain a set distance from the wall: `error = targetdistance - measured_distance` (measured from the active side ultrasonic). Readings are first smoothed with an EMA to suppress noise. The PID output (clamped to a maximum correction in degrees) is translated into servo angle offsets around `spos`; when following the right wall the output sign is inverted so a positive command always means “steer left” in code. Forward motor PWM is automatically scaled down based on how large the steering correction is, so the robot slows during aggressive steering.
- **Ultrasonic sensors**
- The ultrasonic sensors on the right and left sides determine how far away the robot is from the wall and in which way it should move. During the loop, if the robot is moving clockwise, it uses the data from the left sensor to orient itself (PID wall following); if it is moving counterclockwise, it uses the data from the right sensor. When it's time to turn, if the front sensor data is smaller than given threshold value, it checks both sides to learn which direction it should go then makes turn to that way, then realigns itself with **PID wall following algorithm** to move to the next turning point. *The front sensor is also checks the distance to the parking walls during parking time, enabling it to park in an orderly manner.*
- **HuskyLens**
- The Huskylens camera sends the colors of traffic signs it sees in the distance to the Arduino as raw data and colorID, and the Arduino processes them, enabling the robot to maneuver right or left.
- **Motor driver**
- The L298N motor driver allows us to control the motor's speed and direction and adjust the brightness of the LEDs.
- **Button**
- The button allows us to run the code.
- **LEDs**
- The LEDs we placed on the front side assist the huskylens, making the colors of traffic signs appear more *vivid* and easier to see.
- **Conventors and capacitors**
- The LM2596 regulators reduce the voltage of the power coming from the battery and send it to the sensors/husklens and other components. *The capacitors supply the sudden current surge.*
### ⚙️ Pseudo code