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?
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?
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…
Many a day capacitor values are chosen arbitrarily. Even the placement of a cap may seem a random choice by the circuit designer. The word “sprinkle” is even used sometimes.
“Caps” are small and cheap and do not consume power. So when in doubt, add some more capacitors. That is often the mantra that seems to rule the circuit design world. Most engineers call it a “Best Practise”, but most of them are masking their incompetence. As am I right now.
When fearing for electrical noise, add some suppression caps. When fearing for power dips, add some buffering caps. When blocking a DC bias in an AC signal, put a coupling cap in series.
Etcetera.
Knowing when you are in one of those situations (there are more than three), is half the battle. Te other half consists of a few arbitrary rules of thumb. Like Oddbot’s rule for buffer caps: “bigger is better”. For filter caps, the rule would be something like “faster is better”.
Most of the time, we choose whatever is available in the tackle box and check if it helped with our problem. Or there is no problem and we add the caps anyway. For good measure. Better safe than sorry. Because all the cool kids are doing it. That’s the problem with best practises. You don’t always know why it’s The Right Thing, but you know that it is.
So here’s my advice: learn! Read discussions of cap-remedied problems. Explore other people’s work (crack open appliances and take a good look). Ask around (like you’re doing right now). And experiment, experiment, experiment!
Keep an eye out for the easy answers: Why did the designer put caps in his circuit? Which problem is he solving by that? Keep an eye out for standard scenarios: noise suppression is different from power buffering. They come with different standard solutions. Keep an eye on your measuring thingey (multimeter or oscilloscope): change value, note difference in result. Revise.
Voltage Regulator needs caps: not always a standard scenario
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.
1. Why are the capacitors there? (and what they do)
The 100uF caps are there to keep the power rail “stiff” (prevent voltage dips). The larger the capacitor value the more charge can be stored and thus can supply current better. The cap could be a farad but it would be expensive. Just make sure the capacitor voltage rating is quite a bit higher than you need. I suggest an electrolytic (which are polarized) capacitor for this purpose.
The 0.1uF caps are there to suppress noise, or more precisely act as a low pass filter (which passes only low frequency current). Capacitors have a reactance (resistance) inversely proportional to frequency. The [high frequency] noise effectively gets shorted to ground by the capacitor. The basic idea is that the capacitor appears as an open circuit for DC (direct current) and a short circuit for high frequency AC (alternating current). I suggest non-polarized ceramic capacitor for this as they are cheap.
2. How do you know to stick them there?
Because brushed motors are very noisy and can draw large currents.
3. How do you know what type/size, or whther they must be polarised?
I think you should first study R-C filters to gain an understanding.
Here’s the general concept of what’s going on in this case: A linear voltage regulator is essentially a self-adjusting voltage divider. Using some simple semiconductor trickery, it can adjust the division ratio internally, so that more/less voltage is ‘burned off’ internally. The higher the voltage drop inside the regulator, the lower the output voltage will be with respect to the input. To determine the amount of voltage the LVR needs to drop, it compares the output voltage to either an internal reference (fixed LVRs) or to an external reference (adjustable LVRs). The difference between the output and the reference is amplified and fed to the voltage divider controlling circuit, such that if the output voltage is higher than the reference the divider eats up more voltage, so that the output voltage will then fall, and vice versa. When there’s no load on the LVR output, and no capacitor, any tiny difference in the output voltage vs reference will be greatly magnified, causing the output voltage to radiply rise/fall to try to hit the target. In some cases the LVR becomes unstable in this state, sweeping the voltage back and forth in a wild attempt to reach the correct output. Sometimes adding the intended load to the output will be enough to stabilise the LVR, as the output voltage won’t change as rapidly with a load consuming power from it. However, adding an appropriate cap (10μF or larger) is usually the better option as this will stabilise the LVR regardless of what the load’s doing at any point in time, and it also adds a bit of extra buffering to the output which means the LVR doesn’t have to work so hard to compensate for fluctuations in the loading.
When your multimeter was reading 6.36V this was actually just the peak output voltage - if you slapped a scope on the output you’d see the voltage bouncing around as the LVR tried to control it. The average output voltage probably wasn’t that far off the intended 5V.
No news on the flux source, but don’t leave Prof. TeleFox out of the list of knowledgeable folks to thank. His explanation about the output capacitor on a VR was highly enlightening. I now have a better understanding of VRs also as a bonus.
Careful with the bigger/better philosophy. It depends on the kind of noise you are getting in your system. Bigger is better for large dips in voltage (motor starting up) whereas small ones are required for high frequency noise (crappy brushed motors running full speed). And if you want a flux capacitor you have to build a time machine first…
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.