Electronics is the craft of steering electric charge around a loop. Three quantities describe what's going on: voltage, the push (in volts, V); current, the flow (in amps, A); and resistance, how hard the path pushes back (in ohms, Ω). One formula ties them together: Ohm's law, V = I × R. Components shape the flow. Resistors limit it, capacitors store a little charge and let it go, and transistors switch it on and off. An integrated circuit (IC), or chip, packs anywhere from a few dozen to billions of transistors into one package. Inside a computer, every 1 and 0 is just a voltage that is either high or low. An Arduino lets you watch that happen on your desk: write a few lines of code and a pin switches between 0 V and 5 V and lights an LED. Everything here runs from batteries or a USB port, at voltages too low to give you a shock.

Why learn electronics?

Most of us use technology as a sealed box. A little electronics opens the lid. You start to see why a charger gets warm, why a battery can read fine on a meter and still not run a torch, why a USB port can't power everything you plug into it, and how a computer can "know" anything at all.

It's also one of the few technical subjects where the feedback is instant and physical: the LED lights or it doesn't, and a multimeter tells you why. And the basics don't go out of date. Georg Ohm published his law in 1827, and it's still the first sum anyone reaches for on a circuit board today.

What you need to follow along

  • A solderless breadboard and a bag of jumper wires. Nothing in this lesson needs soldering.
  • A small parts kit: an assortment of resistors, a few LEDs, some 100 nF ceramic capacitors and a 100 µF electrolytic, a 10 kΩ potentiometer (a knob) and a couple of push buttons. Arduino starter kits bundle all of these, and Australian electronics shops and the online marketplaces sell them.
  • An Arduino UNO (R3 or R4) and the right USB cable: USB-B for the R3, USB-C for the R4. Compatible clones work too.
  • A multimeter. Any cheap one is fine to start. We explain ours, and what the numbers on a meter mean, in our EEVblog BM786 lesson.
  • The free Arduino IDE (the program you write code in) for Windows, macOS or Linux, from arduino.cc.

Safety first: stay at extra-low voltage

  • Everything in this lesson runs from batteries or USB. That's extra-low voltage, which Australia's wiring rules (AS/NZS 3000) define as no more than 50 V AC or 120 V ripple-free DC. At 5 V, your skin's resistance keeps the current far too small to feel.
  • Never open up or experiment on anything that runs on mains power. Plugging in a USB charger or your laptop is fine: they hand you safe low voltage. But Australian mains is 230 V AC and can kill. In Australia, electrical work on fixed wiring, including changing a power point or a light switch, is illegal unless you're licensed: use a licensed electrician. Don't open mains power supplies, old TVs or microwave ovens either. Their capacitors can hold a dangerous charge long after they're unplugged.
  • Short circuits still matter at low voltage. A lithium-ion cell or a car battery can deliver enough current to melt a wire or start a fire. Use a battery holder, and never let a wire or tool bridge the terminals.
  • Parts can get hot. If something smells hot, smokes or is too hot to touch, unplug it, then find out why. Usually it's a wire in the wrong hole.
  • Electrolytic capacitors have a right way round. In backwards they can bulge or burst. More on that below.

Voltage, current and resistance

A circuit is a loop

Electricity only flows when it has a complete loop to flow around: out of one terminal of the battery, through the parts, and back into the other terminal. Break the loop anywhere (open a switch, pull out a wire) and everything in it stops at once. That's all a switch is: a deliberate break in the loop.

A circuit is a loopA battery, a closed switch, a resistor and an LED joined in one loop of wire. Green arrows show the current leaving the battery's positive terminal, passing through the switch, the resistor and the LED, and returning to the negative terminal. The LED is lit.+−batterythe pushswitch (closed)resistorlimits the currentLEDlights upcurrentone complete loop: current flowsopen the switch and everything stopsGreen arrows: conventional current, from + round the loop to −.The electrons themselves drift the other way.
Every circuit is a loop. Current leaves the battery's + terminal, passes through each part in turn and returns to −. The resistor sets how much flows; the LED turns some of it into light. Open the switch and the loop is broken, so nothing flows anywhere.

The water picture is the easiest way in. Think of a tank of water draining through a pipe. How high the water stands is the voltage, the push. How much water flows through the pipe each second is the current. A narrow section of pipe is a resistance: it doesn't use up the water, it just limits how fast it can flow.

Voltage, current and resistance as water in a pipeOn the left, a tank of water drains through a pipe with a narrow section into a bucket below. The height of the water is labelled voltage, the push; the flow along the pipe is labelled current; the narrow section is labelled resistance. On the right, the same three ideas in a circuit: a battery provides the voltage, a green arrow along the wire shows the current, and a resistor provides the resistance.Water in a pipeheight = voltagethe pushnarrow pipe = resistanceflow = currentlower downCharge in a circuit+−voltagethe push, in volts (V)currentthe flow, in amps (A)resistancehow hard the pathpushes back, in ohms (Ω)
The water picture. A taller column of water pushes harder (more voltage); a narrower pipe lets less through (more resistance); what actually moves is the flow (current). Like every analogy it breaks down eventually, but it gets you a long way.

Voltage: the push

Voltage is the difference in electrical "pressure" between two points, measured in volts (V). It's always measured between two points, which is why a multimeter has two probes. When people say a point in a circuit is "at 5 V", they mean 5 V above the circuit's reference point, called ground or GND, which is 0 V by definition.

Where you'll meet it Voltage Notes
AA or AAA cell 1.5 V DC. Two in series make 3 V
Coin cell (CR2032) 3 V DC
Many newer microcontroller boards (ESP32, Raspberry Pi Pico) 3.3 V DC. Their pins must not be fed 5 V
USB port, Arduino UNO R3 and R4 5 V DC. What every project in this lesson runs on
9 V battery 9 V DC. Six small cells inside
Car battery 12 V DC. Can deliver hundreds of amps: treat with respect
Australian power point 230 V AC. Dangerous. Not for experiments

