Close

no remote, no problem

A project log for RC5 Madness

Controlling an old Philips Amplifier with IR, RC5 and Home Assistant via esphome

schlionschlion 10/18/2023 at 15:530 Comments

First I wanted to find out, If the power socket on the back would turn off, if the device was in standby. Unfortunately, I do not have a remote and no way to reach standby without it, just proper off and on.

So I threw together a circuit and tried using the IRremote Arduino library. But I had no luck. I found out that my device would probably use RC5 IR encoding (possibly even extended RC5 (RC5x)). I did find https://github.com/probonopd/irdb which has many IR commands for loads of devices. Furthermore, I tried encoding some data I found it with IRSrutinizer and sending it via

IrSender.sendRaw(.....)

None of this worked. So I checked my setup: Was there even light coming out of the IR LED? Yes, using the old phone camera trick, I could see flashes from the LED. 

Does the LED have the right wavelength and is it bright enough? To test this, I needed a known good. So I got an IR Receiver Module and used the RecieveDump-example from the IRremote library to get the code for power toggle on my other stereo system.

Protocol=NEC Address=0x78 Command=0xF Raw-Data=0xF00F8778 32 bits LSB first

Send with: IrSender.sendNEC(0x78, 0xF, <numberOfRepeats>);

Raw result in internal ticks (50 us) - with leading gap
rawData[68]: 
 -65535
 +179,-88
 +12,-10 +12,-10 +12,-10 +13,-32
 +12,-32 +12,-32 +12,-33 +12,-10
 +12,-32 +12,-32 +13,-32 +12,-10
 +12,-10 +12,-11 +12,-10 +12,-32
 +12,-32 +13,-32 +12,-32 +12,-32
 +13,-10 +12,-10 +12,-10 +12,-10
 +12,-11 +12,-10 +12,-10 +12,-10
 +12,-33 +12,-32 +12,-32 +12,-32
 +13
 Sum: 1344
Raw result in microseconds - with leading gap
rawData[68]: 
 -3276750
 +8950,-4400
 + 600,- 500 + 600,- 500 + 600,- 500 + 650,-1600
 + 600,-1600 + 600,-1600 + 600,-1650 + 600,- 500
 + 600,-1600 + 600,-1600 + 650,-1600 + 600,- 500
 + 600,- 500 + 600,- 550 + 600,- 500 + 600,-1600
 + 600,-1600 + 650,-1600 + 600,-1600 + 600,-1600
 + 650,- 500 + 600,- 500 + 600,- 500 + 600,- 500
 + 600,- 550 + 600,- 500 + 600,- 500 + 600,- 500
 + 600,-1650 + 600,-1600 + 600,-1600 + 600,-1600
 + 650
Sum: 67200

Result as internal 8bit ticks (50 us) array - compensated with MARK_EXCESS_MICROS=20
uint8_t rawTicks[67] = {179,88, 12,10, 12,10, 12,10, 13,32, 12,32, 12,32, 12,33, 12,10, 12,32, 12,32, 13,32, 12,10, 12,10, 12,11, 12,10, 12,32, 12,32, 13,32, 12,32, 12,32, 13,10, 12,10, 12,10, 12,10, 12,11, 12,10, 12,10, 12,10, 12,33, 12,32, 12,32, 12,32, 13};  // Protocol=NEC Address=0x78 Command=0xF Raw-Data=0xF00F8778 32 bits LSB first

Result as microseconds array - compensated with MARK_EXCESS_MICROS=20
uint16_t rawData[67] = {8930,4420, 580,520, 580,520, 580,520, 630,1620, 580,1620, 580,1620, 580,1670, 580,520, 580,1620, 580,1620, 630,1620, 580,520, 580,520, 580,570, 580,520, 580,1620, 580,1620, 630,1620, 580,1620, 580,1620, 630,520, 580,520, 580,520, 580,520, 580,570, 580,520, 580,520, 580,520, 580,1670, 580,1620, 580,1620, 580,1620, 630};  // Protocol=NEC Address=0x78 Command=0xF Raw-Data=0xF00F8778 32 bits LSB first

uint16_t address = 0x78;
uint16_t command = 0xF;
uint32_t rawData = 0xF00F8778;

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

Which is extremely helpful, as it even gives the transmit-command

IrSender.sendNEC(0x78, 0xF, 0);

 So I got the simpleSender example, plugged the command and voilà: It worked!

We now know that the transmitterworks ✅

So I fiddled around with the IRremote library and found the command for sending RC5

IrSender.sendNEC(aAddress, aCommand, aNumberOfRepeats, aEnableAutomaticToggle)

 The biggest struggle for me, was to understand, that the device number listed in different manuals (Wikipedia, irdb) is the same as the address 🥴 After understanding that, I wrote a little script trying to send the volume up command (16 = 0x10) to different addresses starting at 0x00. And at 0x10 (16), I saw the volume change on the display. This lines up well with the codes on the internet identifying 16 as Preamp 1, although I would have called it "AV receiver".

We can now send commands to the amplifier and the amplifier does things ✅

Breadboard test setup, with IR demodulator, IR LED and Arduino Nano

Schematic:

Schematic for sending and receiving
Breadboard:
Breadboard (via Fritzing)

Discussions