IrRemote readout. Which protocol is this?

Hi,

My apologies if I did not find the correct category for this post. Please feel free to move it to another category.

I have read out a push on the Channel 9 button on my TCL TV remote controller.

IrRemote unfortunately doesn't know this protocol (see below). And I can't figure out what to do next with this readout nor do I know what the readout actually is.

My goal is to have my arduino simulate a channel 9 command. Can anyone point me to a direction of how to understand the readout and which command in IrRemote I can use to send this readout as a command?


Received noise or an unknown (or not yet enabled) protocol
rawData[208]:
-3276750
+3950,-3900

  • 500,-1950 + 550,-1950 + 500,-1950 + 500,-1950
  • 500,- 950 + 550,- 950 + 500,-1950 + 500,-1950
  • 500,-2000 + 500,- 950 + 500,- 950 + 550,-1950
  • 500,- 950 + 500,-1000 + 500,- 950 + 500,-1000
  • 500,-1950 + 500,-1950 + 500,-1000 + 500,- 950
  • 550,- 950 + 500,-1950 + 500,-1950 + 500,- 950
  • 500,-8100 +3900,-3950 + 500,-1950 + 500,-1950
  • 550,-1900 + 500,-2000 + 500,- 950 + 550,- 950
  • 500,-1950 + 500,-1950 + 500,-1950 + 500,-1000
  • 500,- 950 + 500,-1950 + 500,-1000 + 500,- 950
  • 550,- 950 + 500,- 950 + 550,-1950 + 450,-2000
  • 500,- 950 + 550,- 950 + 500,- 950 + 500,-1950
  • 500,-2000 + 500,- 950 + 500,-7950 +3950,-3900
  • 500,-1950 + 500,-2000 + 500,-1950 + 500,-1950
  • 500,- 950 + 550,- 950 + 500,-1950 + 500,-1950
  • 500,-1950 + 500,-1000 + 500,- 950 + 550,-1950
  • 500,- 950 + 550,- 950 + 500,- 950 + 550,- 950
  • 500,-1950 + 500,-1950 + 500,- 950 + 550,- 950
  • 500,- 950 + 500,-2000 + 500,-1950 + 500,- 950
  • 550,-7900 +3950,-3950 + 500,-1950 + 500,-1950
  • 500,-1950 + 550,-1900 + 500,-1000 + 500,- 950
  • 550,-1900 + 500,-2000 + 500,-1950 + 500,- 950
  • 550,- 950 + 500,-1950 + 500,- 950 + 550,- 950
  • 500,- 950 + 550,- 950 + 500,-1950 + 500,-1950
  • 550,- 950 + 500,- 950 + 550,- 950 + 500,-1950
  • 500,-1950 + 500,-1000 + 500
    Duration=246250us

Raw data received are 0x2849082119

Use IrReceiver.printIRSendUsage(&Serial) on your receiver code and IRRemote prints on serial monitor the correct syntax to send the code.

I believe the example ReceiveDump from the IrRemote library uses that function.

It comes with different readouts wether I active RECORD_GAP_MICROS or not.

Without RECORD_GAP_MICROS:

Protocol=PulseDistance Raw-Data=0x6309CF 24 bits LSB first Gap=3276750us Duration=55600us


Raw result in internal ticks (50 us) - with leading gap
rawData[52]: 
 -65535
 +79,-79
 +10,-39 +10,-39 +10,-39 +10,-40
 +10,-19 +10,-20 +10,-39 +10,-39
 +10,-39 +10,-19 +10,-20 +10,-39
 +10,-20 +10,-19 +10,-20 +10,-19
 +10,-39 +10,-39 +11,-19 +10,-19
 +11,-19 +10,-39 +10,-39 +10,-20
 +10
Duration=1112 ticks

Raw result in microseconds - with leading gap
rawData[52]: 
 -3276750
 +3950,-3950
 + 500,-1950 + 500,-1950 + 500,-1950 + 500,-2000
 + 500,- 950 + 500,-1000 + 500,-1950 + 500,-1950
 + 500,-1950 + 500,- 950 + 500,-1000 + 500,-1950
 + 500,-1000 + 500,- 950 + 500,-1000 + 500,- 950
 + 500,-1950 + 500,-1950 + 550,- 950 + 500,- 950
 + 550,- 950 + 500,-1950 + 500,-1950 + 500,-1000
 + 500
