decoupling capacitors

vshortt

Senior Member
okay, I need to know, how critical are decoupling capacitors in a well-rounded circuit that uses relays, temp sensors, serial transmissions, and i2c bus and a buck/boost power suppy.

What recommendations do you have as to size, type and placement? seems like every place I turn to has a different idea as to these things. I'd love to hear what your thoughts are.

Thanks!
 

inglewoodpete

Senior Member
okay, I need to know, how critical are decoupling capacitors in a well-rounded circuit that uses relays, temp sensors, serial transmissions, and i2c bus and a buck/boost power suppy.

What recommendations do you have as to size, type and placement? seems like every place I turn to has a different idea as to these things. I'd love to hear what your thoughts are.

Thanks!
Your circuit would not be well rounded without good decoupling. Most of those peripherals you list tell me that you will need decoupling capacitors in a variety of locations.

It goes without saying that you would have a 0.1uF cap as close as possible to the PICAXE's power pins. Each relay needs quenching of back-emf when they are deactivated. Transmission lines (serial or i2c) are prone to noise pickup and hum loops.

Attached is an (extreme) example of how a 0.1uF decoupling capacitor can be added to a 28- or 40-pin PICAXE. You can just see the SMD cap among the top row of pins on the DIL pins. It need not be quite that close to the power pins but it is easy for a retrofit.
 

Attachments

Last edited:

BeanieBots

Moderator
IP puts it nicely. A "well rounded circuit" would include the decoupling capacitors.
With what you describe, I would say essential, but a half decent switcher circuit would include a good level of decoupling itself.
Layout will also be critical.
 

Pauldesign

Senior Member
Well, why most people and previous posts are concerned mostly about the value and ESR of caps, i'll say also consider the voltage ratings of the capacitor esp for power apps. A cap with rated voltage at least twice your supply voltage should be considered.
 

SAborn

Senior Member
As most 0.1uf caps are rather small i often just solder them to the bottom of the board across the power pins of all chips, and fold them down flat to the board.

As for voltage rating of decoupling caps, i dont know of many 0.1uf caps that are rated as low as 10 volts and would say almost any 0.1uf cap would do, but some do work better than others.

Still any is better than none at all.
 

hippy

Technical Support
Staff member
I agree with inglewoodpete's, "would not be well rounded without good decoupling". It should perhaps be more of a reverse question; can I get away with leaving the recommended decoupling capacitors out ?

"Sometimes", but the thing to look at is how complicated the circuit is, how likely the circuit is to have noise induced on the power supply that the decoupling capacitors remove or reduce. For a single PICAXE chip and download circuit running on batteries it may work without. When you add things like relays and buck/boost power supplies you are moving towards likely not, best to be on the safe side and fit them.
 

Dippy

Moderator
Absolutely.
They are a good idea in any circuit and manadatory in noisy circuits.
A well rounded pukka circuit will also have decoupling on the reset pin too.....

When used as chip decoupling there are several things to consider, including:-
1. Noise from circuit getting into chip.
2. Noise from chip getting into circuit
3. In some cases crowbar pulses (e.g. old 555).
A good ceramic capacitor 'diverts' a lot of HF noise as it is appears as an easier route for HF AC.
An electro or tantalum in parallel acts as a reservoir for crowbar or LF/transients coming from power line.
These should be close to chip so that the PCB track effects are minimal.

ADCing? Fit decoupling. Get rid of noise in and out of PICaxe. You'll thank me later. :)


The bits which most people forget are when they have relays or power LEDs (or any noisy thing) in the circuit - especially where sharing a power track on a PCB.

My awful drawing shows a general pulsed device - this could be a power LED.

A relay could be even worse.
REMEMBER: at switch-off the Back-EMF diode will shunt a nasty spike onto the power line.
The capacitor can help to absorb that and prevent it getting to other places in your circuit.
(Obviously , the magnitude will depend on PSU 'strength' , proximity and layout so let's not get too pedantic).

THINK of each track/wire as an Resistive conductor which can transmit and radiate noise.
THEREFORE placing a capacitor in strategic places makes it an RC filter.
AND placing the capacitor 'locally' keeps the noise and high harmonics and transients in a small patch.
THINK of capacitors as a HF noise diverter and reservoir.
NOTE different type capacitors have different characteristics.

It's a BIG subject as 'good practice' also encompasses track layout and good ground techniques, shared lines, proximities etc.
As well as paralleling ceramics in some RF circuits.

It could go on for pages and I'm puffed out.

(Sorry, I did this in a rush, hope it makes vague sense)
 

Attachments

Pauldesign

Senior Member
Yeah Dippy, although it makes sense but your Nasty pulse in the first diagram doesn't look Nasty to me. :)

Nevertheless, you gave a logical valid excuse (rush) which is always the case. ;)
 

Dippy

Moderator
You didn't ask about the magnitude.... that pulse height was 18 Amps.
18 Amps square wave along a PCB track? Lovely. ;)

But seriously, if you had done as much signal processing design work as I have done then you will see that even piddly magnitudes can have serious effects elsewhere. Transients, harmonics, conduction, radiation, induction... aargh!
There are many aspects which you probably haven't come across yet.

But my drawing was just meant to give an idea of principle. If you want to write a 'Tutorial' then please do so - people would appreciate it.
Ah... whatever happened to the Tutorials....?
 

vshortt

