Hardware Academy
PCB Design

Circuit fundamentals you actually use

Ohm's law, Kirchhoff's laws, dividers, time constants and the mistakes that bite on real boards.

Day 4 · 45 min

After this lesson

  • You can apply Ohm's law, KVL and KCL to simple networks.
  • You can design a voltage divider that does not get loaded down.
  • You can explain RC time constants and reactance of capacitors and inductors.

The handful of circuit ideas that carry real boards

Charge, current, voltage and power

Everything on a board starts with four quantities. Current is charge moving past a point: 1 A is 1 coulomb per second, about 6.24 × 1018 electrons every second. Voltage is energy per unit charge: 1 V means each coulomb gains or gives up 1 joule. It is always a difference between two points, so every voltage needs a reference, and in a circuit that reference is called ground. Power is P = V · I, in watts. A 3.3 V rail supplying 200 mA delivers 0.66 W, and a 2000 mAh, 3.7 V cell stores 7.4 Wh, which is about 26.6 kJ.

Ohm's law and where the heat goes

For a resistor, V = I · R. Put 5 V across 1 kΩ and 5 mA flows. Power can be written three ways, P = V · I = I² · R = V² / R, and which one you reach for depends on what you know. 5 V across 1 kΩ burns 25 mW, but 12 V across the same part burns 144 mW, more than a 0603 resistor (100 mW) can take. Check dissipation against the package rating, and keep real designs at half the rating or less.

Kirchhoff's laws, series and parallel

KCL: the currents flowing into a node sum to zero, because charge cannot pile up at a point. KVL: the voltage rises and drops around any closed loop sum to zero. Take a 12 V battery with R1 = 27 kΩ and R2 = 10 kΩ in series. The current is 12 V / 37 kΩ = 324 µA, the drops are 8.76 V and 3.24 V, and 12 − 8.76 − 3.24 = 0. Series resistances add. Parallel resistances combine as 1/R = 1/R1 + 1/R2, so two 10 kΩ parts make 5 kΩ, and the result is always smaller than the smallest branch.

The voltage divider, loading and Thevenin

Two series resistors tapped in the middle give Vout = Vin · R2 / (R1 + R2). To scale 12 V down for a 3.3 V ADC you want a ratio of 0.275, and 27 kΩ over 10 kΩ gives 3.24 V while drawing 324 µA. But a divider is not an ideal source. Thevenin's theorem says any linear network seen from two terminals behaves like one ideal source in series with one resistance, and here that is 3.24 V behind R1 ∥ R2 = 7.3 kΩ.

A load RL on the output forms a second divider with that 7.3 kΩ, so the output falls by the factor RL / (RL + 7.3 kΩ). A 1 MΩ load costs 0.7%, 100 kΩ costs 6.8%, and 10 kΩ drags the output down to 1.88 V. Keep the load at least 10 times the Thevenin resistance for about 10% error and 100 times for about 1%.

A 27 kilohm and 10 kilohm voltage divider on 12 volts giving 3.24 volts for an ADC pinVoltage divider324 µAVin = 12 VR1 = 27 kΩdrops 8.76 VR2 = 10 kΩdrops 3.24 VVout = 3.24 Vto the ADC pinRth = 7.3 kΩA series loop of a 12 volt source and two resistors whose voltage drops of 8.76 and 3.24 volts add up to 12 voltsKirchhoff's voltage law around the loop+−12 VR1 = 27 kΩ−8.76 VR2 = 10 kΩ−3.24 VI = 12 V / 37 kΩ = 324 µAsum of rises and drops = 0+12 − 8.76 − 3.24 = 0 Vthe loop closes on itself
The 27 kΩ / 10 kΩ divider and the KVL loop it forms with the battery: the drops across R1 and R2 add up to the 12 V source.

Time and frequency: DC, AC, τ = RC and reactance

DC has constant polarity; AC alternates, and a sine is described by its peak, its frequency and its RMS value, Vrms = Vpk / √2, so 230 V RMS mains peaks at 325 V. Put a resistor in series with a capacitor and the capacitor charges as V · (1 − e−t/RC). The product τ = R · C is the time constant: after 1τ the capacitor is at 63.2%, after 3τ at 95%, and after 5τ at 99.3%, which is why 5τ is the practical settling time. A 10 kΩ resistor with a 100 nF capacitor gives τ = 1 ms and settles in 5 ms; the same pair is a low-pass filter with cutoff fc = 1 / (2πRC) = 159 Hz.

Capacitors and inductors oppose AC through their impedance, which for an ideal part is pure reactance. XC = 1 / (2πfC) falls as frequency rises, while XL = 2πfL rises. A 100 nF capacitor is 15.9 kΩ at 100 Hz but only 1.59 Ω at 1 MHz, which is why it shorts fast noise to ground, and a 10 µH inductor is 62.8 Ω at 1 MHz. A capacitor blocks DC and passes high frequencies; an inductor does the opposite.

Decibels

