Overview
This note presents a few different ways of building an microcontroller-based IR receiver. It is meant as a complement to the "PC media remote" note.
The idea is to somewhat parallel "Software design patterns" -- only for physical hardware builds. The note provides a variety of implementation examples for an IR receiver project. Juxtaposition is used to compare various different mechanical/mounting systems that provide structure, and also different practical connectivity solutions. Hopefully these options will make builds feel a bit more approachable, and possibly inspire new ideas.
Regarding the overall design philosophy: Attempts were made not to solder everything together in one monolithic block. Design often involves making mistakes, so having a way to easily re-configure your solution as it develops really helps. More specifically, I find that building "blocks" in a somewhat modular/generic fashion is preferable to building something that is completely "application-specific". As a bonus, if your blocks don't quite work out the way you want, they can more likely be re-purposed in later projects.
Before we begin
Many projects below make use of the STEMMA-QT port of as a means to connect the IR receiver. Note that the original intent (+typical usage) of this port is to provide I2C connectivity to multiple devices like sensors & actuators.
A good way to improve on the original "PC media remote" breadboard example is to use the IR receiver module (#5939). The build pictured above makes use of the STEMMA-QT port from a PiCowbell protoboard, and mounts all components to a 5x5 Adafruit swirly grid. Overall, this build should be a little more robust than what can be obtained with the breadboard solution, yet still be achievable without any soldering (if using Pico board with pre-soldered headers).
Some things to keep in mind:
- Need a custom 4-pin JST-SH to 3-pin JST-PH cable.
- Make sure the pin order is correct to avoid damaging the circuits (especially power/gnd).
Connecting the 2 boards in this fashion requires modifying a pre-built JST-SH cable (this one, for example). Crimping JST-SH connectors can be a bit difficult due to the small size, but removing the 4th (yellow) wire from a 4-pin connector is a bit more manageable. A hobby knife can be used to ⚠️carefully lift the plastic tab to release the pin/wire. Once that's done, JST-PH pins can be crimped to the other end of the cable, which in turn snap into the 3-pin JST-PH connector needed for the IR receiver terminal.
In theory, crimping your own JST-SH pins is also possible. In practice, however, you will likely find it difficult enough to crimp even the larger JST-PH pins.
Also note that the Adafruit swirly grids tend to slide & scratch the surfaces on which they sit. To avoid scratches and add a bit of grip, you can add bumper feet like the ones shown below:
Parts/links:
- RP2350 Pico 2 (alt: RP2040 Pico with headers!)
- IR receiver module (#5939)
- 5x5 Adafruit swirly grid
- Bumper feet (DK #36-720-ND)
- Custom 4-pin JST-SH to 3-pin JST-PH (a potential starting point here)
PicoTrinkey-5939
The Adafruit Trinkey RP2040 is a very interesting product. It is small/compact, and has mounting holes coinciding with many of Adafruit's smaller sensor devices (including the IR receiver module (#5939)).
Similar to the above Pico-Swirly example, this solution connects the IR receiver module (#5939) through the Trinkey's STEMMA-QT connector. Because of this, many of the same considerations apply:
- Need a custom 4-pin JST-SH to 3-pin JST-PH cable (see Pico-Swirly example above).
- Make sure the pin order is correct to avoid damaging the circuits (especially power/gnd).
Parts/links:
- Adafruit Trinkey RP2040
- IR receiver module (#5939)
- Custom 4-pin JST-SH to 3-pin JST-PH (a potential starting point here)
- M2.5 standoff kit - white (also available in black)
Bluefruit-Swirly-5939
If you don't have a device as fast as the RP2040, the Circuit Playground Bluefruit (#4333) might be a reasonable alternative. This exploration-focused board has sufficient space to upload the Media Remote project, and is fast enough to run.
⚠️ Known issues
- Circuit Playground Bluefruit is somewhat sluggish at running said project. You will likely notice times where the microcontroller is overloaded (some button presses will not be detected).
- Library code needs a bit more optimization.
Given these issues, it might be preferable to use a different library for builds using the Bluefruit (at least for now). Here are some options:
- adafruit_irremote library (CircuitPython): learn guide example here
- IRLib2 library (Arduino framework/C++): learn guide example here
- Arduino-IRremote library (Arduino framework/C++)
- ...
Parts/links:
- Circuit Playground Bluefruit (#4333)
- IR receiver module (#5939)
- JST-PH (3-pin) to alligator clips
- 90°/L-bracket (#3768): Designed for motors - but great at holding up a Circuit Playground boards perpendicularly atop Adafruit swirly grids.
- M2.5 standoff kit - white (also available in black)
Pico-Stacked-5939/dongle
By adding a connector to a PiCowbell protoboard (#5200), it is possible to position the receiver module within sight of the IR remote while keeping the microcontroller board & USB cable hidden away.
More variations
Use stacking headers (#5582) to place the protoboard on top of the RP2040 pico (#4864), or use one of the doubler/tripler/... boards to connect them side-by-side.
Pitfalls: IR receiver dongles
Note that different TRS-wired IR receiver dongles might use different pinout schemes. At the time of purchase, the ones linked above/here used:
- tip => SUPPLY / ring => signal / sleeve => GND.
- (You can leave the second "R" of the TRRS jack floating)
This is a good scheme because the supply only makes contact when the TRS connector is fully inserted. Note that, whenever possible, I would still avoid connecting/disconnecting the receiver connector while powered.
Comments: IR reciever modules & cables
When connecting IR receivers with long(-ish) cables, it is preferable to use PCB modules such as #5939 instead of connecting up bare devices (ex: TSOP38238 (#157)). The PCB's supporting circuitry (like local de-coupling) should make the overall behaviour more robust.
Parts/links:
- RP2350 Pico 2 (alt: RP2040 Pico with headers!)
- Female headers: (Easier if you have shorter ones - but these can be trimmed)
- Male pin headers: Easily trimmed.
- Version A: IR receiver module (#5939) / JST XH connectors (#4423)
- Version B: TRS-wired IR reciever dongle / TRRS jack
KeeBoar-Proto-TSOP38238
Adafruit's KeeBoar (#5302) makes for an even smaller RP2040 Pico-based build. Although you can definitely solder this board directly to a small PCB, consider that you might want to tweak your build in the future. Your need for this particular solution might also go away in a few months, but you will likely want to re-use the core KB2040 board with some other project. As a bonus, using headers means you don't have to worry as much when building the more error-prone PCB/protoboard connections. Your microcontroller will remain safe on your workbench.
In the build pictured above, Short female headers (#3008) were soldered directly to the bottom of the KB2040 instead of going for usual male header pins. Some advantages include:
- Short headers are a bit easier to remove from pins.
- Female headers are less prone to damage by accidental bending.
- Overall simpler to build:
- Trimming female headers is a bit more difficult than trimming male headers.
- Might as well do the tricky bit once per microcontroller board instead of once for each PCB/protoboard socket.
- Also, by experience: protoboard builds sometimes need more than one iteration to get a project working correctly.
The following picture shows how the protoboard looks with the microcontroller board removed. Note the small jumpers that supply V3P3 & GND to the IR receiver module.
Parts/links:
- Adafruit KeeBoar (#5302)
- TSOP38238 IR receiver module
- Adafruit small perma-proto board (#1214): 4 mounting holes. Great for adding feet.
- Short female headers (#3008)
- Plastic standoffs
- 12.7x1.5mm bumper feet: Really good grip on most surfaces.
This page (Build patterns: IR receiver variants) was last updated on January 05, 2025.
Text editor powered by tinymce.