Silicon Chip3-Input Stereo Audio Switcher - January 2012 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Australia's energy needs are in the hands of the clowns
  4. Feature: Arduino: What’s All The Fuss About? by Jonathan Oxer
  5. Project: A Stereo Audio Compressor by John Clarke
  6. Project: Build A Simple AM Radio by John Clarke
  7. Project: Dorji 433MHz Wireless Data Modules by Stan Swan
  8. Project: 3-Input Stereo Audio Switcher by John Clarke & Greg Swain
  9. Feature: Playing USB-Stick & SD/MMC Card Music Without A PC by Ross Tester
  10. Vintage Radio: The AWA PA1002 50W Valve PA Amplifier by Rodney Champness
  11. Book Store
  12. Market Centre
  13. Advertising Index
  14. Outer Back Cover

This is only a preview of the January 2012 issue of Silicon Chip.

You can view 26 of the 104 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Items relevant to "A Stereo Audio Compressor":
  • Stereo Audio Compressor PCB [01201121] (AUD $15.00)
  • Stereo Audio Compressor front & rear panels [0120112P1/2] (PCB, AUD $15.00)
  • Stereo Audio Compressor PCB pattern (PDF download) [01201121] (Free)
  • Stereo Audio Compressor front & rear panel artwork (PNG download) [01201122/3] (Free)
Items relevant to "Build A Simple AM Radio":
  • AM Radio PCB [06101121] (AUD $10.00)
  • AM Radio PCB pattern (PDF download) [06101121] (Free)
  • AM Radio panels artwork (PDF download) (Panel Artwork, Free)
