The image below is a link. Try to click on it.

Recording Air Conditioner remote controls using Irdroid

 

Recording Air conditioner remote controls with Irdroid

Recording Air conditioner remote controls with Irdroid

Recording Air Conditioner (AC) infrared remote controls can be a challenge, when using conventional methods for recording IR remote control codes with LIRC (The Linux Infrared Remote control software package).Recording off-the-shelf TV / STB infrared remote control includes running the irrecord utility that comes with LIRC and recording the physical infrared remote buttons one after another and storing the data into a flat text file. The above procedure is standard for recording home appliance IR remotes, except for Air Conditioner remote controls.

OK, what is different about the AC infrared remote controls ?

Well, the difference is that the AC infrared remote control codes are longer in comparison with any TV, DVD, STB or any other IR controlled equipment. The main difference is the way these infrared remote controls work.

The AC remote control sends all its settings (current state) at once (in one infrared code sequence) . That means when you set for example a temperature, air direction , mode etc these are all send with one IR command which contains all the current settings (current state) with other words all the data in the remote. It means that normally we can’t record remote buttons individually by pressing each button and recording with LIRC, as with every button press we get the remote current state, not a single pressed button.

We can record ON command, OFF command in combination with the current setting/state (mode – heat, current temperature;air direction etc) . We can do that using a patched version of the IR record utility, which is part of the LIRC software package which will allow us to record longer infrared commands.

The LIRC irrecord utility assumes maximum infrared code length of 200 bits, which is a limitation and it is not enought as most of the ACs are using code length > 200bits (some are using code length of ~500 bits) .To change the setting, we need to edit the source file irrecord.c that comes with the version of LIRC , attached to this article.

In particular we have to edit line #109 of irrecord.c

  • #define MAX_SIGNALS 200

this defines the maximum signal length that irrecord shall consider as valid. We shall change that to :

  • #define MAX_SIGNALS 600 (to have some reserve and make sure we cover all ACs with code length over 500 bits)

After changing the file we have to compile LIRC by issuing:

./configure
make
make install

*My configuration for the above procedure was a Laptop running Ubuntu Linux 14.04 LTS
*In Windows the user needs to download WinLIRC, edit the irrecord.c file and recompile the software

After the install process finishes we should be able to use the Irdroid USB IR Transceiver or the Irdroid-Rpi (infrared transceiver for Raspberry Pi) in combination with irrecord to record any AC infrared remote control code in RAW form.

The irrecord syntax:

irrecord -f -d /dev/ttyACMx /etc/lirc/lircd.conf

*depending on your configuration and the number of the serial ACM devices used in your system the ttyACMx can be ttyACM0 or any other number depending on the number of serial ACM devices in enumerated in your system.

the irrecord -f option forces the program to go in a RAW IR record mode (it will not try to decode any of the known IR protocols like RC5, RC6 etc)

Example lircd.conf file with a scanned toshiba Air Conditioner ON command :

begin remote

name Toshiba
flags RAW_CODES
eps 30
aeps 100

gap 1000000

begin raw_codes

name ON
3285 1578 447 405 405 405
426 1173 469 383 426 1173
469 383 426 383 426 383
426 1173 469 1173 469 383
426 383 426 383 426 1173
426 1194 426 405 405 405
405 447 383 447 383 405
405 405 405 405 405 405
405 405 405 405 405 405
405 405 405 405 405 1215
405 405 405 405 405 405
405 405 405 405 405 405
405 405 405 1215 405 405
405 405 405 405 405 405
405 1215 405 405 405 405
405 405 405 405 405 405
405 405 405 1237 405 405
405 1215 405 1215 405 1215
405 1215 405 1215 405 1215
405

end raw_codes

end remote

*The above example represents a ON command, and the current remote state (mode heat,22 degrees celsius, swing mode). You maybe noticed that there are repeating codes like 405, 1215, 1173 , these are the bit representations normally a sequence of zero’s and one’s . these numbers also represent the pusle / space IR signal length in microseconds. The big number in the begining is the so called “lead-in” “informing” the receiver that a infrared command starts.

Initially the program will try to identify the so-called “IR Gap” , it will ask you to press different buttons from the physical remote control. Even if the Gap is not found you can still continue and record button presses from the target remote and store them in a flat lircd.conf file, which is later used by lircd for reproducing the recorded infrared signals.

*The recorded remote control in the above example was for an old Toshiba Air Conditioner. A friend of mine asked me whether he can use one of the Irdroid modules to control (Turn On and Off) the Air Conditioner at his office. In particular to do that using WinLirc in Windows. I have successfully scanned the physical remote control and tested successfully with the target AC. Later on I find out a nice automation utility for windows which has plugins for LIRC and a Scheduler, giving the option to schedule infrared remote control commands. Convenient , isn’t it?

Downloads:

Hardware: