Analog Circuit Design

Analog design is where the precision work lives. Digital circuits are mostly about logic and timing; analog circuits are about getting signals to behave exactly the way you want across temperature, supply voltage, and component tolerance. The goal is usually to amplify, filter, or measure something to a specified accuracy — and then verify that it actually works that well.

Transistor Amplifier Configurations

Beyond op-amps, discrete transistor amplifiers are still essential for high-frequency work and in situations where you need specific input/output impedance characteristics.

Common Emitter (BJT)

         VCC
          |
         [RC] ← collector resistor sets gain
          |
         C──── output
         |
    B────┤ NPN
         |
         E
         |
        [RE] ← emitter degeneration resistor (stabilises gain)
         |
        GND

Voltage gain Av ≈ −RC / RE  (with emitter degeneration)
Input impedance ≈ β × RE

High gain, moderate input and output impedance. The workhorse transistor amplifier stage. The emitter resistor provides negative feedback that stabilises the operating point against temperature drift.

Common Collector (Emitter Follower)

VCC ──── C
          |
    B ────┤ NPN     Gain ≈ 1 (slightly less)
          |         High Rin, Low Rout
         E ──── output
          |
         [RE]
          |
         GND

Unity gain, high input impedance, low output impedance. A buffer — protects a sensitive source from loading. The output follows the input.

Instrumentation Amplifiers

When you need to amplify a small differential signal in the presence of large common-mode noise — sensor outputs, thermocouple signals, bridge measurements — an instrumentation amplifier (INA) is the right tool. Three op-amps in a specific configuration give very high CMRR (common-mode rejection ratio):

Gain = 1 + 2R/RG

Where RG sets the gain. For INA128 with RG=10kΩ:
Gain = 1 + 100kΩ/10kΩ = 11

Typical CMRR: 80–120dB (rejects common-mode interference while amplifying the difference)

Use INA chips (INA128, INA333, AD8221) rather than building your own from three op-amps — the resistor matching that gives high CMRR is laser-trimmed in the IC.

Noise in Analog Circuits

Every resistor and every active component adds noise. The two main types:

  • Thermal noise (Johnson noise) — from resistors. V_noise = √(4kTRB), where k is Boltzmann's constant, T is temperature in Kelvin, R is resistance in ohms, B is bandwidth in Hz. Lower resistance, narrower bandwidth = less noise.
  • Shot noise — from current flowing through a junction. In transistors and diodes.

The noise figure of an amplifier stage tells you how much noise it adds relative to the noise at its input. To minimise amplifier noise: use low source impedance, pick a low-noise op-amp (op-amp datasheets specify nV/√Hz input voltage noise), and limit bandwidth to only what you need with filtering.

Total noise in a bandwidth B:
V_noise_total = V_noise_density × √B

Example: 5nV/√Hz op-amp, 10kHz bandwidth:
V_noise = 5 × √10,000 = 5 × 100 = 500nV RMS

Signal Conditioning

Raw sensor signals often need conditioning before an ADC can read them: scaling to the ADC reference range, filtering noise, level shifting, or converting current to voltage.

Transimpedance Amplifier (TIA)

Converts current to voltage. Essential for photodiode circuits where the sensor output is current:

         Rf
    ┌───[   ]───┐
    |           |
PD──┤(−)  (+)──GND──── Vout
    └──────────┘ (op-amp)

Vout = I_pd × Rf

The feedback resistor Rf sets the transimpedance gain. A capacitor in parallel with Rf limits bandwidth and prevents oscillation — without it, the circuit often rings.

Anti-Aliasing Filter

Before any ADC, you need a low-pass filter to remove frequencies above half the sample rate. If they're not removed, they alias back into the sampled spectrum and corrupt the data:

Nyquist requirement: f_cutoff < f_sample / 2

For 10ksps sample rate, filter at < 5kHz
Use a 2nd or 4th order Butterworth for a reasonably flat passband with adequate rolloff

Layout for Analog

Analog circuits are more sensitive to layout than digital. Key rules:

  • Keep high-gain signal paths short. Long traces pick up interference.
  • Guard rings around high-impedance nodes (op-amp inputs, ADC inputs) — a ring of driven low-impedance signal or ground around the node prevents leakage currents from adjacent traces from corrupting the signal.
  • Avoid routing digital clock signals near analog signal paths. The switching edges radiate and couple into sensitive nodes.
  • Place filter capacitors at the op-amp output, not the input — filtering at the input increases noise, filtering at the output reduces it.