TExcelTAD
Home › Analog Electronics: Diodes, Transistors & Op-Amps › Analog Electronics: Introduction

Analog Electronics: Introduction

A thermocouple produces 41 μV41\ \mu\text{V} per kelvin. A microphone gives a few millivolts. A battery-powered sensor node must run for years on a coin cell, and a USB charger must turn a lumpy rectified voltage into a clean 5 V5\ \text{V}. None of these signals can go straight into a microcontroller's ADC. Something has to rectify, regulate, amplify, filter and buffer them first, and that something is an analog circuit built from diodes, transistors and op-amps.

Circuit theory (Circuit Theory & Network Analysis) taught you to analyse networks of linear elements. This course adds the nonlinear devices that make electronics useful, and the main idea that keeps them tractable: bias a device at a DC operating point, then treat small signals around that point as linear. By the end you will be able to design, simulate and test a complete amplifier, filter, oscillator or regulator from a written requirement.

The map

Section You will be able to Labs and tools
Getting started explain carriers, doping and the PN junction well enough to use device models figures, Python
Diodes and diode circuits choose a diode model, solve diode circuits, design rectifiers, clippers, Zener regulators and LED drivers ee-netlist (linearised), Python, ngspice
Bipolar junction transistors bias a BJT robustly, use it as a switch, build CE, CC and CB amplifiers from the hybrid-π\pi model ee-transistor-curves, ee-netlist, ngspice
Field-effect transistors bias MOSFETs and JFETs, build CS, CD and CG stages ee-transistor-curves, ee-netlist, ngspice
Analog building blocks combine stages, design current mirrors, differential pairs and class A, B and AB output stages Python, ngspice
Frequency response and feedback find an amplifier's bandwidth, use the Miller effect, predict what feedback does, compensate a loop ee-bode-plot, ee-netlist, control, ngspice
Operational amplifiers design with ideal op-amps, then account for offset, bias currents, GBW, slew rate and CMRR ee-op-amp, ee-netlist, ngspice macro-models
Active filters and oscillators design Sallen-Key and MFB filters, pick a Butterworth, Bessel or Chebyshev response, make oscillators start and settle ee-bode-plot, ee-rlc-resonance, SciPy, ngspice
References and regulators design Zener-follower and LDO regulators, size a heatsink, understand when a switcher is better ee-buck-boost, Python, ngspice
Analog design practice estimate noise, lay out and ground a board, read datasheets and design for tolerances Python, ngspice

Units, components, bench instruments and safety are in EE Foundations; nodal analysis, Thevenin, transients, phasors and Bode plots in Circuit Theory. This course links to those lessons instead of repeating them. It uses only as much semiconductor physics as a circuit designer needs; the device physics in depth (band diagrams, fabrication, FinFETs) belongs to the planned chip-design courses of the Embedded Systems & Chip Design track.

How analog design is done

  1. Model. Replace each device with the simplest model that answers the question: an ideal diode for a rough rectifier estimate, a 0.7 V0.7\ \text{V} drop for a bias point, the exponential Shockley law or the hybrid-π\pi model when the numbers matter.
  2. Hand calculation. Solve the model by hand or in a few lines of Python. A hand result tells you why the circuit works and which component sets which property.
  3. Simulate. Check the hand result in SPICE with fuller device models, then explore what the hand model ignored: temperature, tolerances, large signals, frequency limits.
  4. Measure. Build it, measure it, and compare within the measurement uncertainty (Accuracy, Precision and Measurement Uncertainty). A disagreement means the model missed something, and finding what is how you learn.

