RC Car with physical controller
A remote controlled car designed to drive around for entertainment using a physical controller.
Author: Gheorghe Alin-Ioan
GitHub Project Link: https://github.com/UPB-PMRust-Students/project-blue-v27
Descriptionβ
This car is build using a Raspberry Pi Pico 2W, 2 motors with wheels, a L298N module, and two LEDs. The controller is build using a Raspberry Pi Pico 2W, a joystick and two buttons. The controller sends the input to the car via WIFI, thus dictating the movement of the car.
Motivationβ
Growing up I've never had a remote controlled car and so I chose to build one for myself. I aim to make it the car in such a way that it is fun to drive around.
Architectureβ
Schematic Diagramβ
The diagram of the project:
Raspberry Pi Pico 2W
- Role: Controls every component. In the case of the car it controls the motors and the LEDs. In the case of the controller it reads the input from the buttons and the joystick.
- Connections: GPIO for LEDs, motors, buttons and ADC joystick.
DC motors
- Interface: GPIO
- Role: Allow the car to go forward and backwards
- Connections: conected to the L298N Module, left Motor: + -> out1, - -> out2; right Motor: + -> out3, - -> out4
L298N
- Interface: GPIO
- Role: controls the motors
- Connections: Vcc -> powerSource, Gnd -> Gnd, 5V -> Vsys, in1 -> GP2, in2 -> GP3, in3 -> GP4, in4 -> GP5,
Servo motor
- Interface: GPIO
- Role: controls the steering of the car
- Connections: Gnd -> Gnd, 5V -> powerSource, Pwm - GP14
LEDs
- Interface: GPIO
- Role: Indicate when the car is breaking.
- Connections: GP12 and GP13, each having a 470Ohm resistor connected in series.
Joystick
- Interface: ADC
- Role: Controlls the steering of the car
- Connections: yAxis -> GP27, VCC -> powerSource, GND -> Gnd.
Buttons
- Interface: GPIO
- Role: Controlls the acceleration and breaking of the car
- Connections: GP16 AND GP17, each having a 10kOhm resistor in series
Logβ
Week 5 - 11 Mayβ
I started cutting the Acrylic plates and assembling the hardware part of the project.
Week 12 - 18 Mayβ
Completed the hardware of the project making all connections and the cable management. I have also added a ballcaster underneath the plate to support some of the weight pressing onto the small front wheels. For the controller I simply connected everything onto a custom made acrylic frame. I have also designed and cut a custom steering setup for the car.
Week 19 - 25 Mayβ
Completed the code for the car wich gets inputs, and acts acordingly, from the controller via UDP acces point.
Hardwareβ
I've used two Raspberry Pi Pico 2 W's, a L298N module connected to 2 Dc motors with wheels, 2 LEDs to indicate when you are breaking, a servo motor for steering, a joystick for controlling the steering and 2 buttons for going forward and backwards. The frames for both the car and the controlel, as well as the steering setup, are made out of acrylic.
Schematicsβ
Bill of Materialsβ
Device | Usage | Price |
---|---|---|
2x Raspberry Pi Pico 2W | The microcontroller | 39.66 RON |
L298N driver module | Driver module | 10.99 RON |
2x Dc Motor | Wheels | 2x 14.99 RON |
2x Wheels | Steering Wheels | 2 x 4.99 RON |
Servo Motor | Servo Motor | 13.99 RON |
Joystick | Joystick | 6.92 RON |
2x LEDs | Break lights | 2x 0.39 RON |
2x 1k Rezistor | Series Resistance for the break lights | 2x 0.10 RON |
2 Round Cap Buttons | Acceleration and breaking buttons | 2x 1.99 RON |
40 15cm Male-Female wires | Male-Female Wires | 7.99 RON |
40 15cm Male-Female Wires | Male-Male Wires | 6.99 RON |
40 30cm Male-Male Wires | Male-Male Wires | 7.98 RON |
Softwareβ
Library | Description | Usage |
---|---|---|
embassy-rp | RP2040 peripheral access | Initializes and interacts with Pico W hardware peripherals |
embassy-executor | Async runtime | Runs asynchronous tasks like motor control and input reading |
embassy-time | Time utilities | Used for delays, scheduling, and task coordination |
embassy-net | Networking stack | Manages TCP/IP over Wi-Fi; used for remote control |
embassy-lab-utils | Pico W Wi-Fi helpers | Simplifies Wi-Fi and network stack setup |
gpio | GPIO module | Controls motor direction pins (L298N IN1βIN4) |
pwm | PWM module | Adjusts the arm position of the servo motor |
adc | ADC module | Reads analog joystick values for direction/speed input |
defmt | Logging framework | For debug messages via RTT/serial |
panic-probe | Panic handler | Handles panics with minimal overhead |
static_cell | Static memory allocation | Safely manages statically allocated Embassy resources |
cyw43 | WIFI | Handles the wifi chip on the board |