Effect Switching: Questions about keeping things quiet and digital.

Started by David, March 23, 2012, 11:56:34 AM

Previous topic - Next topic

David

My issue with the "power fail bypass" that I posted earlier got answered so quickly and so elegantly that I can consider that problem solved and move on to another big one.  I've been wrestling with doing the bypass switching for my integrated pedalboard digitally so I can locate the actuators an arbitrary distance from the effects themselves and not have them carry audio.  In the interest of keeping the length of wires that have to carry audio as short as possible, I have decided, after much wrangling, to do my effect switching with a PIC and a 4066 for each effect.  I would be using either a PIC16F628 or 16F648.  Basically I would be automating a lot of what the "Wicked Switch" does.  The PIC can read the pushbutton, which can be arbitrarily far from the effect it's selecting and it can send the necessary bits necessary to select portions of a 4066 to enable or bypass an effect pedal.  It's pretty simple, and good ol' Nigel Goodwin already did the hard work.

I had tried to use a single PIC to handle selection of 8 pedals, but that would have required that I use inverters also to give me the select and "not select" logic signals.  It just seemed like that got real complicated real fast.

Anyway, what I'd like to know is if I will run into any kind of trouble if I power all these PICS and 4066s from a single 5V power supply.  If so, what, and how would I address it?  Also, is there anything that I can proactively do to address noise before I create it, like star grounding or leaving shields unconnected?

R.G.

Quote from: David on March 23, 2012, 11:56:34 AM
... so I can locate the actuators an arbitrary distance from the effects themselves and not have them carry audio. 
There are small, cheap RF transmitter/receiver sets which serve much the function of remoting a logic change out to the full range of the RF. They're about $20.

How and why do I know this?    :icon_lol:
Quote
I had tried to use a single PIC to handle selection of 8 pedals, but that would have required that I use inverters also to give me the select and "not select" logic signals.  It just seemed like that got real complicated real fast.
Just use two output pins and make one be high when the other is low. No inverters needed. Or use an NPN or small MOSFET for the inverter.

QuoteAnyway, what I'd like to know is if I will run into any kind of trouble if I power all these PICS and 4066s from a single 5V power supply. 
Sure. It's just that you don't want your logic supply ground connected to your analog ground in any meaningful way. In particular, you don't want them sharing current flow through any length of wire.

QuoteIf so, what, and how would I address it?  Also, is there anything that I can proactively do to address noise before I create it, like star grounding or leaving shields unconnected?
1. Do not use the 9V supply which powers your pedals to also make the 5V for the logic.
2. Connect the grounds with exactly 1.0000000 wires, verifying that they do not connect when you open the wire, then connect when you do. Or use a 10R, 1K, or 1M resistor instead of the wire.

This is hard because you have to think of where the current goes, not where the voltage is.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

David

1)  I actually meant the "footswitches" might be 0 to 24 inches from the effects, not THAT remote.

2)  This is what I had planned to do.  I had also figured out that I could create an inverter from a transistor.  I was considering parking one out with its accompanying 4066.  I thought I'd do a feasibility study of just using a PIC for each effect.

3)   Regarding the power supply:  I was planning to feed my pedalboard with the wall wart from a Dunlop Power Brick.  It puts out 18VDC at 1 amp.  My plan was to separate out 15V from this to run an AMZ Super Buffer, 9V for the other effects and 5V for the logic circuits.  I understood from your comment not to supply power for the PICs and switches by tapping 5V from the 9V portion of my power bus.  Is having a separate 5V bus not enough?  Am I going to need a secondary power supply that outputs regulated 5V for the logic stuff?  Or do I need to investigate some kind of Spyder thing (which should be interesting -- didn't someone say those transformers were unavailable?)

R.G.

Quote from: David on March 23, 2012, 02:08:24 PM
1)  I actually meant the "footswitches" might be 0 to 24 inches from the effects, not THAT remote.
Well, OK, but you can really get REMOTE if you want.  :icon_biggrin:

Quote3)   Regarding the power supply:  I was planning to feed my pedalboard with the wall wart from a Dunlop Power Brick.  It puts out 18VDC at 1 amp.  My plan was to separate out 15V from this to run an AMZ Super Buffer, 9V for the other effects and 5V for the logic circuits.  I understood from your comment not to supply power for the PICs and switches by tapping 5V from the 9V portion of my power bus.  Is having a separate 5V bus not enough?
It's the shared ground return that bites you. A separate 5V bus doesn't necessarily separate the grounds.

QuoteAm I going to need a secondary power supply that outputs regulated 5V for the logic stuff?
These are very, very common, and this is probably simpler than the debugging you'll do. It is not impossible to make a single all-in-one analog/digital power supply work. But it's not necessarily simple or easy.