Current: the flow

Current is how much electric charge flows past a point each second, measured in amps (A). Hobby electronics mostly deals in milliamps (mA), thousandths of an amp: an indicator LED runs happily on 5 to 10 mA.

Current flows through things, so to measure it the meter has to become part of the loop: you break the circuit and let the current pass through the meter.

One historical quirk: diagrams show current flowing from + to −. That direction, called conventional current, was agreed long before anyone knew about electrons. In a metal wire, the electrons actually drift the other way, from − to +. For almost everything you'll build, it doesn't matter: use conventional current, as every diagram and datasheet does.

Resistance: how hard the path pushes back

Resistance is how strongly something opposes the flow, measured in ohms (Ω). You'll see kΩ (thousands of ohms) and MΩ (millions) all the time. Everything has some resistance: a short copper wire has a tiny amount, a resistor has the amount marked on it (within its tolerance), and the plastic insulation round the wire has so much that, for practical purposes, nothing gets through.

Ohm's law: the one formula you need

Voltage, current and resistance are tied together by Ohm's law: voltage equals current times resistance. If you know any two, you can work out the third.

The Ohm's law triangleA triangle split into three: V at the top, I and R side by side at the bottom. Beside it, the three forms of Ohm's law: V equals I times R, I equals V divided by R, and R equals V divided by I. Cover the one you want and the other two show the sum.VIRV = I × Rvolts = amps × ohmsI = V ÷ Ramps = volts ÷ ohmsR = V ÷ Iohms = volts ÷ ampsCover the one you want: the other two give the sum.Side by side means multiply; one above the other, divide.
V = I × R. Cover V and you see I beside R: multiply. Cover I and you see V over R: divide. Work in volts, amps and ohms (not milliamps or kilohms) and the answers come out right.

Two quick sums.

1. How much current? A 9 V battery across a 1 kΩ (1,000 Ω) resistor: I = V ÷ R = 9 ÷ 1,000 = 0.009 A, or 9 mA.

2. Will it get hot? Power, in watts, is P = V × I. That resistor drops 9 V at 0.009 A: P = 9 × 0.009 ≈ 0.08 W, comfortably under the 0.25 W that the common resistors in starter kits are rated for.

Measuring them with a multimeter

  • Voltage is measured across. Red lead in V, black in COM, dial on DC volts, and touch the probes to the two points you're comparing, with the circuit running. Our battery-testing lesson walks through it.
  • Current is measured through. Move the red lead to the mA socket, turn the dial to DC milliamps, then break the loop and put the meter in the gap, so the current has to flow through it.
  • Resistance is measured with the power off. Dial on Ω, probes across the part. Take a resistor out of the circuit to measure it on its own; other parts connected to it change the reading.

Never put a meter set to amps across a battery or a power supply. On the A and mA settings the meter is almost a plain wire, so you short the supply out. A fused meter will blow its fuse; an unfused one can be wrecked. When you've finished measuring current, move the red lead straight back to V.

DC and AC

Batteries and USB ports give direct current (DC): the voltage stays the same way round. Australian power points give alternating current (AC), which swings back and forth 50 times a second. The plug pack or charger in between converts the wall's 230 V AC into the low-voltage DC that electronics run on. Everything in this lesson is DC.

Reading a circuit diagram

A circuit diagram (a schematic) shows what connects to what, not what the parts look like or where they sit on the board. Lines are wires. Where lines meet with a dot, they're joined; where they cross without a dot, they aren't. These ten symbols cover most beginner circuits:

Ten common circuit symbolsTen circuit diagram symbols in two rows. Top row: a cell or battery, with the long plate marked positive; a resistor drawn as a zigzag; a resistor drawn as a plain box, the style used in Australia and Europe; a potentiometer, a resistor with an arrow pointing at it; and a capacitor, two equal parallel plates. Bottom row: an electrolytic capacitor, with one curved plate and the straight plate marked positive; a diode, a triangle pointing at a bar; an LED, a diode with two arrows coming out of it; an open switch; and ground, three shrinking horizontal lines.+cell or batterylong plate is +resistorzigzag styleresistorbox style (Australia, Europe)potentiometeradjustable: a knobcapacitorceramic, film: either way+electrolytic capacitorpolarised: + mattersdiodecurrent flows one way: →LEDa diode that lightsswitchopen: no currentground (GND)the 0 V referenceLines are wires. A dot where lines meet means joined; lines that cross without a dot are not connected.
Ten symbols cover most beginner circuits. American diagrams draw resistors as zigzags; Australian and European ones often use a plain box. Both mean the same thing. This lesson uses zigzags because most Arduino tutorials do.

Resistors

A resistor is the simplest component there is: two legs and a fixed amount of resistance between them. It's used to limit current (stopping an LED from burning out), to set a voltage (with two resistors as a voltage divider, below), and to hold an input steady at a known voltage (a pull-up or pull-down resistor). It doesn't matter which way round it goes.

Reading the colour code

Most through-hole resistors are too small to print a number on, so their value is painted on as coloured bands. On the common four-band resistor, the first two bands are digits, the third says how many zeros to add (the multiplier), and the fourth, usually gold or silver and set a little apart, is the tolerance: how far from the stated value the real one may be.

