All hail the mighty by-pass cap

IronJungle

Senior Member
It has been said a 1000 times on this forum; "add by-pass caps".

My stepper motor project wasn't working after adding a second stepper. On occasion the PICAXE would not accept a new download.

Insert by-pass cap and it's all good again.
 

SAborn

Senior Member
The simplest solution i find for a decoupling cap, is to place a SMD 0.1uf cap on the bottom side of the board between the 2 power pins, its not a hard job to solder a SMD cap between the pins, and makes for a neat job without the need to modify an existing circuit.
 

Captain Haddock

Senior Member
Have to admit it's too easy to build something on a breadboard with nice power supply only to see it fail in situ, I've just added the biggest cap I could find in my stash to the 12v power in on my boat engine start/monitoring circuit and suddenly much more stable, the picaxe was fine but ds1307 and lcd were getting emotional when both engines started together.
I am slowly getting converted but bet I still forget next time.
I've never realy understood caps more than 'a power sponge' so if anyone can point me in the right direction for a good explanation it'd help as I never know wether to go electrolytic or not or what value unless it's on a schematic or datasheet.
 

Captain Haddock

Senior Member
Nothing to do with me, my boat is leo magill, The captain haddock is because I used to have a boat called 'haddocks revenge' after yet another boat that called 'Pingu the haddock slayer' after too many beers :D , you know how these things happen....
 

nick12ab

Senior Member
On the topic of the importance of decoupling capacitors, recently a teacher handed me five PCBs which each take a 08m2, which is connected to a piezo, two LEDs and a switch (and no decoupling capacitor) and they weren't working. One of them didn't work because the manufacturer failed to test that there was a short between the pads for one LED, three didn't work due to sloppy soldering and the last one was odd - it looked fine but when the switch was pressed the tune would stop as soon as the switch was released and there was no problem with the power connections to the PICAXE. The board worked properly after adding a decoupling capacitor.

So statistically failure to include a decoupling capacitor causes one in five circuits to not work properly. Of course, the 6V AAA battery packs that were powering these things did not influence the results in any way whatsoever.
 

Svejk

Senior Member
Pete is right, I was quite sure there is only one Captain Haddock :eek:. I apologise if I created any inconvenience.

Blistering barnacles!
 

westaust55

Moderator
I've never realy understood caps more than 'a power sponge' so if anyone can point me in the right direction for a good explanation it'd help as I never know wether to go electrolytic or not or what value unless it's on a schematic or datasheet.
A simplified explanation:
Every IC contains many transistors as switches. When the transistors operate to change the internal logic state of a signal (address, data etc) and this is at high speed, the switching creates disturbances which we typically refer to as "electrical noise". This noise can affect the operation of other parts of the circuit.
By adding a decoupling capacitor these filter the noise by in effect shorting/diverting the high frequencies to ground.
Typically, decoupling caps are around 100pF as ceramic or polyester type caps.
EDIT: typo -that should have read 100 nF as mentioned in later posts

When there are larger sudden momentary increases in load on a circuit, the supply may not be able to supply the momentary peak load sighing a corresponding momentary voltage dip. This voltage dip can affect the operation of the electronics resulting in chips such as the PICAXE resetting.
By including an Electrolytic or Tantalum capacitor across the power supply, this helps to provide the extra current during the momentary current surge. The cap cannot keep supplying current forever so only good to help overcome momentary surges such as when starting a motor.
An aspect to be aware of is that if you have a very large electro/tantalum. Cap across a power supply relative to the supply capacity, the voltage may take a little longer to rise to working voltage. Some IC's do an internal reset based on the voltage rising at a particular rate (ie to. Given level in a specified time) otherwise the chip may not reset - then for example your LCD appears not to work!

For a cap think of the relationship with the supply as:
The voltage canning change instantly but the current can.
 
Last edited:

SAborn

Senior Member
It would be worth Re-ed including a decoupling cap in the basic schematic for the download circuit, everyone follows the basic download requirements so 1 extra component included should solve many future problems.
 

Grogster

Senior Member
@ westaust55 - What's a Tantrum cap? One which gives you a lot of trouble? ;) (I know you mean Tantalum, I am just being a smart-arse...)

I use 100n monoblock caps on all supply pins, as close to the chip as possible, in addition to all the other normal PSU decoupling.
 
Last edited by a moderator:

westaust55

Moderator
@ westaust55 - What's a Tantrum cap? One which gives you a lot of trouble? ;) (I know you mean Tantalum, I am just being a smart-arse...)

Nah, designed to prevent a trantrum - aka why doesn't this @#~@ thing work ???

but thanks for the typo report - fixed so some future newbies doesn't go to Element14 or Farnell and ask for a 100 uF Trantrum (along with the "long weight") ;)
 

mrburnette

Senior Member
westaust55's explanation of the two normally required capacitors (physical) is good since it separates function to a device that performs as needed.

Another way to approach the capacitor issue is to realize that capacitors (all) have reactance above pure DC. Reactance may be thought of (in simple terms) as the AC equivalent of resistance in DC circuits. This thought process then creates two scenarios: one for AC and one for DC. The bulk capacitor is for surge issues and the decoupling capacitor is for reducing the effects of noise spikes (which have a complex high frequency component due to the fast rise time.) The fun part of this is that Reactance is given in the unit of Ohms and is frequency dependent. Rather than going on 'n on, here is a handy tool for playing around with capacitive reactance:
Calculator

- Ray

xC.jpg
 

Dippy

Moderator
It's also handy for people to realise that capacitors and many things should be considered as LCR. This may only become apparent at higher frequencies but anyone trying to design RF circuits should be thoroughly aware. As they should be about resonance in-circuit too.

These discussions and explanations have been posted on the Forum many times - maybe Rev-Ed could include a paragraph in one of the Manuals? (Or have they - I haven't looked as I have to mow the lawn).

Am I imagining it, but are some later PICAXE project boards including a decouple/bypass cap?
If so, it shows that even Rev-Ed can learn from the Forum :)
 

mrburnette

Senior Member
@Dippy
Even the least expensive PICAXE-08 Proto Board includes a bypass cap of 104pf along with the 2 resistors for the Serial In pin.

- Ray
 

KeithRB

Senior Member
One thing missing in Westaust55's explanation is that it still doesn't really explain *why* the capacitor is really needed.
You should really mention that the supply line has inductance, and inductance makes the supply line resist any fast change in current (Ldi/dt), such as when the picAxe switches internally and needs a fast boost in power supply current. Because of the inductance, the current cannot be instantly increased from the power supply, so the bypass capacitor, connected to the picAxe with a low inductance path, tries to even out the voltage sag by supplying a very fast pulse of current. Eventually, the supply line catches up and recharges the capacitor.
 

Dippy

Moderator
Thanks Ray. Note to self: Pay more attention!


As PCB tracks include resistance as well as impedance (if you see what I mean) I think between Keith and Westy they have covered the basics. Thought I would say 100nF ceramic (X7R or better) rather than picoFarads mentioned by Westy and a fatty for longer LF droops.


But , keeping in mind the majority audience, where do we stop with this one?
I can WMW as well asn anyone but it is easy to go overboard at this level.

1. The decoupling benefits of both power going into PICaxe as well as noise coming out.
2. The effects on ADC - which shows up more on dsPICs in my experience.
3. It is preferable to run the power & return lines to the decoupling caps first to ensure they are first in line.
4. The need , on occasions, for more than one cap in HF noise infested circuits and care with resonance values.
5. Run through the Real World impedance vs Fq of various caps and explain the different dielectrics used and how you make your design choice.

A summary could show the many benefits and how it is very much 'Horses for Courses' , because in many hobby apps much of it is OTT.


Then , for your encore , you could also discuss the benefits of capacitance on the MCLR line which rarely gets a mention here, but gets described in many PIC data sheets. This can sometimes solve reset time probs associated with slow power-up alluded to by Westy. I always include it on my designs now because of the reasons given by Microchip.
Anyone with MikroElektronika dev boards will notice they do too. Belt and braces and all that. Again; HfC.


Most of this has been discussed several times before over the years but is lost in Forumfog.
Maybe someone could write a 3 page pdf such that we can all point to it?
Don't aim it too high as it could go over the heads of 99% of novices.
A few pictures and no too much huge blocks of boring text (so completely the opposite of my post!)

