Arduino Bluetooth RC Car

Control RC car with RoboRemo app

Arduino Bluetooth RC Car

This page explains how to modify an RC car toy so that it can be controlled over Bluetooth and how to configure the RoboRemo app for it.

Materials needed:
- RC car
- Arduino UNO (or similar) + USB cable for it
- BlueSMiRF module
- S7V7F5 voltage regulator module
- 1500 uF capacitor (or 1000 or 2200)
- wires with pins for Arduino
- solder + soldering iron
- android phone with RoboRemo app installed

Introduction

I took a cheap toy RC car that uses 2 DC motors: one for driving and one for steering. I determined the command pins of the controller IC inside the car, there are 4 command pins: forward, backward, left, right. I attached 4 wires to those pins, and 2 more wires for power, totally 6 wires. Then I attached Arduino and Bluetooth module to contorl the car via Bluetooth.

Steps:

1.
First you need an RC car toy.
You don't need the remote control, just the car.

rc-car-toy.jpg

2.
Disassemble it.

rc-car-inside.jpg

3.
The car circuit board has 3 main parts: receiver, controller and motor drivers.

rc-car-board-main-parts.jpg


You have to find 4 resistors of the same value, usually 1k (color code: brown black red) that link the controller to the motor drivers.
Then look on the other side of the circuit board and find the 4 controller pins that are linked to the resistors.

4.
These 4 pins are command pins (forward, backward, left, right). Solder 4 wires, so that you can connect them to Arduino.

rc-car-board-controller-pins.jpg

5.
Solder 2 more wires for power supply (+ and -)
(You can find out which is + and which is - by looking where the batteries are connected.)

rc-car-board-wires.jpg

6.
Now put the car back together, it should look like this:
(with 6 wires getting out).

rc-car-with-wires.jpg


Now you can find out which wire commands forward, backward, left and right by connecting them (!!! ONE AT A TIME !!!) to the power +.
WARNING: If you connect both left and right or both forward and backward to power +, it will cause permanent damage to the motor drivers, and you will have to replace transistors.

7.
Now it's time to program the Arduino, here is the code:

#include <SoftwareSerial.h>  

int bluetoothTx = 2; // TX-O pin of BT module to Arduino pin2
int bluetoothRx = 3; // RX-I pin of B module to Arduino pin3

SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);

int forward = 4;
int backward = 5;
int left = 6;
int right = 7;

char cmd[100];
int cmdIndex;

void exeCmd() {
  
  if(cmd[0]=='f') {  // forward
    digitalWrite(backward, LOW);  // disable backward
    digitalWrite(forward, HIGH);  // enable forward
  } 
  
  if(cmd[0]=='b') {  // backward
    digitalWrite(forward, LOW); 
    digitalWrite(backward, HIGH);  
  } 
  
  if(cmd[0]=='s') {  // stop
    digitalWrite(backward, LOW);  
    digitalWrite(forward, LOW);
  }
  
  
  if(cmd[0]=='l') { // left
    digitalWrite(right, LOW);
    digitalWrite(left, HIGH);
  } 
  
  if(cmd[0]=='r') {  // right
    digitalWrite(left, LOW);
    digitalWrite(right, HIGH);
  } 
  
  if(cmd[0]=='c') {  // center
    digitalWrite(left, LOW);
    digitalWrite(right, LOW);
  } 
}

void setup() {   // at power on
  
  delay(500); // wait for bluetooth module to start
  
  pinMode(forward, OUTPUT);
  digitalWrite(forward, LOW);
  
  pinMode(backward, OUTPUT);
  digitalWrite(backward, LOW);
  
  pinMode(left, OUTPUT);
  digitalWrite(left, LOW);
  
  pinMode(right, OUTPUT);
  digitalWrite(right, LOW);
  
  // change Bluetooth module baud rate to 9600:
  
  bluetooth.begin(115200); // Bluetooth default baud is 115200
  
  bluetooth.print("$");
  bluetooth.print("$");
  bluetooth.print("$"); // enter cmd mode
  delay(250);  
  bluetooth.println("U,9600,N"); // change baud to 9600
  
  bluetooth.begin(9600);
  
  cmdIndex = 0;
}

void loop() {
  
  if(bluetooth.available()) {
 
    char c = (char)bluetooth.read();
    
    cmd[cmdIndex] = c;  
    if(cmdIndex<99) cmdIndex++;
      
    if(c=='\n') {   // each command ends with '\n'
      exeCmd();
      cmdIndex = 0;
    }  
  } 
}

8.
After programming, connect all the components like this:

arduino-bluetooth-rc-car-schematic.jpg

9.
Fix everything with mounting tape :)

arduino-rc-car.jpg

10.
The car is ready !
Now configure the RoboRemo app interface for controlling the car.

11.
Enjoy :)