IR receiver - not relaying received signal / not working? [SOLVED]

I have an IR receiver (with a remote) that I have been able to use in the past, no issues. I thought about using it again for a project, but now it doesn’t seem to be working.

I am able to get the IR Receiver to receive the data. I know this because there’s a small light on the receiver that lights up when data is received. However, the signal doesn’t seem to be making it to my Serial monitor.

Here’s the code:

#include <IRremote.h>

int RECV_PIN = 7;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

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

Compiling and uploading produce no errors. When I upload and run the sketch, and press a button on my IR remote, the LED on the IR Reciever blinks, but nothing shows up in the Serial monitor…I am unsure why. I have double checked the connection and have the Ground and VCC going straight to the Arduino Uno’s pins, and the data connection part going straight to pin 7.

The serial monitor just stays blank - nothing shows up.

(I am using the Arduino 1.0.6 IDE.)

Thanks for any ideas or help. If there’s something important I forgot to mention, just ask!

EDIT: Solution - The IR’s data relay pin must have been broken. I purchased another IR sensor and it works with same code/setup.

When I used IRremote.h, the examples used input pin 11. It is possible this is fixed in the library.

Weedpharma

weedpharma:
When I used IRremote.h, the examples used input pin 11. It is possible this is fixed in the library.

Weedpharma

Hm, I tried using pin 11 (and changed the code to int RECV_PIN = 11; but still get no response from the receiver in the Serial monitor...

if (irrecv.decode(&results)) {

irrecv.resume(); // Receive the next value

Delay (200);

Serial.println(results.value, HEX);
}

This is the form I have used in my program. I found the delay was necessary.

Weedpharma

weedpharma:
When I used IRremote.h, the examples used input pin 11. It is possible this is fixed in the library.

Weedpharma

No it's not. I changed it to 4.
What is fixed is the sender IR that must be on 3.

Btw. Put in the setup

Serial.println("something to test");

Then at least you know if you get serial output at all

weedpharma:
if (irrecv.decode(&results)) {

irrecv.resume(); // Receive the next value

Delay (200);

Serial.println(results.value, HEX);
}

This is the form I have used in my program. I found the delay was necessary.

Weedpharma

Tried that, no luck :confused:

Also, I added a println to Setup and can see it - so Serial is working.

Hmm…

Are you sure:

The remote sender and receiver are compatible
The sensor is wired correctly.

Have you tried the example program directly from the library?

Weedpharma

weedpharma:
Are you sure:

The remote sender and receiver are compatible
The sensor is wired correctly.

Have you tried the example program directly from the library?

Weedpharma

I know for a fact the remote and receiver are compatible. I made a program a few months ago that used both - I could post here, but don't think it's necessary. For some reason when I run that code, it DOESN'T work anymore. But again, they're definitely, 100% compatible.

Also, I am 99.999% positive they're wired correctly. When I had my working sketch from months ago working, I took pictures of it all hooked up and have reconnected it in the same manner. I tried running the example from the library, to no avail.

Apparently, the new Arduino IDE may have something to do with it? I have looked to Github and installed the IR library, but still nothing works. I even installed the Arduino IDE 1.0 to see if that helps, but it didn't...

It's possible the receiver is broken, but I doubt it because it's been sitting safely in its drawer, and it does light up when I press a button on the remote.

Can someone link to a working IRreceiver library and I will totally remove the one in my current Arduino folder and try that one? I am thinking it's something in the .h or .cpp file but can't guess what it might be.

:-\

edit: Just to make sure it's actually the signal not being sent, instead of some weird Serial monitor issue - I added an LED to the breadboard and added to the code if I press the "1" button on the remote, turn LED on. That didn't work - so I'm pretty sure the issue is with the signal from IR receiver not being detected/used by Arduino...

....press a button on my IR remote, the LED on the IR Reciever blinks,

Can you explain what the above is from your first post? A LED on the receiver could impact the signal getting to the Arduino. (ie missing the logic HIGH/LOW levels)

Better still:

  • model # of IR Receiver being used
  • post the photo you have of your setup and/or a sketch (schematic) of your circuit.
  • Try using IRLib just in case something is messed up with your IRremote Library.

The IR receiver is the Keyes IR receiver. The LED I am referring to is the small LED labeled "L" in this image.

Today, I went to RadioShack and picked up two IR receiver modules and lo and behold, these work!

So, I think my other IR receiver must be on the fritz. However, I can't see how it doesn't work since I kept it safe, didn't step on it or anything, and the LED on the receiver does work (with the same code/wiring as the Keyes one)!

Hm, oh well?

I wish I could still use the keyes one still, but it looks like it's kaputt - unless someone has any ideas on how to know for sure?

It may well be the same as this one:

AnalysIR:
It may well be the same as this one:
http://www.analysir.com/blog/2014/12/08/infrared-receiver-showdown-tsop34438-vs-vs1838b-winner-revealed/

It is indeed! The one that's not working is the one that "lost" in their comparison - I just picked up two of the winners, nice to see I'm doing something right! Thanks for that, pretty interesting. :smiley:

In Afrikaans there's a saying "Goedkoop is duurkoop" which means good (ie cheap) buying is expensive buying.

JimboZA:
In Afrikaans there's a saying "Goedkoop is duurkoop" which means good (ie cheap) buying is expensive buying.

I'll have to keep that in mind. I did indeed buy the Keyes one because it was really cheap, but hey - I learned about IR from it, so it wasn't totally a bad idea!