Project tutorial

Remote Controlled Bulb With Arduino © GPL3+

In this project I am going guide you through how to make a bulb or any appliance controlled by a TV remote, and show how to get hex codes.

  • 821 views
  • 0 comments
  • 8 respects

Components and supplies

Apps and online services

About this project

Step 1: Gather:

  • Arduino
  • Breadboard
  • Jumpers
  • Relay
  • TSOP or IR receiver
  • Bi-colored LED (You can use 2 LEDs for this)

Step 2: Setting up the receiver

  • Arduino D2 => TSOP OUT
  • Arduino 5v => TSOP +
  • Arduino GND => TSOP GND

Now I will show you how to get hex codes from the TV remote:

Go to examples>IRremote>IRrecvdemo if the library not installed install from here (after you install the zip file go to sketch>include library>Add .ZIP library and show it where you put you zip file)

Upload the code and open the serial monitor make sure that you are selecting the correct COM port take your TV remote and press any button you will get a hex code. Write it down and add 0x to the code you got you will need it my code is 0x14EB18E7.

Step 3: Connect the Relay

Connect the relay:

  • relay vcc => Arduino 5v
  • relay GND => Arduino GND
  • relay IN => Arduino 8
  • relay COM => BULB
  • relay NO => AC +
  • BULB => AC -

Step 4: Connect the LEDs:

Connect 9 and 10 to 2 LED like shown. I have a bi-colored led so I will use that:

  • LED1 + => 9
  • LED2 + => 10
  • LED1 - => GND
  • LED2 - => GND

Step 5: Upload the code:

Don't forget to change the hex code. Type your hex code where I typed 0x14EB18E7 in the sketch on the code tab. See my other projects here:

Thank you

How to make a capacitance alarm with Arduino - check it out.

Support

Vote for me please!

https://www.instructables.com/id/How-to-Make-Remote-Controlled-Bulb-With-Arduino/

https://www.instructables.com/id/How-to-Make-a-Parabolic-Microphone-With-an-Old-TV-/

https://www.instructables.com/id/How-to-Make-Secret-Drawer-Alarm/

Schematics

schematics
schematics
myirproject_QKx19zmXkH.fzz

Code

upload this code to arduinoArduino
CODE
#include <boarddefs.h>
#include <IRremote.h>
#include <IRremoteInt.h>
#include <ir_Lego_PF_BitStreamEncoder.h>

int receiver = 2; // Signal Pin of IR receiver to Arduino Digital Pin 11
bool hit = false;

/*-----( Declare objects )-----*/
IRrecv irrecv(receiver);     // create instance of 'irrecv'
decode_results results;      // create instance of 'decode_results'

void setup()   /*----( SETUP: RUNS ONCE )----*/
{
  Serial.begin(9600);
  Serial.println("IR Receiver Button Decode"); 
  irrecv.enableIRIn(); // Start the receiver
  pinMode(8,OUTPUT);
  pinMode(10,OUTPUT);
  pinMode(9,OUTPUT);

}/*--(end setup )---*/


void loop()   /*----( LOOP: RUNS CONSTANTLY )----*/
{
  if (irrecv.decode(&results)) // have we received an IR signal?

  {
    translateIR(); 
    irrecv.resume(); // receive the next value
  }  
}/* --(end main loop )-- */

/*-----( Function )-----*/
void translateIR() // takes action based on IR code received

// describing Remote IR codes 

{

  if (results.value==0x14EB18E7){ // use the code you got in IRrecvdemo sketch here
     hit = !hit;
  }
  if (hit==true) {
    digitalWrite(10,LOW);
    digitalWrite(8,HIGH);
    digitalWrite(9,HIGH);
  }
  else {
    digitalWrite(9,LOW);
    digitalWrite(8,LOW);
    digitalWrite(10,HIGH);
  }

  delay(100); // Do not get immediate repeat


} 

Comments

Similar projects you might like

Arduino UNO High Precision Counting Scale

Project showcase by Fedeasche

  • 3,307 views
  • 5 comments
  • 19 respects

Arduino Controlled Piano Robot: PiBot

Project tutorial by Jeremy Yoo

  • 1,229 views
  • 0 comments
  • 6 respects

Automation of Railway Models Part 3 - Bidirectional Line

Project showcase by Steve_Massikker

  • 752 views
  • 2 comments
  • 10 respects

Arduino TV Volume Control

Project tutorial by Sam

  • 2,402 views
  • 0 comments
  • 11 respects

Arduino Strain Relief Enclosure

Project tutorial by Jeremy S. Cook

  • 981 views
  • 0 comments
  • 7 respects

Mini CNC a Hand-Made Masterpiece

Project showcase by Mr-M

  • 663 views
  • 0 comments
  • 3 respects
Add projectSign up / Login