IRsender not working

Hello guys,
I bought an IR emitter module with the intention of powering on/off my Samsung TV. The problem is that my TV does not respond. I wrote this code for testing:

#include <IRremote.hpp>
void setup() {
  Serial.begin(9600);
  IrSender.begin(3, ENABLE_LED_FEEDBACK, USE_DEFAULT_FEEDBACK_LED_PIN);
}
void loop() {
  IrSender.sendSamsung(0x707, 0x2, 3);
  delay(5000);
}

First thing I did was dumping the power button code from my remote using the ReceiveDump example in the IRremote library. I obtained the following output:

Protocol=Samsung Address=0x707 Command=0x2 Raw-Data=0xFD020707 32 bits LSB first

Send with: IrSender.sendSamsung(0x707, 0x2, <numberOfRepeats>);

Raw result in internal ticks (50 us) - with leading gap
rawData[68]: 
 -65535
 +90,-90
 +11,-34 +11,-33 +11,-34 +11,-11
 +11,-12 +10,-12 +11,-11 +12,-11
 +11,-33 +12,-33 +12,-33 +11,-11
 +12,-10 +12,-11 +11,-11 +11,-11
 +12,-11 +11,-33 +12,-11 +11,-11
 +11,-12 +11,-11 +11,-11 +11,-12
 +11,-34 +10,-12 +11,-34 +10,-34
 +11,-34 +11,-34 +10,-34 +11,-35
 +10
Sum: 1219
Raw result in microseconds - with leading gap
rawData[68]: 
 -3276750
 +4500,-4500
 + 550,-1700 + 550,-1650 + 550,-1700 + 550,- 550
 + 550,- 600 + 500,- 600 + 550,- 550 + 600,- 550
 + 550,-1650 + 600,-1650 + 600,-1650 + 550,- 550
 + 600,- 500 + 600,- 550 + 550,- 550 + 550,- 550
 + 600,- 550 + 550,-1650 + 600,- 550 + 550,- 550
 + 550,- 600 + 550,- 550 + 550,- 550 + 550,- 600
 + 550,-1700 + 500,- 600 + 550,-1700 + 500,-1700	
 + 550,-1700 + 550,-1700 + 500,-1700 + 550,-1750
 + 500
Sum: 60950

Result as internal 8bit ticks (50 us) array - compensated with MARK_EXCESS_MICROS=20
uint8_t rawTicks[67] = {90,90, 11,34, 11,33, 11,34, 11,11, 11,12, 10,12, 11,11, 12,11, 11,33, 12,33, 12,33, 11,11, 12,10, 12,11, 11,11, 11,11, 12,11, 11,33, 12,11, 11,11, 11,12, 11,11, 11,11, 11,12, 11,34, 10,12, 11,34, 10,34, 11,34, 11,34, 10,34, 11,35, 10};  // Protocol=Samsung Address=0x707 Command=0x2 Raw-Data=0xFD020707 32 bits LSB first

Result as microseconds array - compensated with MARK_EXCESS_MICROS=20
uint16_t rawData[67] = {4480,4520, 530,1720, 530,1670, 530,1720, 530,570, 530,620, 480,620, 530,570, 580,570, 530,1670, 580,1670, 580,1670, 530,570, 580,520, 580,570, 530,570, 530,570, 580,570, 530,1670, 580,570, 530,570, 530,620, 530,570, 530,570, 530,620, 530,1720, 480,620, 530,1720, 480,1720, 530,1720, 530,1720, 480,1720, 530,1770, 480};  // Protocol=Samsung Address=0x707 Command=0x2 Raw-Data=0xFD020707 32 bits LSB first

uint16_t address = 0x707;
uint16_t command = 0x2;
uint32_t rawData = 0xFD020707;


Send with: IrSender.sendSamsung(0x707, 0x2, <numberOfRepeats>);

