Electromagnetism
Electric Circuits
Closed loops of components — voltage drives current through resistors, capacitors, inductors
An electric circuit is a closed loop of conductors and components — voltage source drives current through resistors (R), capacitors (C), inductors (L), and other components. Series and parallel arrangements give different behaviors. Kirchhoff's laws (current and voltage) plus Ohm's law solve any circuit. Foundation of all electronics — phones, computers, power grids.
- Closed loop requiredCurrent can't flow without complete circuit
- Voltage sourceBattery, generator, power supply (V)
- ComponentsResistors, capacitors, inductors, transistors, diodes
- SeriesSame current through all components
- ParallelSame voltage across all components
- Two key lawsKCL (current at node), KVL (voltage around loop)
Interactive visualization
Press play, or step through manually. The visualization is yours to drive — try it before reading on.
Watch the 60-second explainer
A condensed visual walkthrough — narrated, captioned, under a minute.
Circuit basics
An electric circuit is a closed loop containing:
- Source — battery, generator, or power supply providing voltage V.
- Conductors — wires (typically negligible resistance).
- Components — resistors (R), capacitors (C), inductors (L), diodes, transistors, etc.
- Switch (often) — opens/closes the circuit.
Charge flows around the loop driven by the voltage source. Current I = charge/time = dQ/dt (units: amperes, A).
Series vs parallel
| Property | Series | Parallel |
|---|---|---|
| Topology | Components on one path | Components on multiple paths |
| Current | Same through all | Divides among components |
| Voltage | Adds across components | Same across all |
| Resistors | R_total = ΣR_i | 1/R_total = Σ(1/R_i) |
| Capacitors | 1/C_total = Σ(1/C_i) | C_total = ΣC_i |
| Inductors | L_total = ΣL_i | 1/L_total = Σ(1/L_i) |
Key laws
Ohm's Law:
V = I · R
Kirchhoff's Current Law (KCL): Sum of currents into a node equals sum out. (Charge conservation at junctions.)
Kirchhoff's Voltage Law (KVL): Sum of voltage drops around any closed loop equals 0. (Energy conservation around the loop.)
Common components
| Component | Symbol | Behavior |
|---|---|---|
| Resistor | —/\/\/\— | V = IR; dissipates power as heat |
| Capacitor | —||— | Stores charge; I = C·dV/dt |
| Inductor | —UUUU— | Stores energy in B-field; V = L·dI/dt |
| Diode | —|>|— | One-way valve; passes current in one direction |
| Transistor | (complex) | Amplifier or switch |
| Voltage source | —|+ −|— | Constant V regardless of current |
| Current source | —(↑)— | Constant I regardless of voltage |
| Switch | —/_/— | Opens/closes the path |
Common configurations
| Circuit | Behavior |
|---|---|
| Simple R | I = V/R; voltage drives current through resistor |
| RC charging | V_C = V·(1 − e^(−t/RC)); approaches V exponentially |
| RC discharging | V_C = V_0·e^(−t/RC); decays exponentially |
| RL circuit | I = (V/R)·(1 − e^(−tR/L)); inductor opposes change |
| RLC resonance | Resonance at f = 1/(2π√(LC)) |
| Voltage divider | V_out = V_in · R₂/(R₁ + R₂) |
| Current divider | I_branch = I_total · (other_R)/(R₁ + R₂) |
JavaScript — circuit calculations
// Series resistors
function seriesResistance(R_array) {
return R_array.reduce((a, b) => a + b, 0);
}
// Parallel resistors
function parallelResistance(R_array) {
return 1 / R_array.reduce((sum, R) => sum + 1/R, 0);
}
console.log(`100Ω, 200Ω series: ${seriesResistance([100, 200])} Ω`); // 300
console.log(`100Ω, 200Ω parallel: ${parallelResistance([100, 200]).toFixed(2)} Ω`); // 66.67
console.log(`Two 100Ω parallel: ${parallelResistance([100, 100])} Ω`); // 50 (half)
// Current and voltage for simple circuit
function ohms(V, R) { return V / R; } // Current
function dropV(I, R) { return I * R; } // Voltage drop
// Voltage divider
function voltageDivider(V_in, R1, R2) {
// V_out across R2: V_out = V_in · R2/(R1+R2)
return V_in * R2 / (R1 + R2);
}
console.log(`9V divided by 1k+2k: ${voltageDivider(9, 1000, 2000).toFixed(1)} V`); // 6.0
// Current divider
function currentDivider(I_total, R_branch, R_other) {
return I_total * R_other / (R_branch + R_other);
}
// RC charging
function rcChargingVoltage(V_source, R, C, t) {
const tau = R * C;
return V_source * (1 - Math.exp(-t / tau));
}
// 9V battery, 1kΩ resistor, 100µF capacitor
console.log(`After 0.1 sec: ${rcChargingVoltage(9, 1000, 100e-6, 0.1).toFixed(2)} V`);
// τ = RC = 0.1 sec; after 1τ, V = 9·(1 - 1/e) = 5.69V
// RC discharging
function rcDischarging(V_initial, R, C, t) {
return V_initial * Math.exp(-t / (R * C));
}
// RLC resonant frequency
function lcResonance(L, C) {
return 1 / (2 * Math.PI * Math.sqrt(L * C));
}
console.log(`LC: 1mH + 1µF: ${(lcResonance(1e-3, 1e-6) / 1000).toFixed(2)} kHz`); // ~5.03 kHz
// Power in resistor
function powerInResistor(V, I) {
// P = VI = I²R = V²/R
return V * I;
}
console.log(`9V, 0.05A: ${powerInResistor(9, 0.05)} W`); // 0.45 W
// Bridge circuit (Wheatstone) — used for sensitive resistance measurements
function wheatstoneBridge(R1, R2, R3, R4) {
// Balanced when R1/R2 = R3/R4
return Math.abs(R1/R2 - R3/R4) < 1e-9;
}
// Battery voltage with internal resistance r
function loadedVoltage(V_emf, r_internal, R_load) {
// V = V_emf - I·r where I = V_emf/(r + R_load)
// V_terminal = V_emf · R_load/(r + R_load)
return V_emf * R_load / (r_internal + R_load);
}
console.log(`9V battery, 0.5Ω internal, 1Ω load: ${loadedVoltage(9, 0.5, 1).toFixed(2)} V`); // 6.0
Where circuits matter
- Electronics — everywhere. Phones, computers, TVs, IoT, medical devices.
- Power systems. Generation, transmission, distribution; AC and DC grids.
- Control systems. Sensors, actuators, automation.
- Communications. Radio, TV, internet, fiber optics — all involve circuits at endpoints.
- Robotics. Motor drivers, sensor circuits, microcontrollers.
- Energy storage. Battery management, DC-DC converters, charging circuits.
- Education. Foundation of EE; intro circuits taught universally.
Common mistakes
- Confusing series and parallel. Series — same current. Parallel — same voltage. Resistor formulas opposite. Capacitor formulas reversed from resistors.
- Forgetting Kirchhoff signs. Voltage drops in direction of current through resistor; rise from − to + through battery. Sign errors common.
- Using DC analysis on AC. Capacitor blocks DC but passes AC; inductor passes DC, blocks AC. Don't analyze RLC with simple DC-only methods.
- Ignoring polarity (capacitors). Electrolytic caps are polarized; reversed connection damages them. Ceramic caps are not polarized.
- Forgetting wire resistance/heat. Real wires have small but nonzero R. High currents in thin wires → significant voltage drop, heat.
- Open vs closed switch confusion. Open = breaks circuit, no current. Closed = complete loop, current flows.
Frequently asked questions
Why does current need a complete circuit?
Current is moving charge. For continuous flow, charges must return to source — completing the loop. Otherwise, charges would pile up and stop. A "broken circuit" prevents charge return → no current. Open switches break the circuit; closed switches complete it.
What's the difference between series and parallel?
Series — components on one path; same current flows through all. Voltage divides among them. Series resistors: R_total = R₁ + R₂ + ... Parallel — components on multiple paths; same voltage across all. Current divides. Parallel resistors: 1/R_total = 1/R₁ + 1/R₂ + ...
How does Ohm's law connect to circuits?
V = IR. For a resistor with voltage V across it, current I = V/R flows. Tells you current from voltage, voltage from current, etc. Used at every step of circuit analysis. Ohm's law is for ohmic resistors only — non-ohmic devices (diodes, transistors) need different equations.
What are Kirchhoff's laws?
KCL (Current law): sum of currents into a node = sum out (charge conservation). KVL (Voltage law): sum of voltage drops around any closed loop = 0 (energy conservation). With Ohm's law, these solve any circuit. Setting up loop equations is systematic — choose loops, sum, solve.
How do capacitors and inductors behave?
Capacitors store energy in electric field; current = C·dV/dt (current proportional to voltage rate of change). Open circuits at DC steady state; conduct at high frequencies. Inductors store energy in magnetic field; voltage = L·dI/dt (voltage proportional to current rate of change). Short circuits at DC; impede at high frequencies. Together with R, form RLC circuits with resonance.
What's the difference between AC and DC?
DC (direct current) — steady current flow in one direction. Batteries, USB, simple electronics. AC (alternating current) — current reverses periodically (60 Hz in US, 50 Hz in EU). Power grid uses AC for easy transformers/voltage conversion. Most modern electronics convert AC → DC internally.
How are circuits analyzed in practice?
For simple circuits — apply Ohm's law and Kirchhoff's laws by hand. For complex — use mesh or nodal analysis (systematic methods using KVL/KCL). Modern: SPICE simulations (industry-standard software) handle circuits with millions of components. Real-world: oscilloscopes, multimeters measure V, I in operating circuits.