Electricity Basics

Basic Electronics

Course 1 · Chapter 1 · Electricity Basics

Every robot, from a line-following buggy to a walking quadruped, is a collection of circuits: sensors that turn the world into voltages, logic that decides, and drivers that push current into motors. This course builds that picture one component at a time. This first chapter gives you the four ideas everything else rests on (charge, voltage, current and resistance), the one equation that ties them together (Ohm's law), and ends with a circuit you can build in ten minutes: a battery, a resistor and an LED.

No background is assumed. You will need a calculator and, ideally, a cheap multimeter, but you can do every exercise in this chapter in a free browser simulator if you have no hardware yet.

1. The four quantities

Charge and current

Matter contains charged particles. In a metal wire, some electrons are free to drift between atoms. Current is the rate at which charge flows past a point. It is measured in amperes (A), and one ampere is one coulomb of charge per second:

I = Q / t current (A) = charge (C) / time (s) Example: 0.5 C passes in 2 s -> I = 0.5 / 2 = 0.25 A = 250 mA

One coulomb is about 6.24 × 1018 electrons, so even a tiny current is an enormous number of moving electrons.

Conventional current

Early scientists guessed that current flowed from the positive terminal of a battery to the negative. We now know that in wires it is electrons moving the other way, but the convention stuck. Conventional current flows from + to −, and every schematic, datasheet and arrow symbol (such as the one inside a diode) uses it. The maths comes out identical, so use it and ignore the electron direction.

Voltage

Voltage (potential difference) is the energy given to each coulomb of charge as it moves between two points. It is measured in volts (V): one volt is one joule per coulomb.

V = E / Q voltage (V) = energy (J) / charge (C)

Voltage is always measured between two points. A battery marked 9 V has 9 V between its terminals; there is no such thing as "the voltage at one point" without a reference. In circuits that reference is called ground (0 V), usually the battery's negative terminal.

Resistance

Resistance measures how much a component opposes current. It is measured in ohms (Ω). A thick copper wire has almost none, rubber has almost infinite resistance, and a resistor is a part built to have an exact value.

The water analogy
Think of a water system. Voltage is the water pressure, current is the flow rate, and resistance is a narrow pipe. More pressure gives more flow; a narrower pipe gives less. The analogy breaks down in places, but it is the best first mental model.

Units and prefixes

Electronics constantly uses very small and very large numbers, so you must be fluent in the prefixes:

PrefixSymbolMultiply byExample
megaM1,000,0001 MΩ = 1,000,000 Ω
kilok1,0004.7 kΩ = 4,700 Ω
(none)19 V, 220 Ω, 2 A
millim0.00120 mA = 0.020 A
microµ0.000001150 µA = 0.000150 A

The most common beginner error is forgetting to convert. If you put 10 mA into a formula, write 0.010 A, or keep everything in volts, kilohms and milliamps (the three are consistent: V = kΩ × mA).

2. Ohm's law

In 1827 Georg Ohm found that for most conductors the current is proportional to the voltage across them. Doubling the voltage doubles the current. The constant of proportionality is 1/R, so:

I = V / R current = voltage / resistance V = I × R voltage = current x resistance R = V / I resistance = voltage / current Memory triangle (cover the one you want): V ----- I | R

Worked example. A 1 kΩ resistor has 5 V across it. Then I = 5 / 1000 = 0.005 A = 5 mA. Put 10 V across the same resistor and the current doubles to 10 mA.

Ohm's law is not true for everything
It holds for resistors and wires. It does not hold for LEDs, diodes and transistors, whose current rises far faster than the voltage. That is exactly why an LED needs a resistor in series: the resistor does the limiting, and Ohm's law applies to the resistor alone. You will see how diodes behave in Basic Electronics 5.

3. Power

Power is the rate at which energy is converted, measured in watts (W). Since voltage is energy per coulomb and current is coulombs per second, multiplying them gives joules per second:

P = V × I Substitute V = I x R: P = I x I x R = I^2 x R Substitute I = V / R: P = V x V / R = V^2 / R

All three forms are the same law; choose whichever uses the two numbers you already know.

Worked example: why power ratings matter. Suppose you wire a 100 Ω resistor straight across a 9 V battery. I = 9 / 100 = 0.09 A (90 mA). P = V × I = 9 × 0.09 = 0.81 W. A common resistor is rated 0.25 W (1/4 W). It is dissipating more than three times its rating, so it will get too hot to touch and can burn. Always check P against the rating, and leave margin: aim for at most half the rating.

4. DC and AC

Direct current (DC) flows one way at a steady value: batteries, USB chargers and the supply rails inside every robot. Alternating current (AC) reverses direction continuously. UK mains is AC at 230 V RMS and 50 Hz, so the voltage swings 50 times per second between about +325 V and −325 V.

The "230 V" is an RMS value, defined as the DC voltage that would heat a resistor equally. For a sine wave, Vpeak = VRMS × √2, giving 230 × 1.414 ≈ 325 V. Robot electronics works almost entirely in DC; AC appears in this course in power supplies (rectifiers, Basic Electronics 5) and in signals such as audio and motor drive waveforms.

DCAC
DirectionConstantReverses periodically
Typical sourcesBatteries, USB, solar cells, regulatorsMains sockets, generators, signal sources
Described byA single value (e.g. 5 V)RMS (or peak) value and frequency
In this courseNearly everythingFilters, rectifiers, signals

5. Safety: what is safe to touch

The danger to your body is current through it, but current is driven by voltage, so voltage is the practical guide. Dry skin has a resistance of tens of kilohms or more, so low voltages cannot push a dangerous current through you.

SourceVoltageRisk
AA/AAA cells, coin cells, USB, Arduino/Pico/Pi boards1.5 to 5 VSafe to touch. The risk is to the components, and to wires if you short a battery.
9 V PP3 battery, 12 V lead-acid, hobby 3S LiPo (11.1 V)9 to 12 VSafe to touch, but can deliver large currents if shorted: hot wires, burns. LiPo cells can catch fire.
Mains outlets and anything plugged into them230 V AC (UK)Can kill. Do not open, modify or probe mains equipment, and do not build mains circuits on a breadboard.
Rules for this entire course
  • Only build from batteries or a low-voltage (5 V to 12 V) supply. Never from the mains.
  • Never connect a battery's + terminal directly to its − terminal. A short circuit makes the wire and battery hot within seconds.
  • Disconnect the battery before changing the wiring.
  • Do not charge or puncture LiPo or lithium cells without a proper charger and a fireproof bag. This chapter uses neither.
  • Wear eye protection when trimming component legs: the offcuts fly off at speed.
  • Hot resistors and soldering irons burn. Check with the back of a finger first.

6. First circuit: battery, resistor, LED

An LED (light-emitting diode) lights when current flows through it in one direction only. It has a roughly fixed voltage drop across it when lit (its forward voltage, VF) and no resistance worth speaking of, so connected straight to a battery it would try to draw as much current as the battery could give, and burn out in a moment. A series resistor sets the current.

Parts list

PartValueNotes
Battery9 V (PP3) with snap clipOr a 3 x AA pack (4.5 V) with a different resistor: see Challenge 1
R1820 Ω, 1/4 WColour code grey-red-brown (an E12 series value)
D1Standard 5 mm red LEDVF about 2.0 V at 10 mA; absolute maximum about 20 to 30 mA
BreadboardHalf size or largerPlus 3 jumper wires
MultimeterAny digitalOptional but strongly recommended

Choosing R1: worked calculation

Aim for a comfortable 10 mA: bright for an indicator LED and safely below its limit. In a series loop, the battery voltage is shared between the resistor and the LED, so the resistor gets whatever the LED does not:

Step 1: voltage across the resistor V_R = V_supply - V_F = 9.0 - 2.0 = 7.0 V Step 2: Ohm's law for the resistor, aiming for I = 10 mA R = V_R / I = 7.0 / 0.010 = 700 ohm Step 3: pick a real value. Resistors come in the E12 series: 10 12 15 18 22 27 33 39 47 56 68 82 (x 1, 10, 100, 1k ...). 700 ohm is not E12; the neighbours are 680 and 820. Choose the higher (820) to stay on the safe side. Step 4: actual current with 820 ohm I = 7.0 / 820 = 0.00854 A = 8.5 mA Step 5: power check P_R = V_R x I = 7.0 x 0.00854 = 0.060 W = 60 mW (rating 250 mW: fine) P_LED = V_F x I = 2.0 x 0.00854 = 0.017 W = 17 mW P_bat = 9.0 x 0.00854 = 0.077 W = 77 mW (= 60 + 17: energy is conserved)

With 680 Ω the current would be 10.3 mA, also fine; 820 Ω just gives a little more margin and the brightness difference is barely visible. Round the resistor up when in doubt: a dimmer LED is harmless, a hot one is not.

Schematic

A schematic shows how parts connect, not where they sit physically. The resistor is the zigzag (or a rectangle); the LED is a triangle pointing in the direction of conventional current, with a bar at the cathode.

R1 820 ohm D1 red LED +----/\/\/\/\/\----+-------|>|-------+ | | | conventional current -> | (+)| | [ 9 V battery ] | (-)| | | | +------------------------------------+ 0 V (ground) Current path: battery (+) -> R1 -> LED anode -> LED cathode -> battery (-) Measured voltages: across battery 9 V = across R1 7 V + across LED 2 V

Breadboard version

A breadboard has short rows of five connected holes (a to e connected together, f to j connected together, with a gap down the middle) and long power rails down the sides. Basic Electronics 2 covers the layout in detail; for now follow this recipe, using one numbered column of the board for each connection.

  1. Disconnect the battery. Place the LED with its longer leg (anode, +) in column 10 and its shorter leg (cathode, next to the flat edge of the plastic rim) in column 12, both in rows a to e.
  2. Place R1 with one leg in column 5 and the other in column 10, so it shares column 10 with the LED anode.
  3. Run a jumper wire from the LED's cathode column (12) to the board's − rail (blue line).
  4. Run a jumper from column 5 (R1's free end) to the + rail (red line).
  5. Clip the battery on: red lead to the + rail, black lead to the − rail. The LED lights.
LED does not light?
Check, in order: the LED is the right way round (swap it; 9 V through 820 Ω will not harm it), both rails are connected to the right battery wires, nothing bridges two columns accidentally, and the battery is fresh.

Simulator version (no hardware needed)

Falstad Circuit Simulator (falstad.com/circuit, runs in the browser):

  1. Right-click the canvas and add a Resistor (Passive Components), an LED (Active Components, under Diode) and a DC Voltage Source (Inputs and Sources).
  2. Wire the three in a loop, battery to resistor to LED to battery, with the LED's anode (the triangle's flat base) towards the resistor.
  3. Double-click the voltage source and set it to 9 V; double-click the resistor and set it to 820 Ω.
  4. Hover over or click a component to see its voltage and current. The moving dots show current direction (+ to −).

Tinkercad Circuits (tinkercad.com, free account): create a new circuit and drag in a 9 V battery, a resistor, a red LED and a multimeter. Set the resistor to 820 Ω in its panel and wire the same loop. Click Start Simulation. Place the multimeter across (in parallel with) a part to read volts, or in series to read current, and select the mode in its panel.

Expected meter readings

MeasurementCalculatedReal circuitSimulator
Battery terminals (DC V)9.0 V9.3 to 9.6 V fresh; 8 V or less when tiredThe value you set
Across R1 (DC V)7.0 V7.2 to 7.6 VAbout 7.0 V (depends on the LED model)
Across LED (DC V)2.0 V1.8 to 2.1 V (red)About 1.8 to 2.1 V
Loop current (DC mA, meter in series)8.5 mAAbout 8 to 9 mAAbout 8 to 9 mA

Expect real values to differ by a few percent: the battery voltage is not exactly 9 V, E12 resistors are typically ±5% (or ±1% for metal-film types), and each LED's VF varies. What matters is that the two voltages add up to the battery voltage (7.4 + 2.0 = 9.4 V, say) and that R1's voltage divided by 820 gives the measured current. That is Kirchhoff's voltage law, covered in Basic Electronics 2.

Measuring current: the meter goes in series
To measure current, break the loop and put the meter's probes in the gap, with the red probe in the mA or A socket and the dial on DC current. Never put an ammeter directly across the battery or another voltage source: that is a short circuit through the meter and will blow its fuse. For voltages, probe in parallel with the part and use the V dial. Full multimeter technique is the subject of Basic Electronics 2.

7. Series and parallel resistance

There are two ways to connect resistors, and the rules for them will be used constantly.

Series: one path, same current

The same current passes through each resistor, and the voltages across them add up to the supply. Using V = IR for each:

V = V1 + V2 = I x R1 + I x R2 = I x (R1 + R2) R_series = R1 + R2 (+ R3 ...) Example: 1 k + 2.2 k = 3.2 k ohm

Parallel: several paths, same voltage

The same voltage is across each branch, and the branch currents add. Using I = V/R for each:

I = I1 + I2 = V / R1 + V / R2 = V x (1/R1 + 1/R2) 1 / R_parallel = 1/R1 + 1/R2 (+ 1/R3 ...) Two resistors only (product over sum): R_parallel = (R1 x R2) / (R1 + R2) Example: 330 || 470 = (330 x 470) / (330 + 470) = 155,100 / 800 = 193.9 ohm Two equal resistors: R / 2. 1 k || 1 k = 500 ohm.

Adding a branch in parallel always lowers the total resistance (there are more paths for current), and the result is always smaller than the smallest branch (193.9 Ω is below 330 Ω). That is a quick sanity check on any calculation. Voltage dividers (series pairs used to scale a voltage) are the subject of Basic Electronics 3.

SeriesParallel
CurrentSame through eachSplits between branches
VoltageSplits between partsSame across each branch
Total resistanceSum (larger than any one)Reciprocal sum (smaller than any one)
If one part fails openEverything stopsOther branches keep working

8. Challenges

Challenge 1: Size a resistor
A green LED (VF about 2.1 V, maximum 20 mA) is to be powered from 5 V (a USB supply). Calculate the resistor needed for about 10 mA, pick the nearest safe E12 value, then work out the actual current and the power dissipated in the resistor. Repeat with the 4.5 V (3 x AA) pack and decide whether 220 Ω is acceptable.
View solution
Challenge 2: Series and parallel
A 12 V supply is connected across a 1 kΩ resistor and a 2.2 kΩ resistor in series. Find the current, the voltage across each, and the power in each. Then rewire them in parallel across the same 12 V and find each branch current, the total current, and the equivalent resistance. Check that the answers satisfy the sanity rules in section 7.
View solution
Challenge 3: Build it and measure it
Build the battery-resistor-LED circuit (breadboard or simulator). Record the battery voltage, the voltage across R1, the voltage across the LED and the loop current, and compare them with the table in section 6. Then swap R1 for 220 Ω and predict, before you do it, the current and the resistor power; decide whether that is safe for the LED and the resistor.
View solution

Quick reference

  • Current: I = Q / t (amperes); conventional current flows + to −
  • Voltage: V = E / Q (volts); always measured between two points
  • Ohm's law: V = I × R, so I = V / R and R = V / I
  • Power: P = V × I = I²R = V²/R; keep P below half the rating
  • Series: R = R1 + R2, same current. Parallel: R = R1R2 / (R1 + R2), same voltage
  • LED resistor: R = (Vsupply − VF) / I, rounded up to the next E12 value
  • Safety: low-voltage batteries only; never short a battery; never touch mains

Next, Basic Electronics 2 turns to circuits and measurement: Kirchhoff's laws, the breadboard layout in full, and how to use the multimeter properly to check what you have built.