Things used in this project

Hardware components:
A000066 iso both
Arduino UNO & Genuino UNO
×1
IR receiver (generic)
×1
09590 01
LED (generic)
×2
12002 04
Breadboard (generic)
×1
11026 02
Jumper wires (generic)
×1
Relay (generic)
×1
Software apps and online services:
Ide web
Arduino IDE

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


} 

Credits

Profile ezerugfmpt
muhammed shameel k.v

I am a beginner in electronics. I have programming knowledge and some projects of my own

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Arduinomated Car Parking with Voice Assistance in Smartphone
Intermediate
  • 250
  • 9

Full instructions

Make an assistant which tells you about how much to drive backwards without any collision through your smartphone by Arduino and 1Sheeld.

Arduino Like Function on Kinetis K82 Freedom Stupid Board
Intermediate
  • 19
  • 2

Protip

1000 of K82 Freedom Boards are collecting dust because of the hobbyist unfriendly IDE, pump up the duds with easy Arduino-like functions.

Sigfox Forest Fire Detector
Intermediate
  • 2,590
  • 16

Full instructions

How to prevent forest from burning? A small Sigfox signal can prevent natural disasters. We will use an Arduino MKRFOX + a flame detector.

Analog-XY-Plotter-Output-to-HPGL-Translator
Intermediate
  • 369
  • 5

Translate analog X-Y plotter output to HPGL command stream.

Magic VR Hat
Intermediate
  • 667
  • 8

Wear the hat, get transported to different 360 VR experience.

Remote Lamp
Intermediate
  • 277
  • 4

Full instructions

How to make a lamp controlled by TV remote control.

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaFree StoreBlog