IR reciever -arduino

i use below code to read IR signal from my tv remote control

but when i face "tv remote" directly to ir reciver i read just this code every time i press any button

FFFFFF

if i face the remote to the wall or different direction i get random codes

24AE7D4E
712A92AA
4CB0FADD
F60E8A74
722B04B7
BC4E3B6
D24C5DE9
C783CFC5
4EBF1D2B
C82C8099
26648207

#include <IRremote.h>

// Define the IR receiver pin
int receiverPin = 11;

// Create an instance of the IR receiver library
IRrecv irrecv(receiverPin);

// Create a variable to hold the received IR code
decode_results results;

void setup() {
  // Initialize the serial communication
  Serial.begin(9600);

  // Enable the IR receiver
  irrecv.enableIRIn();
}

void loop() {
  // Check if an IR signal has been received
  if (irrecv.decode(&results)) {
    // Print the received IR code
    Serial.println(results.value, HEX);

    // Reset the IR receiver to receive the next signal
    irrecv.resume();
  }
}

IR photo diode or what's this?

https://www.aliexpress.com/item/1005004410195896.html

This receiver is not usable with IR remote controls. Search for "IR remote receiver" module with built-in filter and decoder.

can u suggest me any model . or how can i search it aliexpress

Google like @DrDiettrich says:

IR remote receiver

See things like this

Ideally, you would look for one that matched the carrier frequency of you remote device, like 38 kHz or whatever.

a7

how can i find how much kHz i need. there are universal remote controlers how they know what frequency is the remote tv

this is 38khz but doesn not work
https://www.aliexpress.com/item/1005004410195896.html

That's totally misleading ad copy. That product is not an IR transmitter/receiver pair that uses a modulated carrier to transmit digital signals.

The ad copy only means it coukd be used in such a circuit.

You want a product like the one I linked.

I do not know how you could determine the carrier frequency of your remote.

38 kHz is common, and might work. If it was about that. Perhaps with reduced range. Perhaps not at all if you carrier frequently is very different.

a7

It is NOT 38 kHz remote receiver. You must use a TSOP with the proper carrier frequency filter. The most common remotes have 38 kHz carrier, like TSOP2238 (the last 2 digits represent the frequency), or TSOP34838 (on 5 digits models, the first one is a "3" meaning it's the 3.3V version), but you can find more HERE.

1 Like

Try the ReceiveDemo of the IRremote library and you will be wiser.

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