RC
car transformed in BT car
Abstract
This project consists in transform a RC car controlled by a RC transmitter into a car controlled with a smartphone by bluetooth. To do this, it is necessary to change the electronic circuit that the toy has. Basically, I removed the chip that controls the radio-frequency communication and the power transistors that manage the two DC motors. Then, I replaced that chip by an Arduino Pro Mini 5V and I added a Bluetooth module. Finally, I've developed a very, very simple Android application for driving the car with the phone.
This project consists in transform a RC car controlled by a RC transmitter into a car controlled with a smartphone by bluetooth. To do this, it is necessary to change the electronic circuit that the toy has. Basically, I removed the chip that controls the radio-frequency communication and the power transistors that manage the two DC motors. Then, I replaced that chip by an Arduino Pro Mini 5V and I added a Bluetooth module. Finally, I've developed a very, very simple Android application for driving the car with the phone.
Figure 1: RC car |
Materials
1 x Arduino Pro Mini
1 x Bluetooth Module HC06
1 x RC chinese car
Cables, soldering iron, ...
1 x Arduino Pro Mini
1 x Bluetooth Module HC06
1 x RC chinese car
Cables, soldering iron, ...
Development
I bought this toy in a chinese bazaar for 7,95€. At the beginning, my intentions were to buy four little wheels for making my own car using an Arduino and a DC Motor Shield, however the wheels costed 6€ each one in my electronic local shop. In my opinion, they were very expensives. So, I looked for a cheap toy with wheels and I found this one. After playing with the car during a month, it was the time for disassembling the toy and see what things had inside the plastic case.
The toy is managed by a single pcb. This circuit can be divided in three different parts for understanding how it works. The first part is the radio-frequency receiver. The second part is a chip that decoded the signal received and process it for activating four digital outputs that control the power transistors. These digital outputs switch on/off the two DC motor and they can drive the car in four direcctions: backward, fordward, left and right. The third part is composed with a bunch of power transistors that control the DC motors.
I bought this toy in a chinese bazaar for 7,95€. At the beginning, my intentions were to buy four little wheels for making my own car using an Arduino and a DC Motor Shield, however the wheels costed 6€ each one in my electronic local shop. In my opinion, they were very expensives. So, I looked for a cheap toy with wheels and I found this one. After playing with the car during a month, it was the time for disassembling the toy and see what things had inside the plastic case.
The toy is managed by a single pcb. This circuit can be divided in three different parts for understanding how it works. The first part is the radio-frequency receiver. The second part is a chip that decoded the signal received and process it for activating four digital outputs that control the power transistors. These digital outputs switch on/off the two DC motor and they can drive the car in four direcctions: backward, fordward, left and right. The third part is composed with a bunch of power transistors that control the DC motors.
The
steering of the car didn't work due to the plastic parts didn't fit
well and as a consequence, the DC motor doesn't serve for anything
and can be removed. This situation, simplifies the project because I
only have to control one motor but, on the other hand, I don't be able
to drive the car that it is a bit sad.
Figure 2: mechanical parts of the steering of the car.
|
Instead
of using a H-Bridge to drive the motors of the RC car, I've reused
the electronic board that the toy has. The circuit has a bunch of
power transistors for managing the current properly through the DC
motors. These
transistors are controlled by a specific integrated circuit. This
chip has the purpose of translating the radio-signals into electrical impulses for driving
the motors. The next picture shows the names of the leads of this
chip. As we can see, it has four specific outputs for controlling the
directions of the toy. These output are called: RIGHT, LEFT, FORWARD
and BACKWARD. So, it is very easy to understand that if we put a high
level in one of these outputs, we can activate the motion of the
motor.
Figure 3: simbol of the chip LOG RX2 1222 |
Before
removing the chip, I did a simple test. I took two wires from
Arduino: GND and 3V3. Then, I hooked up the GND of the Arduino with
the GND of LOG RX2 1222. Finally, I put 3.3 volts on the output FORWARD.
The result was that the wheels of the toy moved very fast.
Figure 4: cables soldered to toy's circuit |
I removed the chip by cutting the leads with a knife. After this, I
soldered four cables. One for GND, one for VCC, other for FORWARD and
another for BACKWARD. Later, I will connect GND and VCC to Arduino; FORWARD to the Arduino digital output 4 and BACKWARD to 5.
Arduino takes the power supply from the toy's batteries. The power supply is composed by three 1.5V AAA batteries (4.5V).
Figure 5: Funduino next to the power transistors on the toy.
|
Before
installing the Arduino Pro Mini in the toy, it was necessary to
program the Arduino. My Funduino doesn't have a 3.3 volts regulated,
so, I've used a digital output for generating three volts with the
function "analogwrite". These three volts are for supplying
power to the Bluetooth module. Afterwards, I connected the Bluetooth
module and the wires soldererd to the chinese PCB to the Arduino
pins.
Figure 6: RC car cirtuits connected to Arduino Pro Mini and the Bluetooth
module.
|
The
Arduino pin-out used in this project is the following:
-GND
to GND
-VIN
to VCC
-D6(threevolts)
to VCC Bluetooth
-D5(TX)
to RX Bluetooth
-D4(RX)
to TX Buetooth
-D3(BACKWARD)
to BACKWARD
-D2(FORDWARD)
to FORDWARD
The
code programmed for Arduino is in the Appendix and basically, it does this:
-Setup
the software serial comunication.
-Configure
bluetooth.
-Wait
connection to a devices.
-Once
a connection is established, waits for a valid character. If the data
received is 'f', the car moves forward. If the data received is 'b',
the car moves backward, otherwise, the car stops.
This
car must be controlled by Bluetooth 2.0. To test the car I used the
application Blueterm that it can be downloaded from the Play Store.
However, once I check that all works fine, I developed a very simple
Android application. The demostration can be watched in the next
video.
Appendix
The
Arduino code used is:
#include
<SoftwareSerial.h>
#define
threeVolts 6
#define
RX 4
#define
TX 5
#define
FORDWARD 2
#define
BAKWARD 3
SoftwareSerial
mySerial(RX, TX);// RX, TX
char
var=NULL;
void
setup()
{
Serial.begin(9600);
mySerial.begin(9600);
delay(1000);
pinMode(threeVolts,OUTPUT);
pinMode(BAKWARD,OUTPUT);
pinMode(FORDWARD,OUTPUT);
pinMode(TX,OUTPUT);
pinMode(RX,INPUT);
analogWrite(threeVolts,170);
//Configure
parameters of the bluetooth HC-06
mySerial.print("AT");
delay(1000);
mySerial.print("AT+NAMETopTaxi");
delay(1000);
mySerial.print("AT+BAUD4");
delay(1000);
mySerial.print("AT+PIN1234");
delay(1000);
}
void
loop()
{
//Wait
until a command is received over bluetooth
if(mySerial.available()>0)
{
var
= mySerial.read();
switch(var)
{
case
'f':
digitalWrite(BAKWARD,LOW);
digitalWrite(FORDWARD,HIGH);
break;
case
'b':
digitalWrite(BAKWARD,HIGH);
digitalWrite(FORDWARD,LOW);
break;
default:
digitalWrite(BAKWARD,LOW);
digitalWrite(FORDWARD,LOW);
break;
}
}
delay(500);
//The
motor only is active during a small period of time for security
reasons and in order to save //battery
digitalWrite(BAKWARD,LOW);
digitalWrite(FORDWARD,LOW);
}