Reading a four-band resistor: brown, black, orange, goldA beige resistor with four coloured bands. From the left: brown, labelled first digit, 1; black, labelled second digit, 0; orange, labelled multiplier, times 1,000; and, set apart on the right, gold, labelled tolerance, plus or minus 5 percent. The result: 10 times 1,000 is 10,000 ohms, or 10 kilohms.1st digit2nd digitmultipliertolerancebrownblackorangegold10× 1,000± 5%1 0 × 1,000 = 10,000 Ω = 10 kΩRead from the end away from the gold or silver band.
Brown, black, orange, gold = 10 kΩ ±5%. So the real resistance is somewhere between 9.5 kΩ and 10.5 kΩ. Colours can be hard to tell apart under warm light (red, orange and brown especially): when in doubt, measure it.
Colour Digit Multiplier Tolerance
Black0× 1—
Brown1× 10±1%
Red2× 100±2%
Orange3× 1,000 (1 k)—
Yellow4× 10,000 (10 k)—
Green5× 100,000 (100 k)—
Blue6× 1,000,000 (1 M)—
Violet7——
Grey8——
White9——
Gold—× 0.1±5%
Silver—× 0.01±10%

A dash means you won't meet that use on everyday resistors. The international standard, IEC 60062, does define most of them, for precision and very high-value parts. Precision resistors use five bands: three digits, then the multiplier, then the tolerance (often brown, ±1%). Tiny surface-mount resistors use printed numbers instead: 103 means 10 and three zeros, 10 kΩ.

Two you'll use constantly: yellow, violet, brown is 470 Ω (the LED resistor in the projects below), and brown, black, red is 1 kΩ.

Why the values look odd

Resistors come in standard series of values, not every number. The E12 series, made for ±10% parts, is 10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68 and 82, then the same again times 10, 100 and so on (100 Ω, 120 Ω … 1 kΩ, 1.2 kΩ …). The ±5% resistors in most kits follow the E24 series, which adds a value between each (11, 13, 16, 20 …). That's why resistor sums end with "use the nearest standard value".

Power rating

A resistor turns the energy it takes out of the circuit into heat. Work out how much with P = V × I (or, equivalently, P = I² × R) and keep it well under the resistor's rating. The resistors in starter kits are usually ¼ W (0.25 W), which is plenty for LED and logic circuits. A resistor that is too hot to touch is a sign to recheck the sum.

Series and parallel

  • In series (one after another, so the same current flows through each), resistances add: 1 kΩ + 1 kΩ = 2 kΩ.
  • In parallel (side by side, so the current splits between them), the total is less than the smallest one: 1 ÷ R = 1 ÷ R1 + 1 ÷ R2. Two equal resistors in parallel give exactly half: two 1 kΩ make 500 Ω.

The voltage divider

Put two resistors in series across a supply and the point between them sits at a fraction of the supply voltage. This voltage divider is one of the most useful little circuits in electronics. A potentiometer (the knob in your kit) is a voltage divider you can adjust: a resistor with a third terminal, the wiper, that slides along it as you turn the shaft.

A voltage divider, and a potentiometer as an adjustable oneOn the left, two 10 kilohm resistors in series between 5 volts and ground. The point between them is at 2.5 volts. The formula: out equals 5 volts times R2 divided by R1 plus R2. On the right, a 10 kilohm potentiometer between 5 volts and ground, with its wiper connected to an Arduino's A0 pin. Turning the knob slides the wiper from 0 volts to 5 volts, and analogRead of A0 gives 0 to 1023.Two fixed resistors5 Vout2.5 VR110 kΩR210 kΩout = 5 V × R2 ÷ (R1 + R2) = 2.5 VA potentiometer is an adjustable divider5 VA0Arduino pin10 kΩ knob(potentiometer)wiperTurn the knob and the wiper slidesfrom 0 V (bottom) to 5 V (top):analogRead(A0) gives 0 to 1023.
Two equal resistors split the voltage in half. Change the ratio and you change the fraction: a 20 kΩ R1 above a 10 kΩ R2 gives one third of the supply, about 1.67 V. A potentiometer does the same with a moving tap, which is how a volume knob, a joystick and the dimmer in project 2 all work.

The divider's output only holds steady if whatever you connect to it draws very little current. An Arduino's analogue input draws almost nothing, so it's a perfect match. A motor or an LED isn't: don't try to power things from a divider.

Capacitors

A capacitor is two conducting plates separated by a thin insulator. Put a voltage across it and charge piles up on the plates; take the voltage away and, if there's a path, the charge flows back out. In the water picture it's a small tank that fills and empties. A capacitor stops steady DC from flowing through it, but lets changes through.

Capacitance is measured in farads (F), but one farad is enormous, so you'll mostly see:

  • µF, microfarads: millionths of a farad (1 µF = 1,000 nF);
  • nF, nanofarads: billionths (1 nF = 1,000 pF);
  • pF, picofarads: trillionths.

Common types, and which way round

A ceramic capacitor and an electrolytic capacitorOn the left, an orange ceramic disc capacitor printed 104, with two equal legs. 104 means 10 times 10 to the power 4 picofarads, which is 100 nanofarads, and it can go either way round. On the right, a blue cylindrical electrolytic capacitor printed 100 microfarads, 25 volts, with a pale stripe of minus signs down its right side. Its left leg is longer and positive; its right leg, on the stripe side, is shorter and negative.104ceramic104 = 10 × 10⁴ pF = 100 nF, either way round−−−100µF25V+ long leg− short leg,stripe sideelectrolyticpolarised: + and − must go the right way
Ceramic: either way. Electrolytic: the stripe marks −. The longer leg of a new electrolytic is +. Once the legs have been trimmed, go by the stripe.
  • Ceramic capacitors are small, cheap and not polarised. They come in small values, from a few pF up to a few µF, and are marked with a three-digit code: the first two digits, then how many zeros, in picofarads. 104 = 10 and four zeros = 100,000 pF = 100 nF (0.1 µF). 103 = 10 nF, 102 = 1 nF.
  • Electrolytic capacitors pack much more capacitance (1 µF up to thousands of µF) into a can, but they're polarised: the stripe marks the negative leg, and on a new part the positive leg is longer. They're also marked with a maximum voltage; pick one rated comfortably above your circuit's voltage, such as 16 V or 25 V for a 5 V circuit. (Small bead-shaped tantalum capacitors are polarised too, but marked the other way: their stripe or + sign marks the positive leg.)
  • Film capacitors (often little boxes) sit in between: not polarised, stable, and common in audio circuits.

