Infra-Red Sensor

Hardware part
Software part
Windows configuration
Linux configuration

Hardware part

Different circuits are available. The easiest is maybe to take an infrared sensor and to connect it on the serial port, with just a resistor between RX and the ground. This works very well for me.

Pin numbers indicated are for SUB-D9. See this table for SUB-D25.

Common replacements :

This one is probably the best, it works merely always.

A 78L05 regulator has the following pins :

Software part

The sensor makes the most of the decoding process, by demodulating the ir signal..

Many IR protocols exist, like RC5, RCA,… , and that make the decoding not an easy task.
Here are some useful links :

I have summarised information about decoding protocols stored in these documents in this file.

Here is an example of codes : TV Philips.

Windows configuration

Under windows, an excellent program is WinLIRC. This software decodes data of the serial port, according to a configuration file, and puts the result on a TCP/IP port. This is based on LIRC, that we will see later.

The configuration is very easy : you just have to enter the name of the configuration file and which serial port is it. If you do not have the configuration file, you can record it by pushing the keys one after the other.

Once launched, WinLIRC stays in the TrayBar and send data to the TCP/IP port. Yellow means configuration, green a good code, and red a bad code.

You can find a version of WinLirc here. The latest version will be found on the WinLIRC home page.

The use of these data is done program by program. A plugin has been developed for WinAmp. You can find it on the WinLirc home page or here.
The configuration is very easy :

  • Ensure WinLIRC is working properly.
  • Copy gen_ir.dll in the plugin directory of winamp.
  • Configure this plugin (tab General Purpose), with matching names of the keys with actions to do.
  • Activate the plugin

The problem is that a plugin is required for each application. Girder is a wonderul freeware that allows to send keys to windows or to move the mouse, … a must !

I am developping a program capable of sending a keystoke or a message to a window by the remote controller. But nothing relevant has been done yet and I will not have many time to continue.

Linux configuration

Under Linux, you have the possibility to do approximatively everything you want with your remote controller, from controlling an application to emulating a mouse. All this is possible owing to this software : LIRC (Linux Infra Red Control). A version is available here.

This program set up a module allowing decoding the IR signals, and putting the results in a device (/dev/lircd). LIRC has several parts :

  • lircd : the daemon, converting the IR signals.
  • irexec : to launch a command when a key has been pressed.
  • irrecord : to record yourself the codes of your remote.
  • irw : to see the key pressed.

Lircd configuration

  • First you have to compile LIRC, what is very easy typing ./configure, selecting the correct serial port number, then typing make and make install (with root rigths).
  • Then you have to load the module if is not automaticaly made : modprobe lirc_serial.
  • You have then to record a configuration file with irrecord, except if you had it already : you can find some on the homepage of LIRC.
  • Launch the daemon lircd
  • Check your configuration with irw and pressing a key of your remote controller. The name of the key should print. If not, check /var/log/lircd.

Irexec configuration

You can now configure irexec. The documentation of LIRC is brief and well doneto create the file lircrc. You can also adapt my configuration file.

Xmms configuration

A plugin is available for Xmms. You can find the latest on the software page of LIRC or a version here.

You have then to compile it and install it. The installation process have sometimes problems with shared libraries. A solution is to copy this file : cp /usr/local/lib/liblirc_client.so.0.0.0 /usr/lib/liblirc_client.so.0.0.0
Then launch xmms from a terminal in order to see any problem. Do not forget to activate the plugin.

This plugin is used through the lircrc configuration file. You will need irexec to be running to use this plugin. Just see in my configuration file what to add in it to make this plugin work properly.

That’s it ! You can now enjoy your IR remote.

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close Menu