Getting an on/off indicator voltage out of a Squeezebox Receiver

Background

These notes discuss a technique for obtaining a trigger signal from a Logitech Squeezebox Duet Receiver while it is switched on. A typical use for this is to switch on ancilliary components (eg. an amplifier). In these notes, I will abbreviate Squeezebox Receiver to "SBR".

Felix Mueller's very useful PowerSwitchII plugin can be used to obtain a DC voltage of approximately 3.3V from the headphone socket (on a Squeezebox Classic or the previous model Squeezebox2) or the IR output (on a Transporter).

The SBR lacks either of these outputs, so Felix's plugin cannot be used. Given the nature of the SBR, it seems highly likely that it will be installed alongside an amp in an inaccessible location, and so there is an even greater need to be able to switch ancilliaries along with the SBR.

Strategy

Note that no associated software plug-in is required - this is executed entirely in hardware.

Detection of the SBR's LED is the basis of this technique. A phototransistor is used to deliver a signal when the LED comes on, which can then be fed into some suitable circuitry that ultimately operates a relay:

So what's in the "Detection Circuitry" box? If the phototransistor had enough gain, it could be nothing: the phototransistor would drive the relay directly. But in practice there isn't enough gain, so we'll need to use a transistor:

(Note: the diode protects the transistor from the back emf voltage spike generated when the relay is switched off. Any standard power diode will do, eg. 1N4004).

Unfortunately, even this doesn't work. Although the LED is bright when music is actually playing, it is illuminated only dimly when the SBR is switched on but paused or stopped. The signal delivered by the phototransistor when the LED is in this dim state is rather small, and is not enough to trigger the transistor. Therefore a Darlington pair is used to increase the gain:

I'm not completely sure why it happens, but something I discovered through experiment is that the Darlington pair switches on even when the SBR's LED is off. Perhaps it is caused by the phototransistor's "dark current" (which is a very small current that passes through even when there is no light present). Therefore the 100k resistor is included to prevent this unwanted switching when the SBR is off. In fact it need not be 100k - anything around 20k or higher is probably fine.

Possible Implementation Methods

1. External Power