Senior Member
Thank you for all the replies everyone. I do understand the theory behind EMF caps and smoothing out pulsed lines, etc.. and I'm starting to get an even better idea about the hows and whys in regards to where they are placed. I've always used a .1uF between the + and - of my chips, but recently built a board and started putting it together before I realized I was out of caps - So, I built it anyway, just for fun, and put shunts in place where the .1uf Caps would normally go, JUST to see what would happen.

The board is a mixture of a 5V rail running two picaxe 20X2's, an i2c bus that has a DS1307 and an 24LC512, on it, and uses 5 optocouplers and 5 2N222's to trip 5 relays with 5v coils. Now the OTHER side of the relay has 120 A/C going through it. and yes, that travels through traces on the board. Those traces are quite thick and reinforced by over-soldering them. I was smart enough to keep the 110 side and the 5v side well seperated. The only place where the 5v side "intrudes" the 120V sections is where the traces have to reach the coils. Other than that, they are totally seperate.

However, the i2c bus meanders all through the 5v side of the board, and I thought this would give me all kinds of problems. The only reason it does this is because it's a one-sided board.

Additionally, the two serial OUT and serial IN lines meander through the board before reaching a single mini-molex plug headed out to a touchscreen LCD module.

To my surprise, I've not had any problems whatsoever. The only capacitors on the whole board are the two used in the bucking power supply. It uses a 100uf on the 12v side, a 220uf on the inductor side, a 330uh inductor, a power diode, and an LM335Z as the bucking converter.

I'm not saying I won't eventually get problems, I am sure that if I leave it like it is, I will end up with all sorts of failed parts and poor signaling. This was a "proof of concept" board for a project though, so I have been looking forward to getting it done for a while. I am guessing I've managed to do an okay job designing the board if it works well enough without a single decoupler or filter.

I would imagine that if I converted the power portion of this circuit from a bucking power-supply to a transformerless converter I would need to consider decoupling much more closely - and thats something I'm seriously thinking about doing. I really like the idea of being able to build this toy without having to use a "wall cube" to run it, and since I'm bringing 110 into the box anyway, I might as well make use of it to run the circuit. I've got a few designs I'd like to play with for a 120 A/C to 5v DC transformerless power supplies, if anyone has any good tips for making this type of on-board converter, let me know!
 

Rbeckett

Member
Westy wrote a gem of a tutorial, but it doesnt have a place of it's own so it is getting pushed down and out and becoming invisible. The newb will never see what a great piece of work that is. If it had a residence it would not become obscure and invisible after a short period of time like westy's is.
Bob
 

Dippy

Moderator
vshort, this is a message to you... other people should look away.

Small boys and novices should not read any further...

Check out Power Integrations for their LNK30x range of bucks.
and
ST Microelectronics for their very similar Viper.


Both of these buck straight from mains to 'DC'.
Both are far more efficient that transformer or capacitor supplies.
Both are intrinsically more noisy than transformer or capacitor supplies.

REMEMBER: the standard minimum part topology is NOT isolated so you have to be VERY careful. Your circuit may be dangerously live.
e.g. do not try and programme your micro whilst mains power applied and Do not use 'scope on the circuit unless you have isolated probes or 'scope.

This type of method is being used more and more in consumer products to reduce quiescent and standby powers for the latest regs.

I did a mains circuit using the LNK304 bucked down to power various chips including a PIC and XBee and the performance was flawless - though I did pay careful attention to PCB layout, ground planes, decoupling , correctly rated quality components etc.

In addition I made an opto isolated programmer interface to programme the PIC. If you are skilled and competent (and only if you are comptetent) you could make an opto-isolator for PICAXE programming.

However, I am not encouraging you to do this as the Nanny Police will raid the party. And novices and incompetents should steer well clear.
If people wish to add pages of warnings feel free. :rolleyes:
 

vshortt

Senior Member
LOL, Thanks Dippy. I appreciate the input and will check out the two bucks you've mentioned.

As far as isolation for safety. I acutllay thought about configuring the board so I could place a "cage" over the converter circuit. Think something like a small enclosure box screwed to the board upside down, housing the HV components.

Originaly, the thought was to have a secondary DC input inside the box, so that I could program/tinker with the finished circuit without having to use mains to power the system.. would that make sense to you?
 

Dippy

Moderator
As long as your secondary (safe DC) doesn't affect the unpowered buck then it sounds fine.

In my case I had to make an isolated interface as the circuit was for energy monitoring so had to be connected to PC and mains - not a comfortable feeling! You always have this feeling that it's going to end in tears ;)

If looking at Power Integrations devices, then get the Data Sheet and several Application Notes which give good info.

Also, their free software to do the calcs for you is good - sorry, I've forgotten the App name.
I seem to remember in my design the overall efficiency was 60 - 70% and the quiescent mains power was a fraction of a watt.
 

vshortt

Senior Member
Call me crazy, but that appears to be a good tutorial on an LCD module that he's using - are you sure thats the right link?
 

Rbeckett

Member
No I may be the one who's confused, I thought he was asking about a tutorial in general, not specific to the present discussion, just one that had been written previously. I think I am the one who got it confused. Sorry!!
Bob
 

John West

Senior Member
There is an assortment of possible capacitors and implementations of capacitors that wil work for various circuits. There's lots of room for variety in their implementation without mucking things up too badly. Thus the variety of implementations you see in various projects on websites.

Having had to redesign the layout of a thousand-hole PCB because the "professional" designer I'd hired had failed miserably in his efforts to keep digital noise sources and grounds away from analog circuits, I can attest to the necessity of properly organizing current paths along with the proper implementation of decoupling capacitors.

The caps are essential - but not in and of themselves the solution to noise problems.
 
Top