Skip to main content
Version: FILS English

Smart Ride

Our favourite childhood toys meet modern technology! Smart Ride is an improved remote-controlled car that uses an ultrasonic sensor to map the room!

info

Author: Popovici Andra-Raluca

GitHub Project Link: https://github.com/UPB-PMRust-Students/project-andra-raluca-pop

Description​

The car is controlled by means of a virtual remote control simulated in a web app. It uses an IOE-SR05 Ultrasonic Sensor to display the distance between the car and obstacles and aims to create a virtual map inside the web app.

Motivation​

Since I was in primary school, my favourite toys were remote-controlled cars, which I've collected for several years. This project combines my childhood passion with modern technology and aims to make a more interesting, cooler remote control car suitable for all ages!

Architecture​

Components​

1. Raspberry Pi Pico 2W​

  • The brain of the system.
  • Handles:
    • Wi-Fi communication using cyw43 driver
    • TCP server via embassy-net
    • GPIO-based control of motors and sensors
    • Real-time task management via embassy async runtime

2. Web App​

  • Runs in any browser on the same Wi-Fi network.
  • Sends TCP commands to the Pico 2W ("forward", "backward", "left", "right", "stop", "distance", "map").

3. Web Server (Rust Firmware on Pico 2W)​

  • Accepts and parses TCP socket messages.
  • Sends movement signals to motors and reads data from sensors.
  • Responds with sensor readings or map history when requested.

4. Ultrasonic Sensor (IOE-SR05)​

  • Triggered via GPIO (PIN_7) and receives echo on PIN_6.
  • Measures front-facing distance using echo timing.
  • Used for mapping and collision awareness.

5. Motor Control (L298N via GPIO)​

  • Controlled through GPIO (PIN_2 to PIN_5) β€” no PWM used.
  • Logic functions for movement:
    • forward() – move ahead
    • backward() – move back
    • left() / right() – turn
    • stop() – stop motion

Communication Between Components​

The architecture relies on coordinated communication between all components as follows:

FromToMediumPurpose
Web AppPico 2WWi-FiSend movement/query commands via TCP socket
Pico 2WL298N Motor DriverGPIOControl motor direction (IN1–IN4 logic levels)
Pico 2WIOE-SR05 SensorGPIOSend trigger and read echo (distance)
Pico 2WWeb AppTCPReply with sensor or mapping information

Log​

Week 5 - 11 May​

After establishing the final form of the project, I started my documentation by gathering information about the required hardware parts and necessary libraries. I configured the setup: I connected the Raspberry Pi Pico 1 for debugging to the target (Raspberry Pi Pico 2W) and used the provided lab repository. I also started working on the hardware pieces by cutting the base structure on which all the components will be glued. Then I connected the 2 DC motors to the L298N module and added their required functions to the code.

Week 12 - 18 May​

This week, I finished the code and functions for the DC motors (final adjustments), created the basic function for the IOE-SR05 sensor and created the web app for the remote control, including the TCP server and http converter. In terms of harware, I finished the setup (wiring, fixing the ball caster that replaces the wheels in the back, fixing the sensor onto the acrylic plate).

Week 19 - 25 May​

During the last week I customised the web app for the remote control, making it user-friendly and visually pleasing. I also finished the mapping logic and function and made the car show it in the web app as well as in the terminal.

Hardware​

The car uses a Raspberry Pi Pico 2W microcontroller that manages motor control and sensor input. I included 2 motors with gearbox and attached wheels that allow movement in 4 directions (left, right, forward, backward) as well as stopping the movement when the user presses the " stop" button. An IOE-SR05 Ultrasonic sensor is attached in the front and used for distance measurement and mapping. It provides feedback for the user to help avoid obstacles. Finally, for debugging, a Raspberry Pi Pico 1 was as it helped in testing the hardware components and developing the source code.

Schematics​

Bill of Materials​

DeviceUsagePrice
Raspberry Pi Pico WMain microcontroller with Wi-Fi, runs Rust firmware35 RON
Raspberry Pi PicoUsed for debugging during development25 RON
DC Motor with Gearbox and Wheel x2Motion and propulsion11.90 RON x2 = 23.80 RON
IOE-SR05 Ultrasonic SensorRoom mapping / obstacle detection8.90 RON
L298N Motor Driver ModuleControls the motors with PWM and direction signals13.90 RON
Breadboard 400 pins x2Prototyping and wiring7.90 RON x2 = 15.80 RON
Male-to-Male Jumper WiresWiring connections between modules4.90 RON
Female-to-Female Jumper WiresWiring connections between modules4.90 RON
3.7V Li-ion Rechargeable Battery x2Powers the system (motors and/or controller)19.99 RON x2 = 39.98 RON
Transparent Plexiglass PlateChassis base for mounting electronics and wheels10.90 RON

| Total | | 182.98 RON |

Software​

Software Libraries​

Library / CrateDescriptionUsage Example
embassy-executorAsync runtime for embedded RustDrives async main loop
embassy-rpHAL for Raspberry Pi Pico boardsAccess GPIOs, peripherals
embassy-timeTiming and delaysTimer::after_millis(100).await
embassy-netTCP/IP networking stackRuns a TCP server
embassy-usbUSB support (optional)USB-related functions (if used)
cyw43Driver for CYW43 Wi-Fi chip on Pico WConnects to Wi-Fi
cyw43-pioPIO backend used by CYW43Enables PIO communication
defmt / defmt-rttEfficient logging and debugging via RTTinfo!("message") in terminal
panic-probePanic handler for embedded RustShows panic messages
embedded-io-asyncAsync I/O traits for socketsUsed for socket.write_all(...)
gpio::{Level, Input, Output}Pin control for motors and sensorsUsed for motor/sensor pins
fixed::traits::ToFixedNumeric conversion to fixed-pointConverts float to fixed
static_cellSafe global static memory managementStatic memory for network stack

Masina Bluetooth - Exemplu Proiect PM