Last Modified: 20 Apr 2013


Input Signal Selector and Line Buffer Pre-Amp


aurora-owston4c.jpg




T

he original problem was a state of being sans pre-ampliifer, resulting in this mess:

misc/phono-leads.jpg


... whereby equipment is simply plugged one into another as and when required. Not at all a convenient way of doing things.

Can't go on like this, need a kosher switch box to connect everything together.

Also, my 801A amp's PSU box sat on the floor in my alcove. Anyone who's seen my alcove knows what I'm on about.

This alcove seems to have the propensity to trap and amplify even very quiet sounds. Which being a closed in space I suppose is not unreasonable. Despite being piled full of shelves and stuff. Thing is, in my "normal listening position", it's only a couple of feet away. That was the whole point of the arrangement, so that I can just reach out a paw to twiddle a volume knob or whatever without having to get up....

However, even small mains transformers in any gizmo on the shelves may be clearly heard if the room is very quiet.

To cut a long story short, the (old) 801A amplifier PSU box used to hum quite badly.


Migration
Now here's a radical idea, how about move the whole power amp to somewhere else in the room? *Somewhere out of earshot ~ seemples!

Most obvious place, same wall where the speakers are. Brilliant.

Only problem then is, that's where the main vol control would be as well.

I had a rummage through my various plastic bags and boxes, and found I'd got nine pairs (EIGHTEEN) of SIL reed relays, several more 12V DPDT relays, so we can make a relay switched switcher box! I'd got an ally case; a 2 x 12V mains TX, some spare NE5532 dual audio op-amps, + and – 12V regulators; a usefully sized piece of genu-wine Vero stripboard; 28 spare gold plated chassis phono sockets (if I take 'em off two old amp chassis in the shed). It can also have a "master" vol control on it and whatever else, and at arms reach.

I'd used these reed relays before in a much much modified and hybrid-ised (with FET's and bipolars) Maplin Newton pre-amp, and while the pre-amp ended up as pants, the reed relay selector switching was quite successful. Apart from the bodged logic control circuit.

The point of using reed switches is, of course, that the switch contacts are sealed against dirt and oxygen, possibly in a vacuum (?) A poor or intermitent signal due to 'dirty switch contacts' is just not going to happen.


Controller
So the next idea was use something more sophisticated, like a PIC micro-controller.

Certainly one nice idea was just two buttons for "up / down" sequence of input channels. Would mean much less clutter on the front panel. How complicated would it be to make a microchip also output to a single digit LED display? Which could tell you three things: A. it's switched on (it glows ); B. "channel number" selected 1 - 9; C. '0' = muted. For example. This could be simply done by just 4 bits to switch up to 10 separate things, using a SN7445 BCD to decimal decoder/driver, and a SN7447 (on the same port bits) to do the 7-segment display. All the MPU has to output is then a digital number.

This needed a couple of days familiarising myself with the PIC instruction set, using the free simulator download from the mplabs website. Memories of fiddling with 6502 assembly code came flooding back. *. I also treated myself to a PICkit 2 programmer kit (discontinued, superceded by PICkit 4), with a handful of PIC16F505 MCU's.

Pretty soon I seemed to possess a nearly fully functional controller program for the switcher box. Only the 'up' / 'down' selector buttons coding left to do. The mplabs assembler/simulator and wotnot package is really excellent.

I then found an extra feature, the simulator has got a 'stimulus' window. Basically means can run the code then change an input port pin state (of your choice) so it's got actual input to respond to.

Using go low for half a second simulates pressing one of the control buttons. The pins must start at logic high to assume pull-up resistors to start with, but that's set up by adding them to the stimulus window list of entries as well. Well neat.


PIC
The PIC16F505 looks just like any other ordinary 14-pin DIL IC but still remarkable to think that there's a complete computer inside. Albeit a little one. It has two ports B and C, of 6 pins each (bits 0 - 5).

Pin 1 = Vdd (+5V); pin 2 = RB5; pin 3 = RB4; pin 4 = RB3; pin 5 = RC5; pin 6 = RC4; pin 7 = RC3; pin 8 = RC2; pin 9 = RC1; pin 10 = RC0; pin 11 = RB2; pin 12 = RB1; pin 13 = RB0; pin 14 = Vss (0V).

I added an extra option to the program to be able set up how many inputs you want it to switch, ranging 2 (minimum) to 9 (maximum), and merely depends on how three pins of port B are wired up.

Code:
Port B bits:
RB5    RB4    RB3     
000= 2
001= 3
010= 4
011= 5
100= 6
101= 7
110= 8
111= 9

Port B bits:
RB0 = decrement button (go down)
RB1 = increment button (go up)
RB2 = mute button, toggle press-on / press-off


If mute is on and either up or down pressed it just un-mutes keeping the same selection.

Port C bits RC0 - RC3 is the 4-bit binary output for the SN7445 BCD to 1 of 10 decimal decoder/driver, which is the thing that actually switches the reed relays. This has open collector ouputs for up to 30V @ 80mA. The same port C bits also feed the 7-segment decoder/driver SN7447.

So got me PICkit2 starter kit, complete with sample MCU chip, plugs straight into the mplabs assembler/ simulator and works a treat.

There are a number of example programs to demo it with. Surprisingly easy to program the chip, make sure you've assembled everything ("build all"), then "program" zaps it to the chip and it's running straightaway. It's an EEPROM so you can do it as many times as you like, spleshly if you've made a balls up in the code and need to edit!

The PICkit2 just needs a USB. That's all I've got on my notebook so that's why I chose it.