Articles in this series:
  • Amateur Radio (November 1987)
  • Amateur Radio (November 1987)
  • Amateur Radio (December 1987)
  • Amateur Radio (December 1987)
  • Amateur Radio (February 1988)
  • Amateur Radio (February 1988)
  • Amateur Radio (March 1988)
  • Amateur Radio (March 1988)
  • Amateur Radio (April 1988)
  • Amateur Radio (April 1988)
  • Amateur Radio (May 1988)
  • Amateur Radio (May 1988)
  • Amateur Radio (June 1988)
  • Amateur Radio (June 1988)
  • Amateur Radio (July 1988)
  • Amateur Radio (July 1988)
  • Amateur Radio (August 1988)
  • Amateur Radio (August 1988)
  • Amateur Radio (September 1988)
  • Amateur Radio (September 1988)
  • Amateur Radio (October 1988)
  • Amateur Radio (October 1988)
  • Amateur Radio (November 1988)
  • Amateur Radio (November 1988)
  • Amateur Radio (December 1988)
  • Amateur Radio (December 1988)
  • Amateur Radio (January 1989)
  • Amateur Radio (January 1989)
  • Amateur Radio (April 1989)
  • Amateur Radio (April 1989)
  • Amateur Radio (May 1989)
  • Amateur Radio (May 1989)
  • Amateur Radio (June 1989)
  • Amateur Radio (June 1989)
  • Amateur Radio (July 1989)
  • Amateur Radio (July 1989)
  • Amateur Radio (August 1989)
  • Amateur Radio (August 1989)
  • Amateur Radio (September 1989)
  • Amateur Radio (September 1989)
  • Amateur Radio (October 1989)
  • Amateur Radio (October 1989)
  • Amateur Radio (November 1989)
  • Amateur Radio (November 1989)
  • Amateur Radio (December 1989)
  • Amateur Radio (December 1989)
  • Amateur Radio (February 1990)
  • Amateur Radio (February 1990)
  • Amateur Radio (March 1990)
  • Amateur Radio (March 1990)
  • Amateur Radio (April 1990)
  • Amateur Radio (April 1990)
  • Amateur Radio (May 1990)
  • Amateur Radio (May 1990)
  • Amateur Radio (June 1990)
  • Amateur Radio (June 1990)
  • Amateur Radio (July 1990)
  • Amateur Radio (July 1990)
  • The "Tube" vs. The Microchip (August 1990)
  • The "Tube" vs. The Microchip (August 1990)
  • Amateur Radio (September 1990)
  • Amateur Radio (September 1990)
  • Amateur Radio (October 1990)
  • Amateur Radio (October 1990)
  • Amateur Radio (November 1990)
  • Amateur Radio (November 1990)
  • Amateur Radio (December 1990)
  • Amateur Radio (December 1990)
  • Amateur Radio (January 1991)
  • Amateur Radio (January 1991)
  • Amateur Radio (February 1991)
  • Amateur Radio (February 1991)
  • Amateur Radio (March 1991)
  • Amateur Radio (March 1991)
  • Amateur Radio (April 1991)
  • Amateur Radio (April 1991)
  • Amateur Radio (May 1991)
  • Amateur Radio (May 1991)
  • Amateur Radio (June 1991)
  • Amateur Radio (June 1991)
  • Amateur Radio (July 1991)
  • Amateur Radio (July 1991)
  • Amateur Radio (August 1991)
  • Amateur Radio (August 1991)
  • Amateur Radio (September 1991)
  • Amateur Radio (September 1991)
  • Amateur Radio (October 1991)
  • Amateur Radio (October 1991)
  • Amateur Radio (November 1991)
  • Amateur Radio (November 1991)
  • Amateur Radio (January 1992)
  • Amateur Radio (January 1992)
  • Amateur Radio (February 1992)
  • Amateur Radio (February 1992)
  • Amateur Radio (March 1992)
  • Amateur Radio (March 1992)
  • Amateur Radio (July 1992)
  • Amateur Radio (July 1992)
  • Amateur Radio (August 1992)
  • Amateur Radio (August 1992)
  • Amateur Radio (September 1992)
  • Amateur Radio (September 1992)
  • Amateur Radio (October 1992)
  • Amateur Radio (October 1992)
  • Amateur Radio (November 1992)
  • Amateur Radio (November 1992)
  • Amateur Radio (January 1993)
  • Amateur Radio (January 1993)
  • Amateur Radio (March 1993)
  • Amateur Radio (March 1993)
  • Amateur Radio (May 1993)
  • Amateur Radio (May 1993)
  • Amateur Radio (June 1993)
  • Amateur Radio (June 1993)
  • Amateur Radio (July 1993)
  • Amateur Radio (July 1993)
  • Amateur Radio (August 1993)
  • Amateur Radio (August 1993)
  • Amateur Radio (September 1993)
  • Amateur Radio (September 1993)
  • Amateur Radio (October 1993)
  • Amateur Radio (October 1993)
  • Amateur Radio (December 1993)
  • Amateur Radio (December 1993)
  • Amateur Radio (February 1994)
  • Amateur Radio (February 1994)
  • Amateur Radio (March 1994)
  • Amateur Radio (March 1994)
  • Amateur Radio (May 1994)
  • Amateur Radio (May 1994)
  • Amateur Radio (June 1994)
  • Amateur Radio (June 1994)
  • Amateur Radio (September 1994)
  • Amateur Radio (September 1994)
  • Amateur Radio (December 1994)
  • Amateur Radio (December 1994)
  • Amateur Radio (January 1995)
  • Amateur Radio (January 1995)
  • CB Radio Can Now Transmit Data (March 2001)
  • CB Radio Can Now Transmit Data (March 2001)
  • What's On Offer In "Walkie Talkies" (March 2001)
  • What's On Offer In "Walkie Talkies" (March 2001)
  • Stressless Wireless (October 2004)
  • Stressless Wireless (October 2004)
  • WiNRADiO: Marrying A Radio Receiver To A PC (January 2007)
  • WiNRADiO: Marrying A Radio Receiver To A PC (January 2007)
  • “Degen” Synthesised HF Communications Receiver (January 2007)
  • “Degen” Synthesised HF Communications Receiver (January 2007)
  • PICAXE-08M 433MHz Data Transceiver (October 2008)
  • PICAXE-08M 433MHz Data Transceiver (October 2008)
  • Half-Duplex With HopeRF’s HM-TR UHF Transceivers (April 2009)
  • Half-Duplex With HopeRF’s HM-TR UHF Transceivers (April 2009)
  • Dorji 433MHz Wireless Data Modules (January 2012)
  • Dorji 433MHz Wireless Data Modules (January 2012)
Items relevant to "3-Input Stereo Audio Switcher":
  • 3-Input Audio Selector (Set of 2 PCBs) [01101121/2] (AUD $30.00)
  • PIC16F88-I/P programmed for the 3-Input Stereo Audio Switcher [0111211A.HEX] (Programmed Microcontroller, AUD $15.00)
  • Firmware HEX file and ASM source code for the 3-Input Switcher [0111211A] (Software, Free)
  • 3-Input Stereo Audio Selector Main PCB pattern (PDF download) [01101121] (Free)
  • 3-Input Stereo Audio Selector Switch PCB pattern (PDF download) [01101122] (Free)
Items relevant to "Playing USB-Stick & SD/MMC Card Music Without A PC":
  • 3-pin JST plug to bare wires cable, 100mm (Component, AUD $2.00)