In this configuration we feed a supply voltage to the phototransistor from outside the SBR. This arrangement is convenient if you happen to have a suitable external DC voltage source (eg. if the amplifier you're switching has a DC supply you can take a feed from), and means you don't mess with the SBR's circuit board at all:

The actual value of +V depends entirely on what is appropriate for the particular installation. If the external supply you have available has a higher voltage than the relay coil requires, you'll need to add a resistor which in conjunction with the relay's coil will create a voltage divider. For example, if the external supply voltage is 9V and the relay's coil expects 6V, we need to step down the voltage by a third. A 6V relay coil typically has a resistance of about 100 ohms, so that would require a 50 ohm resistor:

2. Internal Power

In this configuration we take the supply voltage for the phototransistor from the SBR's own power supply, hooking into the 9V supply as it enters the SBR by soldering supply wires onto the pads of the input socket. You'd use this arrangement when there is no convenient external DC supply (eg. the amplifier to be switched takes AC power). You might also go for this arrangement to avoid the additional power drain (however small) of keeping an external DC supply on all the time. (In these days of climate change awareness, every little helps).

The voltage available for driving the relay is a little less than the SBR's internal 9V supply, due to the inevitable voltage drop across the transistor. You'll probably get about 8.2V.

R1 steps down the voltage to whatever is required for the relay. For example, if the relay has a coil with a resistance of 100 ohms (typical for a 6V coil), R1 should be about 35 ohms. You could put R1 inside the SBR if you like, of course.

3. Use a Relay with an AC coil?

You might be thinking that another possible configuration would be to use a relay with an AC coil and switch it with an optically-coupled triac isolator. The circuit would look something like this:

R1 would be required to step down the voltage emerging from the SBR to whatever the opto-coupler requires (typically around 1.2V).

However, I have experimented with this arrangement, and came up against a problem that I couldn't solve. When the SBR's LED switches off, it doesn't go from light to dark instantly, but fades down over the course of about half a second. At some borderline level of luminosity, the opto-coupler seems to fluctuate between on and off, which causes the connected relay to rapidly switch on & off (making a nasty buzzing sound). This can't be good for the relay or the device it's switching.

I did consider that it might be due to the voltage spike (created when the magnetic field in the relay coil collapses) causing the triac to switch back on, and tried adding an RC snubber across the coil, but this didn't help. Although I do not fully understand what's going on, I am inclined to believe it really is due to the opto-coupler "flip-flopping" as the voltage output from the SBR falls gradually in response to the LED fading.

Implementation

In the following description, to see a full-size version of any photo, just click it.

First, open up the SBR. You'll need to peel off the large rubber foot to reveal the case screws. Note that the screws are Torx style.

Here's how it looks with the lid removed:

The LED sits underneath a plastic "light-pipe" that transmits the light to the front panel button. Here is a close-up of the light-pipe:

It is easy to remove the light-pipe - it simply slides backwards, although there are a couple of tiny "pips" that locate it which you may need to lift with a suitable thin implement. Note that once the lightpipe is removed, the front panel button is likely to fall out. So to make sure you don't lose it, it's probably best to take it out and keep it somewhere safe for the time being. Here is the area after removal:

D15 is the actual LED over which we will place a phototransistor.

With the light-pipe removed it is still possible to discern the LED status colours through the front button, although they are of course not as bright.

1. External Power

If you're going to use an external supply, the only thing that needs to go inside the SBR is the phototransistor itself, which can be mounted onto a small piece of stripboard:

The collector & emitter are brought to a suitable connector. I chose to use a 3.5mm jack socket mounted on the side of the case. Here is the where I drilled the hole:

Note: when drilling a hole in the case, you should of course remove the SBR's circuit board!!! This is easy - prise the antenna away from the side of the case with a craft knife and then the whole board just lifts out. I will also point out that the side of the case is actually quite thick, and you may need to pare away some extra material on the inside so that the socket can push through far enough.

I put the socket on the side because there is not really much room at the back, although you might just be able to squeeze it in between the ethernet port and COAX digital output socket. (It will not fit between the Toslink socket and analogue outputs, since there is a component (which I take to be a crystal) in the way.

Here is the phototransistor and 3.5mm socket installed:

If you want to avoid drilling a hole in the SBR case, then I guess it might be possible to feed extremely thin wires through the clearance around one of the RCA sockets. But the thinnest wire I had (7/0.2, outside diameter 1.2mm) was too thick to pass through.

The remainder of the circuitry (input resistor, Darlington pair and relay) are external:

You can see that I used an actual pair of transistors, and that's simply because I had them to hand. It would of course be slightly neater to use a Darlington pair in a single device (eg. BC517).

2. Internal Power

More intrepid modders might choose instead to move the Darlington pair inside the SBR and take a 9V supply voltage from the SBR itself. This involves hooking in to the pads where the input socket is attached to the circuit board. The easiest way to do this is on the bottom of the board:

The power lines are taken across the underside of the board to come up to the top side through the diagonally opposite corner, near where the circuit board will be placed:

The circuitry (phototransistor plus Darlington pair) is mounted over the LED and held in place with blu-tak, a sticky pad, or similar:

You can see the power lines appearing up through the corner (as discussed above). Whereas in the previous configuration (external power source), I used the tip and ring of the stereo minijack socket for the collector and emitter connections to the phototransistor, I felt that in this configuration it was appropriate to connect the ground line to the sleeve and the output voltage to the tip. (I had already cut the normal solder point for the sleeve from the socket when experimenting with external power, hence the rather less-than-perfect joint to the outer casing of the socket for the ground line).

Of course, you can make the connections any way you like. You may decide that since we're dealing with DC voltages, it would be more appropriate to use traditional DC low voltage power connectors. I used a stereo minijack because I happened to have one lying around and had suitable cables to plug into it. It also makes the installation mirror the use of the headphone socket by the PowerSwitchII plugin on a Squeezebox Classic.

If you're wondering about the piece of transparent plastic at the top of the photo, it's the light-pipe that was removed from behind the front panel button. I felt that the safest place where it wouldn't get lost was attached to the circuit board with a little sticky pad.

The external circuitry (minijack socket, resistor and relay is built on a separate board:

The wires are the connections to the relay's main contacts, and will typically carry the AC power to the amplifier being switched. In my installation, a small PCB-mounted relay was sufficient (believe it or not, the relay in the picture above claims to be able to handle 7A at 240VAC, although I'm sceptical). If you need to switch genuinely big AC currents, then you will need to use a beefier relay.

The Finished Product

Regardless of whether external or internal power is in use, here's what my finished SBR with the extra socket looks like:

(Of course, you might use a different type of socket and/or you might find somewhere else to locate it on the case).

Disclaimer

I take no responsibility for any consequences arising if you decide to try this for yourself. (Blowing up a Squeezebox Receiver would be a shame, but don't expect me to reimburse you!). These notes are simply a description of what worked for me. You may need to modify some of the details for your own implementation.