Dual voltage regulating help

Started by WickedBlade, June 23, 2009, 04:45:54 AM

Previous topic - Next topic

WickedBlade

Hello,

my pedalboard project involves relays, an input and an output buffer, as well as a PIC microcontroller and associated digital wizardry. The PIC and relays need to be fed with 5V DC, and I figure the buffer opamps will use that too. To keep noise down, I was advised to keep the power supplies for the relays and buffers separate from the digital power supply, but I'm wondering if I made the correct design choice.

Basically my pedalboard will be fed with a 9-12V power supply, and I will have 2 voltage regulating circuits, one for the digital side, one for the other side.

I've made a quick schematics of what the "dual" power supply will look like. I didn't know how to represent the input 9V so I used those +9V and -UB thingies, please ignore that, just think of it as the power input...  Given the schematics, the input could be anything AC or DC, from 9 to 12V or more, but I'll probably plug a 9V or 12V DC adaptor.

(schematics link)

Basically in this schematics, I plan to wire the 2 grounds together and that's it. Can somebody tell me if there's something wrong with this design?

Also, among the digital stuff will be darlington transistors arrays (ULN2803) that will pull the relay coils to ground, while the other end of the coils will be wired to the second +5V supply. but the transistors arrays will be fed with the first +5V supply. I'm wondering if that will be a problem and if I need to do something to ensure that both +5V supplies work well together (simply wire them together?!). Any ideas?

BTW I'm not sure if i should post in the digital section, feel free to move the thread if that's so.

cpm

wont need diode bridges if you are using DC. even if you use them, you can put both 7805 sharing the same DC "in".
you could also use another 7809 for your opamps, since 5v may be a bit short (some wont even work), or even make a bipolar using a charge pump?

what i have done without problems in projects like this is separate 7805 for (5v relays), shared with logic (cmos gates, latches, etc), 7809 for audio path. If using a PIC i would also make its power independent

WickedBlade

I'm going to use an OPA2134 for the opamp, the datasheets say that it works from 2.5V to 18V, so that's covered.
The reason that there are 2 bridges is simply that the first regulating circuit is actually part of the PIC PCB I bought, and I'd rather plug the second circuit to the DC source instead of hijack the PIC PCB to get the rectified supply. All of this is of little relevance since I'll use a DC power supply, but I like the idea that the hardware will be protected in case I accidently plug something with the wrong polarity or voltage, otherwise I'd just use a 5V power supply and be done with it :)

You say that in your projects the logic circuit shared the relays power supply. I was told that this might not be good, noise-wise. Do you confirm that it's not actually a problem?

Anyway, if separating power supplies between PIC and the other stuff (relays and darlington arrays), one of my question still stands: the darlington arrays are triggered by the PIC, but they will use a different +5V source than the PIC (and associated shift registers), so how can I be sure that this works?

cpm

Quote from: WickedBlade on June 23, 2009, 05:53:58 AMYou say that in your projects the logic circuit shared the relays power supply. I was told that this might not be good, noise-wise. Do you confirm that it's not actually a problem?

neither relays or logic chips share power with audio path so there should be no noise induced, which usually is caused by big voltage swings on logic transitions from low to high levels and such.

Quote from: WickedBlade on June 23, 2009, 05:53:58 AMAnyway, if separating power supplies between PIC and the other stuff (relays and darlington arrays), one of my question still stands: the darlington arrays are triggered by the PIC, but they will use a different +5V source than the PIC (and associated shift registers), so how can I be sure that this works?

will work as long as they share ground. the transistor is your "interface" with the relay functional block, any preset voltage applied to the base of the transistor will "switch" it on and current will flow, but it comes from the relay power source

WickedBlade

OK thanks. I'm cutting costs drastically now (I'm way above my initial budget :() so I think I'll keep using only 2 power supplies. Maybe later I'll add another one if need be. In the meantime, I'll power the digital stuff with the 1st regulator, and the relays and opamp with the second. Since the relays change state only when a footswitch is pressed on, I'm hoping they won't incurr much noise to the opamp...

Regarding the bridge rectifiers, can someone tell me if having both of them "linked" through the ground connection (and input power) is likely to be a problem or not, in the general case of an AC input voltage?