How fast a capacitor charges: the RC time constant

Charge a capacitor through a resistor and it doesn't fill instantly. It fills quickly at first, then more and more slowly as it nears the supply voltage. The speed is set by the time constant, written τ (the Greek letter tau): τ = R × C, in seconds when R is in ohms and C in farads.

A capacitor charging through a resistorA graph of capacitor voltage against time. The curve rises steeply at first and then levels off towards 100 percent. After one time constant, tau, it has reached 63 percent; after five time constants it is at 99 percent, as good as full. Tau equals R times C: 10 kilohms times 100 microfarads is 1 second.01τ2τ3τ4τ5τ100%63%063% after one τ99% after 5ττ (tau) = R × C10 kΩ × 100 µF = 1 second,so this one is as good as full in about 5 secondscapacitor voltagetime →
63% after one time constant, effectively full after five. Discharging works the same way in reverse: after one τ, 37% of the voltage is left. Bigger resistor or bigger capacitor = slower.
Time 1 τ 2 τ 3 τ 4 τ 5 τ
Charged to 63% 86% 95% 98% 99%

That predictable delay is what makes capacitors useful for timing (the 555 timer chip below uses it to flash an LED), and for smoothing: a capacitor across a power supply fills up when the voltage rises and tops it up when it sags.

The capacitor next to every chip

Almost every circuit board has a small capacitor right beside each chip's power pins. These decoupling capacitors, usually 100 nF ceramics, are tiny local reservoirs that cover the chip's sudden bursts of current so the supply voltage doesn't dip. Do the same on a breadboard: a 100 nF capacitor across each chip's supply pins, as close to the chip as you can.

Diodes and LEDs

A diode is a one-way valve for current. In the symbol, the triangle points the way conventional current is allowed to flow; the bar end, called the cathode, is marked on the part with a band. A silicon diode uses up roughly 0.6–0.7 V when it conducts.

An LED (light-emitting diode) is a diode that gives off light as current flows through it. Two things to know:

  • It has a right way round. The longer leg is the anode (+). The shorter leg, on the side where the rim of the plastic body is flat, is the cathode (−). Backwards, it simply doesn't light. At 5 V that does it no harm (typical LEDs are rated to take 5 V in reverse), so if one stays dark, try turning it round.
  • It needs a resistor in series. Always. Once an LED is conducting, it does almost nothing to limit the current, so wired straight to a battery or an Arduino pin it takes far too much and dies, possibly taking the pin with it.

Each colour needs a different voltage to light, called its forward voltage. For a typical 5 mm LED, from Kingbright's datasheets: red about 1.9 V, green about 2.0 V, white about 3.3 V, measured at 10–20 mA. At the lower currents used here they need a little less. Modern LEDs are bright at a few milliamps, and the absolute maximum is usually 25–30 mA. To pick the resistor:

R = (supply voltage − LED voltage) ÷ current

Red LED from a 5 V Arduino pin, aiming for about 6.5 mA: (5 − 1.9) ÷ 0.0065 ≈ 477 Ω → 470 Ω.

White LED from 5 V: at about 6 mA it needs nearer 3.0 V than its 3.3 V rating, so (5 − 3.0) ÷ 0.006 ≈ 333 Ω → 330 Ω.

White LED from a 3.3 V board: there's no voltage left over for a resistor, so it will be dim or won't light at all. Use a red LED there.

Why 6.5 mA and not the 20 mA you'll see in many tutorials? Because the newer Arduino UNO R4 is rated for only 8 mA per pin (the older UNO R3 manages 20 mA). A 470 Ω resistor keeps a red LED safely inside both limits and still plenty bright.

Transistors: the switch that built the digital world

A transistor is a switch with no moving parts: a small current or voltage at one of its three legs controls a much larger current through the other two. The two families you'll meet are the bipolar transistor (BJT; common beginner parts are the BC547 and 2N2222) and the MOSFET.

In your first projects they switch things an Arduino pin can't drive itself: a pin supplies a few milliamps, while even a small relay wants tens and a motor can want hundreds. The pin switches the transistor; the transistor switches the load.

That same idea, one voltage switching another, is the basis of computing. A few transistors make a logic gate, gates make circuits that add and remember, and billions of them make a processor.

Integrated circuits (chips)

An integrated circuit is a complete circuit (transistors, resistors, sometimes small capacitors) made together on one small piece of semiconductor and sealed in a package with metal pins. Jack Kilby at Texas Instruments demonstrated the first working one on 12 September 1958 (he shared the 2000 Nobel Prize in Physics for it), and in 1959 Robert Noyce at Fairchild applied to patent the monolithic silicon chip, the approach every chip has used since. Intel's first microprocessor, the 4004 of 1971, had about 2,300 transistors; Apple's M3 Max of 2023 has 92 billion.

Packages, and finding pin 1

Chips come in two broad kinds of package. DIP (dual in-line) chips have two rows of legs, 0.1 inch (2.54 mm) apart along each row, with the rows 0.3 inch (7.62 mm) apart on most small chips, so they sit straight across a breadboard's centre gap: these are what you'll learn on. Surface-mount chips are much smaller and are soldered onto the surface of a board; that's what you'll find inside your phone.

Every chip has a notch or a dot to show which end is which. With the notch at the top, pin 1 is top left, and the numbers run down the left side, then up the right: anticlockwise, looking down on the chip.

