This project sends IR signals using Arduino and Arduino drives one IR LED; when we press button on serial monitor or code trigger, then IR LED sends coded light signal
Also, this Arduino IR LED Transmitter Circuit works like a small remote controller and circuit is easy and simple.
Arduino Code:
#include <IRremote.h>
int irPin = 3;
IRsend irsend;
int b1 = 6;
int b2 = 7;
int b3 = 8;
void setup() {
pinMode(b1, INPUT);
pinMode(b2, INPUT);
pinMode(b3, INPUT);
}
void loop() {
if (digitalRead(b1) == HIGH) {
irsend.sendNEC(0x00FF30CF, 32);
delay(400);
}
if (digitalRead(b2) == HIGH) {
irsend.sendNEC(0x00FF18E7, 32);
delay(400);
}
if (digitalRead(b3) == HIGH) {
irsend.sendNEC(0x00FF7A85, 32);
delay(400);
}
}Coding Explanation:
- Library IRremote needed for sending IR.
- It handle the IR LED.
- irPin is pin 3 for IR output.
- Buttons come on pin 6, pin 7 and pin 8.
- pinMode make them input pins.
- Loop keep checking button press.
- If button 1 is press, send code 00FF30CF.
- If button 2 is press, send code 00FF18E7.
- If button 3 is press, send code 00FF7A85.
- All codes are 32 bit.
- delay stop fast repeat.
- IR LED blink with coded light.
- Device receive it same like remote button.
Circuit Working:

Parts List:
| Components | Values | Quantity |
|---|---|---|
| Resistors | 220Ω 1/4 watt | 4 |
| Semiconductors | Arduino UNO board | 1 |
| Standard IR Transmitter LED | 1 | |
| Tactile push button switch | 3 |
Arduino pin gives digital signal and this signal goes through resistor and then resistor protects IR LED from high current.
Then IR LED flashes at fast speed and then this flash carries IR code, after that receiver device reads this code.
Here, the buttons act as simple input switches, then the Arduino reads the button presses and sends a different IR signal for each button.
Formulas with Calculation:
Below is the LED current formula:
I = V / R
If Arduino gives 5V then IR LED drop about 1.2V.
Voltage across resistor = 5 – 1.2 = 3.8V
Our circuit resistor is 220 ohm:
Current = 3.8 / 220 = 0.017A
Hence, current is about 17mA which is safe for IR LED.
How to Build:
To build a Arduino IR LED Transmitter Circuit follow the below steps for connection:
- First, take all the parts as shown in circuit diagram.
- Next, connect IR LED anode to R1 one resistor end and then connect R1 resistor other end to Arduino digital pin 3.
- Also, connect IR LED cathode to GND.
- Now each resistors R2 to R4 one end go to 5V and other end go to Arduino pins 6, 7 and 8.
- Finally, each switch S1 to S3 one end go to resistors R2 to R4 and other end go to GND.
Conclusion:
To conclude, this circuit sends IR signals like a simple remote and buttons choose which code to send and then Arduino drives IR LED safely using resistor
Therefore, this Arduino IR LED Transmitter Circuit is small, cheap and useful for learning IR communication.
Leave a Reply