Introduction: RC Car Steered by Wheel and Pedals🏎️
Life is about making your dreams come true. Mine was to make RC Car steered with PC gaming wheel. So I made it.
Hope that it's going to be useful for someone. In case of questions, write a comment.
Step 1: Parts
To make this project you'll need:
- Raspberry Pi (I used RPI 4B with 4GB of RAM)
- Chassis with servo-steered front axle (motor and servo included)
- RPI Camera with 3D printed case (optional)
- Li-Po battery 11.1V
- PC wheel with pedals
- Polulu DRV8835 Dual Motor Kit
- 11.1V to 5V Buck converter
Step 2: Assembling
Assemble your chassis. I got mine from: https://www.aliexpress.com/item/32977739930.html?s...
Next solder two wires to DC motor on the back.
After that mount Raspberry Pi using nuts & bolts
Step 3: Attach Motor Driver to RPI
Now we need to solder the motor driver. Next take the 3 pin goldpin and solder it to 5V and GND in the driver board (see the photo). To the last pin solder wire with goldpin female end. We are going to use it for PWM signal that steeres the servo.
Next take the buck converter and solder :
- black (ground) wire to GND
- red output wire to 5V
- red input wire to Vout
When soldering is completed use two-sided tape to mount the converter on the motor driver.
After that our driver is ready and can be plugged into the RPI.
Step 4: Print Case for Camera
Next step is to print housing for camera. You can find many projects on: https://www.thingiverse.com/
Use one that fits your camera.
Step 5: Final Assembling
Now it's time to put everything together. Insert the battery, attach the camera, plug servo to pins and connect the motor to the driver as well as battery.
You can see whole schematic on the photo.
Step 6: Run the Code
The final part is running the code.
The communication between RPI and laptop is established using Flask server written in Python.
We are going to send two things to server:
- Angle of the steering wheel
- Motor speed (480 for full speed forward and -480 for full speed backward)
The program on laptop is responsible for reading values from pedals and wheel and sending it to server which is running on Raspberry.
On RPI we have to launch server code and program that reads values stored on server that controls servo angle and motor speed.
- Raspberry Pi & laptop must be connected to the same WiFi network!
- You have to run programs on RPI from terminal using sudo (eg. sudo python3 Flask_server_RPI.py) command!
Participated in the
Raspberry Pi Contest 2020