Infrared codes for consumer Audio/Visual Electronics

November 5th, 1999

Authors:

Gabriel Ricardo, Michael Vandegriend, Scott Medynski

 

Introduction:

This student application note is concerned with the common carrier and coding schemes used by manufactures of consumer audio/visual electronics (such as televisions, VCRs, CD players, etc...). First an overview of how IR (infrared) codes are transmitted and decoded is presented along with two of the most common coding standards used by industry. Then decoder and transmitter circuits are introduced with a discussion of their operation and where their components can be obtained. Lastly we present how this knowledge was used and implemented in our digital system.

 

Overview of most common coding schemes:

Almost all infrared remote controls use the same modulation scheme. The transmitter sends a 38kHz to 40KHz square wave (optimized to 50% duty cycle) signal gated by a stream of bits. This signal is sent to one or several infrared LEDs for transmission. The wavelength for infrared light used in most commercial applications is 940nm +/- 100nm. Transmitter circuits are discussed below

The receiver circuit consists of a photodiode (sensitive to the same wavelength mentioned above), a pre-amplifier and a demodulator circuit. The preamplifier circuit has a band-pass filter typically with a 3dB drop off at +/- 3kHz from the center frequency. The receiver circuit also has an adjustable gain control (AGC) which modifies the level of the incoming signal for the demodulator circuit. Since this gain adjustment is necessary in most circuits for proper demodulation almost all code protocols have a long leading pulse which sets the AGC accordingly. The output of the receiver is a bit stream which corresponds to the original signal used to gate the modulator. It is important to note that almost all protocols are active low (i.e. in terms of the carrier signal a low voltage, typically 0V, corresponds to a logical '1' and a high voltage, typically 5V, corresponds to a logical '0'). Receiver circuits and modules are discussed below.

 

Two common international IR coding standards (RC-5 and RECS-80):

Although modulation and demodulation techniques conform almost universally to the method described above there are various methods for encoding the bits for IR commands. There are two coding standards that are the most commonly used in consumer A/V products. These are the RC-5 and RECS-80 standards. They are explained below.

 

RECS-80:

The RECS-80 code uses pulse-length modulation. Each bit that is transmitted has the following coding scheme:

The duration of 'T' may vary depending on the manufacturer but is typically 550ns. An example of RECS-80 coding is shown below.

 

Note how the transmission of a logical '1' takes more time than a logical '0'.

RC-5:

This coding protocol contrasts the RECS-80 protocol by using a uniform duration of all bits. A transition, from high to low or low to high, in the middle of the time interval encodes the logical value.

Thus additional transitions at the beginning of each bit are necessary to set the proper start level if a series of equal bits is sent. This additional transition is not need if the next bit has a different value. This coding technique is commonly referred to as 'biphase' code. An example of this coding sequence is shown below.

 

Notes regarding coding schemes:

Out of the various manufactures that we investigated for IR television command codes all used the RECS-80 coding scheme. The RC-5 coding scheme was never encountered.

 

Further differences in code sets:

Even when the same carrier and coding schemes are used the IR code sequences can still differ greatly from manufacturer to manufacturer. Some manufacturers use a starting sequence or header-bits. Some us 12-bit codes while others us 32-bit codes and some us stop sequences while others do not. Furthermore the way the information in the bit sequence is presented can vary greatly. In some cases the 12-bit codes may be broken up into a 5-bit address code followed by a 7-bit command code. An excellent web-site, which takes a look at six common VCR manufactures (Sony, Kenwood, Pioneer, Aiwa, JCpenny and Onkyo) and their remote control configurations is listed below. The site details the carrier and coding schemes of the various remote controls as well as looks at the component performance. This is a great place to start in understanding infrared remote controls. Also check the links below for a wealth of information on IR.

http://www.ee.washington.edu/conselec/A95/projects/pierreg/main.htm

IR decoder and transmitter circuits:

An excellent example of a circuit that performs both the decoding (demodulation to a bit stream) and transmission (modulation to a 38kHz carrier) is show below. This circuit is an IR repeater.

 

