Joystick Controlled Remote Car

18,003

27

18

Introduction: Joystick Controlled Remote Car

About: An electronics hobbyist

We always are interested in remote controlled cars. Here I'll show a way to use the Joystick module with Arduino and build a remote controlled car using Infra-Red as the transmitting medium.This will be an interesting project for a wireless car and will be interactive too since it uses joystick that we use in our XBOX or Play-Station. And another thing is that it will be the cheapest way of communication.

Step 1: Components Required

1. IR LED 1pc

2. TSOP 1738 IR receiver 1pc

3. 2 Arduino UNO/nano/mega/micro

4. Jumper wires

5. L298/L293 motor driver 1pc

6. Castor wheel 1pc

7. DC toy geared motor and wheels 2pc

8. Chassis for car

9. Joystick module 1pc

10. Tapes,Screws,Screw driver,Double sided tapes

11. 1 powerbank

12. 1 9V battery with battery clip

Step 2: Working Principle

The car is based on IR transmission method, that means that the IR LED at transmitter remote(TX) will send HEX codes and the receiver at the car will get those values and car will move likewise. The arduino at TX side will read the analog values from joystick and will likewise send the required HEX code via the IR LED. The TSOP receiver at the car can read those HEX values and car will move likewise.

The joystick is just a analog device that uses 2 potentiometer to give analog values, one for each direction. The two direction is just the X and Y direction, and one potentiometer is meant to be for one direction. Hence for one position of joystick shaft, we have two analog values of joystick, one for x and another for y. So for any position of joystick we always have 2 values, and I have written the code to read those values and used different conditions( like, joy-shaft at up position, down position, right,left) to send HEX values using IR LED.

I have used two Arduino UNO, one for transmitter(remote) and other at receiver(car). Basically any microcontroller is able to do the job, but people are more familiar to arduino environment, so I used arduino as easiest solution.

The TSOP1738 is an infra red receiver and can detect 38KHz IR data, which our remotes send. Actually these devices are being used inside TV to get signals from remote.Our TV remotes operate at 38KHz.

There is an excellent library for using this IR LED as well as TSOP receiver, the IRremote.h library. Download it here, extract it and paste in arduino libraries folder. https://github.com/z3t0/Arduino-IRremote

I've used L298 motor driver at receiver(car). You can use L293 too. I've used powerbank to power up both the receiver's arduino as well as the motor driver.

The transmitter side is being powered by using a 9V battery.

Actually you can use any transmission method, but here I'm interested with IR since is the cheapest transmission medium. IR is prone to light disturbances so you might not get 100% satisfactory results, but in 90% cases it works just fine.The TSOP is a very powerful receiver and can detect IR data even 3-5 meters.

See the circuit diagram and I've also given the Fritzing file here. You can download fritzing here

http://fritzing.org/home/

see also the TSOP datasheet if you are interested http://www.micropik.com/PDF/tsop17xx.pdf

Step 3: Building the Circuit

See the circuit diagram in the previous step, and construct both the TX and RX(receiver-car) circuits. You may require double sided tapes and insulation tapes. Construct the chassis and attach motors too using screws.

Now if you are using motor driver for first time then first just program your arduino to move the two motors forward( it is just a matter of digitalWrite to the 4 IN pins), then move backward ,then right then left. You may have to reverse the motor's polarity during your first test with motor driver. You can use YouTube too, your best friend.

I have used a barrel jack to connect my 9V battery to the TX arduino, you can directly insert to Vin pin too.

The L298 at RX is powered up using powerbank and it works fine if you are using toy geared motors

Step 4: Upload Code

Now upload the two codes to the two arduino. the files are attached here. power up the receiver powerbank and the 9V battery of the TX side. Now you can add a driver transistor at the TX side to further increase the range of the remote, without the transistor it will work at less than 1 meter range,beyond it can create some problems. You can also use your own HEX and DEC values in the code. See the videos embedded here to see the final working.This is the cheapest remote car you will ever see, no use of WiFi,Bluetooth,433MHz,etc

So now drive around, give it to your kids and let them enjoy, for any problem comment down here, or mail me at robosanu1@gmail.com

Arduino Contest 2017

Participated in the
Arduino Contest 2017

Wheels Contest 2017

Participated in the
Wheels Contest 2017

Remote Control Contest 2017

Participated in the
Remote Control Contest 2017

