Go Down

Topic: Problem with IR receiver and Arduino Uno (Read 2027 times) previous topic - next topic

marcus barnet

I'm using IRemote library to try to receive IR signal from a generic TV remote controller: at the moment, i'm using the demo example available with the library and i'm able to detect the IR signals but, in the serial monitor, it always prints 0 and not the signal value.

I'm using the IR TSOP2438 receiver (i connected the OUT pin to Arduino UNO PIN 11), this is its datasheet: TSOP2438.

And this is the code:

Code: [Select]
* IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
* An IR detector/demodulator must be connected to the input RECV_PIN.
* Version 0.1 July, 2009
* Copyright 2009 Ken Shirriff
* http://arcfn.com

#include <IRremote.h>

int RECV_PIN = 11;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
  irrecv.enableIRIn(); // Start the receiver

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value

When i press a button from the IR remote controller, serial monitor always prints 0 value.

Can you help me to solve this problem, please? I'd like to print the correct received values.


   Its possible that you IR Receiver and IR Transmitter are in different ranges. The receiver I use is tuned to signals around 40Khz, but from what I have seen others may be above or below this range.

   A simple way to check whether you IR Receiver is working is to create a standalone circuit with the receiver connected to an LED.

There is an example circuit using a few AA Batteries an LED and a Resistor here, there is also lots of useful background information -


Duane B

Read this
then watch this


marcus barnet


In addition to the frequency your receiver is also designed for PCM encoding.

The IRremote library also has some debugging routines: adding "#define DEBUG" to IRremote.h appears to print a "MARK" or "SPACE" on the serial monitor when a high/low is seen by the receiver.

marcus barnet

Thanks a lot for your suggestion! ;)

It seems to work good, now.


      i also wanted to work with ir receiver, but my  IRremote lib demo program doesn,t work
     can  u tell me why
      have a great day 

marcus barnet

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131