KY-005 IR Transmitter with an Arduino Uno
The KY-005 is a 940 nm infrared LED on a 3-pin board for sending TV and air-conditioner remote codes from an Arduino.

On an Arduino Uno the KY-005's S pin goes to D3, the pin IRremote uses on the Uno to make its 38 kHz carrier from Timer2. With the Uno's 5 V and the 220 Ω resistor in the cathode lead, the LED runs just under the Uno's 20 mA per-pin rating.
Wiring the KY-005 IR Transmitter to the Arduino Uno
Pin by pin.
| KY-005 IR Transmitter | Arduino Uno | Note |
|---|---|---|
| S | D3 | |
| GND | GND | through a 220 Ω resistor |
What to know on the Arduino Uno
- With a 1.1 V LED and 220 Ω on 5 V, the LED current is (5 - 1.1) / 220, about 18 mA: at the KY-005's 20 mA rating and within the Uno pin's recommended 20 mA. A lower resistor for more range would push the pin past that rating; drive the LED through a transistor instead.Joy-IT KY-005 sensor kit page; Arduino UNO R3 tech specs
- D3 is Timer2's output on the Uno, which IRremote uses for a hardware-generated carrier. That timer is then busy: tone() cannot run in the same sketch, and D11's PWM is affected too.IRremote library README, Send pin and timer tables; Arduino language reference, tone()
- IRremote cannot receive while it sends on the same Uno, so test the transmitter with a receiver on a second board or a phone camera, which shows the 940 nm LED as a faint glow.IRremote library README
KY-005 IR Transmitter code for the Arduino Uno
Compiled for arduino:avr:uno on 2026-10-29.
// KY-005 IR Transmitter on Arduino Uno: wiring and a free simulation at https://www.tinkered.ai/components/ky-005-ir-transmitter/arduino-uno
#include <Arduino.h>
#include <IRremote.hpp>
const uint8_t SEND_PIN = 3; // D3 on an Uno or Nano (timer 2), D9 on a Mega
void setup() {
Serial.begin(115200);
IrSender.begin(SEND_PIN);
Serial.println("IR sender ready");
}
uint8_t command = 0x02;
void loop() {
IrSender.sendNEC(0x00, command, 0); // address 0x00, the command, no repeats
Serial.print("sent NEC 0x00 0x");
Serial.println(command, HEX);
command++;
delay(1000);
}
KY-005 IR Transmitter on the Arduino Uno: questions
Which Uno pin should the KY-005 use?
D3. IRremote generates the 38 kHz carrier on the Uno from Timer2, whose output is D3; on a Mega it is D9 (IRremote README).
What resistor does the KY-005 need on an Arduino Uno?
220 Ω in the cathode lead on 5 V (Joy-IT), which gives about 18 mA, inside the Uno's 20 mA per-pin rating.
Can the Uno send and receive IR codes at the same time?
Not with IRremote on one board: it cannot receive while it sends. Use a second board to check what the KY-005 transmits.
Keep going
This guide as plain Markdown. /components/ky-005-ir-transmitter/arduino-uno.md