Control a Pioneer AVR with Arduino IR

Hello everyone, since I've got too many remotes in my home tv setup and I only need one to control everything (the other ones are need only to turn on and off the devices) I wanted to create an arduino code to read the "main" remote on/off and then send the on/off signal to the other devices.
Using the IRremote library I was able to record and send the IR signal of the tv and smart boxes BUT I was not able to do it with my AVR (Pioneer VSX-321).
Using the example code "SimpleReader" I get this:

Protocol=NEC Address=0xA5 Command=0x1C Raw-Data=0xE31C5AA5 32 bits LSB first
Send with: IrSender.sendNEC(0xA5, 0x1C, <numberOfRepeats>);

Then using also the example code named "SimpleSender" I sent the signal and check with my phone camera if the led worked, and it did, but the avr did not turn on or off. I also tried to record and send raw data but that didn't work either. Have you got any suggestions?

Well remember all IR remote protocols are not created equal. There are hardware differences that can stop some hardware and not others.

You can have the carrier modulation frequency anywhere from 28 to 42 KHz (in 2 KHz steps). And there are two different frequencies of IR diode that can be used, both with a different wavelength of emission, so requiring a different sensor at the receive end.

So you see a universal remote is actually not a very easy thing to produce, without the endless variations in code they can produce.

1 Like

It's been my experience that IR sensors (photo-transistor, photo-diode, etc) are quite wide band (optically) and will work (perhaps with reduced sensitivity) with IR emitters designated for a different wavelength. For example, 1.3um IR detectors work quite well with 1.5um emitters and vice versa.

The point about modulation frequency is a different matter and needs attention.

The reduction normally makes the range less than 6 inches instead of the 12 feet you can normally get, in my experience.

Most of my experience is with telecom-grade optics where I'd expect a couple dB at most. I guess YMMV with consumer-grade stuff.

Yes, I used to design TV set top boxes, that we made by the million.

The decoupling on the voltage supply of the decoder chip (any Visahy Tsop chip) of a 100R and 4u7F is absoloutly vital, It is often missed out because amateurs think it is not necessary because "they work without it". In fact they do but not all of them and not for long.

What value have you taken for <numberOfRepeats>?

I randomly chose 3. I looked into the github page of the library but it didn't mention anything about this parameter. (3/4 worked fine on the tv box)

Please post the output of the received command and its repeats.
Maybe you can test NEC2 protocol with IrSender.sendNEC2(0xA5, 0x1C, 3);

ReceiveDemo:

Protocol=NEC Address=0xA5 Command=0x1C Raw-Data=0xE31C5AA5 32 bits LSB first
Send with: IrSender.sendNEC(0xA5, 0x1C, <numberOfRepeats>);

Protocol=NEC Address=0xA5 Command=0x1C Special repeat Repeat gap=25400us Raw-Data=0xE31C5AA5 32 bits LSB first

For more data:

ReceiveDump
Protocol=NEC Address=0xA5 Command=0x1C Raw-Data=0xE31C5AA5 32 bits LSB first

Send with: IrSender.sendNEC(0xA5, 0x1C, <numberOfRepeats>);

Raw result in internal ticks (50 us) - with leading gap
rawData[68]: 
 -65535
 +169,-84
 +11,-31 +11,-10 +11,-31 +11,-11
 +10,-11 +11,-31 +11,-10 +11,-31
 +11,-11 +10,-32 +10,-11 +11,-31
 +11,-31 +11,-11 +10,-32 +10,-11
 +10,-11 +11,-10 +11,-31 +11,-32
 +10,-32 +10,-11 +11,-10 +11,-10
 +11,-32 +10,-32 +10,-11 +10,-11
 +11,-10 +11,-32 +10,-32 +10,-32
 +10
Raw result in microseconds - with leading gap
rawData[68]: 
 -3276750
 +8450,-4200
 + 550,-1550 + 550,- 500 + 550,-1550 + 550,- 550
 + 500,- 550 + 550,-1550 + 550,- 500 + 550,-1550
 + 550,- 550 + 500,-1600 + 500,- 550 + 550,-1550
 + 550,-1550 + 550,- 550 + 500,-1600 + 500,- 550
 + 500,- 550 + 550,- 500 + 550,-1550 + 550,-1600
 + 500,-1600 + 500,- 550 + 550,- 500 + 550,- 500
 + 550,-1600 + 500,-1600 + 500,- 550 + 500,- 550
 + 550,- 500 + 550,-1600 + 500,-1600 + 500,-1600
 + 500

Result as internal ticks (50 us) array - compensated with MARK_EXCESS_MICROS=20
uint8_t rawTicks[67] = {169,84, 11,31, 11,10, 11,31, 11,11, 10,11, 11,31, 11,10, 11,31, 11,11, 10,32, 10,11, 11,31, 11,31, 11,11, 10,32, 10,11, 10,11, 11,10, 11,31, 11,32, 10,32, 10,11, 11,10, 11,10, 11,32, 10,32, 10,11, 10,11, 11,10, 11,32, 10,32, 10,32, 10};  // Protocol=NEC Address=0xA5 Command=0x1C Raw-Data=0xE31C5AA5 32 bits LSB first

Result as microseconds array - compensated with MARK_EXCESS_MICROS=20
uint16_t rawData[67] = {8430,4220, 530,1570, 530,520, 530,1570, 530,570, 480,570, 530,1570, 530,520, 530,1570, 530,570, 480,1620, 480,570, 530,1570, 530,1570, 530,570, 480,1620, 480,570, 480,570, 530,520, 530,1570, 530,1620, 480,1620, 480,570, 530,520, 530,520, 530,1620, 480,1620, 480,570, 480,570, 530,520, 530,1620, 480,1620, 480,1620, 480};  // Protocol=NEC Address=0xA5 Command=0x1C Raw-Data=0xE31C5AA5 32 bits LSB first

uint16_t address = 0xA5;
uint16_t command = 0x1C;
uint32_t data = 0xE31C5AA5;

Pronto Hex as string
char prontoData[] = "0000 006D 0022 0000 0146 00A1 0016 003B 0016 0012 0016 003B 0016 0014 0014 0014 0016 003B 0016 0012 0016 003B 0016 0014 0014 003D 0014 0014 0016 003B 0016 003B 0016 0014 0014 003D 0014 0014 0014 0014 0016 0012 0016 003B 0016 003D 0014 003D 0014 0014 0016 0012 0016 0012 0016 003D 0014 003D 0014 0014 0014 0014 0016 0012 0016 003D 0014 003D 0014 003D 0014 06C3 ";

Does not work either

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.