Electricity, explained with water

Beginner20 min readUpdated September 2026

Voltage, current, resistance and Ohm's law, plus what resistors, capacitors, inductors and transistors actually do, all built on one picture: water moving through pipes.

You can't see electricity. You can't watch it flow, feel how hard it's pushing, or tell by looking whether a wire is carrying a milliamp or an amp. That's what makes it hard to learn. Everything happens inside copper, silently.

Water is the opposite. You already have a lifetime of intuition for it: how pressure pushes, how a narrow pipe slows things down, how a full tank pushes back. And it turns out that water in pipes behaves almost exactly like electricity in wires.

This article uses that one picture all the way through. First for the three basic quantities and the law that ties them together. Then for the four components you'll meet in almost every circuit: resistors, capacitors, inductors and transistors.

The three things you need to know

Imagine a closed loop of pipe, completely full of water, with a pump somewhere in it.

Voltage is pressure. It's how hard the pump pushes. A 9 V battery pushes harder than a 1.5 V one, the same way a bigger pump builds more pressure. Voltage is measured in volts (V).

Current is flow. It's how much water passes a point each second. It's measured in amps (A). Most of what you'll build uses thousandths of an amp, milliamps (mA).

Resistance is narrowness. A thin pipe fights the flow more than a wide one. Resistance is measured in ohms (Ω). Every part of a circuit has some, even plain wire, but wire has so little that you can usually ignore it.

ElectricityWaterUnit
VoltagePressure: how hard it's pushedvolts (V)
CurrentFlow: how much moves per secondamps (A)
ResistanceNarrowness: how hard it is to push throughohms (Ω)
Battery or power supplyPump
WireWide, smooth pipe

Two details of this picture matter more than they seem.

The pipes are always full. The wires in a circuit are already packed with electrons, just as the pipes are already full of water. When you flip a switch, electrons from the battery don't have to race to the bulb. The push travels through the water that's already there, which is why a light comes on instantly even though each individual electron drifts along at less than a millimetre per second.

It has to be a loop. A pump in a pipe with a dead end can't make anything flow. Water leaves the pump, goes round the loop and comes back in. A circuit is the same: current leaves the battery, goes through your components and returns to the other terminal. That's why every part needs two connections, and why a single broken wire stops everything.

Voltage is always measured between two points, the way pressure is a difference between two places in a pipe. When a circuit says a pin is "at 3.3 V", it means 3.3 V above ground, the zero point everything else is measured from. Think of ground as sea level.

Ohm's law

The three quantities are tied together by one simple rule:

V = I × R
voltage = current × resistance