Conventions used in this course

  • Symbols. DC quantities in capitals with capital subscripts (VCEV_{CE}, ICI_C), small-signal quantities in lower case (vcev_{ce}, ici_c), total instantaneous values in lower case with capital subscripts (vCE=VCE+vcev_{CE} = V_{CE} + v_{ce}). Voltage is VV; school physics books often write UU. The imaginary unit is jj.
  • Thermal voltage. VT=kT/q=25.85 mVV_T = kT/q = 25.85\ \text{mV} at T=300 KT = 300\ \text{K}, the value ngspice uses at its default 27 ∘C27\,^\circ\text{C}.
  • Units upright, with a space: 4.7 kΩ4.7\ \text{k}\Omega, 100 nF100\ \text{nF}, 2.5 mA2.5\ \text{mA}.
  • Worked examples use Given / Find / Solve / Check.
  • SPICE. Decks run in ngspice 42. Device models are written in each deck for this course (a generic small-signal silicon diode DSIG, a rectifier DREC, an NPN QN, an n-MOSFET MN, and so on); they are not vendor models. SPICE reports a source's current flowing into its ++ terminal, so a source delivering power shows a negative current.
  • The ee-netlist lab solves linear circuits only. It has no diode or transistor elements, so the course uses it with linearised models: a diode as a voltage source plus a resistor, a transistor as its small-signal model with a controlled source, an op-amp as a voltage-controlled voltage source.
  • Safety. Hands-on work uses a bench supply set to at most 24 V24\ \text{V} DC with its current limit on, batteries, function generators and USB-powered boards. Anything connected to the mains (transformer primaries, off-line rectifiers, mains-powered supplies) is taught by calculation and simulation only.

A first example, three ways

+ - VS 5 V R 1 kOhm D Si, DSIG + - VD I a

Given: a 5 V5\ \text{V} supply, R=1 kΩR = 1\ \text{k}\Omega and a small silicon diode in series (the figure).

Find: the current II and the diode voltage VDV_D with three diode models.

Solve: KVL around the loop gives VS=IR+VDV_S = IR + V_D.

ideal diode (VD=0):I=5 V1 kΩ=5.000 mAconstant drop (VD=0.7 V):I=5 V−0.7 V1 kΩ=4.300 mAShockley: VD=nVTln⁡(IIS+1)+IRS:solve 5 V=IR+VD(I) numerically\begin{aligned} \text{ideal diode } (V_D = 0): \quad & I = \frac{5\ \text{V}}{1\ \text{k}\Omega} = 5.000\ \text{mA} \\ \text{constant drop } (V_D = 0.7\ \text{V}): \quad & I = \frac{5\ \text{V} - 0.7\ \text{V}}{1\ \text{k}\Omega} = 4.300\ \text{mA} \\ \text{Shockley: } V_D = nV_T \ln\left(\frac{I}{I_S} + 1\right) + I R_S: \quad & \text{solve } 5\ \text{V} = I R + V_D(I) \text{ numerically} \end{aligned}

The third model cannot be solved by algebra alone, so let Python find the root:

python · try it yourself
import numpy as np
from scipy.optimize import brentq

VS, R = 5.0, 1e3
IS, N, RS, VT = 2.52e-9, 1.752, 0.568, 0.02585

def kvl(i):  # supply minus the drops around the loop
    vd = N * VT * np.log(i / IS + 1) + RS * i
    return VS - R * i - vd

i_ideal = VS / R
i_drop = (VS - 0.7) / R
i_exp = brentq(kvl, 1e-12, VS / R)
vd = VS - R * i_exp
print(f"ideal switch : I = {i_ideal*1e3:.3f} mA, VD = 0.000 V")
print(f"0.7 V drop   : I = {i_drop*1e3:.3f} mA, VD = 0.700 V")
print(f"Shockley + Rs: I = {i_exp*1e3:.3f} mA, VD = {vd:.3f} V")
print(f"error of the 0.7 V model: {100*(i_drop-i_exp)/i_exp:+.2f} %")
ideal switch : I = 5.000 mA, VD = 0.000 V
0.7 V drop   : I = 4.300 mA, VD = 0.700 V
Shockley + Rs: I = 4.347 mA, VD = 0.653 V
error of the 0.7 V model: -1.08 %

And in SPICE, with the same diode model written in the deck:

bash · try it yourself
cat > d.cir <<'EOF'
* 5 V, 1 k and a small-signal silicon diode (model written for this course)
.model DSIG D(Is=2.52n N=1.752 Rs=0.568 Cjo=4p M=0.4 Tt=20n BV=100 IBV=0.1u)
V1 in 0 5
R1 in a 1k
D1 a 0 DSIG
.control
op
print v(a) i(V1)
.endc
.end
EOF
ngspice -b d.cir 2>&1 | grep -E '^(v\(|i\()'
v(a) = 6.532286e-01
i(v1) = -4.34677e-03

