Ir remote controll using tsop 1838


MATERIALS REQUIRED
1.ARDUINO UNO
2.HALF BREADBOARD
3.MALE TO MALE JUMPER WIRE
4.ACTIVE BUZZER
5.TSOP 1838 IR RECIEVER

CIRCUIT














TSOP 1838 GND-ARDUINO  GND
TSOP1838 VCC-ARDUINO +5V
TSOP1838 DATA-ARDUINO PIN 11
BUZZER +-ARDUINO PIN 7
BUZZER - TO ARDUINO GND

CODE
IR LIBRARY  LINK-https://github.com/z3t0/Arduino-IRremote



#include <IRremote.h>

int RECV_PIN = 11;
int buzz = 7;

int buzzon = 33441975;
int buzzof =33446055;
IRrecv irrecv(RECV_PIN);

decode_results results;

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

}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, DEC);
    irrecv.resume(); // Receive the next value
  }
  delay(100);
  if(results.value==33441975){
    digitalWrite(buzz,HIGH);
   
    delay(2000);
    }
    if(results.value==33446055){
    digitalWrite(buzz,LOW);
    
    }
    

}

Comments