Project showcase
Remote Controlled Lights

Remote Controlled Lights © GPL3+

Lights that turn on when they receive an infrared signal from an old TV remote.

  • 1,519 views
  • 0 comments
  • 9 respects

Components and supplies

09264 1
RGB Diffused Common Cathode
×1
11026 02
Jumper wires (generic)
×1
Mfr 25fbf52 221r sml
Resistor 221 ohm
I used 220 Ohm
×1
IR receiver (generic)
I used 38 kHz TSOP4838
×1
A000066 iso both
Arduino UNO & Genuino UNO
×1
12002 04
Breadboard (generic)
Small ones work well
×1
Old TV Remote
Mine had specific IR codes, you may need to change the codes based on your TV remote. If the infrared signal from your remote is too lengthy, you may need to change the code a little.
×1

About this project

After seeing Google Home and Amazon Alexa work with Smart Lights, I decided to make some remote controlled stuff! I thought that the multicolored smart lightbulbs looked cool, so I decided to make my own small-scale version. Instead of using voice control, I used IR, and instead of lightbulbs, I used a single RGB LED.

Code

IR RGB LightsC/C++
Code that basically takes in infrared signals from an old TV remote and deciphers them. A certain infrared signal will change the color of the LED to a certain color. For example, '1' will make the LED red.
#include <IRremote.h>

int numberOfCycles = 10;
int cycleValue = 300;
int RECV_PIN = 2;
int brightness = 0;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver

  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value);

    switch (results.value) {
    
    case 2962 : //1
      analogWrite(9, 255);
      analogWrite(10, 0);
      analogWrite(11, 0);
      break;
    case 527250 : //2
      analogWrite(9, 0);
      analogWrite(10, 255);
      analogWrite(11, 0);
      break;
    case 265106 : //3
      analogWrite(9, 0);
      analogWrite(10, 0);
      analogWrite(11, 255);
      break;
    case 789394 : //4
      analogWrite(9, 190);
      analogWrite(10, 255);
      analogWrite(11, 0);
      break;
    case 134034 : //5
      analogWrite(9, 200);
      analogWrite(10, 0);
      analogWrite(11, 255);
      break;
    case 658322 : //6
      analogWrite(9, 0);
      analogWrite(10, 255);
      analogWrite(11, 255);
      break;
    case 21516 : //POWER
      analogWrite(9, 0);
      analogWrite(10, 0);
      analogWrite(11, 0);
      break;
    case 314258 : //PLAY
      for (int i=0 ; i<numberOfCycles ; i++) { 
        cycle();
      }
        
    }
    

    /*if (results.value == 551502015) { 
      brightness = brightness + 10;
    }
    if (results.value == 551534655) { 
      brightness = brightness - 10;
    }*/
    delay (100);
    irrecv.resume(); // Receive the next value
  }
}

void cycle() { 
      analogWrite(9, 255);
      analogWrite(10, 0);
      analogWrite(11, 0);
      delay (cycleValue);
      analogWrite(9, 0);
      analogWrite(10, 255);
      analogWrite(11, 0);
      delay (cycleValue);
      analogWrite(9, 0);
      analogWrite(10, 0);
      analogWrite(11, 255);
      delay (cycleValue);
      analogWrite(9, 190);
      analogWrite(10, 255);
      analogWrite(11, 0);
      delay (cycleValue);
      analogWrite(9, 200);
      analogWrite(10, 0);
      analogWrite(11, 255);
      delay (cycleValue);
      analogWrite(9, 0);
      analogWrite(10, 255);
      analogWrite(11, 255);
      delay (cycleValue);
}

Schematics

IR Light Circuit Diagram
This is a diagram showing how to wire both an RGB LED and a TSOP infrared sensor to an Arduino.
ir_lights_DgNtOBeYrl.fzz

Comments

Similar projects you might like

Remote Controlled Pet Feeder

Project tutorial by Amal Mathew

  • 2,814 views
  • 1 comment
  • 20 respects

Remote Controlled Bulb With Arduino

Project tutorial by muhammed shameel k.v

  • 2,405 views
  • 0 comments
  • 12 respects

TV remote controlled Light and Fan

Project tutorial by Rishabh

  • 18,329 views
  • 13 comments
  • 63 respects

Infrared Controlled Logic Puzzle -- Lights On!

Project tutorial by FIELDING

  • 1,404 views
  • 1 comment
  • 7 respects

IR Remote Controlled Power Switch for Rapsberry Pi 3

Project tutorial by Vilém Kužel

  • 1,463 views
  • 1 comment
  • 7 respects

Remote Controlled Jack-o-Lantern

Project tutorial by Josh From BreakoutBros.com

  • 1,648 views
  • 0 comments
  • 1 respect
Add projectSign up / Login