Site icon Circuit Ideas for You

Arduino IR Remote Control RGB LED Circuit

This Arduino project changes RGB LED color with IR remote.

Press one button and LED changes fast.

No touch, no switch, only remote use.

IR sensor reads signal and Arduino drives LED.

It feels like small smart light.

This Arduino IR Remote Control RGB LED Circuit is easy to build.

Arduino Coding:

#include <IRremote.h>

int RECV_PIN = 2;
int redLED = 8;
int greenLED = 9;
int blueLED = 10;

IRrecv irrecv(RECV_PIN);
decode_results results;

void setup() {
Serial.begin(9600);
irrecv.enableIRIn();

pinMode(redLED, OUTPUT);
pinMode(greenLED, OUTPUT);
pinMode(blueLED, OUTPUT);
}

void loop() {
if (irrecv.decode(&results)) {

unsigned long code = results.value;
Serial.println(code);

if (code == 0xFF30CF) {
  digitalWrite(redLED, HIGH);
  digitalWrite(greenLED, LOW);
  digitalWrite(blueLED, LOW);
}

if (code == 0xFF18E7) {
  digitalWrite(redLED, LOW);
  digitalWrite(greenLED, HIGH);
  digitalWrite(blueLED, LOW);
}

if (code == 0xFF7A85) {
  digitalWrite(redLED, LOW);
  digitalWrite(greenLED, LOW);
  digitalWrite(blueLED, HIGH);
}

if (code == 0xFF10EF) {
  digitalWrite(redLED, LOW);
  digitalWrite(greenLED, LOW);
  digitalWrite(blueLED, LOW);
}

irrecv.resume();


}
}

Code Explanation:

Circuit Working:

Arduino IR Remote Control RGB LED Circuit Diagram

Parts List:

ComponentQuantity
Resistors 220Ω3
Arduino UNO1
IR Receiver Module TSOP17381
RGB LED (Red, Green and Blue)1

IR remote sends tiny light signals.

IR receiver catches these signals.

Receiver gives one digital output to Arduino pin 2.

Arduino reads this output and checks button code.

Arduino sees which color button we press.

Then Arduino turns ON or OFF red, green or blue LED pin.

LED changes to new color after each button press.

Whole system works fast and easy.

How to Build:

To build a Arduino IR Remote Control RGB LED Circuit following are the connection steps:

Conclusion:

This Arduino IR Remote RGB LED project is easy and fun.

We can use the same idea for motors, relays or home devices.

It is good project for beginners to learn Arduino basics.

References:

RGB LED controlled using IR Remote

Exit mobile version