Słomkowski's technical musings

Playing with software, hardware and touching the sky with a paraglider.

Microlab speaker IR remote hijack - autostart and input select

I use Digispark module to inject NEC protocol commands to start Microlab 6C speakers and select sound source automatically at startup.

I use Microlab 6C as my PC speakers. Despite low price, they look and sound nice. However, they draw a lot of power on standby (over 8 watts) so I prefer to disconnect them physically from mains when I turn the PC off.

After I turn them back up, they stay on standby (-- on the display). Each time I have to manually press buttons on the remote to turn them up and select appropriate input. This is quite irritating. I want them to be ready to play sound from PC input from the start.

The idea is to connect a microcontroller to the IR receiver inside the case and simulate signal from it. All integrated IR receivers (like TSOP1838 etc) have open-drain output, so there’s no problem with connecting additional MCU - all devices drive the bus down.

IR protocol

I opened the speaker and looked for the IR receiver connection. Fortunately, the receiver has separate three-wire cable. Using an oscilloscope, I identified the lines in the cable. Each line is marked by distinctively:

I pressed some buttons on the remote and recorded the signal with the scope. An example is shown in the screenshot:

Oscilloscope capture of the signal from IR receiver. 9 ms pulse followed by 4.5 ms gap indicates NEC protocol.

When carrier is present, signal goes from +5 V to 0 V. Notice 9 ms carrier, then 4.5 ms silence - this indicates NEC IR protocol.

Having recorded the signal on the scope, it is possible to decode it by hand. However, I own a nifty Chinese element tester, which is able to decode NEC protocol and spare me the time:

As you can see, it displays decoded message, which consists of two 16-bit words: address and command. For some reason however, the tester switches the byte order of the words. The real code for Power Up command is:

Digispark module

I used Digispark module with ATtiny85 microcontroller. Output is connected to PB0. The program is extremely simple, since the device has only one job, I didn’t use timers at all, _delay_ms function was enough. The code is on GitHub.

Digispark bootloader waits 5 seconds before starting the main program. It is more than enough to initialize internals of the speaker, so the firmware basically:

The module was put inside the speaker box and secured by cable tie.