Pronto Hex as string
char prontoData[] = "0000 006D 0022 0000 00AE 00AC 0016 0041 0016 003F 0016 0041 0016 0014 0016 0016 0014 0016 0016 0014 0018 0014 0016 003F 0018 003F 0018 003F 0016 0014 0018 0012 0018 0014 0016 0014 0016 0014 0018 0014 0016 003F 0018 0014 0016 0014 0016 0016 0016 0014 0016 0014 0016 0016 0016 0041 0014 0016 0016 0041 0014 0041 0016 0041 0016 0041 0014 0041 0016 0043 0014 06C3 ";

Since the code I wrote did not power on my TV I was suspicious that I wasn't sending the signal in the right way. So i took my secondary board and I tried dumping what I was sending with my module. This is the output:

Protocol=Samsung Address=0x707 Command=0x2 Raw-Data=0xFD020707 32 bits LSB first

Send with: IrSender.sendSamsung(0x707, 0x2, <numberOfRepeats>);

Raw result in internal ticks (50 us) - with leading gap
rawData[68]: 
 -7353
 +90,-87
 +13,-32 +13,-32 +12,-33 +12,-11
 +12,-10 +12,-11 +12,-11 +12,-10
 +12,-33 +12,-33 +12,-33 +12,-11
 +11,-11 +13,-10 +12,-11 +11,-11
 +12,-11 +12,-33 +12,-11 +11,-11
 +12,-11 +12,-11 +11,-11 +12,-11
 +12,-33 +12,-11 +11,-33 +12,-33
 +13,-32 +12,-33 +12,-33 +11,-34
 +12
Sum: 1226
Raw result in microseconds - with leading gap
rawData[68]: 
 -367650
 +4500,-4350
 + 650,-1600 + 650,-1600 + 600,-1650 + 600,- 550
 + 600,- 500 + 600,- 550 + 600,- 550 + 600,- 500
 + 600,-1650 + 600,-1650 + 600,-1650 + 600,- 550
 + 550,- 550 + 650,- 500 + 600,- 550 + 550,- 550
 + 600,- 550 + 600,-1650 + 600,- 550 + 550,- 550
 + 600,- 550 + 600,- 550 + 550,- 550 + 600,- 550
 + 600,-1650 + 600,- 550 + 550,-1650 + 600,-1650
 + 650,-1600 + 600,-1650 + 600,-1650 + 550,-1700
 + 600
Sum: 61300

Result as internal 8bit ticks (50 us) array - compensated with MARK_EXCESS_MICROS=20
uint8_t rawTicks[67] = {90,87, 13,32, 13,32, 12,33, 12,11, 12,10, 12,11, 12,11, 12,10, 12,33, 12,33, 12,33, 12,11, 11,11, 13,10, 12,11, 11,11, 12,11, 12,33, 12,11, 11,11, 12,11, 12,11, 11,11, 12,11, 12,33, 12,11, 11,33, 12,33, 13,32, 12,33, 12,33, 11,34, 12};  // Protocol=Samsung Address=0x707 Command=0x2 Raw-Data=0xFD020707 32 bits LSB first

Result as microseconds array - compensated with MARK_EXCESS_MICROS=20
uint16_t rawData[67] = {4480,4370, 630,1620, 630,1620, 580,1670, 580,570, 580,520, 580,570, 580,570, 580,520, 580,1670, 580,1670, 580,1670, 580,570, 530,570, 630,520, 580,570, 530,570, 580,570, 580,1670, 580,570, 530,570, 580,570, 580,570, 530,570, 580,570, 580,1670, 580,570, 530,1670, 580,1670, 630,1620, 580,1670, 580,1670, 530,1720, 580};  // Protocol=Samsung Address=0x707 Command=0x2 Raw-Data=0xFD020707 32 bits LSB first

uint16_t address = 0x707;
uint16_t command = 0x2;
uint32_t rawData = 0xFD020707;


Send with: IrSender.sendSamsung(0x707, 0x2, <numberOfRepeats>);

