Surilli
Published © LGPL

Control LED Using IR Receiver, Remote Control & Surilli GSM

Control the blinking action of an LED using an IR receiver and a remote control.

BeginnerFull instructions provided45 minutes656
Control LED Using IR Receiver, Remote Control & Surilli GSM

Things used in this project

Hardware components

Surilli GSM
Surilli GSM
×1
LED (generic)
LED (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1
IR receiver (generic)
×1
Resistor 1k ohm
Resistor 1k ohm
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Control LED using IR Receiver, Remote Control and Surilli GSM

Code

LED_with_a_Remote_Control

C/C++
#include <boarddefs.h>
#include <IRremote.h>
#include <IRremoteInt.h>
#include <ir_Lego_PF_BitStreamEncoder.h>

int IR_Recv = 11;   // IR Receiver Pin 11.
int led = 13;       // LED Pin Connected to Pin 13 of Surilli GSM.
 
IRrecv irrecv(IR_Recv);
decode_results results;
 
void setup(){
  Serial.begin(9600);  //starts serial communication
  irrecv.enableIRIn(); // Starts the receiver
  pinMode(led, OUTPUT);      // sets the digital pin as output 
}
 
void loop(){
  //decodes the infrared input
  if (irrecv.decode(&results)){
    long int decCode = results.value;
    Serial.println(results.value,DEC);
    //switch case to use the selected remote control button
    switch (results.value){    
        case 3772784863: //when you press the 1 button
        digitalWrite(led, HIGH);
        break;           
        case 3772811383: //when you press the 0 button
        digitalWrite(led, LOW);
        break;       
    }
    irrecv.resume(); // Receives the next value from the button you press
  }
  delay(10);
}

Credits

Surilli

Surilli

196 projects • 47 followers
Surilli is a premiere Internet of Things centric Technology Company aimed at providing cutting edge innovative solutions.

Comments