How to control TV functions using Analog input and Arduino

 by emdarcher
Featured
DSC06244.JPG
Have you ever wanted to use a good old knob to control your TV volume instead of repeated button pushing? Or make it controlled by light? Do you want your remote to be replaced by an awesome arduino and let it do the hard work of using a remote for you? Well this instructable is for you!

Also if you just want to learn how to use IR to control your TV with your arduino this will help you gain some understanding. Or maybe inspire some awesome project and instructable ideas!

In this instructable we will be using a 10k potentiometer, IR LED, and an Arduino to control the volume (or anything else you want) on a TV.

Here is a materials list

NOTE: "*" means optional

Arduino (or clone, but the arduino Leonardo has not worked for me)

10k potentiometer

IR LED http://www.radioshack.com/product/index.jsp?productId=2062565

100 ohm resistor 

IR receiver http://www.radioshack.com/product/index.jsp?productId=2049727

*NPN transistor and 1k resistor (if you want to amplify power to IR LED)

*pushbutton 

*regular LED and 470 ohm resistor

You will also need to download the IRremote library from this site:

http://www.arcfn.com/2009/08/multi-protocol-infrared-remote-library.html

and make shure to make it arduino 1.0/1.0.1 compatible by changing

#include
to
#include
in IRRemoteInt.h.

Now Lets Begin!
 
Remove these adsRemove these ads by Signing Up

Step 1: Get the IR remote library, learn about it, and get some remote codes.

IRsendingSetup_bb.png
Ken Shirriff s blog  A Multi Protocol Infrared Remote Library for the Arduino example 2.png
GenericIRreceiverSetup_bb.png
To get the really handy IR remote library that Ken Shirriff made
go to http://www.arcfn.com/2009/08/multi-protocol-infrared-remote-library.html 
and download and install the library

make sure to change

#include <WProgram.h>
to
#include <Arduino.h>
in IRRemoteInt.h. (to open IRRemoteInt.h and edit it, use Notepad on Windows, or Text Editor on Mac, but don't open with arduino IDE because it won't open with it.)

to make it arduino 1.0/1.0.1 compatable


On the page make sure to read about how to use the library and find the correct protocol for your device

check out the sending example and test it to make sure it works on your arduino

NOTE: picture 1 shows the sending code, and picture 2 shows the hardware setup for it.

then do the receiving test on your arduino to find out your remote hexadecimal codes by pointing your remote at the receiver and pressing the buttons you want the codes for, the see the codes in the Serial monitor.

make sure to write down the codes or store them somewhere for future use.

NOTE: picture 3 shows the receiving code, and picture 4 shows the hardware setup for the receiving code.


If you get all these to work then you are set to continue!

spacehippy says: Jan 15, 2013. 6:00 PM
I too have had issues getting the IRremote library working on an Arduino Leonardo or clone.. I was glad to find you had issues too and that i'm not crazy. It led me to look further and find that Leonard has a timer4 which operates on pin13. The library supports this and it now works for me.
thanks!
--matt
via http://arduino.cc/forum/index.php?topic=115033.0
sfokaren says: Jul 3, 2012. 10:42 PM
Great job! I am looking forward to seeing more of your inventions and instructibles!
randofo says: Jul 1, 2012. 10:12 PM
Nice first Instructable!
emdarcher (author) in reply to randofoJul 2, 2012. 12:23 AM
Thanks!
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!