Pin numbering on an 8-pin chip: the NE555 timerA black 8-pin chip seen from above, with a notch at the top and a dot beside pin 1 in the top-left corner. Pins 1 to 4 run down the left side and pins 5 to 8 run up the right side, anticlockwise, shown by a green arrow. For the NE555 timer, pin 1 is ground, 2 trigger, 3 output, 4 reset, 5 control, 6 threshold, 7 discharge and 8 the positive supply.Top view: pins count anticlockwise from the notch12348765NE555timerGND (0 V)TRIGGEROUTPUTRESETVCC (+ supply)DISCHARGETHRESHOLDCONTROLSame rule on every DIP chip, whether it has 8, 14, 16 or 28 pins.
Notch at the top, pin 1 top left, count anticlockwise. Put a chip in upside down and its power pins land in the wrong place, which can destroy it in seconds. Check pin 1 before you power up.

Datasheets, and some good first chips

Every chip has a free datasheet from its maker: what each pin does, what supply voltage it needs, and its absolute maximum ratings. Treat those as a cliff edge, not a target: the chip is only guaranteed to work properly well inside them. Search for the part number plus "datasheet".

  • NE555 timer. Designed by Hans Camenzind in 1971, released by Signetics in 1972 and still made today. With two resistors and a capacitor it flashes an LED or makes a tone. It needs 4.5 V to 16 V: USB, 4 × AA or a 9 V battery.
  • 74HC08, 74HC32 and 74HC04 logic. Four AND gates, four OR gates, or six inverters (NOT gates) in one chip: the building blocks of the next section, which you can wire up and test with LEDs.

From voltages to 1s and 0s

Here is where electronics turns into the digital world. A digital chip doesn't care about the exact voltage on its input; it only asks one question: is it high or low? High means 1, low means 0.

The ATmega328P on an Arduino UNO R3, running at 5 V, guarantees to read anything below 1.5 V (0.3 × the supply) as a 0, and anything above 3.0 V (0.6 × the supply) as a 1. In between is a no-man's-land where the answer isn't guaranteed, and well-designed circuits stay out of it.

How a 5 volt chip turns voltages into 1s and 0sA voltage scale from 0 to 5 volts. From 3 to 5 volts is shaded green and labelled HIGH equals 1. From 0 to 1.5 volts is shaded blue and labelled LOW equals 0. Between 1.5 and 3 volts is shaded red and labelled undefined: avoid. To the right, a wobbly real-world signal goes high, low, high, high, low. Despite the wobble it stays inside the bands, so the chip reads it cleanly as 1 0 1 1 0.a 5 V chip's inputa real signal wobbles, but still reads cleanly5 V3.0 V1.5 V0 VHIGH = 13.0 to 5 Vundefinedneither: avoidLOW = 00 to 1.5 Vreads as:10110
Wide bands are what make digital reliable. Noise, long wires and tired batteries all nudge real voltages about, but as long as a signal stays inside its band, every chip downstream reads exactly the same 1 or 0, and passes on a fresh, clean copy. That's why a copied file is identical to the original, and a copy of an analogue tape isn't.

Logic gates

A logic gate is a few transistors wired so that its output is a fixed rule of its inputs. The three basic ones:

Input A Input B AND OR NOT A
00001
01011
10010
11110
  • AND outputs 1 only if both inputs are 1.
  • OR outputs 1 if either input is 1.
  • NOT (an inverter) flips its single input.

Combine a handful of gates and you can add two binary digits; chain those and you can add numbers of any size. Cross-connect two gates, each feeding the other's input, and the pair can remember a bit. A processor is that idea repeated billions of times, stepped along by a clock: the UNO R3's runs at 16 MHz, 16 million ticks a second. The Turing machine lesson tells the story of how simple rules like these add up to a universal computer, and how computers check data shows what they do when a bit flips.

Arduino: electronics you can program

An Arduino is a small circuit board built around a microcontroller: a complete, simple computer on one chip, with a processor, memory and pins that can read and set voltages. The project began in 2005 as a teaching tool for students at the Interaction Design Institute Ivrea in Italy, and the designs are open source, which is why so many compatible boards exist.

You write a program (Arduino calls it a sketch) in the free Arduino IDE, plug the board in over USB, and click Upload. The language is C++ with a set of simple, friendly functions. Every sketch has two parts: setup(), which runs once when the board starts, and loop(), which then runs over and over for as long as it has power.

UNO R3 or UNO R4?

UNO R3 UNO R4 Minima / WiFi
MicrocontrollerATmega328P (8-bit)Renesas RA4M1 (32-bit Arm Cortex-M4)
Clock speed16 MHz48 MHz
Program memory (flash)32 KB256 KB
Working memory (SRAM)2 KB32 KB
Operating voltage5 V5 V
Digital pins (PWM)14 (6 with PWM)14 (6 with PWM)
Analogue inputs6, 10-bit (0–1023)6, up to 14-bit (10-bit by default)
Current per pin20 mA8 mA
USB socketUSB-BUSB-C
Extras—A true analogue output (DAC) on A0; the WiFi model adds Wi-Fi, Bluetooth and an LED matrix

Either is a good board to learn on, and everything in this lesson works on both.

The pins

  • Digital pins 0–13 can be outputs (set to 0 V or 5 V) or inputs (read as 0 or 1). Leave 0 and 1 free at first: on the UNO R3 they carry the USB serial link to your computer.
  • Pins marked ~ (3, 5, 6, 9, 10, 11) can also do PWM, a fast on-off trick that fakes an in-between voltage (project 2).
  • A0–A5 are analogue inputs: they measure a voltage between 0 and 5 V and turn it into a number.
  • 5V, 3.3V and GND supply power to your breadboard. VIN is for a battery or plug pack when the board isn't on USB.

Two rules that save boards. Never connect a motor, relay or speaker straight to a pin: drive it through a transistor or a driver board, with its own power if it needs more than the USB port gives. And never feed a voltage above 5 V, or below 0 V, into any input/output pin, digital or analogue. On 3.3 V boards (ESP32, Raspberry Pi Pico), the limit is 3.3 V.

Blink is the "hello, world" of electronics. It puts the whole lesson so far on your desk: a loop, a voltage, a resistor limiting the current, and a chip switching a pin between 0 and 1.

