Hardware theory...

Got a hardware problem? ask for help

Hardware theory...

Postby CodeJunkie » April 19th, 2011, 6:05 pm

So I am a bit new to the DIY electronics hobby buts its always something I have wanted to learn. So I have a pretty good understating of the basics (resistance, diodes, transformers, etc) but capacitance to me is still a bit fuzzy. I get that a capacitor is a storage device for power and the amount of power it can hold is defined by the farads. The hard bit is knowing why and how to use capacitors. All the information I have read has given this basic information but doesn't explain when to use capacitors. e.g. You have a 9 volt battery going to a 5 volt regulator (500ma max). So for power regulation it makes sense that a capacitor should be utilized so that quick spikes of power can be provided. What size of cap do you use? There doesn't seem to be a guide or formula. Can you have too much capacitance? If anyone could help me in my understanding it would be greatly appertained :D .
Last edited by CodeJunkie on August 5th, 2011, 6:18 pm, edited 1 time in total.
Posts: 4
Joined: March 19th, 2011, 2:29 pm

Re: Hardware theroy...

Postby Osgeld » April 19th, 2011, 7:01 pm

well they can be used as smoothing but instead of providing quick spikes, its to protect against power dips, but they can act as filters too, as DC gets blocked but ac passes on though. SO if you have some noisy power or you want to block DC lets say from an amplifier to a speaker but let a signal pass though that would be another application.

you can also hook one up with a resistor and make a RC network (resistor capacitor), which can be used to convert digital pulses to a smooth curve, for instance letting a led dim out, or debouncing a switch.
User avatar
Posts: 725
Joined: January 25th, 2011, 6:16 pm

Re: Hardware theroy...

Postby robodonut » April 19th, 2011, 9:35 pm

Yes, in the simplest sense capacitors store charge. However there are no simple rules for using any component. An understanding of the math behind the devices is very beneficial.

Hydraulic analog: A thin tube
Mechanical analog: Friction
Relationship between voltage and current: V = IR (Ohm's law)

A resistor produces a voltage directly proportional to current flow.

Hydraulic analog: A tube with a diaphragm stretched across the middle.
Mechanical analog: The ideal spring.
Relationship between voltage and current:
For capacitors, voltage is proportional to the integral of current, or charge: v(t) = 1/C ∫ i(t) dt = Q/C. The saying is that voltage "lags" current by 90 degrees.

Capacitors operate because of the electrostatic force between adjacent insulated conductors. When you force electrons into one side, they repel electrons on the other side (and vice-versa).
They act like a conductor to high-frequency AC and an insulator to DC.

Hydraulic analog: A long pipe carrying a large mass of water
Mechanical analog: Any object with considerable momentum, such as a weight or flywheel.
Relationship between voltage and current:
For inductors, voltage is proportional to the derivative of current: v(t) = L di(t)/dt. The relationship between voltage and current is opposite of that in a capacitor; voltage "leads" current by 90 degrees.

Inductors are generally coils of wire which store energy in a magnetic field. They "oppose" changes in current. They block high-frequency AC current while conducting DC.
It is important to note that abrupt changes in current result in huge voltage spikes. This can be used advantageously (as in boost/buck converters) or it might destroy other devices if not accounted for. Electric motors are inductive loads. When a coil in the motor breaks electrical contact (which occurs many times each rotation), it generates a voltage spike known as back-emf. In order to protect the device driving the motor, diodes are often used to short this current either across the motor's terminals or to VCC/ground.

Ohm's law can be generalized to apply to capacitors and inductors: V = IZ, where V, I, and Z are all complex values. AC voltage might be represented as v(t) = Vexp(ωt+φ) (recall euler's formula), where ω=2πf is angular frequency and φ is phase.

Simple combinations of these passive components are identified by the letters representing their values: R - resistor, L - Inductor, C - capacitor.

The circuits you are describing in your post regarding capacitors are generally "RC" circuits.
These are low-pass or high-pass filters. When you see a big electrolytic capacitor from voltage supply to ground it is functioning as a low-pass filter, shorting high-frequency noise to ground and smoothing out voltage spikes/dips.
High-pass filters have the resistor and capacitor flipped. The capacitor will allow AC current to flow, but will block DC entirely.
The -3dB cutoff frequency for both RC high-pass and low-pass circuits is 1/(2πRC). The signal is attenuated by 20dB/decade for frequencies beyond this point.
When choosing coupling/decoupling or filter capacitors, you need to consider the resistance of the source/load and find a value of C that produces sufficient attenuation at the required frequency.

RL circuits can be used as high-pass or low-pass filters much like RC circuits, but arranged differently. While the capacitor blocks DC and pass AC, inductors have the opposite effect; blocking high-frequency AC and passing DC.

LC circuits resonate. Going back to the mechanical model, it's like a large mass (the inductor) on the end of a spring (the capacitor). If you pull the weight and release it, it will continue to bounce for a while at a frequency determined by the mass of the object and the strength of the spring. They have a spike in response at one particular frequency, accompanied by an abrupt shift in phase.

RLC circuits are "damped" resonators. It's like the mass-spring system with friction.

When analyzing circuits, keep in mind Kirchhoff's voltage/current laws and break the circuit into smaller chunks by considering the relative magnitudes of the part's values.
Posts: 37
Joined: March 6th, 2011, 7:30 pm

Re: Hardware theroy...

Postby CodeJunkie » April 21st, 2011, 12:07 pm

