NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Basic Electronics » I don't understand the cap on the MC power supply

May 31, 2009
by luisgarciaalanis
luisgarciaalanis's Avatar

I followed the instructions on the first project and I don't understand the function of the cap goint to the power of the MC.

the cap touches the power line on one side and the ground on the other side, wont that leak battery to the ground?

if its supposed to supply a constant amount of voltage to the MC why isn't the cap in series on the power line?

May 31, 2009
by wayward
wayward's Avatar

The cap serves as a buffer :) When fed DC, a cap will short the circuit in the first moment, but as it fills with charge, the voltage across it will drop until it reaches close to 0V, drawing no current through the charged cap. This lasts only a very short time and can be neglected, especially when the resistance in series with the cap is close to zero. When there's noise on the power line -- unstable supply, radio interference, effects of other parts of the circuit -- the capacitor, being closer to the power supply than the MC, will react first and discharge to fill in the drops in supply voltage, or recharge to trim off some of the peaks.

May 31, 2009
by luisgarciaalanis
luisgarciaalanis's Avatar

But the cap is not in series in the power line more moke like paralel of the MCU.

it touched power line on one leg and then the ground on the other leg.

wouldn't this charge the cap from the current line and then discharge it when its full to the ground?

this cap dos not have polarity? it was too tiny to read :(

May 31, 2009
by hevans
(NerdKits Staff)

hevans's Avatar

Hi luisgarciaalanis,

You're not thinking about the capacitor quite right. Remember that a capacitor acts like a short at high frequencies and an open circuit at low frequencies. With the capacitor placed where it is, at DC (very low frequency) the capacitor acts like an open circuit, as far as the MCU and power rails are concerned, it is not even there. However at high frequencies, whenever there is a sudden change in the power supply the capacitor starts kicking in, allowing current to flow through it, and thereby "smoothing" out any sudden spike (or dip) in power.

It might help you think of if more like a plumbing problem. Pretend wires are pipes with flowing water, being pumped from high pressure (+5) to low pressure GND. You can think of your cap sort of like a balloon you attach in parallel to the +5 rail. Such that water coming in has the option of going to the balloon, or through to the MCU. At first water is going to flow happily into the balloon, until the balloon gets full, at which point no more water will flow into the balloon. If there were to be a sudden (temporary) rise in pressure the balloon would fill up to absorb it without the MCU feeling much of it, likewise if there was a sudden dip in pressure the balloon would dump some of its water to make up the difference.

Now consider your question, what would happen if this cap was instead in series with the pipe? In this case the balloon analogy begins to bread down, but still sort of applies. In essence what you would be doing is cutting the pipe and capping it with the balloon, such that the current (water) has no choice but to first enter the balloon. In this case the balloon would fill up (current would flow) until the balloon can't take anymore, and current would just stop flowing. That is until there are sudden changes in pressure, in which case the balloon would contract and expand to make up for those changes. In this situation the balloon is blocking out the DC component of the current, and only letting through the AC component (sort of the system only reacts when there is changing pressures). So if you were to setup the capacitor in series, you would be blocking out the DC power and only allowing the AC components (the junk) to get through. Sometimes however, when what you want is to only keep the changes in voltage you can set up a capacitor in series with your signal.

Hope that makes sense!

Humberto

May 31, 2009
by luisgarciaalanis
luisgarciaalanis's Avatar

Thanks,

in the ballon analogy it makes sence because it has less density than the pipes so it would inflate/deflate. but here we have wire and it splits in two one going to the MCU and the other one going to the cap. How does the electricity knows that it has to send the small noise to the cap? once the electricity reaches the cap some other electrones with noise reach the MCU as well. I am thinking of electros as a stream of incormation that can come broken, maybe I got the physics of it wrong in my brain.

and if the cap fills the electricity goes to the GND? don't we need a resistor to kill it after the cap?

May 31, 2009
by hevans
(NerdKits Staff)

hevans's Avatar

Hmmm, your confusion is exactly why I don't really like using the balloon analogy too much. It breaks down pretty quickly. You are right, the capacitor does not completely block out all blips, some of spike in current does end up hitting the MCU, but the moral of the story to see is that the capacitor (like a baloon) would help smooth out any variations in the power rails. I could try to convince you in weird ways that the analogy does hold, but it might pay off to just look at a little math about how the capacitor works.

This is the current voltage relationship for the capacitor. Taken straight from the wikipedia page

capacitor equation

Notice that the current through it is directly proportional to the derivative of the voltage across it. Which means current only goes through it when voltage is changing. When the voltage is not changing, no current can go through it and is essentially an open circuit. Faster variations in the voltage will cause current to flow through it, which will essentially shield the MCU from the variations.

You don't want to think about resistors "catching" current. Current will go through resistors, thereby dropping a voltage across them. If you put a resistor in after the cap, it would force the current that the cap is allowing to go through the resistor. There are situations in which you would want to do this, i.e. when you want to more carefully control the time aspects of your circuit. However for something like a bypass cap, there is no need to analyze it in that much detail. All you need to see is that the cap will allow current to flow when there are changes in the voltage, thereby "smoothing" out these changes as far as the MCU (and the rest of your components connected to those rails) are concerned.

Humberto

May 31, 2009
by luisgarciaalanis
luisgarciaalanis's Avatar

I kind follow you... interferance will increase/decrease the Voltage , if dV is positive this extra V will be kind of eaten by the cap. if the cap gets full it will begin dropping the V to the ground (will go back to the battery?), if dV is negative the cap will drop the V back to the circuit?

May 31, 2009
by hevans
(NerdKits Staff)

hevans's Avatar

Sort of. Your general feel for it is right. Although I get a little bit scared when you say "drop the V back to the circuit". Voltages don't really dumped back and forth, they just are. Current does get dumped back and forth though. So a drop in voltage, would cause the capacitor to dump back the charge it has stored up, which would oppose that initial drop in voltage.

May 31, 2009
by luisgarciaalanis
luisgarciaalanis's Avatar

You are right to be afraid because I don't know sh*t :P I said dropped back based on what wayward said about the cap discharging to meet the drops. discharge where?

June 11, 2009
by BobaMosfet
BobaMosfet's Avatar

Let's word this another way.

First, power isn't going to the capacitor in lieu of the MCU. It is headed towards both at the same time. Kirchhoff's law. Since the capacitor is parallel with the MCU on its power-circuit this means that it is a load (not a short) to ground, just like the MCU.

By definition, a short is a link between two differential voltages where no friction is present, allowing the current to flow unimpeded. A capacitor doesn't fit that definition. A capacitor provides friction-- it tries to build an electron field between plates, so it's actually "doing work" with the energy it consumes.

If a voltage drop occurs ahead of the capacitor, it compensates for it, by dumping its load (excess energy) back into the circuit at the same time. A capacitor that is full cannot charge (and hence cannot pass energy through it- it just keeps its field charged). In a DC circuit, this usually means that it only dumps its load and charges when irregular fluxation occurs (sudden demand for power from the MCU, or issue from the power-source). In AC, it is dumping and charging all the time, because the energy itself is in a constant, fluxation state.

June 11, 2009
by BobaMosfet
BobaMosfet's Avatar

In fact, this will probably help you more than anything-- it's fine to look at a mathematical equation, but when you're learning it doesn't help you answer lots of unknown, as of yet to be asked questions. Sometimes a graphic of what the equation means is more useful:

The curve that starts at the bottom left, and goes up and to the right is CAPACITOR VOLTAGE. The curve that starts at the top left, and goes down to the bottom right is CIRCUIT CURRENT. The horizontal and vertical lines are just graph lines.

As voltage through the capacitor reaches maximum, current through the capacitor reaches zero (nearly). This is because the plates are charged and electrons cannot move or cross the gap in the capacitor.

Copy the below graph and put it into NotePad and enlarge the window so you can see the whole thing. Sorry it wasn't better, but there was no way to display the actual graphic in this forum.

------------------------------------------------------------ 
    .          ^              .              ^  !666I|.^.   
    6          ^              .          |6! ^              
    |          .              ^     I|       .              
               ^              .  6.          ^              
               .              O              ^              
     .         ^           .| ^              .              
     6         ^         .|   ^              .              
     I         ^        6     .              ^              
     .         ^      I       .              ^              
               .     6        ^              .              
               ^    ^         .              ^              
    .^6.^.^.^.^!.^.!^.^.^.^.^.!^.^.^.^.^.^.^.!^.^.^.^.^.^   
      6        .              .              ^              
               . I            ^              .              
               ^O             .              ^              
       !       I              .              ^              
       6       .              ^              .              
              O.              ^              .              
               ^              .              ^              
        ^    O .              ^              .              
        6      ^              .              ^              
            6  .              ^              .              
               ^              .              ^              
         | O   .              ^              .              
         !     ^              .              ^              
          !    .              ^              .              
    ^.^.^.I^.^.!^.^.^.^.^.^.^.!^.^.^.^.^.^.^.!^.^.^.^.^.^   
          !    .              ^              .              
         |     ^              .              ^              
         | 6   .              ^              .              
               ^              .              ^              
            6  .              ^              .              
        6      ^              .              ^              
        !    6 .              ^              .              
               ^              .              ^              
       .      O.              ^              .              
       6       ^              .              ^              
       !       I              .              ^              
               .O             ^              .              
               ^ I            .              ^              
      6        .              .              ^              
    .^6.^.^.^.^!.^.|^.^.^.^.^.!^.^.^.^.^.^.^.!^.^.^.^.^.^   
               .    !         ^              .              
               ^     6        .              ^              
     .         .      |       ^              .              
     6         ^        6     .              ^              
     6         .          !   .              ^              
               .            I .              ^              
               .              O              ^              
               .              ^ .6           .              
    I          ^              .     |O.      ^              
    6          .              ^          |6! .              
    ^          .              ^              .  |I66I!^.    
--------------------------------------------------------------

Hope this makes it easier to understand.

June 12, 2009
by luisgarciaalanis
luisgarciaalanis's Avatar

Thanks for the explanation, I understandit better now, I had a wrong impression thinking that the cap was unloading to the ground. Now I understand better the formula :)

The cap will unload back into the line where it was charged because its needed then it will begin to load again, only to go back to full and cut the current once its full again :)

Post a Reply

Please log in to post a reply.

Did you know that a NerdKit can be used to build an iPhone-controlled R/C car? Learn more...