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.
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: 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.
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:
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.
| Colour | Digit | Multiplier | Tolerance |
|---|---|---|---|
| Black | 0 | × 1 | — |
| Brown | 1 | × 10 | ±1% |
| Red | 2 | × 100 | ±2% |
| Orange | 3 | × 1,000 (1 k) | — |
| Yellow | 4 | × 10,000 (10 k) | — |
| Green | 5 | × 100,000 (100 k) | — |
| Blue | 6 | × 1,000,000 (1 M) | — |
| Violet | 7 | — | — |
| Grey | 8 | — | — |
| White | 9 | — | — |
| 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.
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
- 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.
| 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.
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.
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 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 |
- 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 | |
|---|---|---|
| Microcontroller | ATmega328P (8-bit) | Renesas RA4M1 (32-bit Arm Cortex-M4) |
| Clock speed | 16 MHz | 48 MHz |
| Program memory (flash) | 32 KB | 256 KB |
| Working memory (SRAM) | 2 KB | 32 KB |
| Operating voltage | 5 V | 5 V |
| Digital pins (PWM) | 14 (6 with PWM) | 14 (6 with PWM) |
| Analogue inputs | 6, 10-bit (0–1023) | 6, up to 14-bit (10-bit by default) |
| Current per pin | 20 mA | 8 mA |
| USB socket | USB-B | USB-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.
Project 1: blink an LED
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.
Wire it up
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.
- Push the LED into the breadboard with its legs in two different columns. Note which column has the long leg (+).
- Put one leg of a 470 Ω resistor (yellow, violet, brown, gold) in the long-leg column, and the other leg in a new column.
- Run a jumper wire from the Arduino's ~9 pin to the resistor's free column.
- Run a jumper wire from the LED's short-leg column to one of the Arduino's GND pins.
The code
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.
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.
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?
What is Ohm's law?
How do I read a resistor's colour code?
Which way round does a capacitor go?
Why does an LED need a resistor?
What is an integrated circuit?
Is Arduino a good way to learn electronics?
Should I buy an Arduino UNO R3 or an UNO R4?
Can low-voltage electronics hurt me?
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.