Duration=55600us


Result as internal 8bit ticks (50 us) array - compensated with MARK_EXCESS_MICROS=20
uint8_t rawTicks[51] = {79,79, 10,39, 10,39, 10,39, 10,40, 10,19, 10,20, 10,39, 10,39, 10,39, 10,19, 10,20, 10,39, 10,20, 10,19, 10,20, 10,19, 10,39, 10,39, 11,19, 10,19, 11,19, 10,39, 10,39, 10,20, 10};  // Protocol=PulseDistance Raw-Data=0x6309CF 24 bits LSB first Gap=3276750us Duration=55600us

Result as microseconds array - compensated with MARK_EXCESS_MICROS=20
uint16_t rawData[51] = {3930,3970, 480,1970, 480,1970, 480,1970, 480,2020, 480,970, 480,1020, 480,1970, 480,1970, 480,1970, 480,970, 480,1020, 480,1970, 480,1020, 480,970, 480,1020, 480,970, 480,1970, 480,1970, 530,970, 480,970, 530,970, 480,1970, 480,1970, 480,1020, 480};  // Protocol=PulseDistance Raw-Data=0x6309CF 24 bits LSB first Gap=3276750us Duration=55600us

uint16_t address = 0x0;
uint16_t command = 0x0;
uint32_t rawData = 0x6309CF;


Pronto Hex as string without repeat sequence
char prontoData[] = "0000 006D 001A 0000 0099 0097 0014 004A 0014 004A 0014 004A 0014 004C 0014 0024 0014 0026 0014 004A 0014 004A 0014 004A 0014 0024 0014 0026 0014 004A 0014 0026 0014 0024 0014 0026 0014 0024 0014 004A 0014 004A 0016 0024 0014 0024 0016 0024 0014 004A 0014 004A 0014 0026 0014 06C3 ";

With RECORD_GAP_MICROS

Protocol=UNKNOWN Hash=0xB6B8ED7 78 bits (incl. gap and start) received
Received noise or an unknown (or not yet enabled) protocol


Raw result in internal ticks (50 us) - with leading gap
rawData[156]: 
 -33792
 +79,-79
 +10,-39 +10,-39 +10,-39 +10,-40
 +10,-19 +11,-19 +10,-39 +10,-39
 +10,-39 +10,-19 +11,-19 +10,-39
 +10,-20 +10,-19 +10,-20 +10,-19
 +10,-39 +10,-39 +10,-20 +10,-19
 +11,-19 +10,-39 +10,-39 +10,-20
 +10,-161 +79,-78 +10,-39 +10,-39
 +10,-40 +10,-39 +10,-19 +10,-20
 +10,-39 +10,-39 +10,-39 +10,-20
 +10,-19 +10,-39 +10,-20 +10,-19
 +10,-20 +10,-19 +11,-39 +10,-39
 +10,-19 +10,-20 +10,-19 +10,-39
 +10,-39 +10,-20 +10,-159 +79,-78
 +10,-39 +10,-39 +10,-40 +10,-39
 +10,-19 +10,-20 +10,-39 +10,-39
 +10,-39 +10,-20 +10,-19 +10,-39
 +10,-20 +10,-19 +10,-20 +10,-19
 +11,-38 +10,-40 +10,-19 +10,-20
 +10,-19 +11,-38 +10,-39 +10,-20
 +10
Duration=3654 ticks

