Hacking on the TV remote control
Date: 01/04/2013
Last updated
Date: 01/04/2013
Last updated
Do you have an old TV remote? What if I told you that you could create your code to communicate with this remote controller? We can do it.
The infrared remote control is excellent. The idea of this git chapter is to turn it into a presentation tool. It is easy with this remote to keep your finger on the advance button and advance slides — or turn the screen back to your favourite PDF viewer. Like MacGyver, to handle a problematic situation through improvisation using only available materials to do an intellectual activity soon. It's ok. Let us go to the hack.
There are several potential motivations for creating a custom driver for Linux to read TV remote inputs and perform actions on a computer. One motivation is to enable users to control their computers using a TV remote, which can be more convenient and user-friendly than a keyboard or mouse. This can be particularly useful for applications designed to be used with a TV, such as media players or games.
Another motivation for creating a custom driver is to enable users to customize the behaviour of their TV remote. By writing a custom driver, you can specify which buttons on the remote correspond to which actions on the computer, and you can even add new features and functionality to the remote. This can make it easier for users to use their TV remote how they want, and it can make their overall experience more personalized and enjoyable.
Finally, creating a custom driver for Linux can also be a challenging and rewarding learning experience. It can help you improve your programming skills and your knowledge of Linux and driver development, and it can be a fun and exciting way to explore new technologies and techniques.
Computer with Unix Like OS(at my tests Fedora Linux)
Any TV remote control (my control samsung model “AA59-00469A”)
Arduino nano 12,00 USD
IR recv (model “1838B”) - 2,00 USD
Jumpers 1,00 USD
Breadboard 2,50 USD
The total cost is 17.50 USD, looks good and is not expensive, try following this image to assembly your hardware:
The green wire is GND
The orange wire is 5v
The yellow wire is pin 6(this is input to make communication with Arduino)
USB connected at Arduino(usually at mini-series uses FTDI input)
Second step mapping your TV remote control: At this step, we are getting some libraries. Look at the following:
$ git clone https://github.com/shirriff/Arduino-IRremote
$ mv Arduino-IRremote ArduinoRemote; sudo cp -rf ArduinoRemote/ /usr/share/arduino/libraries
At your Arduino IDE tool, you can view examples of use it at the tab "File", load examples that show the input of serial, and look the following:
The function Serial.println() shows the output of the serial input. For example: when you hold the button on one of the TV remote control, this action shows the hexadecimal value "E13DDA28".
Done the mapping process of buttons, the next step is to use syscall open() to open the file "/dev/ttyUSB0" and use the syscall read() to get INPUTs of the Arduino device. Remember to put different conditions at each button input of the device. To automate keyboard hold keys, at Unix like a system, you need to use some libraries like libXtst and libX11, to emulate keys to turn screens of presentation. To install this library, look the following:
$ yum install libXtst-devel libX11-devel
So deb-based distros uses apt-get install pkg_name-dev
To get the final code, rewrite this lines 152 and 159 with the address of your button mapping, compile it and run:
$ git clone https://github.com/CoolerVoid/arduino_ppt_walk
$ gcc IR_remote.c -o IR_remote -lX11 -lXtst -Wall
$ ./IR_remote /dev/ttyUSB0
Look at the following:
Thank you for reading.
Cheers!