Skip to main content

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

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>


int RECV_PIN = 11; //IR receiver pin

int gndIR=10; //initialize pin 10

int powerIR=9;//intialize pin 9

IRrecv irrecv(RECV_PIN);


Servo myservo;  // create servo object to control a servo
                // a maximum of eight servo objects can be created

int pos = 0;    // variable to store the servo position


decode_results results;

void setup(){
  irrecv.enableIRIn(); // start the receiver
pinMode(gndIR, OUTPUT);
pinMode(powerIR, OUTPUT);
digitalWrite(gndIR, LOW); // using pin 10 as gnd
digitalWrite(powerIR, 255); // using pin 9 as a 5v power source

  myservo.attach(5); // declaring the servo object

}

void loop() {

 if (irrecv.decode(&results)) {
  if (results.value==0xE0E0D02F ){ //Move the servo to 35 degrees position
 // You've gotto change these hexadecimal values(0xE0E...) to button values corresponding to your remote
 
    myservo.write(35);
    delay(15);

   }
  if (results.value==0xE0E0E01F ){ //move the servo to 170 degrees position
 
    myservo.write(170);
    delay(15);
    }
   if (results.value==0xE0E0A659 ){//add +10 degress to servo position
 if(pos<180){
     pos=pos+10;
    myservo.write(pos);
    delay(15);
    }}
     if (results.value==0xE0E046B9 ){// decrease servo position by 10
       if(pos>0){
  pos=pos-10;
    myservo.write(pos);
    delay(15);
    }}
  irrecv.resume();
 
}



}






Let your creativity overwrite my code :)
Enjoy your journey of learning and making new things, and let the exploration never stop!

                                                                                                  Cheers
                                                                                                 -Siddharth






Comments

  1. I have read your blog its very attractive and impressive. I like it your blog.

    Technology
    businessexceltemplates

    ReplyDelete
  2. You have provided a nice article, Thank you very much for this one. And I hope this will be useful for many people. And I am waiting for your next post keep on updating these kinds of knowledgeable things
    Android Training Institutes in Bangalore
    Android Training in Bangalore
    Android Course in Bangalore
    Android Training in Coimbatore
    Android Course in Coimbatore
    Android Training in Madurai

    ReplyDelete
  3. You have provided a nice article, Thank you very much for this one. And I hope this will be useful for many people. And I am waiting for your next post keep on updating these kinds of knowledgeable things
    Android Training in Chennai
    Android Course in Chennai
    App Development Course in Chennai
    Android Development Course in Chennai
    Android App Development Course in Chennai

    ReplyDelete
  4. Having read this I thought it was very enlightening. I appreciate you taking the time and effort to put this information together. I once again find myself spending a lot of time both reading and press leaving comments. But so what, it was still worthwhile!

    ReplyDelete
  5. very nice blogs!!! i have to learning for lot of information for this sites...Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing.

    Web Designing Training in Chennai

    Web Designing Course in Chennai

    Web Designing Training in Bangalore

    Web Designing Course in Bangalore

    Web Designing Training in Hyderabad

    Web Designing Course in Hyderabad

    Web Designing Training in Coimbatore

    Web Designing Training

    Web Designing Online Training

    ReplyDelete

Post a comment

Popular posts from this blog

Distortion Pedal Electronics (Explained for beginners!)

If you are into DIY guitar pedals and want to start designing your own effects, this article might help you open a few doors. I write this article as an EE student who earlier struggled with understanding these circuits and would often simply copy schematics off the internet. 

This article is intended for-
1. Absolute beginners who like tinkering with electronics
2. Anyone who has been learning analog circuits and is looking for a jumpstart project.

Also before I start I'd like to mention, for anyone who wants to get a rock-solid foundation in Analog electronics, I highly recommend reading the book, 'Electronic Principles' by AP Malvino and David Bates.

Distortion Pedals come in all flavors and sizes, however, how the distortion effect is achieved in any of the pedals is more or less similar. Let's first see how the output of the pedal compares to its input.

The raw signal coming from the guitar is first amplified a little, and then the peaks of the amplified signal are clip…

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…