Raw result in microseconds - with leading gap
rawData[156]: 
 -1689600
 +3950,-3950
 + 500,-1950 + 500,-1950 + 500,-1950 + 500,-2000
 + 500,- 950 + 550,- 950 + 500,-1950 + 500,-1950
 + 500,-1950 + 500,- 950 + 550,- 950 + 500,-1950
 + 500,-1000 + 500,- 950 + 500,-1000 + 500,- 950
 + 500,-1950 + 500,-1950 + 500,-1000 + 500,- 950
 + 550,- 950 + 500,-1950 + 500,-1950 + 500,-1000
 + 500,-8050 +3950,-3900 + 500,-1950 + 500,-1950
 + 500,-2000 + 500,-1950 + 500,- 950 + 500,-1000
 + 500,-1950 + 500,-1950 + 500,-1950 + 500,-1000
 + 500,- 950 + 500,-1950 + 500,-1000 + 500,- 950
 + 500,-1000 + 500,- 950 + 550,-1950 + 500,-1950
 + 500,- 950 + 500,-1000 + 500,- 950 + 500,-1950
 + 500,-1950 + 500,-1000 + 500,-7950 +3950,-3900
 + 500,-1950 + 500,-1950 + 500,-2000 + 500,-1950
 + 500,- 950 + 500,-1000 + 500,-1950 + 500,-1950
 + 500,-1950 + 500,-1000 + 500,- 950 + 500,-1950
 + 500,-1000 + 500,- 950 + 500,-1000 + 500,- 950
 + 550,-1900 + 500,-2000 + 500,- 950 + 500,-1000
 + 500,- 950 + 550,-1900 + 500,-1950 + 500,-1000
 + 500
Duration=182700us

Result as internal 8bit ticks (50 us) array - compensated with MARK_EXCESS_MICROS=20
uint8_t rawTicks[155] = {79,79, 10,39, 10,39, 10,39, 10,40, 10,19, 11,19, 10,39, 10,39, 10,39, 10,19, 11,19, 10,39, 10,20, 10,19, 10,20, 10,19, 10,39, 10,39, 10,20, 10,19, 11,19, 10,39, 10,39, 10,20, 10,161, 79,78, 10,39, 10,39, 10,40, 10,39, 10,19, 10,20, 10,39, 10,39, 10,39, 10,20, 10,19, 10,39, 10,20, 10,19, 10,20, 10,19, 11,39, 10,39, 10,19, 10,20, 10,19, 10,39, 10,39, 10,20, 10,159, 79,78, 10,39, 10,39, 10,40, 10,39, 10,19, 10,20, 10,39, 10,39, 10,39, 10,20, 10,19, 10,39, 10,20, 10,19, 10,20, 10,19, 11,38, 10,40, 10,19, 10,20, 10,19, 11,38, 10,39, 10,20, 10};  // Protocol=UNKNOWN Hash=0xB6B8ED7 78 bits (incl. gap and start) received

Result as microseconds array - compensated with MARK_EXCESS_MICROS=20
uint16_t rawData[155] = {3930,3970, 480,1970, 480,1970, 480,1970, 480,2020, 480,970, 530,970, 480,1970, 480,1970, 480,1970, 480,970, 530,970, 480,1970, 480,1020, 480,970, 480,1020, 480,970, 480,1970, 480,1970, 480,1020, 480,970, 530,970, 480,1970, 480,1970, 480,1020, 480,8070, 3930,3920, 480,1970, 480,1970, 480,2020, 480,1970, 480,970, 480,1020, 480,1970, 480,1970, 480,1970, 480,1020, 480,970, 480,1970, 480,1020, 480,970, 480,1020, 480,970, 530,1970, 480,1970, 480,970, 480,1020, 480,970, 480,1970, 480,1970, 480,1020, 480,7970, 3930,3920, 480,1970, 480,1970, 480,2020, 480,1970, 480,970, 480,1020, 480,1970, 480,1970, 480,1970, 480,1020, 480,970, 480,1970, 480,1020, 480,970, 480,1020, 480,970, 530,1920, 480,2020, 480,970, 480,1020, 480,970, 530,1920, 480,1970, 480,1020, 480};  // Protocol=UNKNOWN Hash=0xB6B8ED7 78 bits (incl. gap and start) received


