# Infrared LED binary code

I'm a noob of electricity and circuits, so please keep that in mind. Devices have some IR binary codes to operate a function. For example, binary code of a TV for "volume up" is 0001 0111. What do these bits represent? I guess they represent conducting energy from battery to IR LED. What is the time gap between them? Is it specific for every devices?

To repeat, I'm just a noob. I'd be very happy if you explain this to me in a very simple way. Thanks.

• The most common is IRDA protocol. Google it. – Eugene Sh. Aug 27 '15 at 20:12
• The protocol is dependent on every device, as is baud rate (that you call time gap), but for remote control of appliances RC-5 is a common one. Where is a detailed summary en.wikipedia.org/wiki/RC-5 – Diego C Nascimento Aug 27 '15 at 20:15
• also worth reading about Manchester Encoding sometimes used with optical transmitters. – MarkU Aug 27 '15 at 20:17
• @Eugene Sh., IRDA has nothing to do with Consumer Infrared (such as "volume up"). Consumer infrared uses a fixed modulation carrier between 38-56kHz, and either a manchester, or a PWM, or a space-width modulation (SAA1250-SAA1251) or some other modulation to send out data. – Gee Bee Mar 16 '16 at 15:02

IR as used by most remote controls is modulated at 36 (sometimes 30 or 38) kHz: the IR LED is switches on and of at 36 kHz. That is the 'active' signal. At the receiver a 36 kHz filter is used, much like the tuner of a radio, to filter out al kinds of interfering signals (TL tubes fo instance generate a lot of IR at 50 Hz).

On top of this, the active signal is switched on and off acording to a protocol. It must has active and inactive moments, otherwise the receiver will not recognise it (its atomatic gain control will see a constant active 36 kHz signal as backround noise).

The most common protocols are RC-5, Sony, and NEC (also used by Apple). The protocols each have a specific (and totally differebnt) way to encode the bit pattern that represents the keys on your remote. To add to the confusion, the mapping of keys to bit patterns als varies widely, even with the same protcol.

Interestingly, the protocols also differ in how they handle a key that is pressed down for along time. IIRC Sony simply repeats the same bit pattern, RC-5 does likewise but toggles one bit, and NEC sends (after the first keypress signal) a 'repeat' signal that is the same for all keys.

IRDA is a different protocol that also uses IR signals, but without the 36 kHz modulation, and at a much higher data rate, and for shorter distances. It was mainly used to connect hand-held gadgets, either with each other or with laptops. I don't see it used much these days. (Anyone interested in a reel of IBM31T1100A IrDa transceivers?)

• I will trade you the IrDa tranceivers for my modem line encoders! :-P Fluke still uses it a lot on account of RF com causing too much noise back into the multimeter for the 5digit accuracy they sometimes boast. Or at least, that's my interpretation of them still using it. – Asmyldof Aug 27 '15 at 21:29

I would suggest reading up a tutorial: https://learn.sparkfun.com/tutorials/ir-communication

The bits represent actually only "data". The way how that data is transmitted is called a modulation.

For example, the "0" can be trasmitted as no light, "1" can be trasmitted as light - this is called amplitude modulation. However it is not used in consumer infrared, as sending out "1" bits would take too much power.

In the consumer infrared, the first thing is that the transmitter is not just "on" but it is making a pulsing light of 38kHz (or 40, or 56). This pulsing helps the receiver to distinguish from a strong direct light with some infrared (such as sunlight) and an infrared transmitter (since the transmitter is flashing, the Sun does not.)

This pulsing singal - called the carrier - is then modulated a bit to represent some data. For example, a "0" can be transmitted as sending this flashing light for 0.1 second, then sending no light for 0.2 second. An "1" can be transmitted as flashing for 0.2 second, then sending no light for 0.1 second. As you can see, "1" gives a longer flash, similar to the old-school Morse code. This encoding is called pwm encoding.

A lot of the TVs use RC5 encoding. Here the 0 and 1 is encoded differently, by having on and off, and off and on for a while. The tutorial I was referring to is a good place to start.