many purposes, such as controlling devices in a typical household, it’s an
excellent choice.
But infrared also has some drawbacks. It doesn’t work through walls or doors,
and the distance between the remote control and the operated device is fairly
limited. Even more importantly, the infrared signal is subject to interference
from other light sources.
To keep possible distortions caused by other light sources to a minimum, the
infrared signal has to be modulated. That means you turn the LED on and
off at a certain frequency, usually somewhere between 36 kHz and 40 kHz.
That’s one of the problems that complicates building a robust infrared remote
control. The biggest problem is that vendors have invented countless incom-
patible protocols. They all use different frequencies, and they all interpret
data differently. Some interpret “light on” as a 1 bit, while others treat it as
0, and they all define their own commands that have different lengths. So, to
work successfully with different remote control protocols, you need to know
how to obtain all of these properties for a specific remote control.
To get this information, we’ll take a pragmatic approach. In the next two
sections, you’ll learn how to read infrared signals from a commercial-grade
remote control, and you’ll also learn how to reproduce them.
Grabbing Remote Control Codes
Because remote controls from different vendors rarely use the same protocol
or even the same commands, before we start sending remote control codes
ourselves, we should know what we have to send to achieve a certain result.
We have to get as much information as possible about the remote control
we’d like to emulate.
We have two options for obtaining remote control codes for a specific device:
we could use a remote control database on the Internet, such as the Linux
Infrared Remote Control project,
1
or we could use an infrared receiver to read
them directly from our device’s remote. We’ll choose the latter approach
because you can learn a lot from it.
Infrared receivers are fairly complex on the inside, but they’re
easy to use. They automatically observe the infrared light
spectrum at a certain frequency (usually between 36 kHz
and 40 kHz), and they report their observations using a single pin. So, when
1.
http://www.lirc.org/
report erratum • discuss
Grabbing Remote Control Codes • 203
www.it-ebooks.info