Project overview
This project started as a simple goal: build a reliable RC car that feels good to drive from a phone. The final result combines real-time joystick control, a clean command protocol, and basic safety feedback through distance sensing.
What it does
Drive forward/back, steer with a joystick, honk, and react to obstacles.
Why it matters
It’s a great intro to embedded control + mobile UI working together.
How it works
The car is split into small modules—motors, Bluetooth, sensing—so each part is easy to test and improve.
Motor control
Two TB6612FNG drivers handle direction and PWM speed for four motors.
Bluetooth link
The HM-10 receives joystick values and button commands from the iOS app.
Obstacle awareness
An HC-SR04 reads distance and triggers a warning buzzer when close.
Code highlight
This snippet shows the basic idea: parse the joystick input, compute left/right values, and map them to motor speed.
void handleJoystick(String input) {
int commaIndex = input.indexOf(',');
String xStr = input.substring(0, commaIndex);
String yStr = input.substring(commaIndex + 1);
int x = xStr.toInt();
int y = yStr.toInt();
int leftSpeed = y + x;
int rightSpeed = y - x;
moveLeftMotors(map(leftSpeed, -127, 127, -255, 255));
moveRightMotors(map(rightSpeed, -127, 127, -255, 255));
}
iOS controller app
The controller is built in SwiftUI. The goal is simple: low-latency input and a clean Bluetooth connection flow.
- JoystickView: tracks drag gestures and outputs X/Y values.
- BluetoothManager: manages connection and sends commands.
- ContentView: combines joystick + horn control.
Hardware gallery
Add photos as you go—drivers, modules, chassis, wiring, test runs.
What you learn
PWM control
Drive DC motors smoothly with PWM + direction pins.
Bluetooth basics
Send commands reliably from a mobile UI to embedded hardware.
Sensors
Use distance readings for feedback and simple safety checks.
UI + hardware
Connect gestures, state, and control loops end-to-end.