Purchase a printed copy of this issue for $10.00.

By JOHN CLARKE & GREG SWAIN 3-Input Stereo Audio Switcher Need more analog audio inputs for your stereo amplifier or home-theatre set-up? This 3-Input Stereo Audio Switcher will do the job. It works with an infrared remote control or you can just press one of the front-panel buttons to select a program source. W HILE WE WERE developing the Input Selector board for the Ultra-LD Mk.3 Stereo Amplifier, we realised that we also had the basis for a self-contained project. All we had to do was move the PIC microcontroller to the main relay board, re-jig the circuit somewhat and house it in a metal case for shielding. That would give us a remote-controlled 3-Input Stereo Audio Switcher that would be ideal for use in any audio set-up. In practice, it wasn’t quite that easy because we also had to redesign the switch board to include the infrared receiver and an Acknowledge LED. And we had to re-jig the firmware in the micro to suit the reallocated I/O ports and to eliminate the remote 70  Silicon Chip volume control feature used in the Ultra-LD preamp. As shown in the photos, the unit is housed in a metal diecast case which we spray-painted black. The switch board mounts on the front panel, while four pairs of stereo RCA sockets on the main PCB (three for the inputs and one for the outputs) protrude though holes in the rear panel. Power comes from a 9-12V plugpack and the unit typically draws less than 600mW. Virtually any universal remote control can be used with the unit and there are three different “modes” (or devices) to choose from – TV, SAT1 & SAT2. The default mode is TV but SAT1 can be selected by pressing (and holding) button S1 during power-up. Similarly, SAT2 is selected by pressing button S2 at power-up, while pressing S3 at power up reverts to TV mode. Of course, having selected a mode you must also program the remote with the correct code. We’ll have more to say about that later on. In operation, the unit lets you select between any one of three stereo analog inputs by pressing the “1”, “2” or “3” buttons on the remote. Alternatively, you can press the buttons on the frontpanel switch board. An integral blue LED in each switch button lights to indicate the selected input. This occurs both when a button is pressed and when the remote control is used. The blue switch LEDs also serve as power indicators, while siliconchip.com.au Parts List 1 PCB, code 01101121, 101 x 81mm 1 PCB, code 01101122, 84 x 38mm 1 9-12V 300mA plugpack supply (eg, Jaycar MP3280, MP3146) 1 diecast aluminium box, 119 x 94 x 57mm (Jaycar HB5064) 3 DPDT 5V relays, PCB-mount (Altronics S4147) 1 4MHz crystal (X1) 1 18-pin machined DIL socket 4 PCB-mount gold-plated dual RCA sockets (Altronics P0212, Jaycar PS0280) 3 PCB-mount pushbutton switches with blue LEDs (S1-S3) (Altronics S1177, Jaycar SP0614) 8 M3 x 10mm tapped spacers 1 2.5mm PCB-mount DC socket (Altronics P0621A, Jaycar PS0520) 2 ferrite beads (L1, L2) (Altronics L5250A, Jaycar LF1250) 1 10-pin PCB-mount IDC header socket (Altronics P5010, Jaycar PP1100) 1 10-pin 90° PCB-mount IDC header socket (Altronics P5060, Jaycar PP1118) 2 10-pin IDC line sockets 1 100mm length 10-way IDC cable 9 M3 x 6mm pan-head machine screws the orange Acknowledge (ACK) LED on the front panel flashes when ever a valid remote control signal is received. By changing a couple of linking options, you can also build the unit so that it responds to buttons 4, 5 & 6 on the remote, or to buttons 7, 8 & 9 (ie, instead of 1, 2 & 3). You might want to do this if buttons 1, 2 & 3 have been allocated to another piece of equipment (eg, to the selector board in the Ultra-LD Mk.3 Stereo Amplifier) or if you want to build two such units and control them using the same remote. Performance By using relay switching and carefully designing the PCB (especially in regards to earthing), we’ve been able to achieve excellent specifications. The signal-to-noise ratio is >116dB unweighted relative to 1V RMS (2022kHz bandwidth), while channel separation is 109db <at> 1kHz and 90dB <at> 10kHz. The THD+N (total harmonic distortion plus noise) is <0.0004% <at> siliconchip.com.au 4 M3 x 6mm pan-head machine screws (black) 4 M3 x 10mm pan-head machine screws 4 No.3 x 10mm screws (black) 5 M3 nuts 9 M3 washers Semiconductors 1 PIC16F88-I/P programmed with 0111211A.hex (lC1) 1 infrared receiver module (IRD1) (Altronics Z1611A, Jaycar ZD1952) 3 BC337 NPN transistors (Q1-Q3) 1 7805 5V regulator (REG1) 4 1N4004 diodes (D1-D4) 1 3mm orange LED (LED4) Capacitors 2 100μF 16V electrolytic 1 10μF 16V electrolytic 1 100nF MKT polyester 2 470pF MKT polyester or MKP polypropylene (do not use ceramic) 2 22pF ceramic Resistors 6 4.7kW 3 1.8kW 1 1kW 1 330W 7 100W 1kHz (20Hz-22kHz), a figure that’s basically below the measurement capabilities of our test equipment. The interchannel crosstalk is -116dB <at> 1kHz and -101dB at 10kHz (unused input terminated with 100Ω). Suffice to say that this unit will have negligible impact on the audio signal being switched. As such, this unit would be ideal for use with the Class-A Stereo Amplifier which only featured one set of audio inputs. Or it could be used in any other audio or home-theatre set-up where you need extra analog inputs. Give your lighting projects a Give your lighting projects a SEOUL LED Dazzler Kit (As seen in SC Feb’11) Drive up to 3 powerful P7 LEDs Or most other high power LEDs Includes all parts and PCB LEDs not included KIT-LED_DAZZLER $39.95 + GST P7 Power LED 10W Pure White Emitter Approx. 900lm <at> 2.8A Ideal for torch applications PCB available to suit W724C0-D1 $16.00+GST P4 Star 4W LEDs Power LEDs mounted on 20mm Star PCB. Various Colours available. Pure White W42182 $3.90+GST Nat. White S42182 $3.90+GST Warm White N42182 $3.90+GST P3-II Star 2W LEDs Power LEDs mounted on 20mm Star PCB. Various Colours available. Pure White WS2182 $2.95+GST Warm White NS2182 $2.95+GST P5-II RGB Power LED High power RGB LED mounted On 20mm Star PCB Drive each colour <at> 350mA Ideal for wall wash applications F50360-STAR $14.95+GST SMD RGB LED General purpose RGB LED in PLCC-6 package Drive each colour <at> 20mA SFT722N-S $0.95ea+GST Channel Lighting Modules 12v Operation, Cool White Ideal for Sign illumination 3 LED – 41lm min. 21H0007 $2.70ea+GST 4 LED – 55lm min. 21H0008 $3.60ea+GST VOLUME DISCOUNTS APPLY Circuit details Refer now to Fig.1 for the circuit details. It uses 5V DPDT relays (RLY1-RLY3) to switch the three stereo inputs: Input 1, Input 2 & Input 3 (CON1-CON3). These relays are in turn controlled by NPN transistors Q1-Q3, depending on the signals from microcontroller IC1 (PIC16F88-I/P). The incoming stereo line-level AUSTRALIAN DISTRIBUTOR Ph. 07 3390 3302 Fx. 07 3390 3329 Email: sales<at>rmsparts.com.au www.rmsparts.com.au January 2012  71 signal. This oscillator runs when the circuit is first powered up for about 1.5 seconds. It also runs whenever a signal from the infrared receiver is received at its RB0 input or when a button on the switch board is pressed and then for a further 1.5 seconds after the signal ceases. The oscillator then shuts down and the processor goes into sleep mode. This ensures that no noise is radiated into the audio signal paths during normal operation. Power supply The rear panel carries the four RCA socket pairs, with the output pair at left. inputs are connected to the NO (normally open) contacts of each relay. When a relay turns on, its common (C) contacts connect to its NO contacts and the stereo signals are fed through to the left and right outputs via 100Ω resistors and ferrite beads. The resistors isolate the outputs from the audio cable capacitance, while the beads and their associated 470pF capacitors filter any RF signals that may be present. When button 1 on the remote (or on the switch board) is pressed, the micro switches its RA2 port (pin 1) high. This pulls the base of transistor Q1 high via a 4.7kΩ resistor and so Q1 turns on and switches on RLY1 to select Input 1 (CON1). Similarly, RLY2 & RLY3 are switched on via Q2 & Q3 respectively when buttons 2 and 3 are pressed. The firmware in the micro ensures that only one relay can be on at any time. Pressing a button (either on the remote or the switch board) turns the currently-activated relay off before the newly-selected relay turns on. If the input button corresponds to the currently-selected input, then no change takes place. The last input selected is restored at power up. Diodes D1-D3 protect Q1-Q3 by quenching the back-EMF when the relays switch off. Pins 15 & 16 of the micro are the oscillator pins for 4MHz crystal X1 which is used to provide the clock Changing The Remote Control Buttons By changing the linking options on the PIC microcontroller, you can make the unit respond to buttons 4, 5 & 6 on the remote or to buttons 7, 8 & 9 (ie, instead of buttons 1, 2 & 3). By default, pins 18 & 17 (RA1 & RA0) of the micro are tied to ground by two thin tracks on the PCB (the ground tracks runs down the centre of the IC, immediately to the left of these pins). As a result, both pins are at logic 0 (ie, they are both low) and the unit responds to buttons 1, 2 & 3 on the remote. If you want the unit to respond to buttons 4, 5 & 6, cut the track between pin 17 and ground and connect this pin to the adjacent +5V pad (immediately to the right) instead. You can do this using a solder bridge or a short length of tinned copper wire. Alternatively, to make the unit respond to buttons 7, 8 & 9, cut the link between pin 18 and ground and connect this pin to the +5V pad. Tying both pins 17 & 18 high (ie, at logic 1) restores button 1, 2 & 3 operation (ie, it responds to the 1, 2 & 3 buttons when both inputs are tied high or both tied low). The truth table on the circuit diagram shows the various options. Just remember that a logic 1 represents a high (ie, +5V), while logic 0 represents a low (ie, ground). 72  Silicon Chip Power for the circuit is derived from a 9-12V plugpack. This is fed in via reverse-polarity protection diode D4 to regulator REG1 which provides a +5V output. A 100µF capacitor filters the supply to REG1, while 10µF and 100nF capacitors decouple the output. The +5V rail powers the microcontroller and the relays. In addition, this rail is also fed to pin 3 of CON5, while pin 5 of CON5 is connected to ground. This provides power to the switch board via the IDC cable and CON6. Switch board circuitry Fig.1 also shows the circuitry for the switch board. This includes the infrared receiver (IRD1), the three momentary contact pushbuttons with integral blue LEDs (LEDs1-3), the ACK (acknowledge) LED and the 10-way header socket (CON6). The 38kHz infrared signals from the remote are picked up by IRD1 and demodulated to produce a serial data pulse train at its pin 1 output. This signal is then fed to the RB0 (pin 6) input of the PIC16F88-I/P (IC1) via pin 8 of headers CON6 & CON5. IC1 decodes the signal to determine the RC5 code sent by the remote and switches its RA2-RA4 outputs accordingly to select the corresponding input. LED4 (ACK) flashes each time a valid code is received from the remote. It’s driven by the RB4 output of IC1 via a 330Ω current-limiting resistor. Power for IRD1 comes in via pin 3 of CON6 and is decoupled using a 100Ω resistor and a 100µF capacitor. This filtered +5V rail is applied to pin 3 of IRD1, while pin 2 connects to ground. Button switches Switches S1-S3 allow manual selection of the input. One side of each switch is connected to ground, while the tops of S1-S3 are pulled high (ie, siliconchip.com.au CON1 CON4 L1 100 L OUT L1 IN 470pF 100 R1 IN L2 100 CON2 R OUT L2 IN 470pF 100 R2 IN 100 RLY 1 CON3 L3 IN 100 RLY 2 R3 IN RLY 3 100nF 1k K 4 LK1 LK2 18 17 TO CON6 ON FRONT PANEL BOARD 3 8 6 1 10 10 13 9 8 4 12 7 9 2 11 5 CON5 K D2 K D3 A A SC IN GND 10 F A RA1 RA2 1 4.7k B A 100 F 16V RA0 C E RA3 RB0 2 Q1 BC337 4.7k C B + CON7 – RB7 LK2 (RA0) 0 0 1 2 3 0 1 4 5 6 1 0 7 8 9 1 1 1 2 3 E RB4 RA4 3 4.7k B C REMOTE BUTTONS LK1 (RA1) Q2 BC337 Q3 BC337 E RB2 RB6 OSC2 RB3 OSC1 RB5 15 16 Vss 5 E 1 2 C 7805 IRD1 K 3-INPUT STEREO AUDIO SWITCHER B K A D1 – D4: 1N4004 22pF 22pF BC337 LED4 X1 4.0MHz A 2011 K 14 Vdd MCLR IC1 PIC16F88 7 -I/P RB1 6 D1 OUT 9–12V DC INPUT D4 REG1 7805 GND IN 3 GND OUT 100 100 F IRD1 3  4.7k 4.7k CON6 4.7k 3 1 TO CON5 ON INPUT SELECTOR BOARD Fig.1: the circuit uses a PIC16F88-I/P microcontroller (IC1) to decode signals from an infrared receiver (IRD1) and pushbutton switches S1-S3. The micro then drives relays 1-3 via transistors Q1-Q3 to switch the selected input through to the stereo outputs at CON4. Diode D4 provides reverse polarity protection, while REG1 provides a regulated +5V supply. 8 1 2 1.8k 10 1.8k 9 6 4 330 1.8k 7 2 ACK LED4 A  K siliconchip.com.au S1 LED1 A  K S2 LED2 A  K S3 LED3 A 5  K January 2012  73 CON2 OUTPUT CON4 CON3 L2 4.7k 4004 D4 12110110 10 F 100 F 100 100 4.7k Q2 Q1 CON7 4004 D3 Q3 REG1 7805 22pF 22pF IC1 PIC16F88-I/P 4.7k 4004 D2 100 100 4004 100 100 L1 D1 X1 1k RELAY2 RELAY1 CON1 INPUT 3 2x 470pF INPUT 2 RELAY3 INPUT 1 100nF 9 10 1 2 CON5 R OT CELES TUP NI Fig.2: follow this diagram and the photo below to build the main PCB. Note that we initially used 470pF ceramic capacitors across the outputs but these were later changed to MKT types for lower distortion. to +5V) via 4.7kΩ resistors and are respectively connected to the RB7, RB6 & RB5 ports of IC1. Similarly, the cathodes of the internal blue LEDs (LEDs1-3) are connected to ground while their anodes are driven by ports RB1-RB3 respectively via 1.8kΩ current-limiting resistors. When a switch is pressed, it pulls the corresponding port on IC1 low and this wakes the microcontroller up which then processes the data and turns on the corresponding relay. At the same time, either RB1, RB2 or RB3 switches high to light the appropriate switch LED. IC1 then promptly goes back to sleep again. Construction Fig.2 shows the assembly details for the main PCB while Fig.3 shows the switch board assembly. Install the resistors and diodes D1D4 on the main PCB first, then install the ferrite beads, an 18-pin IC socket for IC1 and the two 470pF MKT capacitors near CON4 (do not substitute ceramic capacitors). The two 22pF capacitors below crystal X1 can then go in, along with the 100nF capacitor and the two electrolytics (make sure that the latter are correctly orientated). That done, install transistors Q1Q3, crystal X1 and the 10-way header socket. The latter must go in with its slotted key-way towards IC1 (see photo). Regulator REG1 can then be installed and that’s done by first bending its leads down through 90° to match the holes in the PCB. Its metal tab is then fastened to the PCB using an M3 x 6mm machine screw and nut, after which the leads can be soldered. Capacitor Codes Value µF Value IEC Code EIA Code 100nF 0.1µF 100n 104 470pF NA 470p 471 22pF NA   22p   22 Resistor Colour Codes o o o o o o No.   6   3   1   1   7 74  Silicon Chip Value 4.7kΩ 1.8kΩ 1kΩ 330Ω 100Ω 4-Band Code (1%) yellow violet red brown brown grey red brown brown black red brown orange orange brown brown brown black brown brown 5-Band Code (1%) yellow violet black brown brown brown grey black brown brown brown black black brown brown orange orange black black brown brown black black black brown siliconchip.com.au 1.8k 1.8k R OT CELES TUP NI A 100 A CON6 IRD1 330 A LED4 4.7k S3 4.7k S2 4.7k S1 LE NAP H CTI WS 22110110 100 F 1.8k Fig.3: install the parts on the switch board as shown here, making sure that switches S1-S3 and LED4 are orientated correctly. Refer to the text for the mounting details for LED4 and IRD1. Don’t solder the regulator’s leads before it’s fastened into place. If you do, you could crack the PCB tracks as the mounting screw is tightened. The main board assembly can now be completed by installing the DC socket, the relays and the four stereo RCA input socket pairs. Don’t install the microcontroller (IC1) yet – that step comes later, after the power supply has been checked. Once the board has been finished, fit a 10mm spacer to each corner as shown in Fig.6. Switch board assembly Start the assembly of this board by installing the resistors, the 90° 10-way header (key-way up) and the 100µF capacitor. The latter should be installed with its body leaning by about 60° as shown in one of the photos, so that it won’t later foul the front panel of the case. The three pushbuttons can now go in but note that they must be installed the right way around. These have kinked pins at each corner plus two straight pins for the integral blue LED. The anode pin is the longer of the two and this must go in the hole marked “A” on the layout diagram. Once the pins are in, push the buttons all the way down so that they sit flush against the PCB before soldering their leads. LED4 is next on the list and must be installed with its body exactly 10mm above the PCB. This can be done by pushing it down onto a 10mm-high cardboard spacer. Check that it’s orientated correctly before soldering its leads – its anode lead is the longer of the two. Infrared receiver The infrared receiver (IRD1) must siliconchip.com.au The main board is mounted so that its rear edge lines up with the outside of the lip that runs around the inside edge of the base. This view shows the switch board mounted inside the case, prior to the installation of the main board and base assembly. January 2012  75 ALIGN WITH CENTRE A B B B A C A 33MM UP FROM BOTTOM EDGE A = 3MM; B = 6MM; C = 4.5MM A A ALIGN WITH CENTRE D D D E D E D D D E D E 25MM D = 11MM; E = 2.5MM BOTTOM EDGE OF CASE A A ALIGN WITH CENTRE ALIGN WITH CENTRE be installed so that its domed lens is aligned with LED1 and the switches. If you have the Jaycar unit, the first step is to bend its leads down by 90° exactly 5mm from its body. The device should then be installed with its body exactly 9mm above the PCB (use a 9mm spacer to set the height). This will ensure that the surface around its domed lens rests against the inside of the case when the switch board is later mounted in position. Alternatively, you can leave IRD1 out for the time being and mount it after the case has been drilled. If you elect to do that, it’s just a matter of first pushing its leads through the PCB, then mounting the switch board in the case. The switch side of the case is then positioned face down, after which IRD1 is slid into position and its leads soldered. The mounting arrangement for IRD1 is slightly different if you have the Altronics Z1611A part instead of the Jaycar part. The Altronics device comes with an integral metal shield and this shield must not come into contact with the metal case. Its body is also larger than for the Jaycar device. To install the Altronics device, bend its leads down 3mm from its body, then install it so that the rear of the device is no more than about 5mm above the PCB. Check to ensure that its lens is aligned horizontally with the LED and the switches before soldering its leads. The switch board assembly can now be completed by securing M3 x 10mm spacers plus M3 nuts (which act as additional spacers) to each corner – see Fig.6 and photo. Drilling the case A = 3MM A A Fig.4: these case drilling templates can either be copied or downloaded as a PDF file from the SILICON CHIP website. ALIGN WITH CENTRE 23.5 BOTTOM EDGE OF CASE 76  Silicon Chip 16.5 The next step is to drill the case. Fig.4 shows the four drilling templates and these can either be photocopied or downloaded as a PDF file from the SILICON CHIP website. In each case, it’s just a matter of aligning the blue lines with horizontal and vertical pencil lines marked on the case itself. The templates are then secured in place with sticky tape (see photo), after which you can drill the holes. It’s important to be accurate with the hole locations, so be sure to position each template carefully and to start each hole with a very small pilot drill (eg, 1mm). The holes can then be carefully enlarged to size. You can use drills up to about 4mm but after that it’s best to enlarge the siliconchip.com.au holes using a tapered reamer. This will have to be done for the switch holes, the RCA socket holes and the access hole for the DC socket. It’s easy to get the switch holes all the same size – just ream one out to the correct size, then push the reamer into the hole as far as it will go and wind some sticky tape around the outside where it meets the case. The other two holes are then reamed out up to the sticky tape. The RCA socket holes are done in exactly the same way. Note that the main PCB is not mounted centrally on the base but is offset by 3mm towards the rear. It’s just a matter of drawing horizontal and vertical centre lines on the base and lining up the blue lines on the template with these before taping it into position. Once the drilling is complete, deburr all holes using an oversize drill or a small rat-tail file. The case can then be spray-painted matte black (three or four thin coats are much better than one thick coat). Making the IDC cable Fig.5 shows how to make the IDC cable that links the two PCBs together. Note that pin 1 on the header sockets is indicated by a small triangle in the plastic moulding and the red stripe of the cable must go to these pins. You can either crimp the IDC headers to the cable in a vice or use an IDC crimping tool (eg, Altronics T1540 or Jaycar TH-1941). Don’t forget to fit the locking bars to the headers after crimping, to secure the cable in place. Having completed the cable, check that the headers have been correctly terminated. This can be done by plugging them into the matching sockets on the PCBs and then checking for continuity between the corresponding pins at either end using a multimeter. Initial tests Before installing the PIC microcontroller, it’s a good idea to check that the power supply is correct. To do that, connect a 9-12V DC plugpack, apply power and check the voltage between pins 14 & 5 of the IC socket. Pin 14 should be at +5V with respect to pin 5 (GND). If you don’t get any output from REG1, check the supply polarity and the orientation of D4. Assuming the supply is correct, siliconchip.com.au The templates are secured to the case using sticky tape. Start all holes using a 1-1.5mm drill to ensure accuracy and enlarge holes over 4mm using a reamer. switch off, install the microcontroller and make sure the two boards are connected together via the IDC cable. That done, reapply power and check that one of the blue switch LEDs lights. You should also hear a click from the corresponding relay as it turns on. Now try changing the input selection using the switches. Each time you press a button, its LED should light and you should hear the relays switch over. If there’s no action, check that power is being applied to the switch board (the junction of the 4.7kΩ resistors should be at +5V with respect to ground). Getting the remote working The remote control function can now be tested using a suitable remote – eg, the Altronics A1012 ($19.95) and the Jaycar AR1726 ($37.95). As stated earlier, the default device mode programmed into the micro is TV but if this conflicts with other gear you can use SAT1 or SAT2 instead. Just press (and hold) button S1 at power-up for SAT1, button S2 for SAT2 or button S3 to revert to TV mode. LOCATING SPIGOT UNDER 10-WAY IDC SOCKET 10-WAY IDC SOCKET 100mm x 10-WAY IDC RIBBON CABLE CABLE EDGE STRIPE Fig.5: here’s how to fit the headers to the 10-way IDC cable. Note the positions of the locating spigots on each header – they both face in the same direction. The completed IDC cable should be tested by fitting it to the PCB assemblies and using a DMM to check for continuity between their matching pins. January 2012  77 SWITCH PCB MOUNTED INSIDE BOX USING FOUR M3 x 10mm TAPPED SPACERS, FOUR M3 NUTS FOR ADDITIONAL SPACING AND EIGHT M3 x 6mm PAN HEAD SCREWS MAIN PCB MOUNTED ON BOX LID (WHICH BECOMES BASE) USING FOUR M3 x 10mm TAPPED SPACERS, FOUR M3 x 6mm PAN HEAD SCREWS & FOUR M3 x 10mm PAN HEAD SCREWS 4 x M3 FLAT WASHERS UNDER EACH REAR SPACER TO TILT BOARD UP SLIGHTLY AT REAR RUBBER MOUNTING FEET HELD TO UNDERSIDE OF LID/BASE VIA MOUNTING SCREWS Fig.6: this cross-section diagram shows how it all fits together. The four M3 flat washers under the spacers at the rear tilt the board back slightly, so that the RCA sockets mate with the sloping wall of the case. Be sure to attach the IDC cable before fitting the main board/base assembly to the case and installing the case screws. Once you’ve chosen the “device” mode, you also have to program the correct code into the remote. For the Altronics A1012, use 023 or 089 for TV mode, 242 for SAT1 or 035 for SAT2. 78  Silicon Chip Similarly, for the Jaycar AR1726, use 103 for TV, 1317 for SAT1 or 1316 for SAT2. If you have some other universal remote, it’s just a matter of testing the various codes for a Philips device until you find one that works (most Philips devices rely on the RC5 code standard). Having programmed the remote, check that the inputs can be selected using the 1, 2 & 3 buttons. Each time a button is pressed, the orange ACK LED should flash and you should hear a “click” as the corresponding relay switches on. The blue LED in the corresponding switch button should also light. If the ACK LED doesn’t flash and there’s no response from the relays, make sure that the remote is programmed correctly. Check also that the correct device has been selected (ie, TV, SAT1 or SAT2). The ACK LED won’t flash at all unless everything is correct. Final assembly Once everything is working correctly, the unit can be installed into the case. Fig.6 shows the details. The switch board is secured inside the case using four M3 x 6mm black pan-head screws from the outside. Plug the IDC cable into its header before fitting this board, then check that the switches operate freely, without fouling the edges of their holes. The ACK LED should just protrude through the case, while the Jaycar version of the infrared receiver lens should be against the case and the lens centred in its hole. Alternatively, if you have the Altronics infrared receiver, it should sit further back so that its metal shield doesn’t touch the case. A red perspex window glued to the inside of the case will improve the appearance. The main board sits on the base of the case and is secured to it using four M3 x 10mm machine screws which also hold the rubber feet in place. Note that the four M3 washers are also fitted under the spacers at the rear. This tilts the board back slightly so that the RCA sockets mate with the sloping wall of the case. Don’t forget to connect the IDC cable before fitting the assembly together and installing the case screws. Finally, install the four No.3 x 10mm screws at the rear. These go into the plastic bodies of the RCA socket assemblies and secure them against the inside of the case, so that they are held fast when the cables are plugged in to SC the sockets. siliconchip.com.au