Introduction: Joystick Controlled Remote Car
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
see also the TSOP datasheet if you are interested http://www.micropik.com/PDF/tsop17xx.pdf
Attachments
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

Participated in the
Arduino Contest 2017

Participated in the
Remote Control Contest 2017

Participated in the
Wheels Contest 2017
22 Comments
Question 1 year ago
Where is the code
2 years ago
Hola al lomento de descargar los archivos o intentar abrir los no me deja
2 years ago on Step 3
Hello I have a problem with the syntax I get the following problem. Maybe some solution.
Problem:
error: expected constructor, destructor, or type conversion before 'void'
Best Answer 2 years ago
The two lines of code above void setup is not correct. Take the IR library example codes
3 years 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?😢
Reply 3 years 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.
Reply 3 years ago
So how do I slow it down I am using 2 3.7v 18650 like ion batteries at the moment
Reply 3 years 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.
3 years ago
I am using this ir led :-https://www.amazon.in/Robo-India-IR5P-Photo-Diode/dp/B00VI90C82/ref=mp_s_a_1_1?keywords=ir+led&qid=1578932519&refinements=p_85%3A10440599031&rnid=10440598031&rps=1&sr=8-1
With 220 ohm resistor. I dunno the whole setup is lagging. And it only works when I take the remote close to the car.
3 years 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
Reply 3 years ago
How do you get your own hex and Dec values ?
Or do we just input any number we want
Reply 3 years 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
3 years 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?
Reply 3 years 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.
Reply 3 years ago
Yes I did get it thank you for the answer sir
Reply 3 years 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
3 years ago
Nice proyect but where is the part of the code i don't found it
Reply 3 years ago
At step 4, plz look on a pc, or desktop view on your smartphone
3 years ago
I try to recreate your project but it does not work, there is no signal, what do you think could be happening?
Reply 3 years 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.