Controller not decoding IR signals?

Hey everyone, I recently got an ESP32 nano board for a little project. I do not want to go into too many details, but I have an IR receiver on my breadboard receiving 5V. It's connected to my GPIO5 pin (D2), and whenever I use any remote with IR, my IR receiver flashes red.

The Problem:
For some reason, under the scope of loop(), my if statement for "if (receiver.decode(&results))" isn't being invoked. I have Serial.print in my code to debug the signal command, but the serial monitor is not showing anything. If I put Serial.print outside of the if scope, then it will show in the serial monitor. Another thing to note is that if I include a print statement in the setup, it also doesn't appear in the serial monitor. I'm not sure why. I will include the code and pictures of my setup below in the Imgur link.

Setup & Code:
https://imgur.com/a/jNlmvzI

Sorry Myself and many others will not follow links. Best to post it using code tags.

1 Like

That is okay, I am new here so I am sorry about that. I will provide pictures of my setup and the code in text then.

Setup:

Output:

Code:

#include <IRremote.h>

// Define the GPIO pin connected to the IR receiver
int IR_RECEIVER_PIN = 5; // D2 pin on ESP32 nano

IRrecv receiver(IR_RECEIVER_PIN);
decode_results results;

void setup() {
  Serial.begin(9600); // Initialize serial communication
  receiver.enableIRIn(); // start up receiver
}

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

    receiver.resume(); // receive next value
  }

  Serial.println("Testing123");
}

The first picture and second picture are a little different, but the same problem occurs.
(I connected the GPIO5 pin directly to the bottom half of the breadboard where the IR Receiver sits).

I am not able to see the signal command in hexadecimal. The if statement doesn't even get invoked.

maybe worth looking at the ESP32 Remote Control Transceiver (RMT)

First of all, connect the IR-receiver to 3.3V, NOT 5V. Esp32 is not 5V MCU.
Second, use the latest IRremote library (4.x) and example code.

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