First, how a breadboard works

A solderless breadboard is a grid of spring clips hidden under a plastic face. Push a wire or a component leg into a hole and it's gripped and connected to the other holes on the same strip.

Which holes on a breadboard are joinedPart of a solderless breadboard. Along the top and bottom edges are two power rails, marked with red and blue lines; each long rail is joined along its length. In the middle are rows a to e and f to j, separated by a centre gap. Each column of five holes, a to e or f to j, is joined underneath, shown in green for two columns. An 8-pin chip straddles the centre gap, so each of its pins sits in its own column.+−−+jihgfedcbachippower railseach long row is joined end to end(on some long boards, only halfway)joined underneatheach column of 5 holes, a–e or f–j,is one connectioncentre gapthe two halves are not joined,so a chip can straddle it andeach pin gets its own columnrails on this edge toonot joined to the top rails
Columns of five, rails along the edges. Two legs pushed into the same column are connected; in different columns, they aren't. On some long breadboards each rail is split halfway along, so check with your multimeter's continuity beep before you trust it.

Unplug the USB cable while you wire. We use pin 9 rather than the usual pin 13, because pin 9 can also do PWM and project 2 reuses the same wiring.

  1. Push the LED into the breadboard with its legs in two different columns. Note which column has the long leg (+).
  2. Put one leg of a 470 Ω resistor (yellow, violet, brown, gold) in the long-leg column, and the other leg in a new column.
  3. Run a jumper wire from the Arduino's ~9 pin to the resistor's free column.
  4. Run a jumper wire from the LED's short-leg column to one of the Arduino's GND pins.
Wiring an LED to an Arduino UNOAn Arduino UNO with an orange jumper wire from its pin 9 to a 470 ohm resistor, banded yellow, violet, brown and gold. The resistor connects to the long leg of a red LED. The LED's short leg, on its flat side, connects by a black wire back to the Arduino's GND pin, next to pin 13. Below, the same circuit as a diagram: pin 9, a resistor, an LED, then ground.USBGND13~9Arduino UNOfrom pin ~9back to GND470 Ωyellow violet brown goldLED: long leg (+)to the resistorflat side, short leg (−)to GNDthe same circuit as a diagrampin 9470 ΩLEDGND
Pin 9 → resistor → LED → GND. The breadboard is left out for clarity: each place two leads meet is one breadboard column. The order of resistor and LED doesn't matter, as long as they're both in the loop and the LED's long leg faces the pin.

Open the Arduino IDE, choose your board (Tools → Board) and its port (Tools → Port), paste this in, and click Upload:

// Blink: switch pin 9 on and off, once a second
const int LED_PIN = 9;

void setup() {
  pinMode(LED_PIN, OUTPUT);     // pin 9 will drive a voltage out
}

void loop() {
  digitalWrite(LED_PIN, HIGH);  // 5 V: current flows, the LED lights
  delay(500);                   // wait 500 milliseconds
  digitalWrite(LED_PIN, LOW);   // 0 V: no current, the LED goes out
  delay(500);
}

The LED should flash once a second. If it doesn't, check the LED's long leg faces the resistor, that the legs are in the columns you think they are, and that the resistor really is 470 Ω (yellow, violet, brown).

See it with your meter. Change both delay(500) lines to delay(5000) and upload again, so the pin stays put for five seconds at a time. With your multimeter on DC volts, black probe on GND and red on pin 9, you'll watch it step between about 5 V (a 1) and 0 V (a 0). That's a bit of the digital world, measured.

Then, with the LED lit, measure across the resistor and across the LED. The two add up to (nearly) the pin's voltage, and Ohm's law on the resistor's reading gives the current: about 3.1 V ÷ 470 Ω ≈ 6.6 mA.

Project 2: a dimmer knob (analogue in, PWM out)

Keep the LED wired to pin 9, and add the 10 kΩ potentiometer. It has three legs: connect one outer leg to the Arduino's 5V pin, the other outer leg to GND, and the middle leg (the wiper) to A0. That's the voltage divider from the resistors section: turning the knob moves A0 anywhere from 0 V to 5 V.

// Dimmer: read a knob on A0, set the LED's brightness on pin 9
const int KNOB_PIN = A0;
const int LED_PIN = 9;          // a PWM pin (marked ~ on the board)

void setup() {
  pinMode(LED_PIN, OUTPUT);
  Serial.begin(9600);           // so we can watch the numbers
}

void loop() {
  int reading = analogRead(KNOB_PIN);    // 0 to 1023 for 0 V to 5 V
  float volts = reading * 5.0 / 1023.0;  // turn the number back into volts
  int brightness = reading / 4;          // 0 to 255, the range analogWrite takes
  analogWrite(LED_PIN, brightness);      // PWM: on for brightness/255 of the time

  Serial.print(reading);
  Serial.print("  ");
  Serial.print(volts, 2);
  Serial.println(" V");
  delay(100);
}

Upload it, then open Tools → Serial Monitor and set it to 9600 baud. As you turn the knob, the LED dims and brightens, and the monitor shows the number and the voltage the Arduino is reading. Put your multimeter on the wiper (red) and GND (black) and compare: they should agree to within about a tenth of a volt. The sketch assumes the board's supply is exactly 5.00 V, and a USB port often gives a little less. Measure the board's 5V pin, put that figure in place of 5.0 in the sketch, and the two will agree more closely.

Two things are going on:

  • Analogue in. analogRead() measures the voltage on A0 and turns it into a whole number: on the UNO, 10 bits, so 0 to 1023 for 0 to 5 V. That's an analogue-to-digital converter at work, the same job your phone does on your voice before it sends it.
  • PWM out. A digital pin can only be 0 V or 5 V. So analogWrite() switches it on and off very fast and varies how much of the time it's on, called pulse-width modulation. Your eye averages the flicker into a steady brightness.