This kit only does the 8, 14 and 20-pin chips, which I think is up to PIC16 families. The IDE will tell you which ones are compatible with PICkit2 or not when you select a device to use.


Note there are various PIC "families", and it appears each has its own variation of the instruction set. Best place to get the instruction set is the PDF datasheet on the RS web page for that particular device, and just go by that.

You can run the IDE without a programmer just to have a play with it.


And here it is doing it: *

misc/switcher_mcu.jpg



Lastly, I worked out how to make it auto-increment/decrement if you hold the button down.


This is the final (to date!) schematic, combines audio paths with the controller.


Click for larger image




Construction
Mon Nov 22, 2010
Slight coke up on the regulators front.

Thought I'd bought a –12V regulator, (a while ago, during tone controls musings No. 4 or something).

Turns out it's a –5V! Bum ~ I select-i-choosed the wrong item. More on order.

Also, couldn't find the +12V equivalent bought at the same time, must've used it recently but can't imagine what on. However found an "old" one amongst me semi's spares. Also a +5V for the logic supply so that part is taken care of.

Press on rewardless, gradually piecing together the supply and ground buses.

This is how it started initially, with chips and relays on. A fair few more wires to go on yet though. The layout changed somewhat however later on...

misc/switcher-brd1b.jpg



See what I mean about "a few more wires"

misc/switcher-brd2b.jpg


Guaranteed to drive you very slightly crackers...


Fri Dec 17, 2010
I have just whiled away a few merry hours trying to find out why the PIC chip won't work.

It works in the programmer, but wouldn't work in the board. Just sits there. Does nothing. What are supposed to be outputs seemed to be high impedance.

Turned out, in the template assembly file I used, the blasted external reset is turned on! And as I am using this pin as one of the port B inputs to set the maximum number of channels, and because it is tied low (8 channels not 9), it was constantly stuck in reset mode! *

Anyway works now, me 7-seg display lights up and the reed relays connect and evryfink.

The 5V reg is going to need a bit of metal screwed onto it. The 1.6k dropper resistors for the LED display get surprisingly warm, but then I'm using what will ultimately be the unregulated raw 16 Volts to supply the LED current, so's it won't appear on the 12V rail.



Hiatus & Long Leads
Sun Jun 12, 2011
Time gap because A. I couldn't be asked making a case for it (but found enough scraps to throw one together with a minimum of hassle, so now it's in a case! Hoo-rah .. * ); B. another reason was couldn't decide what the actual analogue electronics should consist of. Well the necessary essentials rapidly became apparent latterly, so a final plan could take shape.... all of a sudden just like that...

What happened was, in the interim the main amp and stepper vol control were moved to the other wall where the speakers are (see top of page), this then required 6 - 7 metres long interconnecting signal leads to reach.

The first were just cheap "shop bought" ordinary ones, just as something that will work in a hurry, so at some point these were always going to be upgraded, which I did eventually by making these about a week ago ~

misc/long-cables.jpg



These are made with 'Evolution XPC OFC' instrument cable, 6 or 7 metres, can't remember which exactly, but total capacitance 870 pF (available in 20 metre lengths from Rapid Electronics). The "shop bought" ones were 1,400 pF each, so this is a helpful change, although 1,400 isn't that bad to be honest for the previous. Maplin or Rapid gold plated phono plugs on the ends.

Now, the Ambit FM tuner and the CD players, even the Akai tape recorder, have no problem driving long leads as they have op-amp type output buffers, and could cope even with the hi-capacitance shop-bought type with nary a hint of a problem.

The phono pre-amp, on the other hand, was struggling. The 'Evolution' leads were a huge improvement, but still "could do better" ~ albeit it's just a gnat's wotsit's worth of difference... or is it?


Constructional pictures thus far....

misc/switch-box1.jpg



Front panel buttons and 7-segment display ~ top is 'up', centre is 'down' and bottom is 'mute':

misc/switch-box2.jpg



Back of the buttons / display board. Later, 100nF ceramic disc caps had to be added across the contacts to prevent spurious tripping of the MPU, which is sensitive to spike type noise, even from th mains wiring in the case!

misc/switch-box4.jpg



Close-up of the main board and rear socket wiring. In the end there are 7 input pairs and 2 parallel output pairs, so the controller was subsequently reconfigured for 1 - 7 inputs (instead of 8 as initially).

misc/switch-box3.jpg



The power supply section is very simple, 2 x 12V @ 1A mains transformer wired as 12 - 0 - 12, SIL bridge rectifier to make plus and minus rails, 2 x reservoir caps, regulators are on the main board.

misc/switch-box5.jpg



Rear sockets wired up. An original idea for tape monitoring wasn't used in the end, so the larger Tianbo DPDT relays at left end of board were ultimately removed.


misc/switch-box6.jpg




The switched signals from the reed relays go into a NE5532P dual op-amp as a unity gain buffer. They were biased with 100k Arcol carbon composite resistors, latterly replaced with a 100k Cosmos Tocos dual potentiometer, then the op-amp inputs are shunted to ground with 2 x back-to-back 5.1V Zeners by way of input protection.

The unit has worked faultlessly ever since initial construction. Early-on some people were trying to tell me that reed switches open themselves sporadically, or intermittently, or bounce, if the signal Voltage is large, or something or another, but which of course seems to be yet another case of "Internet myths & legends".

The low impedance output drive is good enough to allow entirely volume contol-less power amplifiers on the other ends of the 6 metre long Evolution leads, which also run behind a temp. controlled 1 kW radiator along with a bunch of other mains leads, and there's no mains noise pick-up whatsoever.



*