Thanks for the replies. Looks like I will have to invest in a oscilloscope so I can really see what those pesky electrons are doing.
Posts: 4
Joined: March 19th, 2011, 2:29 pm

Re: Hardware theroy...

Postby vtl » May 2nd, 2011, 3:21 am

You don't need to buy a 400$ oscilloscope to learn this stuff. If you want to look at how capacitor charge up and filter you can download a simulation program like LTSpice or similar. Build your circuit visually with a gui and run and look at all the voltage and current to get an understanding of it all.
Posts: 30
Joined: January 27th, 2011, 9:18 am
Location: Melbourne, Australia

Re: Hardware theroy...

Postby wellernumber7 » May 2nd, 2011, 5:01 am

Capacitors block dc voltage. This is really important in a bunch of situations. You'll use a bunch of small value capacitors across logic ICs to "de-couple".

Capacitors also "smooth" out ripples in voltages, that's why a largish capacitor is used in power supplies - to reduce the "ripple voltage" which results from rectification (using diodes to convert AC to DC.)

As others have said, you don't need a 'scope to see this stuff (although a cheap basic simple 'scope is an excellent investment if you really get into the hobby); you could use some simple circuits with LEDs. Changing the value of the capacitor will change the timing constant, making the flashing faster or slower or whatnot.
Posts: 84
Joined: January 27th, 2011, 3:54 pm

Re: Hardware theroy...

Postby k-ww » May 7th, 2011, 3:07 pm

Codejunkie: The spec sheets on the regulator will have typical circuits that give the cap size that the mfg wants. Remember that to a fast changing signal, a wire is an inductor, and will cause havoc to something that expects to see a low rf impeadance [rf short] at it's input. The same goes for the output - driving an inductor [wire] makes most regulators unhappy also, as it screws up their feadback circuitry, therefore the cap on the output. IC's tend to have fast current spikes wehn they operate, and also don't like inductance at their power supply inputs for the same reasons, so caps across their inputs also.
User avatar
Posts: 1261
Joined: February 17th, 2011, 10:47 am

Re: Hardware theroy...

Postby engineersteve » May 8th, 2011, 3:28 pm

This is some good information. Fully agreed that an understanding of the math and a good simulation program (LTSpice, QUCS, etc) will be a great help. Investigate concepts like complex impedance. This allows you to work with filters in the frequency domain, and using the Fourier transform, we can forget about calculus and do the circuit analysis with algebra. Capacitors can be used in many ways, coupling, decoupling, filters, energy storage, switched capacitor networks, and more.

A common question about capacitors regards decoupling, since it's the most frequent use of the part in digital circuits. When we "decouple" IC's, we're trying to prevent transients created by one part from affecting another. For example, say we have an op-amp on the same supply as an MCU. The MCU draws current in spikes (CMOS circuits only draw power when the clock transitions) at the same frequency as it's clock (or peripherals). So say we have a wire with some resistance from the regulator to the mcu, then the from the mcu to the op-amp. When the MCU pulls current, the voltage at the MCU drops due to the resistance (and inductance) of the wire. This means the op-amp supply voltage also drops. This bleeds through to the op-amp output (see power supply rejection ratio spec on the op-amp datasheet to see how much).

We fight this with decoupling capacitors. Linear regulators are low-pass elements (cutoff around 10-100kHz). So any transient currents above this (like at MHz for MCU's) will cause voltage spikes. How large the spikes are is based on the impedance of the power distribution network (the resistance of the wire above). To lower this impedance at the frequencies above the cutoff of the regulator, we use decoupling capacitors.

Now if a capacitor were perfect and had an impedance of 1/(jwc) we could put one big honking cap on and call it a day. But caps have series resistance and impedance, so at some point these affects take over and the impedance actually increases with frequency. So your 100uF aluminum electrolytic might not decouple too well at 100MHz, it has several ohms of impedance, but your 100nF ceramic has mOhms. This is why you see a mix of large and small capacitors on schematics, each one resonates and by combining them we create a broadband low impedance power distribution network.

Happy hacking!
Posts: 45
Joined: May 8th, 2011, 3:09 pm

Re: Hardware theroy...

Postby cgimark » May 9th, 2011, 1:12 pm

To determine capacitor size for a power supply you take the desired voltage , example 12VDC and decide what you want the ripple amount to be, say 2%.
12vdc x .02 = .240 Volts RMS or Vrms.
Next determine the peak to peak value which is 2.828 x .240 = .679 volts
.679V becomes our Vripple value
The 2.828 number is a constant used for full wave rectified DC

formula for the capcitor size is uf = [(IL * time) / Vripple] X 10^6
IL = load on the supply, say 2A
time is a constant of .00833 for 60hz power and .01 for 50hz power
uf = [(2A * .00833) / .679V] x 10^6
uf = .02454 * 10^6
uf = 24,540

Voltage rating of the cap is Voltage x 1.414
12V x 1.414 = 16.9VDC which would mean using a 25V cAP
Posts: 79
Joined: February 1st, 2011, 3:27 pm

Re: Hardware theroy...

Postby machinelou » May 13th, 2011, 11:40 am

Sorry, this has been killing me. If this thread needs to stay a sticky, can someone please fit the title so "theory" is spelled correctly. Thanks
Posts: 21
Joined: April 3rd, 2011, 6:42 pm


Return to Help me! Hardware

Who is online

Users browsing this forum: No registered users and 2 guests