Circuits lessons
What is a circuit?
Animated circuit loop: battery, resistor and LED with flowing current.
A circuit is a closed loop that allows electric current to flow from a power source through components and back again. If the loop is broken at any point, current stops flowing.
Every circuit needs at least three things: a power source like a battery, a conductor like a wire, and a load like a light bulb or resistor that uses the energy.
Circuits are the foundation of all electronics. From a phone screen to a traffic light, every electronic device runs on circuits.
Voltage, current, and resistance
Voltage (measured in volts, V) is the force that pushes electric charge through a circuit. Think of it as electrical pressure.
Current (measured in amps, A) is the rate at which charge flows through the circuit. More current means more charge passing a point each second.
Resistance (measured in ohms, \Omega) is how much a component opposes the flow of current. A higher resistance means less current for the same voltage.
Ohm's law
The relationship between voltage, current, and resistance is described by Ohm's law. It is the most important equation in circuit design.
Ohm's law: V = I \times R
You can rearrange this to find any unknown. To find current: I = \frac{V}{R}. To find resistance: R = \frac{V}{I}.
Interactive Ohm's law calculator — enter any two of V, I, R.
Practice: Apply Ohm's law
Solve for the unknown V, I, or R using Ohm's law.
Resistors
A resistor limits the amount of current flowing through a circuit. Without resistors, too much current would flow and components could burn out.
Resistors are measured in ohms (\Omega). Common values range from 10\ \Omega to 10\ M\Omega. They are the most common component in any circuit.
Interactive resistor colour-band decoder.
Series circuits
In a series circuit, components are connected one after another in a single loop. The same current flows through every component.
The total resistance is the sum of all individual resistances. If you add more resistors, the total resistance increases and the current decreases.
Series resistance: R_{total} = R_1 + R_2 + R_3 + \ldots
Parallel circuits
In a parallel circuit, components are connected across the same two points. Each component gets the full voltage from the source.
The total resistance of parallel resistors is always less than the smallest individual resistor. Current splits between the paths.
Parallel resistance: \frac{1}{R_{total}} = \frac{1}{R_1} + \frac{1}{R_2} + \frac{1}{R_3} + \ldots
Series vs parallel circuits compared side by side with live totals.
Practice: Calculate total resistance
Calculate the total resistance of a random series or parallel network.
Voltage dividers
A voltage divider uses two resistors in series to produce an output voltage that is a fraction of the input voltage. This is one of the most useful circuit patterns.
Voltage divider formula: V_{out} = V_{in} \times \frac{R_2}{R_1 + R_2}
The output voltage is taken across R_2. By choosing different resistor values, you can step down a voltage to any level you need.
Interactive voltage divider with sliders and a live Vout gauge.
Practice: Voltage divider calculation
Calculate Vout for a random voltage divider.
Capacitors
A capacitor stores electrical energy in an electric field between two conductive plates. It charges up when voltage is applied and releases that energy when the voltage is removed.
Capacitance is measured in farads (F). Most real capacitors are measured in microfarads (\mu F) or picofarads (pF) because one farad is an enormous amount of capacitance.
Capacitors are used for filtering noise, smoothing power supplies, and timing circuits. They block DC current but allow AC current to pass through.
Charging and discharging
When a capacitor charges through a resistor, the voltage across it rises in a curve, not a straight line. It follows an exponential pattern described by the time constant.
Time constant: \tau = R \times C
After one time constant (\tau), the capacitor reaches about 63% of the supply voltage. After five time constants (5\tau), it is considered fully charged at over 99%.
Capacitor charge and discharge curves with R and C sliders.
Practice: Calculate the time constant
Calculate the RC time constant in milliseconds.
LEDs and transistors
An LED (light-emitting diode) produces light when current flows through it in the correct direction. LEDs need a resistor in series to limit current, or they will burn out.
A transistor acts as an electronic switch or amplifier. A small current at the base pin controls a much larger current between the collector and emitter pins.
LED circuit simulator with brightness and a 20 mA overcurrent warning.
Practice: Size the LED resistor
Size the series resistor for a given LED current.
Introduction to logic gates
Logic gates are the building blocks of digital electronics. They take one or more binary inputs (0 or 1) and produce a single binary output based on a rule.
Every computer processor is made from billions of logic gates. Understanding gates is the first step toward understanding how computers think.
The basic gates are AND, OR, and NOT. From these three, every other gate and every digital circuit can be built.
AND, OR, and NOT gates
An AND gate outputs 1 only when all inputs are 1. Think of it as "both must be true." An OR gate outputs 1 when at least one input is 1. Think of it as "either one works."
A NOT gate (also called an inverter) has one input and flips it. If the input is 1, the output is 0, and vice versa.
Explore AND, OR and NOT gates with live truth tables.
Practice: Predict the output
Predict a logic gate's output from its inputs.
NAND and XOR gates
A NAND gate is an AND gate followed by a NOT. It outputs 0 only when all inputs are 1. NAND is special because any other gate can be built using only NAND gates.
An XOR gate (exclusive OR) outputs 1 when the inputs are different. If both inputs match, the output is 0. XOR is essential for arithmetic circuits like adders.
NAND: A \cdot B = \overline{A \cdot B}(NOT of AND)XOR: A \oplus B = A\overline{B} + \overline{A}B(one or the other, not both)
Truth tables
A truth table lists every possible combination of inputs and the resulting output for a gate or circuit. For two inputs, there are four rows. For three inputs, there are eight rows.
Truth tables are the standard way to define and verify logic gate behaviour. They are also used to design new circuits by specifying what output you want for each input combination.
Reference wall of truth tables for the five core gates.
Practice: Complete the truth table
Fill in the blank output cells of a gate's truth table.
Combining gates
Real digital circuits combine multiple gates to perform complex operations. The output of one gate becomes the input of the next.
For example, connecting an AND gate and a NOT gate in sequence creates a NAND gate. Combining an XOR gate with an AND gate creates a half adder, which can add two single-bit numbers.
Interactive half adder with animated Sum and Carry outputs.
Practice: Trace the circuit
Trace a two-gate circuit to its final output.
Boolean expressions
Every logic circuit can be written as a Boolean expression. AND is written as multiplication (A \cdot B), OR as addition (A + B), and NOT as a bar (\overline{A}).
For example, the expression \overline{A \cdot B} + C means: AND gates A and B, invert the result, then OR with C. Reading Boolean expressions is how engineers design circuits on paper before building them.
From expression to circuit
To convert a Boolean expression into a circuit, work from the inside out. Find the innermost operation first, draw that gate, then connect its output to the next operation.
F = (A \cdot B) + C(the full expression)A \cdot B \to \text{AND gate}(innermost operation)(result) + C \to \text{OR gate}(connect AND output to OR)
Boolean expressions shown next to their circuit diagrams.
Practice: Match expression to circuit
Match each Boolean expression to its circuit.
Putting it all together
You now know the core building blocks of electronics. Resistors, capacitors, LEDs, and transistors make up analog circuits. Logic gates and truth tables are the basis of digital circuits.
In practice, most electronic devices combine both. A smartphone uses analog circuits for its radio and speaker, and digital circuits for its processor and memory.
The next step is building more complex circuits: flip-flops for memory, counters for timing, and multiplexers for routing signals. All of them use the same gates and principles you have learned here.
Practice: Circuit review
Five-question review quiz drawn from across the course.