Engineers quote ratios in decibels: dB = 20 · log10(Vout / Vin) for voltage, with 10 · log10 for power. Remember four points: +6 dB doubles a voltage, −6 dB halves it, −20 dB is a factor of 10, and −3 dB is ×0.707, the half-power point where a filter reaches its cutoff frequency.

Measuring with a multimeter

Measure voltage in parallel with the leads in the V jack. A typical meter presents 10 MΩ, so it barely disturbs a 7 kΩ divider but would pull a 1 MΩ source down by about 9%. Measure current in series: break the circuit and use the mA or A jack. The meter is then close to a short, so leaving the leads there while you probe a supply blows the fuse. Measure resistance and continuity only with the board unpowered and the part isolated, otherwise parallel paths give a wrong answer.

Floating inputs and the ground reference

A CMOS input connected to nothing floats: it picks up 50 Hz hum from your hand, sits near mid-rail, and may draw extra current or read random bits. Every input needs a defined state, so use a pull-up or pull-down (10 kΩ typical, 100 kΩ when power matters) on reset, enable, strap and unused gate pins. A voltage also only means something against a reference. All grounds on a board are one node by convention, but copper has resistance: 3 A through 10 mΩ of shared ground is 30 mV of ground bounce, tens of counts on a 12-bit ADC.

Interactive: Ohm's law and the loaded divider

Ohm's law and the loaded divider

Change V and R: the dots circulate faster as the current rises, and the resistor heats up as P = V · I approaches its rating.

Circuit
Resistor power rating
Series circuit: a 5.0 volt source drives a 1 kohm resistor, current 5 mA, power 25 mW.+−I = 5 mA5.0 VR = 1 kΩP = 25 mWKirchhoff: source rise = resistor drop+5.0 V − 5.0 V = 0
Current I = V / R
5 mA
Power P = V · I
25 mW
Share of rating
10%
Verdict
Comfortable
Dot speed is proportional to current: 10 mA sends the dots once round the loop each second, up to a cap of about 1.7 loops per second (above 17 mA more current no longer looks faster, to keep the dots from appearing to run backwards). Real resistors are rated at 70 °C ambient; running them at half rating or less keeps them cool.

In practice

Practice

Design a battery-monitor divider

A 12 V battery must feed a 3.3 V ADC pin through a divider that may draw at most 0.5 mA. Pick standard resistor values, then state Vout, the divider current and the Thevenin resistance. Finally check two things: what the output does if the battery reaches 14.4 V, and what a 100 kΩ load does to Vout.

Answer: show the worked solution
text
Ratio     3.3 / 12 = 0.275        R1 / R2 = (1 - 0.275) / 0.275 = 2.64
Budget    12 V / 0.5 mA = 24 kΩ minimum total resistance
Pick      R2 = 10 kΩ, R1 = 27 kΩ (nearest E12 value to 26.4 kΩ)
Vout      12 x 10 / (27 + 10) = 3.24 V
Current   12 V / 37 kΩ = 324 µA (under 0.5 mA), P = 3.9 mW
Rth       27k || 10k = 7.3 kΩ (below 10 kΩ, fine for a SAR ADC)
100 kΩ    3.24 x 100 / (100 + 7.3) = 3.02 V, which is 6.8% low
14.4 V    14.4 x 10 / 37 = 3.89 V, above the 3.3 V pin limit
Fix       R1 = 36 kΩ: 14.4 V gives 3.13 V, 12 V gives 2.61 V, Rth = 7.8 kΩ, I = 313 µA

27 kΩ / 10 kΩ meets the brief at a nominal 12 V, but a charging lead-acid battery breaks it. Moving R1 to 36 kΩ keeps the pin legal up to 14.4 V and still draws only 313 µA; the price is a lower reading at 12 V, which the firmware scales back up. Add 100 nF at the pin so the ADC's sampling charge does not drag the node down.

Real-world scenario

Real-world scenario

ADC reads 2.9 V where the multimeter says 3.3 V

A 12 V battery monitor on a robot board feeds a 12-bit ADC through a divider chosen to waste almost no current: R1 = 261 kΩ and R2 = 100 kΩ, both 1%. The node should sit at 3.32 V and the divider draws only 33 µA. On the bench a multimeter on the ADC pin reads 3.30 V, yet the firmware reports about 2.9 V, and the number shifts when another analog channel is added to the scan list.

Symptoms

  • Multimeter on the ADC pin reads 3.30 V; the firmware prints about 2.9 V, roughly 12% low.
  • The reading is correct when the same channel is sampled twice in a row, and wrong when it follows a channel at 0 V.
  • The error scales with the voltage: it is a constant fraction, not a fixed offset.

Interview questions