Pronto Hex as string
char prontoData[] = "0000 006D 0022 0000 00AE 00A7 001A 003D 001A 003D 0018 003F 0018 0014 0018 0012 0018 0014 0018 0014 0018 0012 0018 003F 0018 003F 0018 003F 0018 0014 0016 0014 001A 0012 0018 0014 0016 0014 0018 0014 0018 003F 0018 0014 0016 0014 0018 0014 0018 0014 0016 0014 0018 0014 0018 003F 0018 0014 0016 003F 0018 003F 001A 003D 0018 003F 0018 003F 0016 0041 0018 06C3 ";

The output seems to be the same, but my TV does not power on. Please somebody help me. Thanks in advance

Are you assuming every Samsung TV is the same?

My Samsung TV uses Bluetooth, not IR.
Leo..

Capture the original value.

I believe that signal needs to be modulated at about 38Khz. Does the library support that.

Thanks for answering.
Obviusly I'm not assuming that, but I showed that the signal I was sending is the same as the one I dumped from the original TV remote.

Thanks for answering.
What do you mean? I'm a noob in the sector... I sent the dump of the original remote and the one I sent with my emitter

Thanks for answering.
I updated my code:

#include <IRremote.hpp>

void setup() {
  Serial.begin(9600);
  IrSender.begin(3, ENABLE_LED_FEEDBACK, USE_DEFAULT_FEEDBACK_LED_PIN);
  IrSender.enableIROut(38); //I added this line
}

void loop() {

  IrSender.sendSamsung(0x707, 0x2, 3);
  delay(5000);
}

Now it seems that the signal is modulated at 38KHz, but it still doesn't work.

Try to reduce the distance to your TV, increase IR Power, use 5 repeats.

Thanks for answering!
I tried with 5 repeats. My module is powered with 5V, and I don't think I can give it more power.
Regarding the distance to my TV I tried literally putting the emitter module next to the TV but it still doesn't work.

DroneBotWorkShop shows you how to capture IR remote signals to build a universal IR remote:

I tried with 5 repeats. My module is powered with 5V, and I don't think I can give it more power.
Regarding the distance to my TV I tried literally putting the emitter module next to the TV but it still doesn't work.

Then you have done everything right!
Last chance is to try ReceiveDemo, to check the repeats and maybe repeat distances.
Good Luck

I read the article, and he dumps the signal using the same sketch. The point is that I can transmit the same signal I send with my remote, but my TV does not respond.

Hello, I tried using ReceiveDemo. This is the output captured from my remote:

Protocol=Samsung Address=0x707 Command=0x2 Raw-Data=0xFD020707 32 bits LSB first
Send with: IrSender.sendSamsung(0x707, 0x2, <numberOfRepeats>);

Protocol=Samsung Address=0x707 Command=0x2 Repeat gap=48100us Raw-Data=0xFD020707 32 bits LSB first

Protocol=Samsung Address=0x707 Command=0x2 Repeat gap=47050us Raw-Data=0xFD020707 32 bits LSB first

And this is the output captured from my IR emitter:

Protocol=Samsung Address=0x707 Command=0x2 Raw-Data=0xFD020707 32 bits LSB first
Send with: IrSender.sendSamsung(0x707, 0x2, <numberOfRepeats>);

Protocol=SamsungLG Address=0x707 Command=0x2 Repeat gap=48650us

Protocol=SamsungLG Address=0x707 Command=0x2 Repeat gap=98450us

Protocol=SamsungLG Address=0x707 Command=0x2 Repeat gap=98500us

Protocol=SamsungLG Address=0x707 Command=0x2 Repeat gap=98500us

Maybe should I buy a diode emitter instead of a module? What do you suggest to me?

I am assuming you were starting with your TV in the OFF mode ("my tv does not respond... power button code")

  • Turn your TV on (the normal way)
  • Try turning the TV off with your IR project.

Thanks for reporting :+1:
This was a bug in the sendSamsung() function.
Please get the latest version from GitHub - Arduino-IRremote/Arduino-IRremote: Infrared remote library for Arduino: send and receive infrared signals with multiple protocols and compile and check again.

