IR Decode and Send for Arduino Remote to Control Lights

Hi,

I have an IR remote that I've decoded using the example sketch in the IR library, but when I try to send the signals to send the IR code, nothing happens. I have tried to send different bit lengths through the for loop, and tried different protocols because I don't know which one works for my remote.

Hardware - Arduino mega 2560 R3, IR 950 nm LED with positive connecting to 100 ohm resistor and then pin 5 of PWM. Short lead to ground. Here is my code and a picture of the remote I have:

#include <IRremote.h>

// Define the IR LED pin
#define IR_LED_PIN 5

// Create an IRremote object
IRsend irSender;

void setup() {
  // Initialize the IR LED pin as an output
  pinMode(IR_LED_PIN, OUTPUT);

  // Serial communication for debugging
  Serial.begin(9600);
}

void loop() {
  // Define the IR code to be emitted
  unsigned long irCode = 0xE51AFF00;


  for (int i = 1; i <= 256; i++) {
irSender.sendNEC(irCode, i);
delay(100);
irSender.sendSony(irCode, i);
delay(100);
irSender.sendRC5(irCode, i);
delay(100);
irSender.sendRC6(irCode, i);
delay(100);
irSender.sendFAST(irCode, i);
delay(100);
irSender.sendSharp(irCode, i);
delay(100);
  }


}

Picture of remote

When I decoded the IR signals this is what the decoded signal output was:

F906FF00
F20DFF00
E619FF00
E41BFF00
EE11FF00
E51AFF00
E01FFF00
F609FF00
E21DFF00
FA05FF00

You can check if the emitting LED works with your phone's camera - as long as it doesn't have a built-in IR filter. Even working with a 100 ohm resistor seems very large in value to me. Usually IR LEDs have quite a high operating current and you will need to drive it with a transistor because the Arduino pin cannot provide enough current.

https://www.mouser.com/datasheet/2/143/EAILP05RDDB1-708504.pdf

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.