Also, if I'm planning to do star grounding for my relays and opamps, where should I wire my grounds? To the bridge ground, to the regulator ground, or somewhere else?

R.G.

Quote from: WickedBlade on June 23, 2009, 04:45:54 AM
Basically in this schematics, I plan to wire the 2 grounds together and that's it. Can somebody tell me if there's something wrong with this design?
"Wrong" may be too harsh. The point of separated power supplies is to keep voltage noise from being generated by current spikes, usually from the logic circuits, from causing voltage spikes in the audio by generating V = I*R voltages in the common wires. No common wires, no common voltage. It requires thinking "where is the current flowing?" rather than "what is the voltage here versus there?" and that's why it's hard. We are usually taught to think in voltages.

If I were doing it, I would bag the separate rectifier bridges. One bridge will do. And be aware that by using a rectifier bridge, you can never use the negative side of the external power supply as "Ground" for any other stuff, perhaps by daisy-chaining, because that "ground" is a diode-drop different from the output side "ground" of your power supply. If you find that diode isolation is needed, a series diode to each regulator will do fine.

I would try to do without separating the inputs like that. I would use one input bridge, then big, honking filter caps at the inputs to the regulators. I'd use the 2200uF caps here, paralleled by 10uF. That's enough to keep the front end of the regulators happy. I would take a single trace/wire from each one of the regulator grounds to the junction of the input caps, forcing the ground currents from the loads to stay separated. The outputs of the regulators need perhaps 22uF caps at the chip. Other decoupling of voltage would be done out at the chips. The purpose of decoupling is to force transient/high frequency currents to flow in small, tight loops right at the chip causing the disturbance. That way it can't cause V=I*R voltages elsewhere and the loop area of the current loop is minimized, making the equivalent transmitting loop antenna very inefficient at transmitting any radiated noise.

The purpose of regulators is to force an average DC level on the chips they supply. Being feedback amplifiers, they do not have the bandwidth to suppress high frequency disturbances by active means. They're pretty good at audio and especially low audio, but they just don't have the bandwidth to to it with digital spikes. Even if they did, the inductance of a few inches of power supply trace is enough to keep them from responding to a transient out at a chip, and for very fast logic pulses, the speed of electromagnetic waves in copper is slow enough that they can't correct in time. So use regulators to keep things honest at DC up to high audio. Then rely on decoupling caps out at the chip.

That being the case, I would run a separate "ground" trace out to the heavy current users, that being primarily the darlington driver chip. I'd put an electrolytic cap of 10-100uF out there to avoid having big pulses being demanded through long power supply lines, and also 0.1uF and 0.01uF monolithic ceramic caps between V+ and V- right at the darlington driver. From there to the relay coils, use a send/return wire pair or trace pair, not a general V+ and V- for all the relays. This forces the current per relay to be sourced/sunk from the darlington driver, with its local decoupling to help smooth things out.

QuoteAlso, among the digital stuff will be darlington transistors arrays (ULN2803) that will pull the relay coils to ground, while the other end of the coils will be wired to the second +5V supply. but the transistors arrays will be fed with the first +5V supply. I'm wondering if that will be a problem and if I need to do something to ensure that both +5V supplies work well together (simply wire them together?!). Any ideas?
Do not do this. The transistor arrays strictly speaking don't need +5 to operate at all. They have it connected as a place to connect the flyback pulses from inductive loads through diodes. The actual current path is from the +5V supplying the relay coils through the coils, through the arrays, to ground, back to power supply, then out to the +5V supply again. You would be trying to force current out of one +5V supply and into the other. Run the arrays and relay coils from the same +5V supply. Watch where the current flows!

Quote from: WickedBlade on June 23, 2009, 05:53:58 AM
I'm going to use an OPA2134 for the opamp, the datasheets say that it works from 2.5V to 18V, so that's covered.
It's covered in so far as the opamp will have enough voltage to amplify. It's not covered from the standpoint of dynamic range.

Single coil pickups put out about 100mV peak. Humbuckers may easily hit a volt and "distortion" humbuckers can be 2-3V. That last can be more than 5V from peak to peak. If you have 9V available for opamps use it. You'll likely need the headroom.