Whatever happened to the Tutorial section?
Is it here yet? I'm not paying attention again. I'm a bit out of touch with the PICAXE world. :)
 

Buzby

Senior Member
I took the 104 pF to mean 10 0000 pf, or 0.1 uF.
So did I, but I've been messing with electronics for years, so I automatically saw "104" as "10^4".

It may confuse a beginner, who might get stuck looking for "104" pF caps.
 

Dippy

Moderator
Read again: I said "picoFarads mentioned by Westy"
I was referring to Westy's post#13 "...around 100pF as ceramic..."

I too assumed 104pf as 100nF, but for clarity it's best to use standard easy-recognisable terminology.
Even many not-so-novices could think of 104pF as a slip of the digit.
I don't see many of you lot talking about 472 resistors after all ;)
 

westaust55

Moderator
Getting to be a case of TLA's galore!

I once (a few aeons ago) had an accountant come and asked for some details on the equipment worth $50,000 that I had purchased.
My response:
" An OLX type OCB from GEC"
when asked if he needed more information, he just shook his head and walked away.

Now where are the ADM's for tonight . . . . :)
 

John West

Senior Member
Good grief. I had to look up TLA as well. My question in regard to TLA is, what do you refer to a two letter acronym as?

I do enjoy the international flavor of this forum, but I have difficulties with understanding certain phrases and abbreviations.

I used to work with an engineer from NZ who was working for awhile in the USA, and our first confusion was about the term "earth," which I'd always referred to as "ground." I learned a lot from him.
 

premelec

Senior Member
Communication with symbol and language

@IP "OMG! What is WMW? " I think it's "Works Mostly Wow" or perhaps "Whats My Wavelength" ... [and John West - a boot sale is where you can get some new shoes - perhaps... ] cheers... [a friend's oriental boss kept referring to "pirate projects" some years ago - turned out to be "pilot projects" - I hope...]
 
Last edited:

sid

Senior Member
Most of this has been discussed several times before over the years but is lost in Forumfog.
Maybe someone could write a 3 page pdf such that we can all point to it?
Don't aim it too high as it could go over the heads of 99% of novices.
A few pictures and no too much huge blocks of boring text (so completely the opposite of my post!)


As a novice I would find such a document useful.
I know I have to decouple and having read this thread I now have a better understanding of why I have to decouple, however it would be really useful as suggested to have maybe half a dozen photos of various scenarios (power, servo, adc, pwm etc) showing where a cap should be placed in a circuit, what type of cap and size should be used and a brief explanation why its there.
 

IronJungle

Senior Member
I'm the OP.

Don'tcha just hate when something works perfectly, then when you go back to the project, the simple act of it sitting quietly in a corner on your desk "breaks" it?

Maybe a bigger by-pass cap... ;)
 

marzan

Senior Member
The simplest solution i find for a decoupling cap, is to place a SMD 0.1uf cap on the bottom side of the board between the 2 power pins, its not a hard job to solder a SMD cap between the pins, and makes for a neat job without ithe need to modify an existing circuit.
Such a Simple idea that will be in everything I do from now on. Thanks for the tip
 

AndyGadget

Senior Member
Very strange thing just happened to me today . . .
I'd just chopped about and repurposed a 20x2 based vivarium climate controller into a pond pump controller. When I was first testing it I put it into 'diagnostic mode' (should cycle through 5 relays, 1 second on each) but it started humming 'happy birthday' through one of the relays. (There are no 'play' commands in the code.)
Suddenly realised that I'd missed the decoupler on the 20x2 when I'd first built it. Added one and all OK now.
 

boriz

Senior Member
"started humming 'happy birthday' through one of the relays" - LOL. That would have freaked me out for a moment.
 

AndyGadget

Senior Member
"started humming 'happy birthday' through one of the relays" - LOL. That would have freaked me out for a moment.
It was a 'WTFGO' moment :)
I thought at first I'd swapped chips at some time but it happened about 50% of the time after reloading the correct code.
The main change I'd made to the circuit was changing it from mains power via an RS 5V block to a 12V battery supply with new regulator circuit.
 
Top