# Capacitors

Hi y'all, just joined LMR, fantastic site, lovin' it already . . .

I am a bit of a beginner to robotics, I mean I can program and all that, and make these things, but I know not how or why they work.

One thing I have been wondering is about capacitors:

When designing a circuit, how does one know where to place capacitors, or why to have them, or how they function in that position?

With this circuit in particular (from here: http://letsmakerobots.com/node/2074), why the caps?

those two in the top-right, why do they both need to be there?

I guess my three main questions are (focussing on this circuit):

1. Why are the capacitors there? (and what they do)

2. How do you know to stick them there?

3. How do you know what type/size, or whther they must be polarised?

Any light shed on this would be much appreciated.

## Comment viewing options

I would also like some more information on capacitors as I only vaguely understand how they work and what they do.
But for your specific circuit I think all the capacitors are there to suppress noise in the system that might raise problems for your microcontroller or sensors.

What exactly do you mean by 'noise' in the circuit?

Is that just jagged spikes in the current and that? How exactly does that present a problem, and, like I ask before, How do you know what type/size capacitor to fix it?

Hey there good question. Capacitors are usually used to absorb fluctuations like spikes or sags in the level of the voltage. A capacitor stores a charge which can be released into the system when a device needs a lot of juice, or it can absorb a high spike back into it. Thats what the 2 caps on the motor driver circuit are for. When the motors start up they suck a lot of juice which the power supply might not immediately be able to give.

Caps can also be used in timing because the time they take to charge and discharge can be calculated mathematically.

Hey flare and Geir, the guy in this video is kinda annoying, but he explains capacitors pretty well...http://www.youtube.com/watch?v=ZYH9dGl4gUE

I think I have seen this video before and I think that guy is great :-)

But it doesn’t really tell me much about what the different types of capacitors are used for. I understand that you can’t have a polarized cap on the motors but what about the two capacitors at the top right. One 100uF polarized and a 0.1uF none polarized, -why and why those exact values?
I have seen lots of voltage regulator circuits but most of them operate with different values for the capacitors on either side of the regulator. Isn’t there a absolute and correct way of doing this?

Depending on the application, you can use a polarized cap on a motor. If it is only going be spinning in one direction, there is no reason why you couldn't. The application I used them in was for RC car racing with a single direction ESC(forward control only) which was the only legal type of ESC for competitions.

How about Afrotechmods then?  Colin is a video hero btw!

I understand about spikes and put a cap across pretty much any incoming voltage from a battery or BEC (which I now think of as sloppy regulators) and at the point of high draw. What I don't understand is using one like I needed last night (if you saw my 7.4v o 5v thread). I had a cap across incoming current from a batter to a VR but not on the output and I was seeing too much voltage. TeleFox politely suggested I actually read the datasheet I posted a link to where it plainly states that the output needs a cap. So I capped it and the voltage was corrected. But why? There was no load and because the input was capped, I don't think there was a spike. I even had a 1AMP fuse in the circuit because I had not built a VR from scratch before (and it is a good idea in general) and it is still intact, so I didn't have any big spikes the first cap wouldn't handle.

I am from the software side of the fence that the Arduino (and other similar tech) bull dozed down. It is really easy to do a lot of stuff that I would never have attempted in the past because it required a lot of support circuitry and a deep understanding of electronics. Now many of the circuits are pure logic level connections and I can just wire them right together (Tx to Rx, PWM to servo control line, VCC to +5, GND to GND) but some need a small amount of circuitry. The trick is knowing when and what to do. The Arduino library is missing the function PutSmokeBackInChip()...

EDIT - and of course, no thread on capacitors will be complete without a request for a good source for flux capacitors... :)

I also have no idea what a VR does on the inside. But here's how I imagine it. It is balancing the output voltage level, like I would balance a broom stick on my flat, open hand.

Your VR without a cap on the output is like me standing in the broom closet: no room to move at all.
Your VR with a cap on the output is like me standing in my yard: plenty of room to move. I might not need all that space (for very long). But it helps me to acquire balance before I can keep it.

I suspect the analogy works if the output voltage is (indeed?) a dynamic balance, like the broom. It is moving up and down a tiny bit, the regulation only works if the output has some space to move inside. Capacitors do exactly that. Give your voltage some space to wiggle.

Again: just my electronic instincts at work here. Not actual knowledge!

What confuses me is that the voltage was steady (well ok, to a meter; might have been different under load) but wrong without the cap and then a cap (or probably more correctly the presence of one) changed the output voltage. I am not an electronics wizard by any stretch, but I thought I understood that capacitors didn't affect voltage of a steady current.