# Adafruit Infrared IR Remote Receiver

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/129/378/medium800thumb/adafruit_products_5939-04.jpg?1713275485)

A year ago we designed a high-current-output [Infrared Transmitter STEMMA](https://www.adafruit.com/product/5639) which makes it easy to create high-powered IR LED blasters. Now we've sat down to design the other side, the super sensitive wide-range **Adafruit Infrared IR Remote Receiver** with two selectable IR receiver chips.

Warning: This board is specifically for receiving 38KHz IR remote control signals - it isn't going to work for proximity/distance sensing or other frequency signals

![](https://cdn-learn.adafruit.com/assets/assets/000/129/379/medium800/adafruit_products_5939-03.jpg?1713275543)

We found plenty of 38KHz receiver sensors that would work nicely on this breakout board - but when it came to choosing one that was vertical or horizontal we just couldn't make up our mind...so why not both? We've placed one on the end and one in the middle, and a slide switch to select which one you want to read the signal from.

We can't just tie the outputs together because they'd 'fight' each other and give incoherent output, but if you're willing to solder two wires, it's possible to read each one independently thanks to labelled breakout pads.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/380/medium800/adafruit_products_5939-01.jpg?1713275604)

Usage is simple: Power the board by connecting V+ and ground to 3 to 5VDC, point a 38KHz remote control at the sensors and press some buttons. The demodulated IR envelope is piped out the Signal pin into your microcontroller which will then need to decode it.

To make usage really easy, we have a green 'power good' LED and a red 'signal' LED. When IR remote signals are read by the onboard sensors, the red LED will blink to let you know.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/381/medium800/adafruit_products_5939-02.jpg?1713275611)

This board will work nicely for a variety of IR remote receiving projects, and with mounting holes and a cable, a lot easier to mount in enclosures and on devices. Using a 2mm pitch STEMMA JST PH cable with headers or alligator clips on the end, you can easily wire this board without any soldering.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/382/medium800/adafruit_products_5939-05.jpg?1713275646)

Note that this board is specifically for receiving 38KHz IR remote control signals - it isn't going to work for proximity/distance sensing or other frequency signals. The signal must be read by a microcontroller that has pulse-input reading capabilities - basically just check that it supports common IR Receiver connectivity and decoding. Sometimes you may need to use special code or microcontroller pins.

Each STEMMA board is a fully assembled and tested PCB but no cable. No soldering is required to use it, but you will need to pick up [a 2mm pitch, 3-pin&nbsp;STEMMA JST PH cable](https://www.adafruit.com/?q=jst+ph+3&sort=BestMatch). Alternatively, if you _do_ want to solder, there's a 0.1" spaced header for power/ground/signal.

# Adafruit Infrared IR Remote Receiver

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/129/388/medium800/adafruit_products_double.jpg?1713277668)

## Power Pins

- **V+** &nbsp;- this is the power pin. To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 5V microcontroller like Arduino, use 5V.
- **GND** - common ground for power and logic.

## Signal Output

- **Sig** &nbsp;- this is the output signal from either the vertical or horizontal infrared receiver. When a 38KHz signal is received, the demodulated IR envelope is piped out the Signal pin into your microcontroller which will then need to decode it.

Warning: This board is specifically for receiving 38KHz IR remote control signals - it isn't going to work for proximity/distance sensing or other frequency signals.

## STEMMA JST PH

