Hello,
New hobbyist here, just getting started. I'm hoping I can get some advice for the annoying problem I'm facing.
Has anyone here managed to get an Arduino nano to work with an IR receiver? Please share how you went about it.
Objective: To verify that I can get an IR receiver (TSOP1738) connected to the Nano to decode signals from an IR remote.
Problem: The serial monitor on the Arduino IDE does not show any hex codes. I've been eliminating possibilities with different tests and am now almost at the end. Would appreciate help on potential fixes.
Possibility 1: Maybe the IR receiver is faulty
Test : tried changing the receiver. Tried 6 so far and none work. So I don't think it's the receiver.
Possibility 2: Maybe the IR remote is unique in its frequency output (either different from the usual 38khz or some outlier protocol that the receiver can't decode).
Test: tried several remotes, 5 of them. Ensured some of them were basic old ones just to be sure there wasn't some proprietary protocol in play. So that's not it either.
Possibility 3: Maybe the digital pin on the Arduino nano is faulty
Test: tried multiple digital PWM pins. No luck.
Possibility 4: Maybe the Arduino is faulty
Test: ran the blink led sample code and confirmed that the Arduino works.
Possibility 5: Maybe the circuit components or connections are faulty
Test: All connections seem to be wired fine. I'm using the Arduino 5v and Gnd pin to power the IR receiver. Multimeter shows receiver is getting 4.59v which I assume is sufficient. Using a 330 ohm resistor between Arduino digital pin and TSOP signal pin.
The library I'm using is the 'IRremote.h' . Sketch is the example one called 'IRRecvDemo', I've made a few minor modifications.
If anyone would like to examine my code, here it is:
#include <IRremote.h>
int RECV_PIN = 16;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600);
// In case the interrupt driver crashes on setup, give a clue
// to the user what's going on.
Serial.println("Enabling IRin");
irrecv.enableIRIn(); // Start the receiver
Serial.println("Enabled IRin");
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
irrecv.resume(); // Receive the next value
}
delay(500);
}