When / where should I use capacitors?

I apologize if this is a pretty basic question, so I'm trying to figure out when, where, and more importantly why you would use capacitors in a circuit?

See this link: https://learn.sparkfun.com/tutorials/capacitors

http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

Most common use cases:

  • 0.1uf ceramic cap between each pair of power and ground pins on any digital IC unless specified otherwise in the datasheet, for decoupling.
  • Larger caps (of any time) between power and supply for power supply filtering - the less stable your power supply or the more uneven your load, the bigger these should be.
  • Small (often in the 10~22 pf range - see datasheet of crystal and device it's connected to for guidance) ceramic caps on both sides of crystal oscillators, as loading capacitors.
  • On analog pins, if you need to smooth out noise and jitter. This is a place where the calculations of time constants and stuff are actually useful.
  • 0.1uf between DTR of a serial adapter and RESET pin of an AVR microcontroller, for the DTR autoreset trick.
  • Larger caps (of any time) between power and supply for power supply filtering - the less stable your power supply or the more uneven your load, the bigger these should be.

Just after the rectifier, the higher the current, the larger the capacitor needed.

You need capacitor's in a wide variety of situations, including oscillators and balancing crystals. Making timers and missing pulse detectors. Integrators for generating a linear ramp and differentiators for generating a pulse from a level change. Also voltage doubler, and triplers use capacitor's as well as voltage mirrors.

Analog circuitry uses capacitors far more, for coupling, filtering (passive and active), stability/phase-margin control. And decoupling. Everything uses decoupling!

For RF they are used in resonant LC circuits as well as coupling / decoupling.

The digital world they are used in switchmode supplies and for decoupling mainly.

You can get digital isolators, rather like opto isolators but using high voltage capacitors and RF to isolate the two sides - they carry logic signals only, but use less power and are faster than most opto isolators.

Ceramic caps based on barium titanate and related compounds have very high values in a small size, but are non-linear, temperature dependent and lossy, not used for analog or RF signal paths (they also are microphonic, generating a voltage when picking up vibrations). Other types of ceramic are completely different and heavily used in RF, but in the 0.1 to 100pF range mainly. For general analog use (not RF) plastic film caps are commonly used (low loss, low leakage, very linear), and for higher values electrolytics (but these again are poor performers, leaky, lossy, noisy)