Hello,
I apologize for the absence. I updated the library. The output is different, but my TV still does not respond. Here the output.
From the emitter:

Protocol=Samsung Address=0x7 Command=0x2 Raw-Data=0xFD020707 32 bits LSB first
Send with: IrSender.sendSamsung(0x7, 0x2, <numberOfRepeats>);

Protocol=Samsung Address=0x7 Command=0x2 Repeat gap=48400us Raw-Data=0xFD020707 32 bits LSB first

Protocol=Samsung Address=0x7 Command=0x2 Repeat gap=47400us Raw-Data=0xFD020707 32 bits LSB first

Protocol=Samsung Address=0x7 Command=0x2 Repeat gap=46450us Raw-Data=0xFD020707 32 bits LSB first

Protocol=Samsung Address=0x7 Command=0x2 Repeat gap=48450us Raw-Data=0xFD020707 32 bits LSB first

Protocol=Samsung Address=0x7 Command=0x2 Repeat gap=46500us Raw-Data=0xFD020707 32 bits LSB first

From the remote:


Protocol=Samsung Address=0x7 Command=0x2 Raw-Data=0xFD020707 32 bits LSB first
Send with: IrSender.sendSamsung(0x7, 0x2, <numberOfRepeats>);

Protocol=Samsung Address=0x7 Command=0x2 Repeat gap=46500us Raw-Data=0xFD020707 32 bits LSB first

Protocol=Samsung Address=0x7 Command=0x2 Repeat gap=46500us Raw-Data=0xFD020707 32 bits LSB first

Protocol=Samsung Address=0x7 Command=0x2 Repeat gap=46600us Raw-Data=0xFD020707 32 bits LSB first

I don't know what to say. Maybe I should by another emitter.

I tried, but it still doesn't work :pensive:

Before you give up, check the exact number of repeats.
Or your remote uses a different modulation frequency, which can only be determined by an oszilloscope (or a logic analyzer, depending on the logic levels) connected to the remote.

I agree with this.

@antonio05200 - Your "remote" sketch output looks like it understands the "emitter" sketch, so the emitter "works" (but may not be the correct frequency for your TV). Try the original tv remote device with your "remote" sketch. No result means "not the same emitter led." Same result means your issue might be signal strength, or power.

Hello,
since I can't measure the modulation frequency, I tried 36kHz frequency but it still doesn't work.
I tried even with the sendRaw function. This is the sketch:

#include <IRremote.hpp>


uint16_t rawData[67] = {4480,4520, 530,1720, 530,1670, 530,1720, 530,570, 530,620, 480,620, 530,570, 580,570, 530,1670, 580,1670, 580,1670, 530,570, 580,520, 580,570, 530,570, 530,570, 580,570, 530,1670, 580,570, 530,570, 530,620, 530,570, 530,570, 530,620, 530,1720, 480,620, 530,1720, 480,1720, 530,1720, 530,1720, 480,1720, 530,1770, 480};

uint16_t rawDataApp[67] = {4500, 4550, 550, 1700, 550, 1650, 550, 1700, 550, 550, 550, 600, 500, 600, 550, 550, 600, 550, 550, 1650, 600, 1650, 600, 1650, 550, 550, 600, 500, 600, 550, 550, 550, 550, 600, 550, 550, 1650, 600, 550, 550, 550, 550, 600, 550, 550, 550, 600, 550, 600, 550, 1700, 500, 600, 550, 1700, 500, 1700, 550, 1700, 550, 1700, 500, 1700, 550, 1750, 500};

void setup() {
  IrSender.begin(3, ENABLE_LED_FEEDBACK, USE_DEFAULT_FEEDBACK_LED_PIN);
}

void loop() {
  for(int i=0; i<3; i++)
    IrSender.sendRaw(rawDataApp, sizeof(rawDataApp)/sizeof(int), 38);
  delay(5000);
}

I approximated the values to be multiple of 50 as I saw in another topic. But still no luck at all...