muhammed shameel k.v
Published © GPL3+

Remote Controlled Bulb With Arduino

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.

IntermediateFull instructions provided36 minutes1,319
Remote Controlled Bulb With Arduino

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
IR receiver (generic)
×1
LED (generic)
LED (generic)
×2
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Relay (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

schematics

schematics

Code

upload this code to arduino

Arduino
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


} 

Credits

muhammed shameel k.v

muhammed shameel k.v

0 projects • 4 followers
I am a great at electronics. I have programming knowledge and some projects of my own
Contact

Comments