An IR (infrared) receiver is a specialized optoelectronic module that detects modulated infrared light pulses from a remote control and demodulates them into a clean digital logic signal for a microcontroller. In a real circuit, this component completely changes the design landscape: it bridges the gap between raw, noisy ambient light and clean 3.3V or 5V TTL logic, allowing an Arduino or ESP32 to understand complex remote protocols without requiring external op-amps, analog filters, or software-based signal decoding.
The 38kHz Carrier Wave: Why We Modulate IR Light
If you simply pointed a raw infrared LED at a photodiode, your circuit would fail the moment you turned on the room lights or opened the blinds. Sunlight and incandescent bulbs emit massive amounts of broadband infrared radiation. To solve this, remote controls use modulation. They blink the IR LED at exactly 38,000 times per second (a 38kHz carrier frequency).
The IR receiver contains a built-in bandpass filter tuned specifically to 38kHz. Think of it like a radio tuned to a specific station; the bandpass filter ignores the broadband "static" of sunlight and only listens to the 38kHz "broadcast."
When you press a button on a standard TV remote using the NEC protocol, the remote sends a 562.5µs burst of 38kHz pulses to represent a logic '0', and a 1.6875ms burst to represent a logic '1'. The IR receiver strips away the 38kHz carrier and outputs a clean LOW (0V) during the burst and a HIGH (3.3V/5V) during the gap, handing the microcontroller a perfect digital square wave.
Inside the Module: TSOP38238 vs. VS1838B Pinouts and Specs
Not all IR receivers are created equal. The market is split between premium modules like the Vishay TSOP38238 (typically $1.10 to $1.50) and generic bulk clones like the VS1838B (around $0.15 in packs of 20). While both share the same standard 3-pin footprint (OUT, GND, Vs), their internal Automatic Gain Control (AGC) and EMI shielding differ drastically.
| Parameter | TSOP38238 (Vishay) | VS1838B (Generic) |
|---|---|---|
| Supply Voltage | 2.5V to 5.5V | 2.7V to 5.5V |
| Carrier Frequency | 38kHz ± 2% | 38kHz ± 5% |
| Active Low Output | Yes | Yes |
| EMI Shielding | Built-in internal filter | Minimal / None |
| Typical Range | Up to 35 meters | Up to 15 meters |
| AGC Noise Rejection | Excellent (ignores DC/fluorescent flicker) | Poor (prone to phantom triggers) |
For critical smart home integrations where a missed signal means your AC unit stays on all night, the Vishay TSOP series is worth the extra dollar. For simple bench toys, the VS1838B is adequate.
Where You Meet This in Practice
You will encounter IR receivers in both consumer teardowns and DIY workbench projects:
- Smart Home IR Blasters: ESP8266 or ESP32 nodes running ESPHome or Tasmota use IR receivers to learn commands from "dumb" AC units and TVs, bridging them into Home Assistant via MQTT.
- Robotics Navigation: While raw IR is used for line-following, modulated IR receivers are used in beacon-based navigation, where a robot homes in on a 38kHz charging dock.
- Accessibility Interfaces: Repurposing cheap TV remotes to trigger relays for motorized blinds, garage doors, or custom macro keypads.
Bench Walkthrough: Wiring and Debugging a TSOP38238 on an ESP32
Let's look at a real-world scenario where theory meets the workbench. We are wiring a Vishay TSOP38238 to an ESP32 DevKit v1 to decode a mini-remote.
- Setup: Wire Pin 1 (OUT) to ESP32 GPIO 15. Wire Pin 2 (GND) to ESP32 GND. Wire Pin 3 (Vs) to the ESP32 3.3V pin. Per the Adafruit IR sensor guide, add a 100Ω series resistor on the Vs line and a 4.7µF ceramic decoupling capacitor directly across the Vs and GND pins at the receiver.
- Numbers: The ESP32 operates at 3.3V logic, which perfectly matches the TSOP38238's output high level. The receiver draws a quiescent current of just 0.35mA, spiking to ~5mA only when actively receiving a burst.
- Outcome: Upon uploading the IRremoteESP8266 library sketch, the serial monitor showed random noise and phantom button presses every 2 to 3 seconds, even when the remote was in a drawer.
- What Went Wrong: The generic 5V USB power supply powering the ESP32 had high-frequency switching noise on the 3.3V rail. The IR receiver's internal AGC interpreted this power rail ripple as a valid 38kHz optical signal, triggering phantom interrupts.
Common Confusions: IR Receivers vs. Photodiodes and Proximity Sensors
People frequently confuse integrated IR receivers with other infrared components. Here is how to tell them apart on the bench:
- Raw IR Photodiode (e.g., BPV10NF): This is a two-lead component that outputs an analog current proportional to all IR light hitting it. It cannot decode a remote control on its own; it requires an external transimpedance amplifier and a software-based bandpass filter to extract a 38kHz signal.
- IR Proximity Sensor (e.g., TCRT5000): This module pairs an IR LED and a phototransistor in a single housing to measure light reflection. It is used for obstacle avoidance and line-following, not for decoding remote control data streams.
- IR Receiver Module (e.g., TSOP38238): This is the three-lead epoxy module we are discussing. It contains the photodiode, preamp, AGC, and bandpass filter internally, outputting a fully decoded digital TTL signal.
FAQ: Troubleshooting IR Receiver Circuits
Q: Why is my IR receiver outputting a constant LOW signal, even when no remote is pressed?
A: A constant LOW means the receiver thinks it is being bombarded with a continuous 38kHz signal. This is almost always caused by severe power supply noise, a missing decoupling capacitor, or intense direct sunlight hitting the sensor. Check your 3.3V/5V rail with an oscilloscope; if you see more than 30mV of ripple, add bulk capacitance.
Q: Can I power a 5V IR receiver directly from a 3.3V ESP32 pin?
A: Yes, if you are using a modern module like the TSOP38238, which is rated down to 2.5V. However, older generic VS1838B modules sometimes struggle to trigger their internal comparators at 3.3V, resulting in severely reduced range. If you must use a VS1838B with a 3.3V microcontroller, power the receiver from a 5V rail and use a logic level shifter or a simple voltage divider on the OUT pin to protect your ESP32 GPIO.
Q: Why does my remote only work when I'm within 2 feet of the receiver?
A: Range issues usually stem from the transmitter, not the receiver. The IR LED on your remote might be degrading, or the remote's coin cell battery has high internal resistance and cannot supply the 100mA+ peak current needed to drive the LED brightly. Try pointing a known-good remote (like a TV remote) at your circuit; if the range jumps to 15 feet, your receiver is fine, and your keychain remote needs a new battery.