QuoteOr do I need to investigate some kind of Spyder thing (which should be interesting -- didn't someone say those transformers were unavailable?)
This is the internet. Somebody, somewhere has said everything. I believe Weber speakers still sells them. I'm sure there are places where they are unavailable or too expensive. But it's quick to find out.

And +5V output wall warts are very, very common - like in your local Goodwill or computer salvage store for a couple of bucks. Shoot, you can get a 1Spot for about $20 to power only the logic, if it comes to that.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

MetalGuy

QuoteIt's just that you don't want your logic supply ground connected to your analog ground in any meaningful way.

One question:  PIC's outputs are connected to ULN2803 inputs (the chips are next to each other) which drives analog signal relays. Is ULN's ground pin analog or digital ground?

David

I don't know, Metal.  Sorry.  I'm just planning to interface a PIC to a CD4066 quad bilateral CMOS switch for each effect.  No ULN or relay need apply.

Cliff Schecht

You could run the 5V stuff off of a non-isolated (but well filtered) switcher set for 100 kHz+ operation. A simple C-L-C filter at the input should be enough to keep digital/switching hash from making it back into your other supply rails. And like R.G. said if you connect both digital and analog systems together with a single grounding point then you should have no problem controlling the digital return currents. The best thing to do honestly is to connect the grounds for each power supply together only at the bulk filtering on each supply, this is where the ground return currents eventually end up anyways and so you will have the lowest resistance path for the return currents to flow.

Cliff Schecht

Quote from: MetalGuy on March 23, 2012, 05:46:23 PM
QuoteIt's just that you don't want your logic supply ground connected to your analog ground in any meaningful way.

One question:  PIC's outputs are connected to ULN2803 inputs (the chips are next to each other) which drives analog signal relays. Is ULN's ground pin analog or digital ground?

They are switching to either on or off so I'd treat them as digital.

Also it might be worth mentioning that limiting the rise/fall times of the switching signals would help keep switching noise down. Fast rising/falling edges create "broadband" energy (aka EMI) that can leak all over a system. It's common practice in switching power supplies to limit the rise/fall times for various reasons, one of them being to control EMI.

David

Not to beat this to death, but now that it's been dragged into the realm of the possible, I need to probe it a trifle further.
OK.  To keep "digital hash" to as low a minimum as possible, I could go back to my idea of using a single PIC to send logic signals to all the effects.  There would have to be a couple that are not controlled by the Great Brain, if you will, but that isn't a showstopper.  Anyway, so posit that I'm back to one PIC.  I would be sending a logic zero to select an effect and a logic one to bypass the effect.  Each effect would have a daughterboard with a 4066 and a discrete inverter implemented with a transistor and 2 resistors.  This way, if the effect is bypassed, I'm only sending a logic 1 to select the 4066 sections that bypass the effect.  The logic zero would cause the inverter to generate a logic one.  This would turn on the indicator LED and turn on the switches that pass signal through the effect.

If I do this, I'd be powering the Great Brain, the inverters and the 4066s through the secondary 5V power supply.  If I add power supply decoupling to the chips, could this eliminate the digital hash?

Cliff Schecht

With careful grounding digital hash shouldn't be an issue. Just sending a static "1" or "0" won't cause digital hash and so as long as the microprocessor has a solid ground that is separate from the digital ground (connected together at only one point, preferably right where the digital side decoupling caps get grounded) then you shouldn't have a problem. The trick is controlling return currents and keeping analog-side and digital-side currents separate as much as possible.

I've designed systems that include multiple switching power supplies, a microprocessor, Bluetooth or some sort of RF modulator and very high gain analog (up to ~150dB) all on one or two boards depending on the application. I was amplifying 100nV and seeing NO noise from any of the other digital/switching/RF parts of the system. Remember most of that stuff is operating at frequencies much higher than audio so as long as you keep everything switching well above say 50 kHz, you shouldn't be hearing anything there. With careful layout and lots of decoupling (I like using a range of values from 1000pF to 10uF because as one falls off impedance-wise the next higher value takes effect) you should be fine.

defaced

Quote from: MetalGuy on March 23, 2012, 05:46:23 PM
QuoteIt's just that you don't want your logic supply ground connected to your analog ground in any meaningful way.

One question:  PIC's outputs are connected to ULN2803 inputs (the chips are next to each other) which drives analog signal relays. Is ULN's ground pin analog or digital ground?

Everything on the coil slide of the relay/control side of the 4066 is digital
Everything on the switch side of the relay/input/output side of the 4066 is analog

Ref: http://www.ti.com/lit/ds/symlink/cd4066b.pdf

If you start this sort of project by drawing functional blocks, the division point becomes much easier to see.  It also makes designing the grounding easier too because all you see are functional block, signal/logic wires connecting the blocks, and ground connections.  So choosing a suitable earth ground location and inter-block ground is much easier to do.   

Quote from: David on March 23, 2012, 10:39:26 PM
Not to beat this to death, but now that it's been dragged into the realm of the possible, I need to probe it a trifle further.
OK.  To keep "digital hash" to as low a minimum as possible, I could go back to my idea of using a single PIC to send logic signals to all the effects.  There would have to be a couple that are not controlled by the Great Brain, if you will, but that isn't a showstopper.  Anyway, so posit that I'm back to one PIC.  I would be sending a logic zero to select an effect and a logic one to bypass the effect.  Each effect would have a daughterboard with a 4066 and a discrete inverter implemented with a transistor and 2 resistors.  This way, if the effect is bypassed, I'm only sending a logic 1 to select the 4066 sections that bypass the effect.  The logic zero would cause the inverter to generate a logic one.  This would turn on the indicator LED and turn on the switches that pass signal through the effect.

If I do this, I'd be powering the Great Brain, the inverters and the 4066s through the secondary 5V power supply.  If I add power supply decoupling to the chips, could this eliminate the digital hash?
R.G.'s words on grounding in the first reply are what's going to keep any digital noise from ending up in the analog signal.  When choosing where to connect the two grounds, it's all about location, location, location.  IMO, this sentence is worth repeating:

QuoteThis is hard because you have to think of where the current goes, not where the voltage is.

Think of every ground path as a wire with resistance.  And remember that V=IR, so every "ground" conductor that has a current flowing through it is some voltage away from true 0v.  
-Mike

PRR

> PIC's outputs are connected to ULN2803 inputs (the chips are next to each other) which drives analog signal relays. Is ULN's ground pin analog or digital ground?

Like Mike said (I didn't see before typing):

It has a computer on one side and a realy on the other side. There is NO audio involved in the '2803. (The relay could be running lights or a beer-cooler.)

Bust a relay's coil and switch apart. The switch is pure audio (or lights or beer). The coil is pure logic. Of course the coil has to hit the switch to do your job, but conceptually they are electrically isolated.
  • SUPPORTER

PRR

> use inverters also to give me the select and "not select" logic signals.

Without thinking too far ahead:

Relays float. They can be pulled-down from V+ or pulled-up from V-.

Relays can be had double-throw. "Coil ON" can be "switch ON" or "switch OFF". Or both.

  • SUPPORTER

David

The relays bear a little more thinking about.  Thanks!

In the meantime, I'm recovering from a little surgery, so I've had nothing but time to think.  CD4053s also offer an excellent switching methodology, especially since I can send a single logic signal to manage the switching (and the LED, I would assume) for an effect.

Here's the other thing.  Except for the momentary switch actuators from Small Bear and pancake-type switches (which I have not experimented with yet, but probably will have to), push button form factor is for the birds!  I was looking at these pinball machine pushbuttons.  Some of them stand at least 1.5 inches tall.  Others are 3 inches tall!  That makes the stomp portion of the pedal way taller than I wanted.  However, I had picked up this SPST latching switch a long time ago that's a pushbutton.  If's for a floor lamp, I guess.  A Carling it ain't, but if I'm gentle with it, it might not be too bad.  Anyway, I found out these are called canopy switches.  Their form factor is sure conducive to a pedal board.

SPST switches throw a monkey wrench into the programming, though.  Polling momentary pushbuttons is easy.  Polling switches sounds like it could be interesting.  How about this?  If I have the contents of the switch port's previous state saved and then have my driver loop "poll" the switch port by subtracting the value of the previous state from the value of the switch port?  If the result is nonzero, one or more switches were toggled.  At that point, I could just copy (and possibly invert) the values in the switch port to the output port to select or unselect the proper effects. 

PRR

> SPST switches throw a monkey wrench into the programming....If I have the contents of the switch port's previous state saved

Why add more memory? Alternate-action switches ARE memory. They remember their on/off state. Poll the switch. If ON, do "A", if OFF, do "B"; where A and B are audio/logic/switching actions and should probably include an LED action. (The switches have memory but do not have a readout.)

You could do a lot with these things and _no_ CPU/PIC. They can hold their state and directly drive relay coils, CMOS switch inputs, LEDs, even a 100 Watt lamp.

OTOH, stomping these switches will break them. One reason they are so very cheap is that there is a huge replacement market in just finger-push applications. But as you say the size and price are worth trying.
  • SUPPORTER