Where to put decoupling caps when using voltage regulator

Blazemaguire

Senior Member
Hi,

I'm running a 20m2 circuit with a 12V 5A DC power brick. (the 12V is powering a stepper motor through a L298n driver)

I'm intending on using a 7805 to drop to 5V necessary for the PICAXE. Where should I fit the standard (ish) 104 ceramic and 100uF electrolytic decoupling capacitors? (I'm good with bolting circuits together, but this side of things is beyond my level of understanding).

Do they go between 12V and 0V (as close as possible to the source) or do they go after the voltage regulator? (i.e, between Ref(which goes to zero volts anyway) and the regulated 5V output? or... do they go in both places? As I don't really know the theory for why they are necessary, I don't really understand where to place them either!

I've had my rig successfully working on a breadboard on the bench, but running from a PC power supply that supplies 5V and 12V on different rails (also, with some decent noise prevention included I'd imagine?) I just put the caps on the 5V rail on my breadboard for now, but as it worked with and without them, I don't know if that's correct!

I'm in the process of transferring to a PCB design now, which will be using a different PSU and onboard regulation to 5V.

Also, if anyone has any other recommendations for making this kind of circuit reliable let me know. It's a one off project for somebody and I would like it to be as reliable long term as it appears to be on my bench setup at the moment. - to Clarify, I'm not experiencing any issues with noise / PIC resetting / as yet. But I'm wondering if the PC powersupply is somehow shielding me from a poor circuit design.

I've read the 7805 is not very efficient as far as regulators go, but efficiency is not important as it's not a battery powered device. The regulated only has to supply a PICAXE, a few LEDs and an MP3 sound module board so shouldn't be drawing anyway near its 1A limit.
 

techElder

Well-known member
Think of these caps as "reservoirs" for short switching transients. Put the big one near the regulator. Put the small one very near the PICAXE.

Consider extra caps very near the motor controller.
 

hippy

Technical Support
Staff member
I normally put a large electrolytic before the regulator but it depends on what the power source is, and maybe a 100uF after it. Two 100nF close to input and output of regulator and across the power pins of each of the chips.

If you are building a motor controller then it may need bigger electrolytics on the input and perhaps diode splitting to keep the voltage to the regulator stable as the motors draw current. Though perhaps not.

I always think of decoupling capacitors as springs working as suspension for the power rails, dampening any bounce induced into them, reservoir capacitors like water header tanks which can handle varying water flows without running dry when you suddenly pull a lot of water in a short burst.
 

Blazemaguire

Senior Member
Thanks guys,

So I can't really do much wrong with a belt and braces approach? (one near the source, one on the reg, one near the PIC and possibly some near the L298n power connectors)

PCB Real estate space or component count is not an issue, so as long as I can't 'over do' it, then I think I'll go with all the suggestions above. Capacitors are cheap!
 

Blazemaguire

Senior Member
* And thanks for a nice analogy Hippy with the header tank. That's kind of what I thought was going on, but I couldn't really see why location on the PCB would make a difference.
 

Blazemaguire

Senior Member
And Hippy, could you explain what you mean by 'diode splitting' ? sorry, to pick your brains, but I'm at that stage with my electronics learning where I've got all the basics down, pretty much on top of programming and found out most of what you can learn from the manuals. I just don't know all the 'tricks of the trade' yet...
 

BESQUEUT

Senior Member
And Hippy, could you explain what you mean by 'diode splitting' ? sorry, to pick your brains, but I'm at that stage with my electronics learning where I've got all the basics down, pretty much on top of programming and found out most of what you can learn from the manuals. I just don't know all the 'tricks of the trade' yet...
Think the diode as a one-way link to the tank :
- Picaxe can draw current from the small capacitor,
- but the motor cannot (because it is as the opposite side of the diode)
Code:
Regulator --> large Capacitor |--> DIODE --> Small Capacitor --> Picaxe
                              |
                              |------------- Large Capacitor --> Motor
 
Last edited:

Blazemaguire

Senior Member
Ok. I kind of get what you mean. Is the Diode in series with the cap or parallel? And do you mean the cap near the PIC, or the cap near the motor driver?

Do you not also get a voltage drop across adiode that would be giving less than 5V to the PIC?
 

BESQUEUT

Senior Member
Post #7 updated...
Do you not also get a voltage drop across adiode that would be giving less than 5V to the PIC?
Yes : Picaxe is very tolerant if voltage is stable, but crash if voltage fall below 3V even for a very short time.
==> IE the small (and very quick) capacitor very close to the Picaxe (decoupling capacitor).

(Small capacitors are quicker because their internal resistor is very small)
 

Blazemaguire

Senior Member
Thank you very much, and thanks for the diagram. However, my motor is not running through the regulator, it's running from the 12V, so do I still apply the same logic. Also, that diagram (to my mind) appears to show the capacitors in series with the regulator, I always thought it was parallel that they were placed?
 

erco

Senior Member
I've read the 7805 is not very efficient as far as regulators go, but efficiency is not important as it's not a battery powered device.
Nonetheless, that's a big drop from 12V to 5V. The more current you draw, the more gets dissipated as heat through the 7805. Pure waste. IMO linear regulators should be avoided (if not outright banned like incandescent light bulbs) for "best practice" when you can get a far more efficient buck converter module for as little as a dollar (a true "buck" converter). Order a few to use in future projects. http://www.ebay.com/itm/Buck-Converter-Step-Down-Adjustable-Converter-Power-Module-Regulator-LM2596-HY-U-/261956897110
 

Blazemaguire

Senior Member
I happen to have one of those in my parts pin. You'd recommend it over the 7805?

Only issue is it's not as neat when making a custom PCB, as it would need piggybacking onto it.
 

BESQUEUT

Senior Member
However, my motor is not running through the regulator, it's running from the 12V, so do I still apply the same logic. Also, that diagram (to my mind) appears to show the capacitors in series with the regulator, I always thought it was parallel that they were placed?
OK : no need for the diode in that case.
YES : capacitor must be connected "parallel" (the diagram show the current travel ; it's not a wiring schematic)
A Picaxe only need few mA ; so a 7805 can be tolerate if it is the only energy-consuming.
But I agree to erco suggestion.
 

Buzby

Senior Member
Just beware with those ( or any other ) buck or boost convertors.

Set the voltage, by using the trimpot, before connecting it to your circuit.

I bought a few, and all were preset at their maximum voltage when delivered.

( Only took one very hot PICAXE for me to learn this ! )

Cheers,

Buzby
 

hippy

Technical Support
Staff member
A diode (D1) before the regulator and its input reservoir cap can still be useful even if you are not powering the motor through the regulator. If the current draw by the motor causes the input voltage to drop the diode will stop the reservoir emptying, will keep it up and running the regulator and hopefully the electronics until the input voltage recovers.

For example ( though different regulator ) here ...


http://lh4.ggpht.com/_FdGFE8NBDgc/S4vRQAtA_NI/AAAAAAAAB9w/mhY6S-EoFjw/9V_dc_regulated_power_supply.GIF

You can take the 12V to the motors from the "in" connection, anode of D1.
 
Top