Automatic TOSLink digital audio switcher
This circuit lets you add another TOSLink input to your home theatre system. While passive optical TOSLink combiners are available, they don’t work if both TOSLink transmitters are active at the same time. Even if only one is active at a time, these devices can degrade the signal, causing audible clicks and pops.
This automatic switcher instead converts the optical signal to an electrical signal and so does not suffer from these problems. It works as long as the connected devices do not transmit signal data while they are stopped (but it’s OK if they leave the transmitter LED on).
The incoming TOSLink optical signals are received by two fibre optic receivers (Receiver1 and Receiver2). The resulting square-wave signals pass to pins 5 & 6 of IC2, a 74AC157 quad 2-way multiplexer IC. Its pin 1 voltage determines which signal is sent to output pin 7; if pin 1 is low then it is the signal at pin 5, from Receiver1. If the pin 1 voltage is high, the selected input is pin 6, from Receiver2.
Whichever signal is selected, it then passes to TOSLink Transmitter1, which is connected to the home-theatre receiver input via another optic fibre cable.
The input to select is determined by an ATTiny13 microcontroller (IC1). When data is present from a receiver, the average output voltage level is around 2.5V (since its output is a high-frequency square-wave). When there is no data present, the average voltage level will be either 0V or 5V, depending on whether the transmitter LED is on or off.
To distinguish between these states, IC1 effectively operates as a window comparator. The data from Receiver1 is low-pass filtered using a 10kΩ resistor and 1µF capacitor and is then applied to pin 1, the ADC0 input. IC1 digitises this voltage. If it is between 1-4V, that indicates there is data present at Receiver1’s output and so the micro sets its PB2 output (pin 7) low, selecting this. Otherwise, PB2 goes high and the other input is selected instead.
A 5V rail to power the TOSLink receivers and transmitters and both ICs comes from linear regulator REG1, which is fitted with protection diodes and bypass/filter capacitors. It is fed from a 9V DC plugpack via reverse polarity protection diode D1.
The power supply for Receiver1 and Receiver2 is further smoothed by separate LC filters, so that noise from the other ICs doesn’t interfere with their operation.
The software for IC1 is available for download from the SILICON CHIP website (toslink_audio_switch.zip).
Seaford, Vic. ($50)
Editor’s note: IC1 could be replaced by an LM339 configured as a window comparator, with resistors to generate the 1V/4V thresholds and a pull-up resistor at its output. Note also that this circuit requires TOSLink receivers and transmitters designed for 5V operation.