Changing an Old RC Car to an Autonomous Car

Introduction: Changing an Old RC Car to an Autonomous Car

i <3 2 Build

Well this is just a part of my complete project, but anyway I thought it will be useful as well its just cool! This project is for the kind of RC cars that have a group of wires ,or a group of joint wires, connected to the receiver that is present in the car. My RC Car had totally three wires, each one consisting of 2 wires joint together.

Step 1: Components Required

So the components required are pretty basic and the total cost isn't more than $15 (or 1000 INR as i am from India) -

1) Arduino Uno (even Nano or Mega are fine)

2) An 8 channel relay- it depends on the number of wires your car has mine had 3 (*2 because it was a bundle) and as 6 channel relays weren't available so I used this for people from India and this for others but as the second one is unavailable even this is a good replacement.

3) Jumper Wires

You can also use an HC-SR04 distance sensor as an additional no crashing function but it isn't actually required.

Step 2: Explaination and Logic

My car has, as I said before (twice), 3 wires. Now I will explain what are they for and how to identify and differenciate them. There are 3 of them as my car needs two for Forward/Backward for the front tyres and the back tyres, and one for Left/Right in the front tyre. As I am going to mention them frequently, lets name the front tyre's wire as F, back tyre's as B and the turning wire as T. So, easily enough, you can identify the one that comes from back as B but when we try identifying F from T, things get a little tricky. If you are lucky and your receiver module has it all labelled then i envy you. But there is an (comparatively) easy and safe way out. The theory is that the motor that turns the vehicle consumes lesser power than that of the actual forward moving motor. Simply connect one wire of the wires to the 5V on the Arduino and other to GND. If you see the vehicle tyre going left of right, BINGO! else try in the other wire, you'll get it

My car uses a 4.8V lithium battery for power (pic attached above). Like all other batteries, it has a GND (black wire) and a VCC (red wire)

I have also attached an image of a rough diagram of one channel of the relay. I dunno if it explains everything but that is the main concept.

Briefing on the relay- its NC or Normally Closed is permanently connected to the COM or Common (unless the relay is given LOW) when it connects to the NO or Normally Open.

SO-

NC-GND

COM- (car)

NO-VCC

Step 3: The Connections Accordingly

The 8 channel relay has a common GND and VCC for all the relays (NOT TO BE CONFUSED WITH THE COM or THE GND OR VCC OF THE LITHIUM BATTERY). Connect the VCC to 5V (as it requires) and GND to GND. Connect the IN1....IN6 to any 6 digital pins of your choice (except 13, which is for the LED and 0 or 1 which are RX and TX).

Coming to the relay, simply connect the NC of Relay 1 to the NC of Relay 2 and that to the one of Relay 3 and same till Relay 6. Repeat procedure for NO.

Now connect the NC wire to the black wire or GND of the li-on battery and the NO to the red wire or VCC of the same.

We are left with the 6 COM's. Connect the COM of Relay 1 to one connector of the F, if you remember the abbreviations, and the COM of Relay 2 to the other. Repeat procedure with Relay 3,4 and 5,6 with B and T respectively.

Step 4: Understanding the Code

Abbreviations used in the code-

For relay

FF- Front - Forward

FB- Front - Backward

BF- Back - Forward

BB- Back - Backward

LT- Left

RT- Right

For function (movethecar)

FW- Forward

BW- Backward

LF- Left

RG- Right

Some important points in the code

1) change the pin numbers according to your setup

2) Change the movethecar(0,0,0,0,1); to the way you want it to move. Remember that the last condition is duration, not delay so the car will go back to stopping after those number of seconds.

3) ENTER THE DURATION in seconds, not the usual miliseconds

int FF  7
int FB  8 
int BF  9 
int BB  10 
int LT  11 
int RT  12 
void setup (){  
pinMode(FF,OUTPUT); // setting all the relays to OUTPUT 
pinMode(BF,OUTPUT);  
pinMode(FB,OUTPUT);  
pinMode(BB,OUTPUT);  
pinMode(LT,OUTPUT);  
pinMode(RT,OUTPUT);  
movethecar(0,0,0,0,1); // commanding the car NOT TO MOVE for the delay of a second } 
void loop(){   } 
void movethecar (int FW, int BW, int LF, int RG, int DELAY)<br>// A function that asks you to input values of either 1 or 0 for forward or backward & left or right while also asking for the parameter of delay or duration of the motion
{
  digitalWrite( FF,FW);
  digitalWrite( FB,FW);
  digitalWrite( BF,BW);
  digitalWrite( BB,BW);
  digitalWrite( LT,LF);
  digitalWrite( RT,RG);
  delay(DELAY*1000);
  digitalWrite( FF,0);
  digitalWrite( FB,0);
  digitalWrite( BF,0);
  digitalWrite( BB,0);
  digitalWrite( LT,0);
  digitalWrite( RT,0);
  }

Most of it is done- now just the last step is required

**IF YOU HAVE ANY PROBLEMS WITH THIS CODE THEN TRY THE DISTANCE SENSOR ONE **

Step 5: Fixing Everything to the Car

Now fix the relay & the arduino on top of the car using a Glue Gun (actually anything is fine).

Charge the Lithium Battery for 4-5 hrs and then just keep it firmly on to the vehicle.

Now POWER UP your Arduino using a powerbank of 7-12 V and watch your car moving AUTONOMOUSLY

Step 6: For the People Who Want to Use a Distance Sensor

Stick the HC-SR04 to the bumper of the car so that its view is uninterrupted

Use the distance sensor code from the file i have attached

You can always ask for help BELOW IN THE QUESTION SECTION.

HAPPY BUILDING!!!

Step 7: P.S-

PLEASE VOTE FOR THIS INSTRUCTABLE FOR THE MAKE IT MOVE CONTEST

Share

    Recommendations

    • Creative Misuse Contest

      Creative Misuse Contest
    • Tiny Home Contest

      Tiny Home Contest
    • Fix It! Contest

      Fix It! Contest

    2 Discussions