Be the First to Share

    Recommendations

    • Make it Glow Contest

      Make it Glow Contest
    • First Time Author Contest

      First Time Author Contest
    • PCB Challenge

      PCB Challenge

    18 Discussions

    0
    Flame Kaiser
    Flame Kaiser

    1 year ago

    I finally finished the project but it is kinda late reaction the ir led is working as Well as the receiver it moves but the whole process is where slow and sometimes it keeps following the first command what could be going wrong?😢

    0
    SayantanM4
    SayantanM4

    Reply 1 year ago

    Actually..since IR is the cheapest means for remote communication, it has the disadvantage of having too much restricted angle of sight as well as low speed of communication. Your car needs to move slow, not too fast, otherwise you'll lose control very easily. Your car needs to move slow so that you can point your IR directly to the receiver. Otherwise for a fast car,you need to use Bluetooth like hc05 or a 433mhz transmitter receiver module.

    0
    Flame Kaiser
    Flame Kaiser

    Reply 1 year ago

    So how do I slow it down I am using 2 3.7v 18650 like ion batteries at the moment

    0
    SayantanM4
    SayantanM4

    Reply 1 year ago

    You need to use the enable pins of L298/L293 IC. Use analog write in Arduino code to control motor speed. There are lots of tutorials about that.

    0
    Flame Kaiser
    Flame Kaiser

    1 year ago

    Sir can u send me the hex code and decimal interpretation when the joystick is pressed downwards because I want to add another mode to it and the joystick press button is the trigger.
    U know the number 8FC.... And decimal interpretation of 20E....
    I need it for when press that pushbutton on the joystick by pressing it downwards perpendicular to the base

    0
    Flame Kaiser
    Flame Kaiser

    Reply 1 year ago

    How do you get your own hex and Dec values ?
    Or do we just input any number we want

    0
    SayantanM4
    SayantanM4

    Reply 1 year ago

    Sorry for the late reply..
    lets take the first hex code from the code: 0x80BF53AC ( in the joystick ir tx .ino file)
    You use this link to convert hex to decimal: https://www.binaryhexconverter.com/hex-to-decimal-...
    You will see the decimal equivalent is 2160022444 ( in receiver.ino file)
    now it is a standard to use 4 byte hex values, as you can see in tv remotes. that's why i've used it. you may try to use your own values by trial and errors.
    good luck

    0
    Flame Kaiser
    Flame Kaiser

    1 year ago

    Umm y did u use photodiode in the video for it transmitter shouldn't we use ir led?
    And which resistor did u use along with the led?how many ohms?

    0
    SayantanM4
    SayantanM4

    Reply 1 year ago

    That's not photodiode, that's IR LED. IR LED may come in a transparent package or may be in a deep bluish window. It is actually not that deep black (photodiode). It's deep blue. Search online for an IR LED and you'll get it. And you may safely use a resistor between 100-330 ohms.

    0
    Flame Kaiser
    Flame Kaiser

    Reply 1 year ago

    Yes I did get it thank you for the answer sir

    0
    Flame Kaiser
    Flame Kaiser

    Reply 1 year ago

    Sir can u send me the hex code and decimal interpretation when the joystick is pressed downwards because I want to add another mode to it and the joystick press button is the trigger

    0
    josealfredong06
    josealfredong06

    1 year ago

    Nice proyect but where is the part of the code i don't found it

    0
    SayantanM4
    SayantanM4

    Reply 1 year ago

    At step 4, plz look on a pc, or desktop view on your smartphone

    0
    Carlos Eduardo PP
    Carlos Eduardo PP

    1 year ago

    Hello excuse me
    I try to recreate your project but it does not work, there is no signal, what do you think could be happening?
    0
    SayantanM4
    SayantanM4

    Reply 1 year ago

    Use your smartphone camera to see whether the IR led is ok or not. It's forward voltage is about 1.5v and it will burn out easily if suitable resistor is not used. Also see whether your TSOP is ok or not by running some debug codes beforehand. Also check whether your TSOP version is 1738 or not. Also check your motor driver, see if enable shorter caps are in place . And last but not the least, those jumper wires tend to become damaged in no time ( the wire dries up in course of time), so check it's continuity.

    0
    Harsh Dethe
    Harsh Dethe

    3 years ago

    Great Project...

    0
    SayantanM4
    SayantanM4

    Reply 2 years ago

    Thanks Sir