Pronto Hex as string without repeat sequence
char prontoData[] = "0000 006D 004E 0000 0099 0097 0014 004A 0014 004A 0014 004A 0014 004C 0014 0024 0016 0024 0014 004A 0014 004A 0014 004A 0014 0024 0016 0024 0014 004A 0014 0026 0014 0024 0014 0026 0014 0024 0014 004A 0014 004A 0014 0026 0014 0024 0016 0024 0014 004A 0014 004A 0014 0026 0014 0135 0099 0095 0014 004A 0014 004A 0014 004C 0014 004A 0014 0024 0014 0026 0014 004A 0014 004A 0014 004A 0014 0026 0014 0024 0014 004A 0014 0026 0014 0024 0014 0026 0014 0024 0016 004A 0014 004A 0014 0024 0014 0026 0014 0024 0014 004A 0014 004A 0014 0026 0014 0131 0099 0095 0014 004A 0014 004A 0014 004C 0014 004A 0014 0024 0014 0026 0014 004A 0014 004A 0014 004A 0014 0026 0014 0024 0014 004A 0014 0026 0014 0024 0014 0026 0014 0024 0016 0048 0014 004C 0014 0024 0014 0026 0014 0024 0016 0048 0014 004A 0014 0026 0014 06C3 ";

If I use another remote controller I have (LG TV) then this example ReceiveDump will state which function to use when to send. But it doesn't seem to do with the remote for my TCL TV.

I see there is repetition of the signal with 8ms pauses between.
Try with

uint16_t singleBlock[] = {
  3950, 3950,
  500,1950, 500,1950, 500,1950, 500,1950,
  500,950, 550,950, 500,1950, 500,1950,
  500,1950, 500,950, 550,950, 500,1950,
  500,1000, 500,950, 500,1000, 500,950,
  500,1950, 500,1950, 500,1000, 500,950,
  550,950, 500,1950, 500,1950, 500,1000,
  500
};

void setup() {
  IrSender.begin();
}

void loop() {
  for (int i = 0; i < 3; i++) {
    irsend.sendRaw(singleBlock, sizeof(singleBlock)/sizeof(singleBlock[0]), 38);
    delay(8); // 8 ms gap between repeats
  }
  delay(10000); // pause before sending sequence again
}

Might be repeats are not even needed though...

Thank you for helping I really appreciate it.
I have put in your code in what I have pieced together from examples. So now the code looks like this and unfortunately it does not turn on the TV.


#include <Arduino.h>
#include "PinDefinitionsAndMore.h"
#include <IRremote.hpp> // include the library

const int buttonPin = 10;  // the number of the pushbutton pin
const int ledPin = LED_BUILTIN;    // the number of the LED pin

// variables will change:
int buttonState = 0;  // variable for reading the pushbutton status

uint16_t singleBlock[] = {
  3950, 3950,
  500,1950, 500,1950, 500,1950, 500,1950,
  500,950, 550,950, 500,1950, 500,1950,
  500,1950, 500,950, 550,950, 500,1950,
  500,1000, 500,950, 500,1000, 500,950,
  500,1950, 500,1950, 500,1000, 500,950,
  550,950, 500,1950, 500,1950, 500,1000,
  500
};


void setup() {
    
    pinMode(LED_BUILTIN, OUTPUT);
    
    IrSender.begin(); 
    disableLEDFeedback(); 

    // initialize the LED pin as an output:
    pinMode(ledPin, OUTPUT);
    // initialize the pushbutton pin as an input:
    pinMode(buttonPin, INPUT);

}

void loop() {
  
 // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);

  // check if the pushbutton is pressed. If it is, the buttonState is HIGH:
  if (buttonState == HIGH) {
   
    // turn LED on:
    digitalWrite(ledPin, HIGH);
    
    for (int i = 0; i < 3; i++) {
      IrSender.sendRaw(singleBlock, sizeof(singleBlock)/sizeof(singleBlock[0]), 38);
      delay(8); // 8 ms gap between repeats
    }

    delay(10000); // pause before sending sequence again
     
  } else {
    // turn LED off:
    digitalWrite(ledPin, LOW);
  }

}

I have another arduino for reading the sender and it says:

Protocol=UNKNOWN Hash=0xB6B8ED7 78 bits (incl. gap and start) received
Received noise or an unknown (or not yet enabled) protocol


Raw result in internal ticks (50 us) - with leading gap
rawData[156]: 
 -65535