QuoteThe reason that there are 2 bridges is simply that the first regulating circuit is actually part of the PIC PCB I bought, and I'd rather plug the second circuit to the DC source instead of hijack the PIC PCB to get the rectified supply. All of this is of little relevance since I'll use a DC power supply, but I like the idea that the hardware will be protected in case I accidently plug something with the wrong polarity or voltage, otherwise I'd just use a 5V power supply and be done with it :)
Better choice: take a single series diode at the input to add polarity protection; run one +5V regulator for the PIC if it doesn't have it there already; Install shorting wires across the rectifier bridge on the PIC board, ensuring you know which polarity is which on the outside connections to your raw voltage. Run your other 7805 regulator for the relays.

QuoteYou say that in your projects the logic circuit shared the relays power supply. I was told that this might not be good, noise-wise. Do you confirm that it's not actually a problem?
It's not a problem as long as the sum of ground lift on transitions and supply droop on transitions does not eat up the logic dead zone in the middle of the logic signal range. Logic is more noise immune than audio not least because there is a "dead zone" between the Most Positive Low Level and the Least Positive High Level for logic signals. If the signal at a logic gate is above or below these, it will be interpreted correctly. Yes, there can be noise issues, but those are largely in bigger logic systems.
Quote
Anyway, if separating power supplies between PIC and the other stuff (relays and darlington arrays), one of my question still stands: the darlington arrays are triggered by the PIC, but they will use a different +5V source than the PIC (and associated shift registers), so how can I be sure that this works?
You can be sure by looking at the internal schematic of the darlington arrays. On page 4 here:http://www.datasheetcatalog.org/datasheets/90/366828_DS.pdf there is a schematic of the eight drivers. These are simply darlington connections for high gain. The current from the PICs goes into the resistor and bases of the darlington. The PIC's output current can be calculated reasonably from this as a bit over 1.3mA per input. The exact +5V level at the PIC does not matter much. The ground current will be less than 10ma if all eight are on. So the cross-power supply interactions are minimal. The speeds required of a darlington driver/relay are not critical, being at fasted milliseconds, not nanoseconds.

Quote from: WickedBlade on June 23, 2009, 08:35:30 AM
I'll power the digital stuff with the 1st regulator, and the relays and opamp with the second. Since the relays change state only when a footswitch is pressed on, I'm hoping they won't incurr much noise to the opamp...
They'll only click and pop when the relays switch.  :icon_cry:

Run your audio from a different voltage supply than the relays OR the digital stuff, and only connect the audio ground to digital ground through ONE wire. That forces there to be no shared ground currents, and so no ground noise.
Quote
Also, if I'm planning to do star grounding for my relays and opamps, where should I wire my grounds? To the bridge ground, to the regulator ground, or somewhere else?
Practical "star" wiring is actually better thought of as "tree" wiring. Connect the most-closely-signal-connected "leaves" in local "stars". Connect closely related "stars" together, then connect these to the power supply trunk.

First off, branch your analog completely away from your digital as early as possible. Branching at the AC wall socket is good.  :icon_biggrin: If that's not practical, branch it after the rectifiers or after the first filter cap. And where those branches join is the first star point. Theorectically every single place "ground" happens in your circuit should have its own wire to there. But that's not practical to wire. So the split is analog and digital. The digital side (note that this means everything that works only with solid up/down signals; relay coils are *digital*) collects its own local star and you get a wire to the main star point. Analog collects all its grounds and there is a wire to the main star point.

Inside the analog, you may still have parts of the circuit using different currents. Probably you will since you are likely to be using this same supply to supply the plug in pedals. Run your opamps to an analog star point, then to the main star point.

The entire trick in grounding is to (a) consider all conductors to be resistors and (b) force the currents to flow in those "resistors" that do not cause signal reference ground shifts that get mixed back into the signal path. This is why I distinguish in my head between power ground, reference voltage ground and "sewer ground", sewer ground be the return path for all the "used electricity" that you can get to flow without contaminating the signal reference grounds.

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.

WickedBlade

R.G., thanks for the detailed answer. I think I understood 80% of what you said. I'll make a new schematics soon to make sure I got you right.

A couple things in the meantime.

All the "digital" ICs in the project do have caps at the V+/V- pins (the design is from MIDIBox.org, BTW), but I had forgotten to use them in my addition of the darlington arrays. Thanks for pointing that out.

