Hx1838 IR receiver can only receive noise

so i am using an hx1838 ir receiver to controll my robot via infrared

this is the circut related to the infrared part

this is the simplified code part

#include <IRremote.hpp>
#define IR_USE_AVR_TIMER 2

const int recv_pin = 2;


void setup() {
   Serial.begin(9600);
   Serial.println("start");
   IrReceiver.begin(recv_pin);
}

void loop() {

  if(IrReceiver.decode()){ 
    Serial.println(IrReceiver.decodedIRData.decodedRawData , HEX);
     IrReceiver.resume();
  }
  
}

the receiver cannot pick up any remote code, just noise, which i later found out is represented as "0"

it also sometimes picks up random hex codes here and there, not related to my remote

Please start yout tests with the examples delivered with the library.

I tested your code with the simulator and it worked OK.
Check if there are errors in your connection or if your sensor or transmitter has problems.
To test the transmitter you can use the camera of any cell phone.
Point the emitter at your cell phone and see if any light appears on your cell phone's camera screen.
If it doesn't appear, your transmitter has a problem.

Simulated:

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