Author Topic: automatic 8-to-1 Toslink Switch  (Read 1603 times)

Offline micro

  • MassiveMember
  • ****
  • Posts: 392
automatic 8-to-1 Toslink Switch
« on: December 18, 2015, 03:06:41 am »
Here's another little project which I've finished recently. It's an automatic 8-to-1 Toslink switch. :)



Key features:
  • powered through Mini-USB cable
  • auto mode: new active inputs are automatically detected and selected. If there is more than one active input, you can use the tact button to cycle between the active inputs.
  • manual mode: use the the tact switch to select the requested input. The selected input is stored and automatically loaded when the toslink switch is turned on.
  • easter egg: hold the tact switch while turning on the toslink switch to make the LED's blink. ;)
Schematic:


Gerber/HEX files:
Unfortunately I can't provide you with bare or assembled PCB's. But you can use the attached gerber files to order the PCB yourself. The PCB's dimensions are 70 mm x 50 mm.

The microcontroller on the PCB has to be flashed with the appropriate HEX file (also attached to this post), or the toslink switch won't work at all. The fuse bytes don't need to be altered. (Factory-set fuse bytes: Low Byte = 0x62; High Byte: 0xDF)

Please keep in mind that the gerber files and the hex file are intended for your personal, non-commercial use only!


Parts list:
You might have a hard time sourcing the needed parts, especially the Toslink receiver and transmitter sockets. Anyways, here's a list of the parts needed with german shopping links.

Qty Name in schematic Description Package Where to buy (in Germany)
1IC1Atmega48A microcontrollerTQFP32http://www.reichelt.de/?ACTION=3;ARTICLE=121828;GROUPID=2959;PROVID=2794&wt_mc=amc14291660253544&zanpid=2107875674806510592
1IC2SN74CBT3251
1:8 Mux
TSSOP16https://www.conrad.de/de/logik-ic-multiplexer-demux-texas-instruments-sn74cbt3251pwr-fet-multiplexerdemux-einzelversorgung-tssop-16-1073668.html
11C1 - C11100 nF ceramic capacitor0805http://www.reichelt.de/Vielschicht-SMD-G0805/X7R-G0805-100N/3/index.html?ACTION=3&GROUPID=3165&ARTICLE=31879&OFFSET=500&WKID=0&
1C12100 uF electrolytic capacitorpitch: 2,5 mm
diameter: 6 mm
https://www.reichelt.de/Elkos-radial-105-C-1000-5000h/RAD-FC-100-16/3/index.html?ACTION=3&GROUPID=4000&ARTICLE=84617&START=0&OFFSET=500&WKID=0&
9RL1 - RL9330 Ohm resistor0805https://www.conrad.de/de/dickschicht-widerstand-330-smd-0805-0125-w-1-100-ppm-samsung-electro-mechanics-rc2012f3300cs-rc2012f331cs-1-st-441762.html
1RRST10 kOhm resistor0805https://www.conrad.de/de/dickschicht-widerstand-10-k-smd-0805-0125-w-1-100-ppm-samsung-electro-mechanics-rc2012f1002cs-rc2012f103cs-1-st-439073.html
8LED1 - LED8red SMD LED0805https://www.reichelt.de/SMD-LEDs-Standard/SMD-LED-0805-RT/3/index.html?ACTION=3&GROUPID=3035&ARTICLE=31435&START=0&OFFSET=500&WKID=0&
1LED9green SMD LED0805https://www.reichelt.de/SMD-LEDs-Standard/SMD-LED-0805-GN/3/index.html?ACTION=3&GROUPID=3035&ARTICLE=31436&START=0&OFFSET=500&WKID=0&
8IN1 - IN8Sharp GP1FA551RZ
Toslink receiver
-http://www.pollin.de/shop/dt/MjMyODQ1OTk-/Bauelemente_Bauteile/Mechanische_Bauelemente/Steckverbinder_Klemmen/Toslink_Receiver_SHARP_GP1FA551RZ.html
1OUTSharp GP1FA551TZ

or

PL131 Toslink transmitter
-http://www.pollin.de/shop/dt/MDQxODQ1OTk-/Bauelemente_Bauteile/Mechanische_Bauelemente/Steckverbinder_Klemmen/Toslink_Transmitter_SHARP_GP1FA551TZ.html

or

https://www.conrad.de/de/ir-transmitter-650-nm-sonderform-everlight-opto-plt-131t112-156403.html
1S1DIP switch-http://www.pollin.de/shop/dt/MDYyOTc1OTk-/Bauelemente_Bauteile/Mechanische_Bauelemente/Schalter_Taster/DIP_Schalter_RP_02_B_10_Stueck.html
1S2tact switch6 mm x 6 mmhttps://www.reichelt.de/Kurzhubtaster/TASTER-9303/3/index.html?ACTION=3&GROUPID=3278&ARTICLE=44583&START=0&OFFSET=500&WKID=0&
1PWR_SWApem 5236WWA-7 toggle switch-http://www.pollin.de/shop/dt/MDAyOTc1OTk-/Bauelemente_Bauteile/Mechanische_Bauelemente/Schalter_Taster/Miniatur_Kippschalter_APEM_5236WWA_7_ON_ON.html
1USB1SMD Mini USB socket-https://www.reichelt.de/USB-Einbauverbinder/USB-BWM-SMD/3/index.html?ACTION=3&GROUPID=6859&ARTICLE=52003&START=0&OFFSET=500&WKID=0&
1-adhesive rubber feetdiameter: 8 mmhttp://www.pollin.de/shop/dt/MjkxODU1OTk-/Bauelemente_Bauteile/Mechanische_Bauelemente/Montagematerial/Gummi_Geraetefuesse_3_Groessen_46_teilig.html

More informations:
On the german circuit-board forums you can find another thread covering this Toslink switch: http://circuit-board.de/forum/index.php/Thread/19096-8-fach-Toslink-Switch-mit-automatischer-Umschaltung/
« Last Edit: December 18, 2015, 03:10:02 am by micro »

Offline Lawrence

  • Runs the place
  • Administrator
  • ThrobbingMember
  • *****
  • Posts: 3331
    • NFGgames
Re: automatic 8-to-1 Toslink Switch
« Reply #1 on: December 20, 2015, 07:39:57 am »
That is really quite cool, thanks for sharing it. 

Offline micro

  • MassiveMember
  • ****
  • Posts: 392
Re: automatic 8-to-1 Toslink Switch
« Reply #2 on: December 30, 2015, 04:30:14 am »
Thanks!  :D

It's kinda strange that there aren't any cheap automatic Toslink switches available as detecting an active source is quite easy.

In case someone wants to know how the detection works:
When there's no active source connected to the Toslink receivers, then the output level of the receivers will be uncertain. It could be 0V or 5V. (Or even toggle at some point.) But IF there's an active source connected, the receiver's output will toggle all the time.

By using the microcontrollers pin change interrupt capability it's convenient to detect if the Toslink receiver's ouput has been toggled. Just wait a certain time (currently 200 us) and check the appropriate flag. If there really has been a change, a counter gets incremented. Repeat the procedure a number of times (currently 50 iterations). After that the counter is evaluated. If the counter is above a certain threshold (currently 70% => 0.7 * 50 iterations = 35), then this Toslink input is treated as active. :)

Offline Slick

  • Newbie
  • *
  • Posts: 1
Re: automatic 8-to-1 Toslink Switch
« Reply #3 on: April 07, 2017, 04:07:41 am »
Wow, this is really great!

I haven't checked the forum post you've linked yet (my faith in online translators is small) - what device did you use to flash the hex file?