QuoteThat being the case, I would run a separate "ground" trace out to the heavy current users, that being primarily the darlington driver chip. I'd put an electrolytic cap of 10-100uF out there to avoid having big pulses being demanded through long power supply lines, and also 0.1uF and 0.01uF monolithic ceramic caps between V+ and V- right at the darlington driver. From there to the relay coils, use a send/return wire pair or trace pair, not a general V+ and V- for all the relays. This forces the current per relay to be sourced/sunk from the darlington driver, with its local decoupling to help smooth things out.
I'm not sure what you mean by "out there". Could you explain? Do you mean at the output of the voltage regulator that feeds the darlington drivers?

The 'first' power supply is the one used by MIDIBox, I'm not sure I want to modify that regarding caps placement. Moving the bridge rectifier is probably OK though.

Regarding the opamp, I must admit I thought that the guitar signal used much lower signals, thanks for pointing that out. I guess that means I'm going to have to use a 3rd power supply regulator/filter, to feed the opamp with something like, what, 7V? I believe I can use a spare 7805 I have with a couple resistors to pull the voltage up, right?

So basically I'll have 3 power supply regulators:
- one for the opamp
- one for the relays and darlington arrays (or do the arrays get fed with the PIC supply? ???)
- one for the digital stuff
Is that right?
What filter caps would you advise for the opamp supply, BTW?

Regarding the relay coils, you're advising I have a separate V+ for each one of them. I'm afraid I can't very much afford to use up that much space in my already crowded design. Would it be so bad to have just one V+ line for all of them? I'm aware that I may have noise issues when switching state, but as the switches will turn some effects on and off, I figure I can afford a wee bit of noise in the process... (I may not have mentioned this yet, but the relays are used to make a simple effects switcher, MIDI controlled, as you probably guessed).
I might add that I included a 'backwards' diode for each coil (just alongside the coil pins) to avoid bad feedbacks when the coil is switched off. That may be relevant, or not.

Regarding the fact that the ground won't be 'reuseable' because of the diodes between the power supply V- and ground, I'm thinking it's OK because I will use a separate power supply for this unit, my effect pedals will use other power supplies, that's guaranteed.

I must say that the people on this forum are very helpful, I learned a ton of things in the few hours I've been registered! A big thank you to everyone!

WickedBlade

Just a quick note to acknowledge that I got a bit confused regarding the darlington drivers. They are not so much power supplied with +5V as given a potential so that the free wheeling diode can be used as a backlash limiting device, IIRC (I'm afraid I don't recall the correct technical term). So yes, of course, the drivers and relays shoud be fed with the same power supply.

WickedBlade

#8
OK here is the new design I came up with:
new power supply circuit

The first regulating circuit is left untouched because it's part of the MIDIbox CORE design...
I've used the same caps for the last two regulators, maybe I should have duplicated them?

I have physically represented the wire that connects the grounds from the regulators to the junction of the filtering caps (C7 & C8).
For the opamp supply I've used what resistors I have, and that would give a 7.5V supply to the opamp. I could also use 220 ohms for R2, which would give about 10.5V. The schematics say 8V because that's what I had in my libraries, but it's a gross approximation. I'm hoping 7.5V would suffice and that I won't have too much power consumption with these added resistors.
Please note that the bridge rectifier is rated to handle 1.5A. I have previously estimated that it is a good upper bound for the power consumption of my project (peaks included).

I don't know what filtering caps to put after regulator IC2, any advice? Also, is the caps type that important? I'm asking because i the first circuit, the input caps are electrolytic and ceramic, whereas the other ones (C7 & C8) are both electrolytics as it stands (that's what I have at hand).

I put a filtering cap after the opamp regulator too, but if I got it right, R.G. says that I don't actually need that because the voltage regulators do a fairly good job at filtering as long as we don't go into the digital-type noises. Or did I get it wrong?

Any advice and suggestion welcome.

EDIT: I'm not sure what to think of the voltage dropout of the third regulator now. If I feed the whole circuit with 9V, will I be able to get the expected voltage at the output of IC3? Or should I go for a 12V power supply input to be safe? I'm planning to do that anyway but I'd like to know the limitations of the design.

WickedBlade

I hate to do that but... anyone?