Have you ever wanted to build your own remote-controlled (RC) car from scratch? In this project, I’ll show you how I built an Arduino-based RC car, controlled using an FS-i6 transmitter. This car features PWM-based speed control, precise steering, and a relay-controlled LED indicator for better user feedback.
The best part? It’s fully customizable and can be upgraded with features like obstacle avoidance, Bluetooth control, and more!
Components UsedBefore we dive into the build process, here’s a list of components I used:
Arduino (Uno/Nano) – The brain of the car
- Arduino (Uno/Nano) – The brain of the car
FS-i6 Transmitter & Receiver – Remote control system
- FS-i6 Transmitter & Receiver – Remote control system
L298 Motor Driver – Controls motor speed and direction
- L298 Motor Driver – Controls motor speed and direction
DC Motors (x3) – Two for movement, one for steering (optional)
- DC Motors (x3) – Two for movement, one for steering
Relay Module – Activates LED when moving forward(optional)
- Relay Module – Activates LED when moving forward
LED – Lights up when the car moves forward(optional)
- LED – Lights up when the car moves forward
Battery Pack – Power source
- Battery Pack – Power source
Jumper Wires – For wiring connections
- Jumper Wires – For wiring connections
To get everything working smoothly, here’s how I connected the components:
#include <Servo.h>
#define MOTOR_A_PWM 6 // Speed control for Motor A (left/right)
#define MOTOR_A_IN1 4 // Motor A forward
#define MOTOR_A_IN2 5 // Motor A backward
#define MOTOR_B_PWM 11 // Speed control for Motor B (forward/backward)
#define MOTOR_B_IN3 7 // Motor B forward
#define MOTOR_B_IN4 8 // Motor B backward
#define CH1_PIN 9 // FS-i6 CH1 (Steering)
#define CH2_PIN 10 // FS-i6 CH2 (Throttle)
// Receiver signal reading
int readChannel(int pin) {
int pulseWidth = pulseIn(pin, HIGH, 25000);
return pulseWidth == 0 ? 1500 : pulseWidth; // Default to 1500 if no signal
}
void setup() {
pinMode(MOTOR_A_PWM, OUTPUT);
pinMode(MOTOR_A_IN1, OUTPUT);
pinMode(MOTOR_A_IN2, OUTPUT);
pinMode(MOTOR_B_PWM, OUTPUT);
pinMode(MOTOR_B_IN3, OUTPUT);
pinMode(MOTOR_B_IN4, OUTPUT);
pinMode(CH1_PIN, INPUT);
pinMode(CH2_PIN, INPUT);
Serial.begin(9600);
}
void loop() {
int throttle = readChannel(CH2_PIN); // Speed control
int steering = readChannel(CH1_PIN); // Direction control
// Convert PWM signals to motor values
int speed = map(throttle, 1000, 2000, -255, 255);
int turn = map(steering, 1000, 2000, -255, 255);
// Serial.print("Speed: "); Serial.print(speed);
// Serial.print(" Turn: "); Serial.println(turn);
// Motor A (Steering)
if (turn > 50) {
digitalWrite(MOTOR_A_IN1, HIGH);
digitalWrite(MOTOR_A_IN2, LOW);
analogWrite(MOTOR_A_PWM, abs(turn));
} else if (turn < -50) {
digitalWrite(MOTOR_A_IN1, LOW);
digitalWrite(MOTOR_A_IN2, HIGH);
analogWrite(MOTOR_A_PWM, abs(turn));
} else {
digitalWrite(MOTOR_A_IN1, LOW);
digitalWrite(MOTOR_A_IN2, LOW);
analogWrite(MOTOR_A_PWM, 0);
}
// Motor B (Throttle)
if (speed > 50) {
digitalWrite(MOTOR_B_IN3, HIGH);
digitalWrite(MOTOR_B_IN4, LOW);
analogWrite(MOTOR_B_PWM, abs(speed));
} else if (speed < -50) {
digitalWrite(MOTOR_B_IN3, LOW);
digitalWrite(MOTOR_B_IN4, HIGH);
analogWrite(MOTOR_B_PWM, abs(speed));
} else {
digitalWrite(MOTOR_B_IN3, LOW);
digitalWrite(MOTOR_B_IN4, LOW);
analogWrite(MOTOR_B_PWM, 0);
}
delay(20);
}
How It Works:1️⃣ Throttle Control (CH2): Controls forward & backward movement
2️⃣ Steering Control (CH1): Rotates an additional motor for turning
The code is optimized for low latency by removing unnecessary print statements, ensuring fast response times.
Testing & DemoOnce everything was wired up and programmed, I tested the car’s movements using the FS-i6 transmitter. The car responded smoothly to throttle and steering inputs. The LED correctly lit up when the car moved forward, and speed adjustments worked flawlessly!
Future ImprovementsThis project is just the beginning! Here are some ideas for enhancements:
Obstacle Avoidance: Add an ultrasonic sensor to detect objects and prevent collisions.
- Obstacle Avoidance: Add an ultrasonic sensor to detect objects and prevent collisions.
Bluetooth App Control: Control the car using a mobile app when needed.
- Bluetooth App Control: Control the car using a mobile app when needed.
Upgraded Motors: Swap out brushed motors for brushless ones for better performance.
- Upgraded Motors: Swap out brushed motors for brushless ones for better performance.
Building this Arduino RC car was an exciting experience! The FS-i6 transmitter integration allowed for precise control, and the relay-controlled LED added a great visual indicator.
If you're interested in building your own version, check out my GitHub repository for the full code and wiring details. Feel free to experiment and customize it! Let me know your thoughts and improvements in the comments.
Happy making! 🔥
Comments
Please log in or sign up to comment.