StartDownloadsPhotos

S/PDIF switcher

I have a couple of devices with digital audio outputs called "optical S/PDIF" which is basically just the S/PDIF protocol transmitted via optic fibre (Toslink connectors) instead of a coaxial connection.
The problem is that my sound system has only one optical S/PDIF input and changing cable sucks. So I needed an S/PDIF switcher, but why buy stuff when you can just make it yourself?

The switcher has 3 inputs and 1 output. There was supposed to be 4 inputs, but I accidentally fried one of the receivers :(
It's a really simple circuit. The inputs are sent into a 2-input AND-gate, where one pin is connected to the input and one to a microcontroller which does the switching. These AND outputs are then fed into an OR-gate and the output from the OR-gate to the Toslink transmitter.
The microcontroller (in this case an AVR ATmega328P) has a couple of buttons hooked up to it which are used to select the input.

Schematics will be available soon.