+77,-79
 +10,-39 +10,-39 +10,-38 +10,-39
 +10,-19 +11,-19 +10,-38 +10,-39
 + 9,-39 +10,-19 +11,-19 +10,-39
 +10,-20 +10,-18 +10,-20 +10,-19
 +10,-39 +10,-38 +10,-20 +10,-19
 +11,-19 +10,-39 +10,-38 +10,-20
 +10,-158 +79,-78 + 9,-40 + 9,-39
 +10,-39 + 9,-39 +10,-19 +11,-19
 +10,-39 +10,-38 +10,-39 +10,-19
 +10,-20 +10,-38 +10,-20 +10,-19
 +10,-20 + 9,-20 + 9,-39 +10,-39
 +10,-20 + 9,-19 +11,-19 +10,-39
 +10,-39 + 9,-20 +10,-159 +78,-78
 +10,-39 +10,-39 + 9,-39 +10,-39
 +10,-19 +11,-19 +10,-38 +10,-39
 +10,-39 +10,-19 +11,-18 +10,-39
 +10,-20 +10,-19 +10,-20 +10,-18
 +10,-39 +10,-39 +10,-19 +10,-19
 +11,-19 +10,-39 + 9,-39 +11,-19
 +10
Duration=3626 ticks

Raw result in microseconds - with leading gap
rawData[156]: 
 -3276750
 +3850,-3950
 + 500,-1950 + 500,-1950 + 500,-1900 + 500,-1950
 + 500,- 950 + 550,- 950 + 500,-1900 + 500,-1950
 + 450,-1950 + 500,- 950 + 550,- 950 + 500,-1950
 + 500,-1000 + 500,- 900 + 500,-1000 + 500,- 950
 + 500,-1950 + 500,-1900 + 500,-1000 + 500,- 950
 + 550,- 950 + 500,-1950 + 500,-1900 + 500,-1000
 + 500,-7900 +3950,-3900 + 450,-2000 + 450,-1950
 + 500,-1950 + 450,-1950 + 500,- 950 + 550,- 950
 + 500,-1950 + 500,-1900 + 500,-1950 + 500,- 950
 + 500,-1000 + 500,-1900 + 500,-1000 + 500,- 950
 + 500,-1000 + 450,-1000 + 450,-1950 + 500,-1950
 + 500,-1000 + 450,- 950 + 550,- 950 + 500,-1950
 + 500,-1950 + 450,-1000 + 500,-7950 +3900,-3900
 + 500,-1950 + 500,-1950 + 450,-1950 + 500,-1950
 + 500,- 950 + 550,- 950 + 500,-1900 + 500,-1950
 + 500,-1950 + 500,- 950 + 550,- 900 + 500,-1950
 + 500,-1000 + 500,- 950 + 500,-1000 + 500,- 900
 + 500,-1950 + 500,-1950 + 500,- 950 + 500,- 950
 + 550,- 950 + 500,-1950 + 450,-1950 + 550,- 950
 + 500
Duration=181300us

Result as internal 8bit ticks (50 us) array - compensated with MARK_EXCESS_MICROS=20
uint8_t rawTicks[155] = {77,79, 10,39, 10,39, 10,38, 10,39, 10,19, 11,19, 10,38, 10,39, 9,39, 10,19, 11,19, 10,39, 10,20, 10,18, 10,20, 10,19, 10,39, 10,38, 10,20, 10,19, 11,19, 10,39, 10,38, 10,20, 10,158, 79,78, 9,40, 9,39, 10,39, 9,39, 10,19, 11,19, 10,39, 10,38, 10,39, 10,19, 10,20, 10,38, 10,20, 10,19, 10,20, 9,20, 9,39, 10,39, 10,20, 9,19, 11,19, 10,39, 10,39, 9,20, 10,159, 78,78, 10,39, 10,39, 9,39, 10,39, 10,19, 11,19, 10,38, 10,39, 10,39, 10,19, 11,18, 10,39, 10,20, 10,19, 10,20, 10,18, 10,39, 10,39, 10,19, 10,19, 11,19, 10,39, 9,39, 11,19, 10};  // Protocol=UNKNOWN Hash=0xB6B8ED7 78 bits (incl. gap and start) received

