Skip to main content

Weekend Project- TV Remote Controlled car!

Its pretty cool that we can control many appliances in our home wirelessly through IR systems. Perhaps is that all ? In this blog, ill be sharing an interesting use of the TV remote other than its conventional use of controlling the TV. 
So, you can make your own TV remote controlled car by following the video and the resources.
1.The video

2. The circuit diagram


DON'T FORGET TO POWER THE ARDUINO!!
3. Link for the IR remote library.

https://github.com/z3t0/Arduino-IRremote


4. List of main parts

If you're having any trouble finding TSOP 1738s, here's a link to one that I use-



5. And of-course the Arduino-Code




// Written and debugged by Siddharth Kothari, curiousmotor.com
#include <IRremote.h>
int leftmotora=8;
int leftmotorb=9;
int rightmotora=10;
int rightmotorb=12;


int RECV_PIN = 11;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup(){
  irrecv.enableIRIn(); // start the receiver


  pinMode (11, INPUT); //pin 11 connects to the IR receiver (tsop1738)
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(12, OUTPUT);
}

void loop() {
  if (irrecv.decode(&results)) {

  if (results.value==0xE0E08679){ // When the forward button is pressed
   digitalWrite(leftmotora, LOW);
   digitalWrite(leftmotorb, HIGH);
   digitalWrite(rightmotora, LOW);
   digitalWrite(rightmotorb, HIGH);
    }
   if (results.value==0xE0E006F9){ //when the backward direction, button is pressed
   digitalWrite(leftmotora, HIGH);
   digitalWrite(leftmotorb, LOW);
   digitalWrite(rightmotora, HIGH);
   digitalWrite(rightmotorb, LOW);
    }
   if (results.value==0xE0E0A659){ //to turn left
   digitalWrite(leftmotora, HIGH);
   digitalWrite(leftmotorb, LOW);
   digitalWrite(rightmotora, LOW);
   digitalWrite(rightmotorb, HIGH);
    }

    if (results.value==0xE0E046B9){//to turn right
   digitalWrite(leftmotora, LOW);
   digitalWrite(leftmotorb, HIGH);
   digitalWrite(rightmotora, HIGH);
   digitalWrite(rightmotorb, LOW);
    }
   if (results.value==0xE0E016E9){//THE STOP BUTTON !!
   digitalWrite(leftmotora, LOW);
   digitalWrite(leftmotorb, LOW);
   digitalWrite(rightmotora, LOW);
   digitalWrite(rightmotorb, LOW);
    }


  irrecv.resume(); // get ready to receive the next signal
}}

Simply copy-paste this in your Arduino IDE and upload it, ensure that you've change the hexadecimal values for the remote buttons as per your remote.
If your receiver doesn't read the value correctly (doesn't give the same value every time you press the button) try using a different remote.
Let the 0x in every if statement remain as it is, it is to declare that the datatype of the value ahead is hexadecimal. 
changes made in the hexadecimal value should follow this syntax-
if(results.value==0x<hexadecimal>)

If you're done with making this, and everything's working perfectly fine, you might want to add some more features, you can do that by simply adding more if statements following the syntax-


if (results.value==0xE0E016E9){
  //add whatever you want to, for example ,switch on an led
digitalWrite(13, HIGH);
    }



I'll leave the rest to you, let your creativity overwrite my code :)

Cheers 
Siddharth





Comments

  1. not able to get tv remote codes on serial monitor

    ReplyDelete
    Replies
    1. Hi! This is a very common problem, usually happens because of wrong connections to the TSOP IC, just try interchanging the pins that connect to the TSOP IC. Also try using different remotes, not all remotes are compatible with all TSOP Ics

      Delete

Post a Comment

Popular posts from this blog

5 Effective Online Tools that will Spice up your Arduino Projects!

Arduino has made electronics projects easier than ever. The question now is- Can we make the process of building projects faster and more enjoyable? Let's have a look at some of the interesting softwares/online tools developed for the Maker Community to make tinkering more effective and documenting projects easier!

1. TinkerCad

TinkerCAD's recently created circuit simulator allows you to arrange your Arduino/Attiny circuits in an easy 'drag and drop' environment and test them virtually without having to make them. This can be really helpful, for testing projects that use components which you are yet to buy. And after all, who doesn't like tinkering?


Try out Tinkercad-Circuits here!

But that's not what Tinkercad is famous for. It offers an amazingly easy to use 3D design tool for Makers, once again in a simple 'Drag and Drop' interface! You can directly download the CAD file, once you're done designing. If you've ever thought of making your own uniqu…

TV Remote Controlled Servo Motor-Using Arduino!

Greetings!
We use our TV remotes to control the functions of the TV's, but when the TV is not in use, they're absolutely useless. Today, we are going to learn how to add more functionality to ordinary IR based remotes, in this one we shall see how to control servo motors. There are so many (SO MANY) different applications of this project that one can think of. Using the following tutorial, you can make one yourself!

1. Watch the video tutorial-


2. Things you will need-

Note that you may use a different IR receiver other than TSOP1738, if it isn't available. Usually you can find this on websites like amazon and ebay.
3. The circuit diagram!

4. The IR Remote Library http://z3t0.github.io/Arduino-IRremote/
5. The Arduino Code- Just copy paste this code into your Arduino IDE

// Written by Siddharth Kothari, curiousmotor.com// Enjoy your journey Exploring Arduino!#include <IRremote.h>#include <IRremoteInt.h>#include <Servo.h>intRECV_PIN=11;//IR receiver pinintgndIR=10;/…

NetBeans Java project- TIC TAC TOE (AI) - logic explained

Greetings!
This article covers the basic concept of how you can implement basic AI in you game, i.e allow the computer to compete with you, giving it equal chances of winning. It's worth a thought what makes the computer invincible in a human vs computer chess game?

A common notion is that programmers code for every single possibility in the game considering all permutations and combinations etc. However this is far from reality. We can instead make the computer go by the 'Human thought process ' for every move. Lets consider a simpler approach to the popular TIC-TAC-TOE game.



Try out TIC TAC TOE here. (500 Kb executable .jar file)



Coming to the TIC-TAC-TOE GAME. This project is a great exercise for beginners to get a hang of basic logic used in games and other applications.
The logic behind the computer's moves is simpler than you think. To begin with, lets see the logical flow of code before getting into the 'code'.
Here's how the code works-

After every move yo…