Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

I would like to control my TV using a Raspberry Pi. I would like my Raspberry Pi to act like a TV remote controller.

What kind of hardware do I need to make it? Do I need something like IR emitter, and if so, where to buy such hardware? …or does the Raspberry Pi already have an IR transmitter and I didn't know?

I have already Google'd my question but the topics I found speak about how to control the Raspberry Pi with Infrared which it's not what I want. I want the opposite: I want my Raspberry Pi to control my TV using IR. I also found we can control the TV thanks to HDMI cable (if TV is compatible) but this unfortunately not convenient to me.

Here is a schema that explain how see the thing. My question is about step 2:

Schema

share|improve this question
2  
Its easy. You have to interface a IR transmitter, that matches with your TV remote and send commands via gpio –  askmish Jul 29 at 13:31
    
@askmish I agree with what you said but (as I'm a totally noob regarding hardware connectivity) how to interface the IR transmitter with the raspberry ? (for instance an IR from an unused TV remote but I dont know how to connect the IR to the raspberry, as I said I'm a noob). –  Ashbay Jul 29 at 15:27
    

2 Answers 2

up vote 3 down vote accepted

I have tried this one, it connects into the USB port, can record and play back the IR codes, supported by LiRC. I have even tried to plug it into my Android phone and it works there as well.

share|improve this answer
    
Upvote, this is the kind of hardware I am looking for. Bonus question : Do you know any possiblity to connect a IR from an unused TV remote to the raspberry ? –  Ashbay Jul 29 at 15:31
    
@Ashbay short answer: "NO", long answer -- TV remote usually has a microcontroller that scans the remote keypads and sends signals through the IR LED to the TV set. Most likely this microcontroller has no external connectors to be connected anywhere besides keypad and IR LED. –  lenik Jul 30 at 12:14

As an alternative to Infrared, you could use HDMI, if your TV has HDMI 2.0, it will support some kind of CEC (Consumer Electronics Control) implemenatation

Each TV brand calls this something else, like Panasonic Viera Link. But it all uses the same standard just some TV's implement more, some less but the basics should be there. Like turn TV on or off, navigate channels, etc.

cec-o-matic is a useful tool to try and help you decode message that the array of HDMI devices are sending across the CEC network. Remember that you can also control the Pi form the TV via a remote, but that can also be an AMP, Blu Ray Play, etc. It is uni directional.

You would need to build CEC-CLIENT so you first need a few dependencies

apt-get install build-essential autoconf liblockdev1-dev libudev-dev git libtool pkg-config

Then get it from GIT and build

git clone git://github.com/Pulse-Eight/libcec.git
cd libcec
./bootstrap
./configure --with-rpi-include-path=/opt/vc/include --with-rpi-lib-path=/opt/vc/lib --enable-rpi
make
make install
ldconfig

You can then check if the CEC device is working properly on the Pi by using this console command

cec-client -l

Here are a few more commands to get you going

  • Scan the CEC bus, and report all devices:
    • echo "scan" | cec-client -s -d 1
  • Check the power status of the TV (device 0):
    • echo "pow 0" | cec-client -s -d 1
  • Turn the TV on:
    • echo "on 0" | cec-client -s -d 1
  • Turn the TV off:
    • echo "standby 0" | cec-client -s -d 1

It might be a bit difficult to work out all the commands at first but it is a very robust way to control devices connected via HDMI.

Most tutoritals show how to control the Pi via the TV, like XBMC does. Basically you use your TV remote to navigate the menu on the XBMC. But you can do it other way too.

I hope this helps somebody in the future as an alternative to Infradead.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.