Result as microseconds array - compensated with MARK_EXCESS_MICROS=20
uint16_t rawData[155] = {3830,3970, 480,1970, 480,1970, 480,1920, 480,1970, 480,970, 530,970, 480,1920, 480,1970, 430,1970, 480,970, 530,970, 480,1970, 480,1020, 480,920, 480,1020, 480,970, 480,1970, 480,1920, 480,1020, 480,970, 530,970, 480,1970, 480,1920, 480,1020, 480,7920, 3930,3920, 430,2020, 430,1970, 480,1970, 430,1970, 480,970, 530,970, 480,1970, 480,1920, 480,1970, 480,970, 480,1020, 480,1920, 480,1020, 480,970, 480,1020, 430,1020, 430,1970, 480,1970, 480,1020, 430,970, 530,970, 480,1970, 480,1970, 430,1020, 480,7970, 3880,3920, 480,1970, 480,1970, 430,1970, 480,1970, 480,970, 530,970, 480,1920, 480,1970, 480,1970, 480,970, 530,920, 480,1970, 480,1020, 480,970, 480,1020, 480,920, 480,1970, 480,1970, 480,970, 480,970, 530,970, 480,1970, 430,1970, 530,970, 480};  // Protocol=UNKNOWN Hash=0xB6B8ED7 78 bits (incl. gap and start) received


Pronto Hex as string without repeat sequence
char prontoData[] = "0000 006D 004E 0000 0095 0097 0014 004A 0014 004A 0014 0048 0014 004A 0014 0024 0016 0024 0014 0048 0014 004A 0012 004A 0014 0024 0016 0024 0014 004A 0014 0026 0014 0022 0014 0026 0014 0024 0014 004A 0014 0048 0014 0026 0014 0024 0016 0024 0014 004A 0014 0048 0014 0026 0014 012F 0099 0095 0012 004C 0012 004A 0014 004A 0012 004A 0014 0024 0016 0024 0014 004A 0014 0048 0014 004A 0014 0024 0014 0026 0014 0048 0014 0026 0014 0024 0014 0026 0012 0026 0012 004A 0014 004A 0014 0026 0012 0024 0016 0024 0014 004A 0014 004A 0012 0026 0014 0131 0097 0095 0014 004A 0014 004A 0012 004A 0014 004A 0014 0024 0016 0024 0014 0048 0014 004A 0014 004A 0014 0024 0016 0022 0014 004A 0014 0026 0014 0024 0014 0026 0014 0022 0014 004A 0014 004A 0014 0024 0014 0024 0016 0024 0014 004A 0012 004A 0016 0024 0014 06C3 ";

The output is identic to the previous code (with some small difference in timings).
It should work. Maybe your transmitter is too weak, what kind of circuit you have? Did you test it at 30cm distance to TV receiver?

I tried again closeup and the TV switched on. Tried again from 1 meter as in first try and the tv switched on again.

When I use same sender in my living room the tv switches on 4 meters away without any inconcistency.

Okay so you helped me with the send code, I thank you very for your help.

Can I ask how did you split the raw code correct and point the specific code out for me to use?

It depends on interferences from lights, filtering on receiver side and many other factors.
If you post the transmitter circuit, I can give suggestion for improvement.

No magic here. If you look at the raw code, you can easily see the caps and you can easily see that it's repeating the same code.
~ 4000, -4000 is the header for the code
~ 500, -1000 means binary 0
~ 500, -2000 means binary 1

so the actual code is 1111 0011 1001 0000 1100 1100

