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!
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
- Wi-Fi communication using
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 onPIN_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
toPIN_5
) β no PWM used. - Logic functions for movement:
forward()
β move aheadbackward()
β move backleft()
/right()
β turnstop()
β stop motion
Communication Between Componentsβ
The architecture relies on coordinated communication between all components as follows:
From | To | Medium | Purpose |
---|---|---|---|
Web App | Pico 2W | Wi-Fi | Send movement/query commands via TCP socket |
Pico 2W | L298N Motor Driver | GPIO | Control motor direction (IN1βIN4 logic levels) |
Pico 2W | IOE-SR05 Sensor | GPIO | Send trigger and read echo (distance) |
Pico 2W | Web App | TCP | Reply 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β
Device | Usage | Price |
---|---|---|
Raspberry Pi Pico W | Main microcontroller with Wi-Fi, runs Rust firmware | 35 RON |
Raspberry Pi Pico | Used for debugging during development | 25 RON |
DC Motor with Gearbox and Wheel x2 | Motion and propulsion | 11.90 RON x2 = 23.80 RON |
IOE-SR05 Ultrasonic Sensor | Room mapping / obstacle detection | 8.90 RON |
L298N Motor Driver Module | Controls the motors with PWM and direction signals | 13.90 RON |
Breadboard 400 pins x2 | Prototyping and wiring | 7.90 RON x2 = 15.80 RON |
Male-to-Male Jumper Wires | Wiring connections between modules | 4.90 RON |
Female-to-Female Jumper Wires | Wiring connections between modules | 4.90 RON |
3.7V Li-ion Rechargeable Battery x2 | Powers the system (motors and/or controller) | 19.99 RON x2 = 39.98 RON |
Transparent Plexiglass Plate | Chassis base for mounting electronics and wheels | 10.90 RON |
| Total | | 182.98 RON |
Softwareβ
Software Librariesβ
Library / Crate | Description | Usage Example |
---|---|---|
embassy-executor | Async runtime for embedded Rust | Drives async main loop |
embassy-rp | HAL for Raspberry Pi Pico boards | Access GPIOs, peripherals |
embassy-time | Timing and delays | Timer::after_millis(100).await |
embassy-net | TCP/IP networking stack | Runs a TCP server |
embassy-usb | USB support (optional) | USB-related functions (if used) |
cyw43 | Driver for CYW43 Wi-Fi chip on Pico W | Connects to Wi-Fi |
cyw43-pio | PIO backend used by CYW43 | Enables PIO communication |
defmt / defmt-rtt | Efficient logging and debugging via RTT | info!("message") in terminal |
panic-probe | Panic handler for embedded Rust | Shows panic messages |
embedded-io-async | Async I/O traits for sockets | Used for socket.write_all(...) |
gpio::{Level, Input, Output} | Pin control for motors and sensors | Used for motor/sensor pins |
fixed::traits::ToFixed | Numeric conversion to fixed-point | Converts float to fixed |
static_cell | Safe global static memory management | Static memory for network stack |