Comments on this circuit:

The module, called the GP1U52X, is a Sharp IR receiver module. Such a module greatly simplifies the process of detecting and demodulating IR signals. This module contains all the components discussed above that are necessary for receiving an IR signal (i.e. photodiode, pre-amplifier, filter, AGC circuit, and demodulation circuit). Such a module can be readily purchased at any local electronic components supplier. The module has three pins, power (Vcc) at pin 2, ground at pin 3 and output (Vout) at pin 1. For our project we used a 276-137A Detector Module from RadioShack that cost around $5. The rest of the circuit is fairly basic. The 555 timer is set to around a 38kHz, 50% duty cycle square wave output at pin 3 and the output from the receiver module feeds into the reset pin of the 555 timer. Thus the circuit performs all the necessary steps for receiving and re-transmitting an IR signal. The portion of the circuit with the visible light LED is not necessary, nor is the transistor connected to it.

Receiver circuits can also be constructed from discrete components using a phototransistor to detect the IR signal. Such circuits may be useful for some applications but are not discussed here since we did not find it adequate for our purposes. The links below contain many IR circuits for various applications. Other circuits for detecting and transmitting can be found.

Integration of IR receiving and transmitting with our project:

Our project was designed so that it was capable of 'grabbing' codes for any television and storing them into memory. This was done via a training mode in which the IR codes of the particular television would be sent to the system. Then when the proper voice command was entered the codes would be accessed from memory and transmitted to the television. Thus our system was capable of IR interfacing with any television. Currently, as of the date that this application note was written, our system has some limitations in what format of IR codes are compatible with our system. Exactly what these limitations are and whether or not we were successful in making our system universal can be found by reading our final report (which we plan on making available on the web). These limitations are not discussed here since they have no baring on the general method we used for storing and transmitting IR codes.

Receiving and storing IR codes:

The method of receiving and storing IR codes was made very simple by two things:

  1. By using the IR detector module sold at RadioShack it was easy to detect and output the stream of bits to the UP1 board.
  2. Since the only purpose of our system was to capture and reproduce the codes we did not need an understanding of how the bit sequence was organized or the data that it contained. (i.e. there was no point in building a system that actually deciphered the incoming data into a series of '1's and '0's).

 

With these important points resolved the receiving and storing of IR codes became a simple task of sampling the incoming bit stream, counting how long the sequence was high and low, and storing these counts into memory. The code for this process will be included in our final report.

(Note: When modulated high or 0V is represented by a 38kHz carrier signal and low or 5V is represented by the lack of a carrier )

Transmitting from the UP1 board:

Transmitting the IR codes was a little more complicated. It involved the reproduction of modulated or 'un-modulated' sequences for the duration of the counts that were stored in memory. The carrier wave was produced by dividing the clock frequency on the UP1 board to 38kHz. The carrier was sent to an IR LED for the duration of the counts stored in memory. Essentially the task of receiving, storing and transmitting IR data was modeled after the IR repeater circuit shown above. Our IR module was no more that a digital system mirroring the IR repeater circuit with control logic routing data to memory or to the output depending on what was required.

Important Note:

Since our system has not yet (as of the date that this application note was written) been fully tested and verified the success or revision of the methods used in our system should be verified in our final report before implementing similar techniques.

Acknowledgements:

Related Links:

http://www.ee.washington.edu/eeca/

- this site has a circuits archive offered by the University of Washington including several IR circuits.

http://www.hut.fi/Misc/Electronics/opto.html

- site has various circuits and general information on IR remotes. The site has plenty of links for more information about IR in general.

http://cgl.bu.edu/GC/shammi/ir/

- This is a great web-site which has an overview of coding schemes and a detailed analysis of the coding scheme used in a Sony CD player.

http://www.ecn.purdue.edu/~laird/electronics/Sony/protocols/sircs.txt

- This site discuses Sony Control-S protocol.

http://www.best.com/~ziggr/ir/

- general information on IR and about computer links with IR.

http://www.ziplabel.com/cir/index.html

- how to set up your computer so that you can record and play back any set of IR codes.