+3950,-3950

  • 500,-1950 + 500,-1950 + 500,-1950 + 500,-2000
  • 500,- 950 + 550,- 950 + 500,-1950 + 500,-1950
  • 500,-1950 + 500,- 950 + 550,- 950 + 500,-1950
  • 500,-1000 + 500,- 950 + 500,-1000 + 500,- 950
  • 500,-1950 + 500,-1950 + 500,-1000 + 500,- 950
  • 550,- 950 + 500,-1950 + 500,-1950 + 500,-1000
  • 500,-8050 +3950,-3900 + 500,-1950 + 500,-1950
  • 500,-2000 + 500,-1950 + 500,- 950 + 500,-1000
  • 500,-1950 + 500,-1950 + 500,-1950 + 500,-1000
  • 500,- 950 + 500,-1950 + 500,-1000 + 500,- 950
  • 500,-1000 + 500,- 950 + 550,-1950 + 500,-1950
  • 500,- 950 + 500,-1000 + 500,- 950 + 500,-1950
  • 500,-1950 + 500,-1000 + 500,-7950 +3950,-3900
  • 500,-1950 + 500,-1950 + 500,-2000 + 500,-1950
  • 500,- 950 + 500,-1000 + 500,-1950 + 500,-1950
  • 500,-1950 + 500,-1000 + 500,- 950 + 500,-1950
  • 500,-1000 + 500,- 950 + 500,-1000 + 500,- 950
  • 550,-1900 + 500,-2000 + 500,- 950 + 500,-1000
  • 500,- 950 + 550,-1900 + 500,-1950 + 500,-1000
  • 500

Thank you I will look into splitting the code for further learning.

I attach the diagram for my sender.

I'm not sure how to read your circuit. LED has wrong polarity and I don't understand the pin 10 approach there.
Anyway basic IR LED circuit for decent range could be something like this:

Thank you. Ill try decreasing the resistance to gain range.

What is the source of the 5V supply powering the IR LED?

1 Like

Thank you for participation. The source is the arduino nano I use.

If you are powering the Nano from USB, and using the Nano's 5V pin as an output to power the LED, then there should be enough current. The 5V is coming from USB through a diode.

But when you switch over to battery power, as I assume you will at some point, then you will want to power the LED directly from the battery. You want to avoid running the LED power through the Nano's 5V regulator - it may not be able to provide enough current.

Thank you I will do that.

I was wondering since I actually dont have from the manufacturer which code/adress/command the tv remote uses, is there a way to get to know for sure or is there anyway to adjust/enhance the raw code to make the TV switch on more consistantly? does it make any sense...

Try the alternative IRMP library. It’s very similar to the latest version of IRremote but supports many more protocols.

It might be that measuring the raw transmission more accurately would help, or possibly sending one or two repeats.

Can you post how your LG TV is identified by the library? And can you get the library to do a raw capture of the LG? We could see how well it's measuring the times. The LG test should be done in a dimly lit room, with the remote several meters from the receiver.

Thank you for your advice. I just tried that and it immediately found out the TCL remote controller uses the protocol Matsushita. That was easy. So nice.

Then I wanted to send a command (power on) with IRMP->SimpleSender but it seems to me I can only choose between two protocols NEC or SAMSUNG. Although it says it supports MATSUSHITA.

So I tried figuring out how to enable the Matsushita but when I run the program the seriel monitor says:

START /private/var/folders/0x/yslh5wfx5zz5kks_6djf03cr0000gn/T/.arduinoIDE-unsaved2025613-79172-i579pz.31t7q/SimpleSender/SimpleSender.ino from Jul 13 2025
Using library version 3.6.4
Send IR signals at pin 3
Protocol not found
Protocol=  Address=0xAB0 Command=0x54F Repeats=2

The sketch code is:

/*
 *  SimpleSender.cpp
 *
 *  Sends NEC or Samsung protocol frames.
 *  Is able to send IR protocol data of 15 main protocols.
 *
 *      Sony SIRCS
 *      NEC + APPLE
 *      Samsung + Samsg32
 *      Kaseikyo
 *
 *      Plus 11 other main protocols
 *      JVC, NEC16, NEC42, Matsushita, DENON, Sharp, RC5, RC6 & RC6A, IR60 (SDA2008) Grundig, Siemens Gigaset, Nokia
 *
 *  To disable one of them or to enable other protocols, specify this before the "#include <irmp.hpp>" line.
 *  If you get warnings of redefining symbols, just ignore them or undefine them first (see Interrupt example).
 *  The exact names can be found in the library file irmpSelectAllProtocols.h (see Callback example).
 *
 *  Copyright (C) 2019-2020  Armin Joachimsmeyer
 *  armin.joachimsmeyer@gmail.com
 *
 *  This file is part of IRMP https://github.com/IRMP-org/IRMP.
 *
 *  IRMP is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *  See the GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
 *
 */