(Current is written I, from the French intensité. It's a historical quirk that stuck.)

In water terms it says what you'd expect. More pressure pushes more flow through the same pipe. A narrower pipe lets less through at the same pressure. Rearranged, it gives you whichever one you're missing:

  • I = V ÷ R: how much current will flow
  • R = V ÷ I: what resistance you need to get a particular current
  • V = I × R: how much voltage a resistor "uses up" when current flows through it

Play with it. The water and the circuit below are the same system, drawn two ways.

The same loop drawn twice: as water in pipes, and as a real circuit. Double the pressure and watch the flow double. Then narrow the pipe and watch it fall.

Water

pumppushes at 6 Vnarrow pipe12 mAflow meter

Circuit

+battery, 6 Vresistor, 500 ΩA12 mA
6 V

How hard the pump pushes

500 Ω

How narrow the pipe is

I = V ÷ R = 6 V ÷ 500 Ω = 12 mA

Voltage
6 V
pressure
Resistance
500 Ω
narrowness
Current
12 mA
flow rate
Power
72 mW
heat from friction

A worked example: a 5 V supply across a 1,000 Ω resistor. I = 5 ÷ 1000 = 0.005 A, or 5 mA. Swap in a 500 Ω resistor and you get 10 mA. Halve the resistance and you double the current.

Power: why things get hot

Pushing water through a narrow pipe takes effort, and in real life that effort turns into heat from friction. Electricity is the same. The power turned into heat is:

P = V × I
power (watts) = voltage × current

That's why resistors come with a power rating, usually ¼ W for the small ones you'll use most. Go past it and the resistor overheats, discolours and eventually fails. For 5 V and 10 mA, P = 5 × 0.01 = 0.05 W, comfortably inside that limit.

Voltage drops: a river from mountain to sea

Pipes are good for showing flow. For seeing where the voltage goes, there's a better picture: a river.

Pressure and height are really the same idea. Water held high up has pressure waiting to be used, which is why towns put their water tanks on hills. So picture voltage as height. The battery lifts water to the top of a mountain. From there it runs downhill through each component in turn, back to the sea. The sea is ground, 0 V, the level everything else is measured from.

Every component the river passes through takes some of that height. That's what people mean when they say a component drops voltage.

Height is voltage. The battery lifts water to the top of the mountain, and it runs down through each component to the sea, which is ground (0 V). Every component takes some of the height. By the time the water reaches the sea, all of it has been used.

sea level: ground, 0 Vthe battery lifts it back up5.00 V2.00 V0 Vrapids220 Ω resistor−3.00 Vwaterfallred LED−2.00 V

Battery (height of the mountain)

LED (a waterfall of fixed height)

220 Ω

Rapids: the drop grows with the flow

none

Slide to zero to take it out

The red LED is a waterfall of fixed height: it always takes about 2 V, however much water goes over it. The resistors share whatever height is left, in proportion to their size.

3.00 V + 2.00 V = 5 V

Battery
5 V
height of the mountain
Current
13.6 mA
same at every point
Drops add up to
5.00 V
always the full height
Ground
0 V
sea level

Three rules fall straight out of the picture, and they hold for every circuit you'll build:

  • The drops always add up to the battery voltage. The river starts at the top of the mountain and ends at the sea, so however it gets there, it falls the full height. Engineers call this Kirchhoff's voltage law.
  • The current is the same all the way along. In a single loop, every drop of water that goes over the first rapids also goes over the waterfall. Nothing is used up except height.
  • Voltage at a point is its height above the sea. A meter measuring "the voltage on this pin" is measuring how high that part of the river is. That's why there's a voltage across a component, from the top of its drop to the bottom, but a voltage at a point, measured down to ground.

Resistors and LEDs drop voltage in different ways. A resistor is rapids: the more water flows, the steeper they get, exactly as V = I × R says. An LED is a waterfall: it's roughly the same height whatever flows over it. You'll see why that matters in the next section.

Resistors: the narrow pipe

A resistor is a component whose only job is to be a known amount of narrow pipe. They're the cheapest, most common part in electronics, and they do two main things.

They limit current. Some parts will take as much current as you give them and destroy themselves in the process. A resistor in front of them sets a sensible ceiling.

They share out voltage. Put two resistors in a row and the height drops across each one in proportion to its size, as you saw on the river. That's called a voltage divider, and it's how you scale a signal down, for example to read a 5 V sensor with a 3.3 V board.

How you connect them changes the total:

  • In series (one after another): the narrow sections add up. R = R1 + R2. Two 1 kΩ resistors in series make 2 kΩ.
  • In parallel (side by side): you've given the water two paths, so it's easier to get through. 1/R = 1/R1 + 1/R2. Two 1 kΩ resistors in parallel make 500 Ω.

A practical example: the LED

Almost every first circuit is an LED, and almost every first mistake is leaving out its resistor.

An LED is a kind of diode, a one-way valve for current. In water terms, it's a flap valve that only opens one way, and only once the pressure is high enough to push it open. Red LEDs need about 2 V; blue and white ones need about 3 V. This is called the forward voltage.

The catch is what happens once the flap is open: it offers almost no resistance at all. With nothing else in the pipe, the flow shoots up until something breaks, and that something is the LED. So you always put a resistor in series to take up the extra pressure. On the river, the LED's waterfall takes its fixed 2 V, and the resistor's rapids have to take the rest of the height:

R = (supply voltage − LED forward voltage) ÷ current you want

Every LED needs a resistor in front of it. Pick a supply, an LED and how bright you want it, and see which resistor to use. Then take the resistor away.

The LED is a one-way flap that takes 2 V of pressure to push open. The resistor has to drop the other 3.0 V.

Supply voltage (pump pressure)

LED colour (how hard its flap is to open)

10 mA

10 mA is plenty bright for a modern LED. 20 mA is the usual maximum.

R = (Vsupply − VLED) ÷ I = (5 − 2) V ÷ 10 mA = 300 Ω → use 330 Ω

Resistor
330 Ω
narrow pipe
Actual current
9.09 mA
flow through the LED
Resistor heat
27.3 mW
any ⅛ W resistor
LED heat
18.2 mW
fine

Resistors only come in certain standard values, so you rarely find exactly the number you calculated. Round up to the next standard value. A bit more resistance just means a bit less current, which is the safe direction to be wrong in.

Capacitors: the stretchy membrane

Imagine a chamber in the pipe, split in two by a sheet of rubber. Water can't pass through the rubber. But when the pump pushes, water flows in on one side and stretches the membrane, and the same amount flows out of the other side. For a moment, it looks exactly like water is flowing through.

The more the membrane stretches, the harder it pushes back. Eventually its back-pressure matches the pump and the flow stops. Now the membrane is holding energy, like a stretched balloon. Turn the pump off and it pushes the water back out.

That's a capacitor. It stores electrical energy, then gives it back. Its size is its capacitance, measured in farads (F). A farad is enormous, so real capacitors are labelled in microfarads (µF) or smaller. A bigger capacitance is a bigger, softer membrane: it takes more water to stretch it to the same pressure.

A capacitor is a chamber split by a stretchy rubber membrane. Water can't get through it, but it can push the membrane and stretch it. Connect the pump and watch the flow start fast, then slow as the membrane pushes back.

Water

pumpoff, water can flow backnarrow pipemembrane0% stretched

Voltage and current over time

0%63%100%1τ2τ3τ4τ5ττ = 1.03 s
Capacitor voltageCurrent
4.7 kΩ

Narrower pipe, slower filling

Capacitance (how big the membrane is)

Capacitor
0.00 V
membrane back-pressure
Current
0 A
flow into chamber
τ = R × C
1.03 s
time to reach 63%
Charged
0%
of the pump's pressure

Notice the shape of both curves. The current is highest at the very start, when the membrane is slack and there's nothing pushing back. As the capacitor fills, the flow slows down, so it fills more and more slowly and never quite gets there.

How fast this happens depends on the resistor feeding it and the capacitor's size, multiplied together into the time constant:

τ = R × C

After one time constant (τ, the Greek letter tau), a capacitor is about 63% full. After five, it's over 99% full, which for practical purposes means done. A 10 kΩ resistor and a 100 µF capacitor give τ = 10000 × 0.0001 = 1 second.

Three things follow from the membrane picture:

  • A capacitor blocks steady current. Once the membrane has stretched as far as the pump can push it, nothing more flows. Steady, unchanging current can't get through.
  • It lets changes through. Anything that pushes back and forth, like an audio signal, just flexes the membrane each way, and the flow on the far side follows along.
  • It smooths out bumps. A stretched membrane pushes back hardest just when the pump falters, filling in the gap. That's why you'll see small capacitors placed right next to every chip. They catch the brief drops in voltage that would otherwise reset your board, as covered in Powering your project.

Large capacitors can stay charged after the power is off, like a stretched membrane with nowhere to push. The small ones on a hobby board are harmless, but the big ones inside mains-powered equipment can give a dangerous shock long after it's unplugged.

Inductors: the heavy water wheel

Now put a heavy water wheel in the pipe, the kind with a lot of mass that takes real effort to get spinning.

Turn the pump on and the wheel resists at first. The flow builds up slowly as the wheel gathers speed. Once it's spinning, it doesn't resist any more, and water flows through freely.

The interesting part is stopping. A spinning heavy wheel refuses to stop. If you slam a valve shut, the wheel keeps pushing water toward it with enormous force, and the pipe bangs. Plumbers call it water hammer.

That's an inductor: a coil of wire that stores energy in a magnetic field while current flows through it. It resists changes in current: slow to start, and very reluctant to stop. Its size is its inductance, measured in henries (H), usually in millihenries (mH).

An inductor is a heavy water wheel in the pipe. It takes time to get spinning, and once it's spinning it refuses to stop. Open the valve, wait, then slam it shut. Then try again with the bypass fitted.

Water

valve shutheavy wheel0% speedpump, 12 V

Current through the coil

0250 mA500 mAlast 5 s, slowed 250×

A real coil does all of this in a few milliseconds. It's slowed down 250× here so you can watch it.

Inductance (how heavy the wheel is)

Current
0 A
wheel speed
Coil push-back
0 V
how hard the wheel resists
τ = L ÷ R
4.17 ms
real time to reach 63%
Bypass
none
nowhere for the flow to go

Electrical water hammer is real, and it's the reason inductors matter to anyone building with a microcontroller. You probably won't buy many inductors on purpose, but you'll use lots of things that contain coils:

  • Motors are coils of wire spinning in a magnetic field.
  • Relays and solenoids use a coil to pull a switch or plunger.
  • Speakers and buzzers push a membrane with a coil.

Switch any of these off suddenly and the coil produces a spike of hundreds of volts as it tries to keep the current going. That spike can destroy the transistor that switched it off.

The fix is the bypass you just tried: a flyback diode wired across the coil. In normal use it does nothing, because it faces the wrong way. When the switch opens, it gives the current a loop to go round while the coil's energy dies away harmlessly. Many motor drivers and relay modules already include one. If you're wiring a bare motor or relay coil to a transistor yourself, add one.

Capacitors and inductors are mirror images. A capacitor resists changes in voltage and stores energy in the stretch of its membrane. An inductor resists changes in current and stores energy in the spin of its wheel.

Transistors: the valve you control

Every component so far has been passive. It responds to the water, but nothing controls it. A transistor is different. It's a valve in the main pipe, worked by a much smaller control input. A little effort on the control moves a lot of water through the main pipe.

That solves a problem you'll hit almost immediately with a microcontroller. A pin can only supply about 20 mA at 3.3 V: plenty for an LED, but nowhere near enough for a motor, a strip of LEDs or a solenoid. So the pin doesn't power the load directly. It works the valve, and the transistor switches power from a supply that can deliver it.

There are two main kinds, and the water picture shows the difference clearly.

A BJT (bipolar junction transistor) is worked by flow. A small stream of current into its base pushes the valve open, letting a much larger current flow between its other two legs, the collector and emitter. The big current is roughly a fixed multiple of the small one, often about 100×. The small stream really does flow, and it joins the big one on the way out.

A MOSFET is worked by pressure. Its control terminal, the gate, is sealed off like a piston. You apply voltage and the valve opens, but no steady current flows in at all. That's why MOSFETs are the usual choice for switching bigger loads from a microcontroller: the pin just has to hold a voltage, not supply current.

A transistor is a valve in a big pipe, worked by a much smaller control. Here the big pipe drives a 12 V motor that needs half an amp, far more than a microcontroller pin can supply. Use the small control to run it anyway.

Water

valvecontrol1 mAmotor100 mApump, 12 V

Type of transistor

1 mA

A small flow that pushes the valve open. A microcontroller pin can safely give about 20 mA.

Partly on

The valve is part open. The motor turns slowly, and the transistor gets hot, because it's the narrow part of the pipe now. Use this to amplify, not to switch.

Control
1 mA
small flow in
Motor current
100 mA
big flow through
Gain
100×
big flow ÷ small flow
State
Partly on
valve part open

Transistors have two ways of working.

As a switch, the valve is either fully shut or fully open. Fully open, the transistor wastes almost no power, because it's hardly in the way. This is what you'll use it for almost every time: turning motors, LED strips and other heavy loads on and off, often thousands of times a second to control speed or brightness.

As an amplifier, the valve sits part-open, so the big flow follows every change in the small one. That's how a tiny signal from a microphone becomes enough to drive a speaker. But a part-open valve is the narrow part of the pipe, so it gets hot. When you mean to switch, open the valve all the way.

Your laptop's processor contains billions of transistors, each one a microscopic valve switching on and off billions of times a second. That's all a computer really is: valves controlling other valves.

Where the analogy breaks

Water gets you remarkably far, but it's a model, not the real thing. Three places it breaks down:

  • Cut a water pipe and it pours out. Cut a wire and nothing spills. Air has such an enormous resistance that current simply stops. An open circuit is a pipe with a perfect seal, not a leak.
  • Capacitors and inductors store energy in fields, not rubber and wheels. A capacitor holds an electric field between two plates. An inductor holds a magnetic field around a coil. The membrane and wheel are good pictures of how they behave, not of what's inside them.
  • Fast signals don't stay in the pipe. At radio frequencies, wires start to act like antennas and energy radiates into the space around them. Water has no equivalent. You won't meet this with the circuits here, but it's why high-speed boards take such care over layout.

Cheat sheet

ComponentWater equivalentWhat it doesUnit
Battery or supplyPumpProvides the pushvolts (V)
WireWide pipeCarries current with almost no resistance
GroundSea levelThe 0 V point every other voltage is measured fromvolts (V)
ResistorNarrow pipeLimits current, shares out voltageohms (Ω)
Diode or LEDOne-way flap valveLets current through one way, once pushed openforward voltage (V)
CapacitorStretchy rubber membraneStores energy, blocks steady current, smooths bumpsfarads (F), usually µF
InductorHeavy water wheelResists changes in current, stores energyhenries (H), usually mH
TransistorValve worked by a small controlLets a small signal switch or amplify a large current

And the two equations worth knowing by heart:

V = I × R     Ohm's law
P = V × I     power, turned into heat

With those, and the picture of water in pipes, you can reason through most of the circuits you'll build. When one surprises you, ask what the water would do.