Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamhow to connect IR receiver module pinout diagram
An IR receiver module normally has 3 pins:
VCC GND OUT/SIGNAL
You connect it like this:
IR Receiver Module Microcontroller / Arduino / ESP32
------------------ -------------------------------
VCC / + ----------> 3.3 V or 5 V
GND / - ----------> GND
OUT / S ----------> Digital input pin
For example, with an Arduino UNO:
IR Receiver Arduino UNO
----------- -----------
VCC --------> 5V
GND --------> GND
OUT/S --------> D2, D7, D11, or another digital pin
For an ESP32 / Raspberry Pi / 3.3 V board:
IR Receiver ESP32 / 3.3 V logic board
----------- -------------------------
VCC --------> 3.3V
GND --------> GND
OUT/S --------> GPIO input pin
The most important warning: do not assume the pin order without checking the markings or part number, because different IR receiver packages use different pinouts.
Most IR receiver modules, such as VS1838B, HX1838, TSOP38xx, KY-022, and similar modules, have three functions:
| Pin name | Meaning | Connect to |
|---|---|---|
| VCC / + | Power supply | 3.3 V or 5 V |
| GND / - | Ground | System ground |
| OUT / S / DATA / SIG | Digital output signal | Microcontroller digital input |
The output is usually active LOW. That means:
So if you measure the OUT pin with a multimeter, it will usually sit near VCC when idle.
Many Arduino-style IR receiver modules are labeled directly on the PCB:
Front/header view:
[ - ] [ + ] [ S ]
| | |
GND VCC SIGNAL
Connection:
KY-022 / IR Module Arduino
------------------ -------
- / GND -----------> GND
+ / VCC -----------> 5V
S / OUT -----------> Digital pin, e.g. D2
Some modules may instead be labeled:
[ S ] [ GND ] [ VCC ]
or:
[ OUT ] [ GND ] [ VCC ]
Therefore, always follow the silkscreen labels on the PCB.
If you have the bare black 3-pin receiver, hold it with the rounded lens/dome facing you and the pins pointing downward.
Common VS1838B / HX1838 pinout:
Front view, lens facing you:
_______
| |
| IR |
|_______|
| | |
1 2 3
Pin 1 = OUT
Pin 2 = GND
Pin 3 = VCC
So the connection is:
VS1838B / HX1838 Microcontroller
---------------- ---------------
Pin 1 OUT ----------> Digital input
Pin 2 GND ----------> GND
Pin 3 VCC ----------> 3.3V or 5V
Some older Vishay TSOP parts use a different pinout. For example, many TSOP1738 receivers use:
Front view, lens facing you:
_______
| |
| TSOP |
|_______|
| | |
1 2 3
Pin 1 = GND
Pin 2 = VCC
Pin 3 = OUT
This is different from VS1838B-type receivers.
So for TSOP1738:
TSOP1738 Microcontroller
-------- ---------------
Pin 1 GND ----> GND
Pin 2 VCC ----> 5V or 3.3V, depending on part
Pin 3 OUT ----> Digital input
This is why checking the exact part number is important.
IR Receiver Module
+-------------------+
| |
Arduino 5V ---| VCC |
Arduino GND --| GND |
Arduino D2 ---| OUT / DATA / S |
| |
+-------------------+
If using a module marked -, +, S:
Arduino GND ---> -
Arduino 5V ---> +
Arduino D2 ---> S
Most common IR receiver modules work from approximately 2.7 V to 5.5 V, but you should check the specific module.
General rule:
| Controller | Recommended IR receiver VCC |
|---|---|
| Arduino UNO / Nano | 5 V |
| ESP32 | 3.3 V |
| ESP8266 | 3.3 V |
| Raspberry Pi | 3.3 V |
| Raspberry Pi Pico | 3.3 V |
For 3.3 V microcontrollers, it is safest to power the IR receiver from 3.3 V, so the OUT signal does not exceed the input voltage rating.
The OUT pin goes to a normal digital input pin. For better decoding, use a pin that supports interrupts if your software library recommends it.
Example:
OUT ---> Arduino D2
or:
OUT ---> ESP32 GPIO 14
or:
OUT ---> Raspberry Pi GPIO 18
IR receivers can be sensitive to power supply noise. Place a small capacitor close to the module:
VCC ----+------ IR receiver VCC
|
=== 100 nF
|
GND ----+------ IR receiver GND
For longer wires or noisy supplies, you can also add a larger capacitor:
100 nF ceramic + 4.7 µF to 10 µF electrolytic/tantalum
In noisy designs, a small series resistor, for example 47 Ω to 100 Ω, in the VCC line can also help.
| Problem | Likely cause | Fix |
|---|---|---|
| No response | VCC/GND/OUT connected incorrectly | Check pinout and labels |
| Receiver gets hot | VCC and GND reversed | Disconnect immediately |
| Random readings | Power supply noise | Add 100 nF capacitor near module |
| Short range | Wrong carrier frequency or poor alignment | Use 38 kHz receiver and aim remote |
| Works on Arduino but not ESP32/Raspberry Pi | Output voltage too high | Power receiver from 3.3 V |
| Remote not detected | Remote battery dead or wrong protocol | Test remote with phone camera |
Connect an IR receiver module as follows:
VCC ---> 3.3 V or 5 V
GND ---> GND
OUT ---> Digital input pin
If your module is labeled -, +, S:
- ---> GND
+ ---> VCC
S ---> Digital input
For a bare 3-pin receiver, check the exact part number because VS1838B/HX1838 and TSOP1738 style receivers can have different pin orders.