#include <Arduino.h>

//#define SEND_SAMSUNG // else send NEC

#define IRMP_SUPPORT_MATSUSHITA_PROTOCOL 1 
/*
 * Set library modifiers first to set output pin etc.
 */
#include "PinDefinitionsAndMore.h"
//#define IR_OUTPUT_IS_ACTIVE_LOW
#define IRSND_IR_FREQUENCY          38000

#define IRSND_PROTOCOL_NAMES        1 // Enable protocol number mapping to protocol strings - requires some FLASH.

//#include <irsndSelectMain15Protocols.h>
// or disable #include <irsndSelectMain15Protocols.h> and use only one protocol to save programming space
//#define IRSND_SUPPORT_NEC_PROTOCOL        1

/*
 * After setting the definitions we can include the code and compile it.
 */
#include <irsnd.hpp>

IRMP_DATA irsnd_data;

#if defined(SEND_SAMSUNG)
union WordUnion
{
    struct
    {
        uint8_t LowByte;
        uint8_t HighByte;
    } UByte;
    struct
    {
        int8_t LowByte;
        int8_t HighByte;
    } Byte;
    uint8_t UBytes[2];
    int8_t Bytes[2];
    uint16_t UWord;
    int16_t Word;
    uint8_t *BytePointer;
};
#endif

void setup() {
    Serial.begin(115200);
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/ \
    || defined(SERIALUSB_PID)  || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_attiny3217)
    delay(4000); // To be able to connect Serial monitor after reset or power up and before first print out. Do not wait for an attached Serial Monitor!
#endif

    // Just to know which program is running on my Arduino
    Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRMP));

    irsnd_init();
    irmp_irsnd_LEDFeedback(true); // Enable send signal feedback at LED_BUILTIN

    Serial.println(F("Send IR signals at pin " STR(IRSND_OUTPUT_PIN)));

#if defined(SEND_SAMSUNG)
    /*
     * Send Samsung32
     */
    irsnd_data.protocol = IRMP_SAMSUNG32_PROTOCOL;
    irsnd_data.address = 0x0707;
    irsnd_data.command = 0xFB04; // For my Samsung, the high byte is the inverse of the low byte
    irsnd_data.flags = 0; // repeat frame 0 time
#else
    /*
     * Send NEC
     */
    irsnd_data.protocol = IRMP_SUPPORT_MATSUSHITA_PROTOCOL;
    irsnd_data.address = 0xAB0;
    irsnd_data.command = 0x54F; // The required inverse of the 8 bit command is added by the send routine.
    irsnd_data.flags = 2; // repeat frame 2 times
#endif

    // true = wait for frame and trailing space/gap to end. This stores timer state and restores it after sending.
    if (!irsnd_send_data(&irsnd_data, true)) {
        Serial.println(F("Protocol not found")); // name of protocol is printed by irsnd_data_print()
    }
    irsnd_data_print(&Serial, &irsnd_data);

}

void loop() {
    delay(5000);
    irsnd_data.command++;
#if defined(SEND_SAMSUNG)
    // For my Samsung remote, the high byte is the inverse of the low byte
    WordUnion tNextCommand; // using WordUnion saves 14 bytes program memory for the next 3 lines
    tNextCommand.UWord = irsnd_data.command;
    tNextCommand.UByte.HighByte = ~tNextCommand.UByte.LowByte;
    irsnd_data.command = tNextCommand.UWord;
#endif
    irsnd_send_data(&irsnd_data, true);
    irsnd_data_print(&Serial, &irsnd_data);
}

I don't think it's Matsushita. Here's what the IRMP site says Matsushita is:

That's from this site:

https://www.mikrocontroller.net/articles/IRMP_-_english

Based on what you've posted earlier, I don't think that's what you have.