- [**STEMMA JST PH**](https://learn.adafruit.com/introducing-adafruit-stemma-qt) - 2mm pitch STEMMA JST port for use with [3-pin STEMMA JST PH cables](https://www.adafruit.com/category/619). It has connections for:
  - **GND** &nbsp;- common ground for power and data. It is the black wire on the JST PH cable.
  - **V+** - power input for the infrared receivers. It is the red wire on the JST PH cable.&nbsp;
  - **Sig** - signal to your microcontroller. It is the white wire on the JST PH cable.

## Selection Switch

On the top right of the board is a slide switch labeled **V** and **H** on the board silk. This switch selects between routing the vertical IR receiver or the horizontal IR receiver to the signal ( **Sig** ) pin. Switch to **V** for the vertical infrared receiver and switch to **H** for the horizontal infrared receiver.

## Infrared Receiver Pins

The selection switch routes either the vertical or horizontal infrared receiver to the signal pin. We can't just tie the outputs together because they'd 'fight' each other and give incoherent output. However, it's possible to read each one independently thanks to the labelled breakout pads:

- **IRH** - breakout pad for the horizontal infrared receiver
- **IRV** - breakout pad for the vertical infrared receiver

## Signal LED and Jumper

- **Signal LED** - to the left of the JST PH connector is the signal LED, labeled **Sig**. It is the red LED. It will light up when an IR signal is read by the selected IR receiver.
- **LED jumper** - in the center of the back of the board is a jumper for the signal LED. It is labeled **SIG** on the board silk. If you want to disable the signal LED, cut the trace on this jumper.

## Power LED and Jumper

- **Power LED** - to the right of the JST PH connector is the power LED, labeled **ON**. It is the green LED.
- **LED jumper** - in the center of the back of the board is a jumper for the power LED. It is labeled **LED** on the board silk. If you want to disable the power LED, cut the trace on this jumper.

# Adafruit Infrared IR Remote Receiver

## CircuitPython and Python

It's easy to use the **Infrared IR Demodulator Breakout** with CircuitPython and the [pulseio](https://docs.circuitpython.org/projects/irremote/en/latest/) module. This module allows you to easily write Python code for sending and receiving IR signals with IR remotes.

You can use this driver with any CircuitPython microcontroller board or with a computer that has GPIO, [pulseio](https://docs.circuitpython.org/projects/blinka/en/latest/api.html#pulseio-pulse-width-modulation-input-and-output-control) support and Python [thanks to Adafruit\_Blinka, our CircuitPython-for-Python compatibility library](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux). Not all single board computers (SBCs) have pulseio support. Make sure to [check if it is supported](https://docs.circuitpython.org/en/latest/shared-bindings/pwmio/index.html#module-pwmio) on your board.&nbsp;

You'll need an IR remote controller to use this example with the receiver:

### Mini Remote Control

[Mini Remote Control](https://www.adafruit.com/product/389)
This little remote control would be handy for controlling a robot or other project from across the room. It has 21 buttons and a layout we thought was handy: directional buttons and number entry buttons. The remote uses the NEC encoding type and sends data codes 0 thru 26 (it skips #3, #7,...

In Stock
[Buy Now](https://www.adafruit.com/product/389)
[Related Guides to the Product](https://learn.adafruit.com/products/389/guides)
![Mini Remote Control with 21 buttons](https://cdn-shop.adafruit.com/640x480/389-03.jpg)

Warning: This board is specifically for receiving 38KHz IR remote control signals - it isn't going to work for proximity/distance sensing or other frequency signals.

## CircuitPython Microcontroller Wiring

First wire up the sensor to your board exactly as follows. The following is the receiver wired to a Feather RP2040 with a JST PH cable.

- **Board 3V** to **receiver JST PH** **V+ (red wire)**  
- **Board GND** to **receiver**** &nbsp;JST PH GND (black wire)**  
- **Board pin 5** to **receiver** &nbsp; **JST PH** **Sig (white wire)**

![adafruit_products_featherSTEMMA_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/129/409/medium640/adafruit_products_featherSTEMMA_bb.jpg?1713284760)

The following is the receiver wired to a Feather RP2040 using a solderless breadboard:

- **Board 3V** to **receiver** **V+ (red wire)**  
- **Board GND** to **receiver**** &nbsp;GND (black wire)**  
- **Board pin 5** to **receiver** **Sig (white wire)**

![adafruit_products_featherBB_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/129/410/medium640/adafruit_products_featherBB_bb.jpg?1713284775)

## Python Computer Wiring

Since there are _dozens_ of Linux computers/boards you can use, we will show wiring for Raspberry Pi. For other platforms, [please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).

Here's the Raspberry Pi wired to the receiver using a JST PH cable:

- **Pi 3V** to **receiver JST PH V+ (red wire)**
- **Pi GND** to **receiver JST PH GND (black wire)**
- **Pi GPIO5** to **receiver JST PH Sig (white wire)**

![adafruit_products_piSTEMMA_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/129/411/medium640/adafruit_products_piSTEMMA_bb.jpg?1713284788)

Here is how you'll wire the receiver to a Raspberry Pi with a breadboard:

- **Pi 3V** to **receiver V+ (red wire)**
- **Pi GND** to **receiver GND (black wire)**
- **Pi GPIO5** to **receiver Sig (white wire)**

![adafruit_products_piBB_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/129/412/medium640/adafruit_products_piBB_bb.jpg?1713284802)

## Python Installation of IR Remote Library

You'll need to install the **Adafruit\_Blinka** library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3. [Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

Once that's done, from your command line run the following command:

- `pip3 install adafruit-circuitpython-irremote`

If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!

## CircuitPython Usage

To use with CircuitPython, you need to first install the **Adafruit\_CircuitPython\_IRRemote** library into the&nbsp; **lib** folder on your **CIRCUITPY** drive. Then you need to update **code.py** with the example script.

Thankfully, we can do this in one go. In the example below, click the **Download Project Bundle** button below to download the necessary library and the **code.py** file in a zip file. Extract the contents of the zip file, and copy the **entire**  **lib**  **folder** and the **code.py** file to your **CIRCUITPY** drive.

Your **CIRCUITPY/lib** folder should contain the following file:

- **adafruit\_irremote.mpy**

![CIRCUITPY](https://adafruit.github.io/Adafruit_Learning_System_Guides/STEMMA_IR_Remote_Receiver_Examples_CircuitPython.png )

## Python Usage

Once you have the library `pip3` installed on your computer, copy or download the following example to your computer, and run the following, replacing **code.py** with whatever you named the file:

`python3 code.py`

## Example Code

**If running CircuitPython:** Once everything is saved to the **CIRCUITPY** drive, [connect to the serial console](https://learn.adafruit.com/welcome-to-circuitpython/kattni-connecting-to-the-serial-console) to see the data printed out!

**If running Python:** The console output will appear wherever you are running Python.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/STEMMA_IR_Remote_Receiver_Examples/CircuitPython/code.py

In the code, if an IR remote command is received, its HEX (hexadecimal) code is printed to the serial monitor.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/403/medium800/adafruit_products_cpSerial.png?1713282561)

# Adafruit Infrared IR Remote Receiver

## Python Docs

# Adafruit Infrared IR Remote Receiver

## Arduino

Using the Infrared IR Remote Receiver with Arduino involves wiring up the receiver to your Arduino-compatible microcontroller, installing the [IRremote](https://github.com/Arduino-IRremote/Arduino-IRremote)&nbsp;library, and running the provided example code.

You'll need an IR remote controller to use this example with the receiver:

### Mini Remote Control

[Mini Remote Control](https://www.adafruit.com/product/389)
This little remote control would be handy for controlling a robot or other project from across the room. It has 21 buttons and a layout we thought was handy: directional buttons and number entry buttons. The remote uses the NEC encoding type and sends data codes 0 thru 26 (it skips #3, #7,...

In Stock
[Buy Now](https://www.adafruit.com/product/389)
[Related Guides to the Product](https://learn.adafruit.com/products/389/guides)
![Mini Remote Control with 21 buttons](https://cdn-shop.adafruit.com/640x480/389-03.jpg)

Warning: This board is specifically for receiving 38KHz IR remote control signals - it isn't going to work for proximity/distance sensing or other frequency signals.

## Wiring

Wire as shown for a **5V** board like an Uno. If you are using a **3V** board, like an Adafruit Feather, wire the board's 3V pin to the breakout VIN.

Here is an Adafruit Metro wired up to the receiver using a JST PH cable.

- **Board 5V** to&nbsp; **receiver JST PH** **V+ (red wire)**  
- **Board GND** to **receiver**** &nbsp;JST PH GND (black wire)**  
- **Board pin 5** to **receiver** &nbsp; **JST PH** **Sig (white wire)**

![adafruit_products_metroSTEMMA_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/129/413/medium640/adafruit_products_metroSTEMMA_bb.jpg?1713284819)

Here is an Adafruit Metro wired up using a solderless breadboard:

- **Board 5V** to&nbsp; **receiver** **V+ (red wire)**  
- **Board GND** to **receiver** **GND (black wire)**  
- **Board pin 5** to **receiver** **Sig (white wire)**

![adafruit_products_metroBB_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/129/414/medium640/adafruit_products_metroBB_bb.jpg?1713284833)

## Library Installation

You can install the **IRremote** library for Arduino using the Library Manager in the Arduino IDE.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/398/medium800/adafruit_products_Arduino_Open_Library_Manager.png?1713281037)

Click the **Manage Libraries ...** menu item, search for **IRremote** , and select the **&nbsp;IRremote** library:

![](https://cdn-learn.adafruit.com/assets/assets/000/129/400/medium800/adafruit_products_lib.png?1713281238)

Info: There are no additional dependencies needed for this library.

## Example Code
https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/STEMMA_IR_Remote_Receiver_Examples/Arduino_STEMMA_IR_Remote_Receiver/Arduino_STEMMA_IR_Remote_Receiver.ino

Upload the sketch to your board and open up the Serial Monitor ( **Tools -\> Serial Monitor** ) at 115200 baud. As you press buttons on your IR remote, you'll see the protocol, address, command, raw data and repeat gap print to the Serial Monitor.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/402/medium800/adafruit_products_arduinoSerial.png?1713282302)

# Adafruit Infrared IR Remote Receiver

## Arduino Docs

# Adafruit Infrared IR Remote Receiver

## Downloads

## Files

- [Product Demo Code](https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/STEMMA_IR_Remote_Receiver_Examples/CircuitPython_ProductDemo/code.py)
- [EagleCAD PCB Files on GitHub](https://github.com/adafruit/Adafruit-Infrared-IR-Remote-Receiver-PCB)
- [3D models on GitHub](https://github.com/adafruit/Adafruit_CAD_Parts/tree/main/5939%20IR%20Remote%20Receiver)
- [Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20Infrared%20IR%20Remote%20Receiver.fzpz)

## Schematic and Fab Print
![](https://cdn-learn.adafruit.com/assets/assets/000/129/383/medium800/adafruit_products_schem.png?1713277155)

![](https://cdn-learn.adafruit.com/assets/assets/000/129/384/medium800/adafruit_products_fab.png?1713277161 dimensions are in inches)

![](https://cdn-learn.adafruit.com/assets/assets/000/130/175/medium800/adafruit_products_5939_IR_Remote_Receiver.jpg?1716399653)


## Primary Products

### Adafruit Infrared IR Remote Receiver - STEMMA JST PH 2mm

[Adafruit Infrared IR Remote Receiver - STEMMA JST PH 2mm](https://www.adafruit.com/product/5939)
A year ago we designed a high-current-output&nbsp;[Infrared&nbsp;Transmitter STEMMA](https://www.adafruit.com/product/5639)&nbsp;which makes it easy to create high-powered IR LED blasters. Now we've sat down to design the other side, the&nbsp;super sensitive wide-range **...**

In Stock
[Buy Now](https://www.adafruit.com/product/5939)
[Related Guides to the Product](https://learn.adafruit.com/products/5939/guides)

## Featured Products

### Mini Remote Control

[Mini Remote Control](https://www.adafruit.com/product/389)
This little remote control would be handy for controlling a robot or other project from across the room. It has 21 buttons and a layout we thought was handy: directional buttons and number entry buttons. The remote uses the NEC encoding type and sends data codes 0 thru 26 (it skips #3, #7,...

In Stock
[Buy Now](https://www.adafruit.com/product/389)
[Related Guides to the Product](https://learn.adafruit.com/products/389/guides)
### STEMMA JST PH 2mm 3-Pin to Male Header Cable - 200mm

[STEMMA JST PH 2mm 3-Pin to Male Header Cable - 200mm](https://www.adafruit.com/product/3893)
This cable will let you turn a JST PH 3-pin cable port into 3 individual wires with high-quality 0.1" male header plugs on the end. We're carrying these to match up with our Hallowing, for extending and connecting sensors or LEDs - and the wires are even color coded!

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/3893)
[Related Guides to the Product](https://learn.adafruit.com/products/3893/guides)
### STEMMA JST PH 2mm 3-Pin to Female Socket Cable - 200mm

[STEMMA JST PH 2mm 3-Pin to Female Socket Cable - 200mm](https://www.adafruit.com/product/3894)
This cable will let you turn a JST PH 3-pin cable port into 3 individual wires with high-quality 0.1" female header sockets on the end. We're carrying these to match up with our Hallowing, for extending and connecting sensors or LEDs - and the wires are even color coded!

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/3894)
[Related Guides to the Product](https://learn.adafruit.com/products/3894/guides)
### JST PH 2mm 3-pin Plug to Color Coded Alligator Clips Cable

[JST PH 2mm 3-pin Plug to Color Coded Alligator Clips Cable](https://www.adafruit.com/product/4030)
This cable will let you turn a JST PH 3-pin cable port into 3 individual wires with grippy mini alligator clips. We're carrying these to match up with any of our boards or breakouts with 3-pin 'STEMMA' connectors on them such as the&nbsp;<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4030)
[Related Guides to the Product](https://learn.adafruit.com/products/4030/guides)

## Related Guides

- [Pico W YBox3](https://learn.adafruit.com/pico-w-ybox3.md)
- [NeoPixel Remote: IR Control with WLED](https://learn.adafruit.com/neopixel-remote-ir-control-with-wled.md)
- [Adafruit H3LIS331 and LIS331 High-g 3-Axis Accelerometers](https://learn.adafruit.com/adafruit-h3lis331-and-lis331hh-high-g-3-axis-accelerometers.md)
- [Adafruit PiCowbell Adalogger for Pico](https://learn.adafruit.com/adafruit-picowbell-adalogger-for-pico.md)
- [Blues Playground](https://learn.adafruit.com/blues-playground.md)
- [PyPortal US Election Calendar](https://learn.adafruit.com/pyportal-electioncal-us.md)
- [Adafruit INA23x DC Current Voltage Power Monitor](https://learn.adafruit.com/adafruit-ina237-dc-current-voltage-power-monitor.md)
- [HalloWing Magic 9 Ball](https://learn.adafruit.com/hallowing-magic-9-ball.md)
- [Adafruit Qualia ESP32-S3 for RGB-666 Displays](https://learn.adafruit.com/adafruit-qualia-esp32-s3-for-rgb666-displays.md)
- [Adafruit I2C Quad Rotary Encoder Breakout](https://learn.adafruit.com/adafruit-i2c-quad-rotary-encoder-breakout.md)
- [Soundbox RP2040](https://learn.adafruit.com/soundbox-rp2040.md)
- [A Logger for CircuitPython](https://learn.adafruit.com/a-logger-for-circuitpython.md)
- [Adafruit TSC2046 SPI Resistive Touch Screen Controller](https://learn.adafruit.com/adafruit-tsc2046-spi-resistive-touch-screen-controller.md)
- [Introducing Adafruit PyGamer](https://learn.adafruit.com/adafruit-pygamer.md)
- [IoT Food Scale with Azure and CircuitPython](https://learn.adafruit.com/iot-food-scale-with-azure-and-circuitpython.md)