screenWalk me through designing a voltage divider that scales a 12 V battery down to a 3.3 V ADC input.
I start with the ratio: 3.3 / 12 = 0.275, so R1 / R2 = 2.64. I pick R2 = 10 kΩ so the divider draws well under a milliamp, which makes R1 = 26.4 kΩ, and I use the nearest standard value, 27 kΩ, for 3.24 V out at 324 µA. Then I check loading: the output resistance is R1 in parallel with R2, 7.3 kΩ, so the ADC or a filter capacitor must not disturb it by more than a percent or two. Finally I design for the worst case rather than the nominal one: a 12 V lead-acid battery reaches 14.4 V while charging, which would put 3.9 V on a 3.3 V pin, so I would move to 36 kΩ and 10 kΩ and add a 100 nF capacitor at the pin.
screenState Kirchhoff's two laws and say when you use each.
KCL says the currents entering a node sum to zero, because charge cannot pile up at a point. I use it to find a branch current, for example when a load taps off a divider. KVL says the voltage rises and drops around any closed loop sum to zero, because voltage is a potential difference. I use it to find an unknown voltage, such as how much of a 12 V supply is left after two series resistors. Together with Ohm's law they solve any resistor network, and I use them as sanity checks: if the drops around a loop do not add up to the source, my schematic or my measurement is wrong.
screenHow do you measure current with a multimeter, and what is the classic mistake?
Current is measured in series: I break the circuit, move the red lead to the mA or A jack and put the meter in the path so the current flows through it. In that mode the meter is a near-zero resistance, a few ohms or less. The classic mistake is leaving the leads in the current jacks and then probing a voltage across a supply, which is almost a short circuit and blows the meter fuse. I move the lead back to the voltage jack right after each current measurement, and on small boards I often measure the voltage across a known shunt resistor instead.
screenWhat happens to a digital input that is left floating, and how do you fix it?
A floating CMOS input has no defined voltage, so it drifts wherever stray capacitance and leakage push it, and it picks up mains hum and nearby switching noise. Near the middle of the logic range both input transistors conduct, so it can draw extra current and read as random zeros and ones. The fix is to give it a defined state with a pull-up or pull-down resistor, typically 10 kΩ, or an internal pull of roughly 30 to 50 kΩ when the timing allows. Enable, reset, strap and unused gate inputs all deserve the same discipline, because a floating pin can work on the bench and fail in the field.
deepExplain a Thevenin equivalent using a voltage divider, and why a divider cannot drive a low-impedance load.
Any linear two-terminal network behaves like one ideal source in series with one resistor. For a divider the source is the unloaded output, Vin · R2 / (R1 + R2), and the series resistance is R1 in parallel with R2, so 27 kΩ and 10 kΩ give 3.24 V behind 7.3 kΩ. A load RL forms a second divider with that Thevenin resistance, so the output falls by the factor RL / (RL + Rth). A 10 kΩ load drags 3.24 V down to 1.88 V, while a 1 MΩ load costs only 0.7%. The rule of thumb is a load of at least 10 times Rth for about 10% error and 100 times for about 1%, which is why dividers feed high-impedance inputs and why I add a buffer or a capacitor in front of a sampled ADC.
deepYou apply a 0 to 3.3 V, 1 kHz square wave to a 10 kΩ and 100 nF RC low-pass. What does the output look like, and why?
The time constant is 10 kΩ × 100 nF = 1 ms, so the cutoff is 1 / (2π · 1 ms) = 159 Hz and 1 kHz sits well above it. Each half period is 0.5 ms, only half a time constant, so the capacitor never gets near either rail. The output settles into a roughly triangular wave centred on 1.65 V that swings between about 1.25 V and 2.05 V, around 0.8 V peak to peak instead of 3.3 V. If I drop the frequency below roughly 50 Hz the output looks like the input again, and if I raise it to 10 kHz the ripple shrinks to about 80 mV.

Quiz

1. A 5 V rail drives a 1 kΩ resistor. How much power does the resistor dissipate?
2. Two 10 kΩ resistors are connected in parallel. What is the total resistance?
3. A divider is built from R1 = 27 kΩ (top) and R2 = 10 kΩ (bottom) on 12 V. What is the unloaded output voltage?
4. That divider has a Thevenin resistance of 7.3 kΩ. Which load keeps the loading error under about 1%?
5. An RC circuit has R = 10 kΩ and C = 100 nF. A step is applied, and 5 ms later the capacitor voltage is about:
6. What is the reactance of a 100 nF capacitor at 1 MHz?
7. A filter's output is 6 dB below its input. The voltage ratio is:
8. A reset input on a new board is left unconnected. What is the most likely outcome?

References and further reading

Where the ideas in this lesson come from, and what to read next. Books are the standard texts; papers are the original sources; standards are what employers work to.

  1. Book

    Paul Horowitz and Winfield Hill (2015). The Art of Electronics. Cambridge University Press, 3rd edition.

    Read: Chapter 1: voltage, current, dividers, RC circuits, with the authors' practical warnings.

  2. Book

    Adel S. Sedra and Kenneth C. Smith (2020). Microelectronic Circuits. Oxford University Press, 8th edition.

    Read: The introductory chapter for the formal versions of the same ideas.