Pulse-width modulation at three settingsThree square waves, each switching between 0 and 5 volts at the same rate. The top one is on 25 percent of the time, set by analogWrite 64, averaging about 1.25 volts: the LED is dim. The middle one is on 50 percent of the time, analogWrite 128, averaging 2.5 volts. The bottom one is on 90 percent of the time, analogWrite 230, averaging about 4.5 volts: the LED is bright. A dashed line on each shows the average.5 V on, 0 V off, hundreds of times a second25% on: dimanalogWrite 64average ≈ 1.25 V50% onanalogWrite 128average ≈ 2.5 V90% on: brightanalogWrite 230average ≈ 4.5 V
PWM fakes an in-between voltage by time-sharing. On the UNO R3, pin 9 switches about 490 times a second, far too fast to see. The amber dashed line is the average your eye (or a motor) responds to. Your multimeter will show roughly that average too, since it can't follow the switching either.

Dimming LEDs, controlling motor speed and making sounds all use PWM. The UNO R4 also has a true analogue output, a DAC, on pin A0, but PWM is what you'll use most.

Where to go next

  • Read a button. Wire a push button between a pin and GND and use pinMode(pin, INPUT_PULLUP). A resistor built into the chip holds the pin at 1 until the button pulls it to 0: a pull-up resistor in action.
  • Build a 555 flasher, no computer needed. In the NE555's standard flashing circuit, its datasheet gives the rate as f ≈ 1.44 ÷ ((RA + 2 × RB) × C). With RA = 1 kΩ, RB = 10 kΩ and C = 47 µF, that's about 1.5 flashes a second. Swap the capacitor and watch the RC time constant change it.
  • Drive something bigger. Switch a small motor through a transistor, with a diode across the motor to catch the voltage spike when it turns off.
  • Sense the world. A light-dependent resistor (LDR) and a fixed resistor make a voltage divider that changes with the light: read it on A0, just like the knob.
  • Try a 3.3 V board such as an ESP32 or a Raspberry Pi Pico, and redo your resistor sums for 3.3 V.
  • Get a kit with the parts. Our lesson on the Elegoo UNO R3 starter kit compares the kits and walks through ten experiments, one idea each.

The most useful tool after your eyes

A multimeter turns "it doesn't work" into "there's no voltage on pin 9". We wrote up what to look for in one, and how to test batteries with it.

Our multimeter Testing batteries

The cheat sheet

  • Voltage = the push (V), measured across. Current = the flow (A, mA), measured through. Resistance = the opposition (Ω).
  • Ohm's law: V = I × R. Power: P = V × I. Work in volts, amps and ohms.
  • Resistor colours: black 0, brown 1, red 2, orange 3, yellow 4, green 5, blue 6, violet 7, grey 8, white 9. Gold ±5%, silver ±10%.
  • Capacitors: 104 = 100 nF. Electrolytics: stripe = −, long leg = +. τ = R × C; full after about 5τ.
  • Every LED needs a series resistor. R = (supply − LED voltage) ÷ current. 470 Ω for a red LED on 5 V, 330 Ω for a white one.
  • Chips: notch at the top, pin 1 top left, count anticlockwise. A 100 nF capacitor across every chip's power pins.
  • Digital = two voltage bands. On a 5 V UNO R3, under 1.5 V reads 0 and over 3.0 V reads 1.
  • Arduino pins: 20 mA each on the UNO R3, 8 mA on the R4. Nothing above 5 V or below 0 V on an I/O pin, and no motors directly.
  • Stay at extra-low voltage. Never experiment with mains.

Common questions

What is the difference between voltage and current?
Voltage is the push: the difference in electrical pressure between two points, measured in volts. Current is the flow: how much electric charge passes a point each second, measured in amps. A battery provides the voltage, but current only flows when there is a complete loop for it to flow around. Ohm's law links the two: current = voltage ÷ resistance.
What is Ohm's law?
Ohm's law says voltage = current × resistance, or V = I × R. Rearranged, current = voltage ÷ resistance, and resistance = voltage ÷ current. For example, 5 volts across a 1,000 ohm resistor drives 0.005 amps (5 milliamps) through it.
How do I read a resistor's colour code?
Hold the resistor with the gold or silver band on the right. The first two bands are digits (black 0, brown 1, red 2, orange 3, yellow 4, green 5, blue 6, violet 7, grey 8, white 9), the third says how many zeros to add, and the last is the tolerance: gold ±5%, silver ±10%. Brown, black, orange, gold is 1, 0 and three zeros: 10,000 ohms (10 kΩ), ±5%. If in doubt, measure it with a multimeter.
Which way round does a capacitor go?
Ceramic and film capacitors can go either way round. Electrolytic capacitors are polarised: the longer leg is positive, and the stripe printed down one side marks the negative leg. Fitted backwards, an electrolytic can overheat, bulge or burst, so check before you power up.
Why does an LED need a resistor?
Once an LED starts to conduct, it does almost nothing to limit the current, so connected straight to a battery or an Arduino pin it draws far too much and burns out, and it can damage the pin too. A resistor in series sets the current. For a red LED on 5 V, a 470 ohm resistor gives about 6–7 milliamps, which is bright enough and within the limits of both the Arduino UNO R3 and the UNO R4.
What is an integrated circuit?
An integrated circuit, or chip, is a complete circuit of transistors, resistors and other parts made together on one small piece of semiconductor and sealed in a package with metal pins. Jack Kilby demonstrated the first one at Texas Instruments on 12 September 1958. Intel's first microprocessor, the 4004 of 1971, had about 2,300 transistors; Apple's M3 Max of 2023 has 92 billion.
Is Arduino a good way to learn electronics?
Yes. An Arduino gives you a safe 5 volt supply over USB and pins you can switch on and off, or measure, with a few lines of code, so you see voltage, current and resistance doing something straight away. Pair it with a breadboard, some resistors, LEDs and a multimeter. It's also worth building a few circuits without it, such as a 555 timer flasher, to see what the parts do on their own.
Should I buy an Arduino UNO R3 or an UNO R4?
Either works for learning, and the basic code and wiring are the same on both. The UNO R4 (Minima or WiFi) is newer and much faster, with more memory and a USB-C socket. The UNO R3 can supply more current from each pin: 20 milliamps against the R4's 8 milliamps. On an R4, keep LED currents to about 6 milliamps (at 5 V, 470 ohms for a red LED, 330 ohms for a white one) and drive anything bigger through a transistor.
Can low-voltage electronics hurt me?
The 5 volts from a USB port or the few volts from AA batteries are far too low to give you a shock. The risks at low voltage are heat and fire: a short circuit across a lithium-ion cell or a car battery can melt wires, and resistors and chips can get hot enough to burn. Never open up or work inside anything that runs on 230 volt mains power; in Australia, electrical work on mains wiring must be done by a licensed electrician.

