Audio Matrix Switch

I’ve had some down time project wise lately, most of my SMPS research is on hold, since I need to order even more parts (namely diodes and switches)… so, I’ve taken the time to draw.

One of my ‘back burner’ projects is a whole-house audio distribution system. So, this past week or so, I set out to design the heart of the system, a matrix switch. Originally I had tried to go “too big”, designing a system with four inputs and eight outputs. However, routing the signal lines and control lines was too much of a challenge, even using a two layer board. So, scaling things back, I wound up with a 4×4 matrix that was barely manageable.

audio matrix switch 4x4 74hc4052 74hc595 schematic

There is the schematic for the latest ‘stable’ version. I call it a stable version, because it passes all of the DRC tests and all the nets are routed. I have another version in design, which adds ESD protection to the external audio connections in the form of high speed schottky diodes which will clip any voltage coming in that rises above or falls below Vcc and Vee.

Control will be provided by either a serial / parallel connection to the audio server PC, or from a “controller board” powered by a microcontroller. I haven’t really figured out how complex I want to make the interface yet. Control of the switch itself is fairly straight forward. Two 74HC595 latching registers are daisy chained together, forming a sixteen bit register. This register is used to provide the eight bits which tell the multiplexers which connections to make. Each multiplexer has a two bit interface, A and B, which selects one of the four IO channels to be connected to the COM channel. I selected the 4052 multiplexer which is internally divided into two sets of four channels each, ideal for stereo I thought. So the first eight bits of my 595 register are connected to the eight control lines on the 4052’s. Second, to provide a “hardware mute” or “output enable” feature, another four bits of my 595 register are connected to the /Inhibit (enable) control lines on the 4052’s. This allows the output of each 4052 to be electrically disconnected from all the sources. The final four bits of the register are used to power four “general purpose outputs”, perhaps to control relays, external indicators, whatever. The control lines connecting to the GPO header have inline resistors, to limit current draw to a safe level, so not to damage the 595 in the event of a short or connection to an unsuitable load. The four bits connected to the inhibit lines are also connected to four LEDs, so I can see which zones are active.

The 74HC4052 is an “analog” multiplexer, in that it allows voltages other than digital 1’s and 0’s to pass through. It is also a bidirectional multiplexer, allowing current to flow in either direction. This allows the multiplexer to handle the “AC” nature of an audio signal. In order to allow a true bipolar sine wave to pass, the 4052 requires a dual rail voltage supply. For simplicity, I will be using a five volt supply with positive and negative outputs.

two layer pcb layout audio matrix switch

Here is the ‘bare’ pcb layout, without the top and bottom pours rendered. This is a composite, showing both the top layer and bottom layer at the same time. It’s easier to follow the traces this way I think.

two layer pcb layout audio matrix switch

Adding in the ground planes or copper pours, it makes the board look mostly purple. I tried to maximize the size of the pours, to help minimize any interference or crosstalk. Although, at such low frequencies, I don’t really expect much trouble.

pcb parts layout silkscreen audio matrix switch

Finally, the board with just the silkscreen or layout layer selected. This again, is a composite, showing parts on both the top and bottom of the board, which makes it look like some of the parts are overlapped.

There is a lot more to come on this subject, but it will be a while. Overall, this was just a fun project to draw, and hopefully one day it will actually get fabricated. I need to figure out how complex I want the interface to be, and what options I have for interfacing with the audio server.

Another hair-brained idea!

One of these days, I’ll get around to re-wiring my house, however there are a number of obstacles in the way … the largest being the 2ft of clearance between my crawlspace and my floor joists.

Along with plenty of 20a rated outlets to go around and ethernet glaore, one thing I’d like to have is music in every room, well, nearly every room. I’d especially like to have audio in the kitchen, work shed (attached), bedroom and dining room. The bedroom would be a special case, I’d like to have the audio system, and an additional thin/fat client for full AV usage.

My idea for the audio system revolves around using a linux server. Here’s the basic idea … each room would have a small LCD screen and some buttons (or maybe old pda’s?). So I’ll call that the interface, whatever it ends up being. Each interface will be able to select the source (perhaps four or five source channels, whatever I can get away with, plugging cheap sound cards into my linux box). If the source is digital, i.e. mp3, the interface should be able to pause playback, next track, previous track, random track. The interface would also need to present a pre-programmed list of Internet radio stations (my main source of music, I have a very small cd/mp3 collection). In the case of internet radio, the interface should let me select the previous station, next station, random station, play, pause, etc. When using a live source, cable, tivo, etc, I dont want to mess with an inter-device interface, so, the only option would be mute. For any source, the interface will also provide a local volume control.

MPG321 and the linux kernel modules apparently have support for multiple DSP audio devices, so a rather simple script should allow for a specific input (file or live) to be routed to a specific output. For mixing of sources, that is, two rooms want the same source, I plan to use a series of analog multiplexors, designed for just this application. These simple ICs can be controlled by the server, and connect specific analog ouputs to specific analog inputs. For example, a 8 channel mux arranged as 2×4 will allow a single stereo output to select from a choice of four inputs. So one IC is required for each stereo output, allowing each source channel to select any of the four sound cards as inputs. A similar IC setup would be used to allow the sound cards to share live-output sources (tivo, cable) as inputs, connecting their line-input to any live source available.

I’m not sure about distribution. I could either go with matching transformers, and send line level signals over cable to the room, and use local amplification… or, I could go with central amplification and just use some heavy speaker wire to drive speaker jacks in the rooms. My house isn’t huge, so there wouldn’t be any runs more than 50-70 ft, so inexpensive 14ga speaker wire should serve nicely … I’m not looking for killer sound while I’m stir-frying … just want to be able to hear the tv or shoutcast stream without having to blast my stereo at the opposite end of the house. The advantages I see of central amps, I can build up a big power supply using old computer psu’s, and drive inexpensive car-audio DC amps, one for each source. The server could control the power to the amps, turning off unused sources. Secondly, line level signals are really low voltage… trying to send them over a long run of wire seems to be asking for trouble … unless I use something expensive like RG58 or RG6. Local amplification also means I need to locate an amplifier somewhere in the room, and provide power for it … not that big of deal I suppose.

This project is a long ways off, but its something that keeps crossing my mind, so I figured I should write it down.

Later!