IR remote/Light you cannot see, flashing/01. The carrier is the trick
Light you cannot see, flashing · 01 of 11

The carrier is the trick

A remote does not flash a light at your television. It switches an infrared LED on and off 38,000 times a second, and the receiver is deaf to everything else. That one decision is why infrared works in a lit room at all.

The problem with light

A photodiode reports how much light falls on it, and that number is never zero and never steady: a window, a ceiling light flickering at twice the mains frequency, a screen, somebody walking past. If a remote sent its ones and zeros by flashing an LED, every one of those would look like a message.

So it switches its LED on and off 38,000 times a second, and sends its bits by turning that flicker on and off. The flicker is the carrier. Drag the frequency and watch what the receiver on the TK15 makes of it.

It is not a light sensor, it is a tuned one
TSOP18138 · 38 kHz
What the transmitter is flashing at38.0 kHz
Sensitivity
100 %
Range against best
100 %
Half-power width
5.4 kHz
Inside the band. The receiver hears this at very nearly full sensitivity. That narrowness is the whole trick. A lamp, a window or a screen is steady or slow, so it never gets through; a remote switching its LED 38 thousand times a second does.

The receiver is not a light sensor; it is a tuned one. Steady light is a frequency of zero and never gets through its filter. Neither does a lamp at 100 Hz. What gets through is a tone near 38 kHz, and almost nothing in a room makes one except a remote.

What the receiver hands you

The part on the TK15 is a Vishay TSOP18138: a photodiode, an amplifier, a 38 kHz band-pass filter and a demodulator in one three-legged package. The demodulator throws the tone away too. A burst of carrier becomes a LOW on its output pin, a gap becomes a HIGH, and your microcontroller never sees one of those 38,000 pulses.

That is why the receiver is the half with a chip on it, and the half you write no timing code for.

What it costs

Sunlight still hurts. The filter rejects a steady level, but a bright infrared background makes it harder to pick a small signal out, so the receiver needs a stronger one. In direct sun that can cost most of your range: how far, and how wide.

Somebody has to make the carrier. The remote has an oscillator. The TK16 has none: your microcontroller switches its LED 38,000 times a second, which is what the sender, pin by pin is about.

Three words

A mark is a run of carrier: the LED flickering. A space is a gap with no carrier. A frame is one whole message: a header, marks and spaces carrying bits, and a closing mark. Every protocol is a different set of lengths for those, and every length in this book is one of them.

When it does not work

Does the remote need line of sight?

Roughly. Infrared does not go through walls or a closed door, but it bounces: pointing a remote at a pale ceiling usually still works, because enough light scatters back to the receiver. Dark or textured surfaces absorb most of it.

Will two remotes in one room interfere?

Only while both are sending. They share the carrier, so two overlapping frames arrive as one corrupt frame and the decoder throws it away. You lose a press rather than getting the wrong one.

Can I use a receiver tuned to 36 or 40 kHz?

It works at shorter range. Vishay makes the same chip for 30, 33, 36, 38, 40 and 56 kHz, and each one's response falls off either side of its own frequency. A remote 2 kHz off costs about a third of the sensitivity; 10 kHz off costs nearly all of it.

Why 38 kHz and not something faster?

Fast enough that room lighting cannot reach it: mains lamps flicker at 100 or 120 Hz and their harmonics die out long before 30 kHz. Slow enough that a cheap photodiode and amplifier can follow it.

Where this goes next

What is in the box, and which board does the hard half.

Two boards and a remote

Edit this page — content/books/ir-receiver/the-carrier-is-the-trick.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

This page covers several products. Choose yours to see the right discussions.

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum