Using the High Power Infrared LED Emitter with Arduino involves wiring up the infrared LED emitter to your Arduino-compatible microcontroller, installing the IRremote library and running the provided example code.

Other Arduino Code Options

There are many libraries available for sending and decoding infrared signals with Arduino. The Using an Infrared Library on Arduino Learn Guide by Chris Young that goes into more detail on other libraries available and their usage. You can also send IR signals without a library, as shown in the original IR Sensor Learn Guide.

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 infrared LED emitter V+.

Here is an Adafruit Metro wired up to the infrared LED emitter using the STEMMA JST PH cable:

  • Board 5V to LED emitter V+ (red wire)
  • Board GND to LED emitter GND (black wire)
  • Board pin 3 to LED emitter In (white wire)

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

  • Board 5V to LED emitter V+ (red wire)
  • Board GND to LED emitter GND (black wire)
  • Board pin 3 to LED emitter In (white wire)

Library Installation

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

Click the Manage Libraries ... menu item, search for IRremote, and select the IRremote library:

Example Code

To launch the example code in the Arduino IDE, click on File - Examples - IRremote and select SimpleSender. The example code can also be found on GitHub in the library repository.

Upload the sketch to your board and open up the Serial Monitor (Tools -> Serial Monitor) at 115200 baud. You should see your library version and the pin number that will be sending the IR pulses print to the Serial Monitor. Then, the address, command and repeats are printed, followed by the message Send NEC with 16 bit address. The address and command will incrementally increase as the code runs.

This guide was first published on Nov 16, 2022. It was last updated on Apr 13, 2024.

This page (Arduino) was last updated on Mar 08, 2024.

Text editor powered by tinymce.