Sources

Arduino

  • Arduino UNO R3 (official store spec table): ATmega328P, 5 V, 16 MHz, 14 digital I/O pins (6 PWM), 6 analogue inputs, 32 KB flash, 2 KB SRAM, 20 mA DC current per I/O pin, built-in LED on pin 13. link. Checked 21/10/2026.
  • Arduino UNO R4 Minima and UNO R4 WiFi (official store and docs pages): Renesas RA4M1 (Arm Cortex-M4), 48 MHz, 5 V, 256 kB flash, 32 kB SRAM, 8 mA DC current per I/O pin, USB-C, 12-bit DAC on A0, up to 14-bit ADC. Minima, WiFi, docs. Checked 21/10/2026.
  • Arduino language reference, analogRead() and analogWrite(): 10-bit default resolution (0–1023 on the UNO), PWM duty 0–255, about 490 Hz on most UNO R3 pins (980 Hz on 5 and 6), PWM on pins 3, 5, 6, 9, 10 and 11. analogRead, analogWrite. Checked 21/10/2026.
  • Arduino UNO R4 WiFi store page: ESP32-S3 module for Wi-Fi and Bluetooth, 12 × 8 red LED matrix. link. Checked 21/10/2026.
  • Arduino, Wikipedia: began in 2005 as a tool for students at the Interaction Design Institute Ivrea, Italy. link. Checked 21/10/2026.

Chips and components

  • Microchip ATmega328P datasheet: input low voltage max 0.3 × VCC, input high voltage min 0.6 × VCC; absolute maximum 40 mA per I/O pin. link. Checked 21/10/2026.
  • Texas Instruments NE555 datasheet: supply 4.5–16 V; astable frequency f ≈ 1.44 / ((RA + 2RB) × C). link. Checked 21/10/2026.
  • 555 timer IC, Wikipedia: designed by Hans Camenzind in 1971 for Signetics, released 1972. link. Checked 21/10/2026.
  • Kingbright 5 mm LED datasheets: red WP7113SRD/D 1.85 V typical at 20 mA; green WP7113GD 2.0 V typical; white WP7113QWC/D 3.3 V typical at 20 mA; absolute maximum DC forward current 25–30 mA; reverse voltage 5 V. red, green, white. Checked 21/10/2026.
  • Ohm's law, Wikipedia: Ohm published his results in 1827 as Die galvanische Kette, mathematisch bearbeitet. link. Checked 21/10/2026.
  • Diode, Wikipedia: forward threshold voltage of a silicon p–n diode 0.6–0.7 V. link. Checked 21/10/2026.
  • Electronic color code, Wikipedia (IEC 60062 colours, multipliers and tolerances). link. Checked 21/10/2026.
  • E series of preferred numbers, Wikipedia (IEC 60063 E12 series). link. Checked 21/10/2026.
  • Capacitor, Wikipedia (three-digit marking code in picofarads), and RC time constant, Wikipedia (τ = RC; 63.2% after 1τ, 99.3% after 5τ). capacitor, RC time constant. Checked 21/10/2026.
  • SparkFun, How to Use a Breadboard: terminal strips of five, the centre ravine for DIP chips, power rails, split rails on some boards. link. Checked 21/10/2026.

History

  • Texas Instruments: Jack Kilby unveiled the first working integrated circuit on 12 September 1958. link. Checked 21/10/2026.
  • Computer History Museum, The Silicon Engine: Kilby's germanium circuit with gold wires (1958); Noyce's monolithic silicon IC patent application (1959). 1958, 1959. Checked 21/10/2026.
  • Jack Kilby, Wikipedia: Nobel Prize in Physics 2000. link. Checked 21/10/2026.
  • Intel: the 4004 (1971) contained 2,300 transistors. link. Checked 21/10/2026.
  • Apple Newsroom, 30/10/2023: M3 Max has 92 billion transistors. link. Checked 21/10/2026.
  • Electric current, Wikipedia (conventional current and electron drift); HyperPhysics, Electric current. Wikipedia, HyperPhysics. Checked 21/10/2026.

Safety (Australia)

  • NSW Resources Regulator, position paper on live electrical work: extra-low voltage under AS/NZS 3000:2018 is not more than 50 V AC or 120 V ripple-free DC. link. Checked 21/10/2026.
  • Energy Safe Victoria, Electrical DDIY (Don't Do It Yourself): unqualified electrical work, including changing power points or light switches, is illegal; use a licensed electrician. link. Checked 21/10/2026.

Keep learning

Reference guides Testing a battery with a multimeter Open-circuit voltage, internal resistance, and when you need to put a load on it. Projects & builds Our new multimeter: the EEVblog BM786 What 60,000 counts, 0.03% and the CAT safety ratings on a meter actually mean. Inside the computer The Turing machine How a tape, a head and a table of rules became the idea inside every computer.