Check: SPICE and the Python root agree to four digits (4.347 mA4.347\ \text{mA}, 0.653 V0.653\ \text{V}), and the negative i(v1) is the SPICE sign convention for a source that delivers power. The constant-drop model is only 1 % off here because the 1 kΩ1\ \text{k}\Omega resistor takes 4.35 V4.35\ \text{V} of the 5 V5\ \text{V}: when the supply is much larger than the diode drop, the exact drop hardly matters. From a 1.5 V1.5\ \text{V} cell the same 0.7 V guess would be badly off, which is the first design lesson of the course: know which model a question needs (Diode Models).

Guided lab: the first measurement

Hand calculation. I≈4.3 mAI \approx 4.3\ \text{mA}, VD≈0.65 VV_D \approx 0.65\ \text{V} (the model above).

Simulation. The Python root and the SPICE operating point.

What you would measure. Set a bench supply to 5.0 V5.0\ \text{V} with a 20 mA20\ \text{mA} current limit, wire a 1 kΩ1\ \text{k}\Omega 1 % resistor and a small-signal silicon diode (a 1N4148-class part) on a breadboard, anode towards the resistor. A handheld multimeter on its DC volts range should read VDV_D between about 0.620.62 and 0.68 V0.68\ \text{V} (diodes of one type vary by a few tens of millivolts, and VDV_D falls by about 2 mV2\ \text{mV} per kelvin as the room warms). The voltage across the resistor, divided by its measured value, gives I≈4.3 mAI \approx 4.3\ \text{mA} within about 1 %. Reverse the diode: the current falls to nanoamperes and the meter shows the full 5 V5\ \text{V} across the diode.

Hazards and safe setup. Low voltage and a current limit; the only hazard is a hot resistor or a dead diode if the supply is set wrongly. Check the setting before connecting the circuit.

Pitfalls

  • Using one model for every question. "0.7 V" is a model, not a law. It breaks at low supply voltages, at very small or very large currents and away from room temperature.
  • Forgetting the operating point. Every amplifier in this course is analysed in two steps: DC bias first, then small signals around it.
  • Trusting a simulation you could not estimate. A SPICE result you cannot predict within a factor of two by hand usually hides a wiring or model mistake.

Practice

  1. Repeat the worked example with VS=1.5 VV_S = 1.5\ \text{V}. By what percentage is the constant-drop current wrong now?
  2. Why does the ideal-diode model overestimate the current in every diode-resistor circuit?
Answer
  1. The Shockley solution is I=0.919 mAI = 0.919\ \text{mA} at VD=0.581 VV_D = 0.581\ \text{V}; the constant-drop model gives 0.800 mA0.800\ \text{mA}, about 13 % low. The smaller the supply compared with the drop, the more the drop model matters.
  2. It sets the diode voltage to zero, so the whole supply is across RR; any real forward drop leaves less voltage for the resistor and therefore less current.

Test yourself

In the worked example (5 V5\ \text{V}, 1 kΩ1\ \text{k}\Omega, silicon diode) the constant-drop model gives…

  1. 5.0 mA5.0\ \text{mA}
  2. 4.3 mA4.3\ \text{mA}
  3. 0.7 mA0.7\ \text{mA}
  4. 5.7 mA5.7\ \text{mA}

Which order does this course follow when designing a circuit?

  1. simulate, build, then calculate
  2. model, hand calculation, simulation, measurement
  3. measure, then fit a model
  4. build, then simulate

Why does the course use ee-netlist only with linearised device models?

  1. it cannot do AC analysis
  2. it has no diode or transistor elements, only R, L, C, sources and controlled sources
  3. it is limited to 5 elements
  4. it only runs transients

What is VT=kT/qV_T = kT/q at 300 K300\ \text{K}?

  1. 0.7 V0.7\ \text{V}
  2. 25.85 mV25.85\ \text{mV}
  3. 2 mV2\ \text{mV}
  4. 1.12 V1.12\ \text{V}