Electricity: charge, current, voltage, resistance
The four quantities behind every circuit, explained with a water hose, and your first LED that you predict before you build.
Questa pagina non è ancora tradotta, quindi è mostrata in inglese.
Four quantities
| Quantity | Symbol | Unit | What it is |
|---|---|---|---|
| charge | Q | coulomb [C] | the “amount of electricity”, carried by electrons |
| current | I | ampere [A] | how much charge flows through a wire per second |
| voltage | U | volt [V] | the “pressure” that pushes the current |
| resistance | R | ohm [Ω] | how hard it is for the current to flow |
Charge can be positive or negative. Electrons are negative, protons positive. Equal charges push each other away, opposite charges pull together.
Current is how much charge passes a point in a given time:
Voltage is the “pressure” of electricity in a wire, just like water pressure in a hose. More exactly, it is the difference of potential between two points: U = φ₁ − φ₂. No difference, no current, the same way water does not flow through a hose when the pressure is equal at both ends.
Resistance is how hard it is for the current to get through. In the hose, it is a narrow place where the pressure drops. A resistor is a part with a deliberately large resistance, so the other parts do not burn. A potentiometer is a resistor whose resistance you change by turning a knob.
The water picture: higher pressure (voltage) pushes more water (current); a narrower hose (resistance) lets less through. Keep this picture; we will use it all through the course.
A circuit is a closed loop
Current only flows when there is a complete path: from the + of the battery, through the parts, and back to the −. That loop is called a circuit. Break it anywhere, and the current stops everywhere at once, not only after the break.
That is what a switch does. A closed switch completes the loop. An open switch makes a gap, and a gap of air is a resistance so large that practically no current gets across.
The battery does not “fill” the wire with electricity. The wires are already full of electrons, like a hose that is already full of water. The voltage pushes all of them along at the same time. That is why a lamp lights the moment you flip the switch, even though each electron moves very slowly.
Which way does the current flow? On paper, we say current flows from + to −. This rule was agreed on long before anyone knew about electrons. Electrons are negative, so they actually drift the other way, from − to +. For everything in this course it does not matter: use “from + to −” and all the formulas work.
Big and small numbers
In electronics you meet very small currents and very large resistances. Instead of writing many zeros, we use prefixes:
| Prefix | Symbol | Means | Example |
|---|---|---|---|
| mega | M | × 1 000 000 | 1 MΩ = 1 000 000 Ω |
| kilo | k | × 1 000 | 4.7 kΩ = 4700 Ω |
| milli | m | ÷ 1 000 | 20 mA = 0.020 A |
| micro | µ | ÷ 1 000 000 | 300 µA = 0.000 3 A = 0.3 mA |
Always convert to plain units (V, A, Ω) before you put numbers into a formula. 9 V divided by 450 Ω gives amps. 9 V divided by “0.45” (because you meant kΩ) gives nonsense.
Ohm’s law
Why? Back to the hose:
- higher pressure (U) → more water flows → I grows with U,
- narrower hose (R) → less water flows → I falls with R.
The formula I = U / R says both at once. Multiply both sides by R and you get U = R · I.
Example: a 9 V battery and a 450 Ω resistor give I = 9 / 450 = 0.02 A = 20 mA.
The LED needs about 2 V for itself
An LED (light-emitting diode) lights up when current flows through it, and only in one direction: the longer leg is +. It does not behave like a resistor: once it has the voltage it needs, it lets almost any current through. Straight from a battery it would take far too much current and burn out. That is why an LED always gets a resistor in series.
A red LED keeps about 2 V for itself (green and blue ones a bit more). The rest of the voltage is left for the resistor:
Now try it here. Change the voltage and the resistor and watch the current.
Picking the resistor yourself
Example: a 9 V battery, an LED that needs about 2 V and 20 mA:
350 Ω is not a value you can buy, so you take the nearest bigger standard value, for example 390 Ω. Bigger means a little less current, which is the safe side.
Check the result with the real resistor: (9 − 2) / 390 ≈ 0.018 A = 18 mA. A little under 20 mA, exactly what we wanted.
Resistors are sold in standard series of values. The most common one (called E12) repeats these numbers in every decade: 10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82. So you can buy 33 Ω, 330 Ω, 3.3 kΩ and 33 kΩ, but not 300 Ω. That is why the same few values (220, 330, 1 k, 4.7 k, 10 k) appear in almost every kit.
How much current should an LED get? A normal 5 mm LED is usually made for about 20 mA at most; check the datasheet of yours. For an indicator light, 2 to 10 mA is often bright enough, and it saves battery. Modern LEDs are quite bright even at a few milliamps.
Power: how warm does the resistor get?
Every resistor turns the voltage it “uses up” into heat. How much heat each second is the power P, measured in watts [W]:
where U is the voltage across that part and I is the current through it.
Back to the 5 V LED circuit with 330 Ω. The resistor gets 5 − 2 = 3 V and the current is about 9 mA:
The small resistors in kits are usually rated for 0.25 W (a quarter of a watt). 27 mW is about a tenth of that, so the resistor stays cool. The LED itself gets 2 V · 9 mA ≈ 18 mW.
Check yourself
What the full course covers
The full course has eleven lessons. Each one has experiments you predict before you build, worked examples with real numbers, and a homework:
- Electricity: charge, current, voltage, resistance (this lesson, free)
- Series, parallel and the voltage divider
- Measuring with a multimeter: volts, amps, ohms and the beep
- Capacitors: storing charge, RC timing and clean power
- Current, magnetism and the DC motor
- The microcontroller and your first MicroPython program
- PWM: half a volt from a pin that only knows on and off
- Diodes and transistors: switching big currents with a small pin
- Sensors: buttons, knobs, light and measuring distance with sound
- Batteries, power supplies and safety
- Reading schematics and datasheets