An IR (infrared) receiver is an integrated optoelectronic module that detects modulated infrared light—typically pulsing at a specific carrier frequency like 38kHz—and converts it into a clean, demodulated digital logic signal. In a real circuit or installation, this component fundamentally changes the design by eliminating the need for complex analog amplification stages and heavy microcontroller software decoding; it takes messy, ambient optical noise and outputs crisp 5V or 3.3V square waves that any GPIO pin can read directly.
How a 38kHz IR Receiver Demodulates Signals
When you press a button on a TV remote, the remote's internal LED doesn't just turn on and off. It blinks on and off roughly 38,000 times per second (a 38kHz carrier frequency), and then pulses that 38kHz signal on and off in specific patterns to encode data.
Inside a standard integrated receiver like the Vishay TSOP38238 or the Everlight VS1838B, three distinct stages process this light:
- PIN Photodiode: Converts incoming infrared photons into a tiny microamp current.
- Preamplifier & Bandpass Filter: Amplifies the signal but aggressively rejects any frequency that isn't exactly 38kHz.
- Automatic Gain Control (AGC) & Envelope Detector: Adjusts the amplification dynamically so the receiver works whether the remote is 1 foot away or 20 feet away, then strips away the 38kHz carrier, leaving only the underlying data envelope.
To understand why the bandpass filter is necessary, imagine trying to spot a friend's flashlight in a brightly sunlit stadium. If they just hold the light steady, you cannot see it against the glare of the sun. But if they flash it exactly 38 times a second, and you wear specialized glasses that only let in light flashing at exactly that rate, their signal stands out perfectly. The receiver's internal bandpass filter acts as those specialized glasses, rejecting the constant 'glare' of ambient sunlight.
Worked Numeric Example: Power Filtering and Timing Math
A common mistake on the bench is wiring an IR receiver directly to a microcontroller's 5V rail without local filtering. Switching voltage regulators and digital logic noise will couple into the receiver's highly sensitive preamplifier, causing phantom triggers or reduced range. The datasheet for the TSOP38238 mandates an RC filter on the Vcc pin.
Let's look at the math behind this requirement. The time constant ($\tau$) of this RC network is:
$\tau = R \times C = 100\Omega \times 4.7\mu F = 0.47 \text{ milliseconds}$
The cutoff frequency ($f_c$) for this low-pass filter is:
$f_c = \frac{1}{2 \pi R C} \approx 338 \text{ Hz}$
This means any power supply ripple above 338 Hz is heavily attenuated before it reaches the receiver's internal preamp, while the DC voltage passes through cleanly.
Now consider the timing math for decoding the signal. The ubiquitous NEC IR protocol uses a 9ms leading pulse burst to wake up the receiver. At a 38kHz carrier frequency, one single cycle takes $1 / 38,000 = 26.3\mu s$. Therefore, a 9ms burst contains exactly $9000 / 26.3 \approx 342$ carrier cycles. Because the TSOP38238's internal envelope detector requires a minimum of 6 to 10 continuous cycles to recognize a valid burst and pull the output pin LOW, 342 cycles provides a massive safety margin against brief optical glitches.
Where You Meet This in Practice (And What People Confuse It With)
You will find 38kHz IR receivers in consumer AV equipment, HVAC thermostat control boards, DIY Arduino-based obstacle-avoidance robots, and custom home-automation blasters. However, makers frequently confuse integrated IR receiver modules with raw IR photodiodes.
| Feature | Raw IR Photodiode (e.g., BPV10NF) | Integrated IR Receiver (e.g., TSOP38238) |
|---|---|---|
| Output Type | Analog current (microamps) | Digital logic (HIGH/LOW square wave) |
| Ambient Light Rejection | Poor (requires external optical filters) | Excellent (internal bandpass & AGC) |
| Component Count | Requires op-amps, comparators, and resistors | Requires only 1 resistor and 1 capacitor |
| Microcontroller Load | High (requires ADC polling or complex interrupts) | Low (simple GPIO edge interrupt) |
If you are building a simple beam-break sensor across a 2-inch gap, a raw photodiode is fine. If you are decoding a remote control across a 20-foot living room, you must use an integrated receiver module.
Bench Troubleshooting: Why Your IR Receiver Range Drops
If your IR sensor circuit works on the bench but fails in the final installation, the culprit is almost always optical noise overwhelming the Automatic Gain Control (AGC).
The Fix: First, try physical shielding (a small piece of heat-shrink tubing or a 3D-printed hood over the epoxy dome). If that fails, change your carrier frequency. Move to a 56kHz carrier using a TSOP38256 receiver and reprogram your remote's transmitter to match. Most modern optical noise is concentrated below 45kHz, making 56kHz a much cleaner band for noisy environments.
Secondly, check your transmitter. Range is rarely a receiver problem; it is usually a transmitter current problem. A standard Arduino GPIO pin can only source 20mA to 40mA. To get 20 feet of range, you need to pulse the IR LED at 100mA. Use a simple 2N2222 NPN transistor with a 10Ω current-limiting resistor on the LED's ground path to safely drive high-current bursts.
Frequently Asked Questions
What is the difference between an IR receiver and an IR photodiode?
A raw IR photodiode is a basic semiconductor that outputs a tiny analog current proportional to all infrared light hitting it, including sunlight and heat. An IR receiver is a complete integrated circuit containing a photodiode, a preamplifier, and a bandpass filter. The receiver actively filters out ambient light and outputs a clean digital 5V or 3.3V logic signal that a microcontroller can read directly without external analog components.
Can I use a 38kHz IR receiver with a 40kHz remote?
Technically yes, but with a severe penalty to range. The internal bandpass filter of a 38kHz receiver is tuned to peak at 38kHz and will attenuate signals at 40kHz by roughly 3dB to 6dB depending on the specific manufacturer's tolerance. This means your effective operating distance might drop from 20 feet to 8 feet. For reliable operation, always match the receiver's center frequency to the transmitter's carrier frequency exactly.
Why does my IR receiver output LOW when it sees a signal?
This is an intentional design choice known as 'active-low' logic. When the receiver detects a valid 38kHz burst, its internal transistor pulls the output pin to ground (LOW). When no signal is present, an internal pull-up resistor holds the pin HIGH. This active-low architecture is preferred in electrical design because pulling a line to ground is less susceptible to electromagnetic interference (EMI) and voltage spikes than pulling it up to Vcc.
Do I need a resistor on the IR receiver data pin?
No, you do not need a series resistor on the data (OUT) pin when connecting it to a microcontroller GPIO like an Arduino or ESP32. The output stage of standard modules like the VS1838B is a push-pull or open-drain configuration with built-in current limiting designed to drive standard CMOS logic inputs directly. However, you must include the 100Ω resistor on the Vcc power pin for filtering.






