KY-005 Infrared Transmitter Module

View on Amazon
Overview
About KY-005 Infrared Transmitter Module
The KY-005 is an infrared (IR) transmitter module designed to emit infrared light at 940 nm, making it ideal for remote control applications. It consists of a 5mm infrared LED and operates with a forward voltage of 1.1V and a current of 20mA.
⚡ Key Features
- 940 nm Infrared Emission – Suitable for IR remote control and data transmission.
- Adjustable Resistor Requirement –
- 3.3V input → Use a 120Ω resistor
- 5V input → Use a 220Ω resistor
- Simple Digital Control – Easily interfaces with ESP32, Arduino, and other microcontrollers.
- Pairs with KY-022 – Works alongside the KY-022 Infrared Receiver Module for IR communication systems.
With its compact design and reliable performance, the KY-005 is an excellent choice for wireless IR control applications. 🚀
Get Your KY-005
Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.
KY-005 Specifications
Complete technical specification details for KY-005 Infrared Transmitter Module
📊 Technical Parameters
KY-005 Pinout
The **KY-005** is a 3-pin infrared LED transmitter module (940 nm):
Visual Pinout Diagram

Pin Types
Quick Tips
**Interface**: Digital output for IR LED control,💡 **Wavelength**: 940 nm infrared emission
**Current**: 20mA forward current, 1.1V forward voltage,🔧 **Resistor**: 120Ω for 3.3V, 220Ω for 5V power
**Pairs With**: [KY-022 IR Receiver](/sensors/ky-022/) for complete IR communication,🎯 **Applications**: Remote controls, IR data transmission, wireless communication
Pin Descriptions
| Pin Name | Type | Description | Notes |
|---|---|---|---|
1 Pin (S) | Communication | Signal/control pin | Connects to GPIO for IR transmission |
2 Pin (middle) | Power | Optional ground | Use if external resistor is soldered on module |
3 Pin (-) | Power | Ground connection | Requires series resistor (120Ω@3.3V, 220Ω@5V) |
Wiring KY-005 to ESP32
To interface the **KY-005** with an **ESP32** for IR transmission:
Visual Wiring Diagram

Connection Status
Protocol
Pin Connections
| KY-005 Pin | Connection | ESP32 Pin | Description |
|---|---|---|---|
1 Pin (S) Required | GPIO17 | IR control signal (any GPIO) | |
2 Pin (-) Required | GND | Ground (via series resistor) | |
3 Pin (middle) Optional | GND | Optional ground connection |
**Series Resistor Required**: Add 120Ω resistor for 3.3V or 220Ω for 5V
**GPIO Selection**: Any GPIO pin works, GPIO17 is just an example
**Power**: Module typically powered from 3.3V via resistor to LED
**Middle Pin**: Only connect if external resistor is already on module
KY-005 Troubleshooting
Common issues and solutions to help you get your sensor working
Common Issues
Issue: The module does not emit an infrared signal.
Solutions:
- Verify that the correct series resistor is used based on the input voltage (e.g., 220Ω for 5V).
- Ensure all connections are secure and correctly placed.
- Confirm that the microcontroller's GPIO pin is configured correctly in the code.
- Test the infrared LED with a camera to see if it lights up when active (infrared light is visible to most digital cameras).
Issue: The module becomes hot or is damaged during operation.
Solutions:
- Check that the appropriate series resistor is in place to limit current through the LED.
- Ensure the input voltage does not exceed the module's specifications.
- Inspect for any short circuits or incorrect wiring that could cause excessive current draw.
Debugging Tips
Use the Serial Monitor to check for error messages and verify the sensor's output. Add debug prints in your code to track the sensor's state.
Use a multimeter to verify voltage levels and check for continuity in your connections. Ensure the power supply is stable and within the sensor's requirements.
Additional Resources
KY-005 Programming Examples
Ready-to-use code examples for different platforms and frameworks
#include <IRremote.h>
IRsend irsend;
void setup() {
Serial.begin(9600);
Serial.println("KY-005 Infrared Transmitter Test");
}
void loop() {
for (int i = 0; i < 3; i++) {
irsend.sendNEC(0xA90, 32); // Send NEC protocol with command 0xA90
delay(40);
}
delay(5000); // Wait 5 seconds before sending the signal again
}This Arduino code utilizes the IRremote library to send an NEC protocol infrared signal with the command 0xA90. The signal is sent three times with a 40ms delay between transmissions, followed by a 5-second pause before repeating. This setup is commonly used to control devices like TVs or other appliances that accept infrared commands.
This ESP-IDF code sets up the KY-005 Infrared Transmitter using the RMT (Remote Control) peripheral of the ESP32. It configures GPIO17 as the output pin and initializes the RMT driver to transmit an infrared signal. The IR protocol can be customized to match the target device's requirements.
remote_transmitter:
- platform: gpio
pin: GPIO17
carrier_duty_percent: 50%
button:
- platform: template
name: "KY-005 Send IR Signal"
on_press:
- remote_transmitter.transmit_nec:
address: 0x00FF
command: 0xA90This ESPHome configuration sets up the KY-005 Infrared Transmitter on GPIO17. It uses the NEC protocol to send an infrared command when a button is pressed, making it ideal for controlling TVs or other IR-enabled devices.
platformio.ini
[env:esp32]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps =
z3t0/IRremotemain.cpp
#include <Arduino.h>
#include <IRremote.h>
IRsend irsend;
void setup() {
Serial.begin(115200);
Serial.println("KY-005 Infrared Transmitter Test");
}
void loop() {
Serial.println("Sending IR signal");
irsend.sendNEC(0x00FF, 32);
delay(5000);
}This PlatformIO code initializes the KY-005 Infrared Transmitter using the IRremote library. It sends an NEC protocol signal every 5 seconds, making it suitable for testing IR communication.
import machine
import time
IR_TX_PIN = machine.Pin(17, machine.Pin.OUT)
def send_pulse():
for _ in range(32):
IR_TX_PIN.value(1)
time.sleep_us(562)
IR_TX_PIN.value(0)
time.sleep_us(562)
while True:
print("Sending IR signal")
send_pulse()
time.sleep(5)This MicroPython script configures the KY-005 Infrared Transmitter on GPIO17. It simulates an NEC-like IR signal by toggling the pin on and off rapidly, mimicking the transmission of an infrared command.
Wrapping Up KY-005
The ESP32 KY-005 Infrared Transmitter Module is a powerful KY-0xx module sensor that offers excellent performance and reliability. With support for multiple development platforms including Arduino, ESP-IDF, ESPHome, PlatformIO, and MicroPython, it's a versatile choice for your IoT projects.
Best Practices
For optimal performance, ensure proper wiring and follow the recommended configuration for your chosen development platform.
Safety First
Always verify power supply requirements and pin connections before powering up your project to avoid potential damage.
Ready to Start Building?
Now that you have all the information you need, it's time to integrate the KY-005 into your ESP32 project and bring your ideas to life!
Explore Alternative Sensors
Looking for alternatives to the KY-005? Check out these similar sensors that might fit your project needs.
The KY-033 is a line tracking sensor module that detects light-reflective and light-absorbing surfaces using infrared technology. It...
The KY-012 is an active piezoelectric buzzer module that emits a 2.5 kHz tone when powered. It operates within a voltage range of 3.3V to 5V...








