IRremote IR Sender confusion

Hi everyone,

I hope I’m posting in the right place. If not, please let me know where I should put this.

I’m using IRremote version 4.1.1 with my Arduino Nano boards. I know it’s an older version, but I’d like to stick with it for now. I’ve got 19 Nano boards working perfectly for sending IR codes, but I’m having trouble with one additional board.

Here’s the issue: when I upload the code below to any of my remaining Nano boards, there is no output on Pin 2. This code is identical to what I’ve used for the other 19 boards, except for the command.

I’ve tried a few troubleshooting steps:

  • I used an NPN transistor to amplify the signal but still saw no output. (2 boards got this and all the following methods)
  • I connected the LED directly to Pin 2 and ground, but it didn’t light up. (1 board got this and the following method)
  • I measured the voltage at Pin 2 with a multimeter (2 boards got this exclusively)

The only sign of activity is that the built-in LED on the Nano blinks briefly when I first upload the code, but then it turns off. Re-uploading the code, powering off the board, or pressing the reset button hasn’t fixed the issue.

Has anyone encountered a similar problem or have any ideas on what might be going wrong? Any suggestions would be greatly appreciated.

Here’s the code I’m using:

#include <Arduino.h>
#include <IRremote.h>
#include <TinyIRSender.hpp>

IRsend irsend;

const uint8_t Tran_Pin = 2;
const uint16_t Address = 123456;
const uint16_t Cmd = 0x38;

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  sendNEC(Tran_Pin, Address, Cmd);
  delay(100);
}

Lookup the maximum size of a uint16_t.

This is the same value i used in all of my other boards so it cant be the issue

1 Like

tenor-670866649

This is an easy test.

Serial.println(Address);

Which will reveal your overflowing the variable....

uint16_t x = 123456;

void setup() {
  Serial.begin(300);
  Serial.println(x);
}

void loop() {
}

You really belive, that you can write code, which behaves differently on identical boards???

  • if you are using an ir led try exchanging with a red led for example, does it flashes?
  • are you using a resistor to limit the current in the led at a safe level ( as you say 'I connected the LED directly to Pin 2 and ground')?
  • is the polarity of the led ok ( try exchanging the pins )?
  • is the ir led ok ( power it with 5v with a resitor in series that limits the current at a safe level and check with the phone camera, or another that is ir sensitive )