Skip to main content
Version: FILS English

R3X-3 Autonomous Rover

A multi-mode autonomous rover with follow-me, patrol, sentry and tilt detection, controllable via IR remote.

info

Author: Tita Matei Alexandru
GitHub Project Link: https://github.com/UPB-PMRust-Students/fils-project-2026-Matei13x13

Description

The R3X-3 is a 4-wheel-drive autonomous rover built on a Raspberry Pi Pico 2 and programmed in Rust using the embassy-rp async framework. It implements five operational modes: follow-me, patrol, sentry, expressive LED states and tilt/pickup detection, all switchable at runtime via an IR remote control.

The rover uses a VL53L0X time-of-flight sensor mounted on a pan-tilt servo head to perform follow-me tracking, obstacle avoidance and sentry scanning. A second Raspberry Pi Pico carried by the user serves as an IR beacon for an alternative beacon-tracking follow mode. An MPU6050 IMU detects when the rover is picked up, tilted or stuck. WS2812B addressable LEDs provide expressive visual feedback for each rover state, and a passive buzzer delivers audio alerts for sentry intrusions and pickup alarms.

Motivation

I chose this project because it combines several areas I want to learn deeply: embedded Rust on a modern microcontroller (the RP2350 in the Pico 2), real-time sensor fusion, async multitasking without an RTOS and basic robotics control.

Building a rover with multiple distinct behavior modes forces me to design a clean state-machine architecture rather than the typical single-purpose hobby project. The IR beacon system adds a second microcontroller communicating with the first, which is a useful skill beyond a single-board project.

The five modes are independent enough that I can ship the rover incrementally: even after just the first mode works, I have a functional robot, and each additional mode adds a clearly visible new capability.

Architecture

The rover firmware is organized as a set of independent async tasks running concurrently on the Pico 2 under the embassy executor. A central shared rover state, protected by an async mutex, holds the current mode, sensor readings, orientation data and alert flags. Sensor tasks write to this state, and behavior tasks read from it.

Schematic diagram

Main architectural components:

  • Mode State Machine: top-level controller that owns the current RoverMode enum (Follow, Patrol, Sentry, Idle, Manual). Receives mode-change requests from the IR remote decoder and dispatches to the appropriate behavior task.
  • IR Remote Decoder: listens on a dedicated IR receiver, decodes NEC protocol button codes from the remote and translates them into mode-change events or manual drive commands.
  • Sensor Polling Task: continuously reads VL53L0X distance, beacon-tracking IR receivers, IR obstacle sensors and MPU6050 orientation. Publishes to shared state.
  • Head Sweep Task: controls pan/tilt servos to sweep the ToF sensor for patrol scanning, sentry monitoring and follow-me search.
  • Motor Control Task: receives drive commands via channel, applies PWM ramping and drives the L298N. All motor commands flow through here so emergency stops are centralized.
  • LED Animation Task: runs at 30 FPS, reads current rover state, renders the appropriate animation pattern on the WS2812B strip and eye LED, drives the buzzer for alerts.
  • IR Beacon Firmware (separate Pico): generates 38kHz PWM driving an IR LED with a recognizable burst pattern. Runs as a single async task on the second Pico, no other logic.

The tasks communicate through:

  • Shared state mutex for sensor readings and rover mode (read by many tasks)
  • Embassy channels for motor commands and mode-change events (point-to-point messaging)
  • Embassy signals for instant notification of state changes (e.g. pickup alarm triggers immediate LED task wakeup)

Log

Week 5 - 11 May

Week 12 - 18 May

Week 19 - 25 May

Hardware

The rover is built on a generic 4WD acrylic chassis with four TT gear motors driven by an L298N dual H-bridge motor driver. The brain is a Raspberry Pi Pico 2, which handles all sensor reading, motor control and LED animation.

A pan-tilt servo head carries a VL53L0X time-of-flight sensor that is swept across the front of the rover for follow-me, patrol and sentry scanning. Three IR receivers provide an alternative beacon-based following method, with the IR beacon emitter built on a second Raspberry Pi Pico that the user carries. A fourth IR receiver listens for commands from a handheld IR remote, used to switch modes and manually drive the rover. Two side-mounted IR obstacle sensors handle lateral collision avoidance.

An MPU6050 6-axis IMU on the I2C bus detects tilt, slope, pickup events and stuck conditions. Visual feedback is provided by a WS2812B addressable RGB LED strip mounted as underglow, a red 5mm LED on the turret as an "eye" indicator and a passive piezo buzzer for audio alerts.

Power is supplied by a battery routed through the L298N's onboard 5V regulator to the Pico, servos and LEDs.

Schematics

Place your KiCAD or similar schematics here in SVG format.

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2Main rover brain, runs all firmware tasks30 RON
4WD Robot Chassis KitAcrylic platform, 4× TT motors, wheels and hardware, the physical rover body20 RON
L298N Dual Motor DriverDual H-bridge that drives the 4 TT motors with PWM speed control and direction10 RON
VL53L0X ToF SensorLaser distance sensor used for follow-me stop distance, patrol obstacle detection and sentry scanning17 RON
MPU6050 IMU6-axis accelerometer and gyroscope that detects pickup, slopes and stuck conditions14 RON
HX1838 IR Receiver Kit (×3)38kHz IR receiver with remote, 3 receivers used for beacon tracking plus 1 for IR remote control input21 RON
IR Obstacle Sensor (×2)Side-mounted reflective IR proximity sensors for lateral collision avoidance6 RON
SG90 Micro Servo (×2)Pan and tilt servos for the head, sweeps the ToF sensor for scanning12 RON
WS2812B LED StripAddressable RGB underglow that shows expressive state animations4 RON
5mm 940nm IR LEDBeacon emitter LED, driven at 38kHz by the carried Pico1 RON
5mm Red LED + 220Ω resistorTurret "eye" indicator for alert and state visualization1 RON
Passive BuzzerPiezo buzzer for audio alerts on sentry intrusion and pickup alarm2 RON
Plusivo Resistor Kit (250 pcs)Various resistors for IR LED current limiting (47Ω), red LED limiting (220Ω) and I2C pull-ups (4.7kΩ)14 RON
Mini Breadboard 400 ptsPrototyping connections before final wiring5 RON
Dupont Wire Kit (M-M, M-F, F-F)Connecting Pico, sensors, motor driver, servos and LEDs24 RON

Estimated total: ~170 RON

Software

LibraryDescriptionUsage
embassy-rpAsync HAL for the RP2040/RP2350Core hardware access for GPIO, PWM, I2C, PIO and timers
embassy-executorAsync task executor for embedded systemsRuns all rover tasks concurrently without an RTOS
embassy-timeAsync timing primitivesDelays, tickers and timeouts in all tasks
embassy-syncSynchronization primitives for async embeddedChannels, mutexes and signals between tasks
vl53l0xDriver for VL53L0X ToF sensorReads distance for follow-me, patrol and sentry
mpu6050Driver for MPU6050 6-axis IMUReads accelerometer and gyroscope for tilt detection
defmtLightweight logging frameworkDebug logging during development
panic-probePanic handler that prints over RTTDiagnoses crashes during development
  1. Embassy embedded async framework documentation
  2. RP2350 datasheet
  3. VL53L0X datasheet
  4. MPU6050 register map
  5. NEC IR protocol reference