Start here
How this course works, and the colour code used on every page.
How to use this course
3 minThe course has eight main parts, plus a workbook, a connectors part and a build checker. Do Part 1 first, because everything else uses it. After that you can jump around.
| Part | What you get | Time |
|---|---|---|
| 1 Electricity from zero | Voltage, current, resistance, power, the parts you will use, and how to pick resistors. | 1.5 h |
| 1A Electricity workbook | Around 100 exercises with step-by-step answers, and endless practice. | 3 h+ |
| 1B Wires and connectors | Wire, jumpers, power plugs, terminals, JST, clips, the multimeter, pin labels and soldering. | 2 h |
| 2 Tinkercad tour | Your account, the dashboard, and the four workspaces. | 15 min |
| 3 3D Design | Shapes, holes, groups, exact sizes, and designing things that 3D print well. | 2 h |
| 4 Circuits | Breadboards, the multimeter, Arduino, code, sensors and motors. | 3 h |
| 4A Build checker | A practice Arduino that checks a copy of your Tinkercad wiring and explains every problem. | any time |
| 5 Codeblocks and Sim Lab | Make 3D shapes with code blocks, and test designs with physics. | 30 min |
| 6 Helping others build | Classes, session plans, hints that teach, and a fault finder. | 45 min |
| 7 Your own projects | A project loop, moving to real hardware, and ideas to start from. | 30 min |
| 8 Bigger builds | Harder maths, code patterns for long programs, ten multi-part projects and a capstone. | 12 h+ |
Each lesson ends with a tick box. Your ticks stay in this browser, and the bar at the top shows how far you are.
The coloured boxes
Something to do in Tinkercad right now.
A common mistake, and how to avoid it.
How to explain this to someone else.
The colour code for letters
2 minElectricity uses four letters again and again. Each one always has the same colour on this page, so you can spot it fast.
V = voltage
The push. Measured in volts (V).
I = current
The flow. Measured in amps (A). It is I, not C, because the French word was intensité.
R = resistance
The squeeze that slows the flow. Measured in ohms (Ω).
P = power
How much energy per second gets used. Measured in watts (W).
Every formula is shown the same way: first what each letter means, then the idea in plain words, then the equation.
Electricity from zero
No maths background needed. Nine short lessons, each with something to try. Then practise in Part 1A.
What electricity is
8 minElectricity is tiny particles called electrons moving through a material, all in the same direction.
Everything is made of atoms. Atoms have electrons around them. In metals like copper, some electrons are loose. They can hop from atom to atom. That is why wires are made of copper.
On their own, loose electrons just drift around at random. To get them to move one way, something has to push them. A battery does that.
The water picture
Think of a circuit like water in pipes. It is not perfect, but it works for almost everything in this course.
| In the circuit | In the water picture |
|---|---|
| Battery | A pump. It pushes water round. |
| Wire | A wide pipe. Water flows easily. |
| Voltage | How hard the pump pushes (pressure). |
| Current | How much water flows past each second. |
| Resistance | A narrow bit of pipe that slows the flow. |
| LED or motor | A water wheel. The flow makes it do work. |
People often think the battery is a bucket of electricity that gets "used up" by the bulb. It isn't. The electrons were already in the wire. The battery pushes them round. What runs out is the battery's chemical energy, its ability to push.
Use the live circuit at the top of this page. Push the battery slider down to 1 V. The LED stays dark, because an LED needs about 2 V of push before any current flows at all.
Voltage, current, resistance
12 minThese three words are the whole of basic electricity. Learn what each one feels like.
Voltage (V)
The push. It is always measured between two points, like the + and − of a battery. Unit: volts, V.
AA battery 1.5 V. Arduino pin 5 V. Square battery 9 V.
Current (I)
The flow. How many electrons go past one point each second. It is the same all the way round one loop. Unit: amps, A.
An LED needs about 0.02 A (20 mA).
Resistance (R)
How much a part fights the flow. More resistance means less current for the same push. Unit: ohms, Ω.
Common resistors: 220 Ω, 1 kΩ, 10 kΩ.
Big and small numbers
Electronics uses very small currents and very big resistances, so we put a short word in front of the unit. These are the four you need.
| Prefix | Means | Example | Same as |
|---|---|---|---|
| M (mega) | × 1,000,000 | 1 MΩ | 1,000,000 Ω |
| k (kilo) | × 1,000 | 4.7 kΩ | 4,700 Ω |
| m (milli) | ÷ 1,000 | 20 mA | 0.02 A |
| µ (micro) | ÷ 1,000,000 | 10 µs | 0.00001 s |
Little m and big M are different. 1 mΩ is a thousandth of an ohm. 1 MΩ is a million ohms. Calculators below always ask which one you mean.
Quick check: what is 330 mA in amps?
0.33 A. Milli means divide by 1,000.
Quick check: a resistor says 2k2. What is that?
2.2 kΩ, which is 2,200 Ω. The letter is used in place of the decimal point so it can't get lost when printed small.
Circuits: closed, open and short
8 minCurrent only flows when there is a full loop, from + all the way back to −.
- Closed circuit: a complete loop. Current flows. Things work.
- Open circuit: there is a gap somewhere. A switch is just a tidy way to make a gap on purpose.
- Short circuit: a path with almost no resistance from + to −. Current takes the easy path, skips your parts, and gets huge. Wires and batteries heat up fast.
In Tinkercad a short just shows a warning. In real life a shorted 9 V battery can get too hot to touch, and a shorted lithium battery can catch fire. Always check for shorts before you connect power.
Which way does current go?
We draw current flowing from + to −. This is called conventional current. The electrons actually move the other way, from − to +. People decided the direction before electrons were discovered, and the old rule stuck. Every diagram, datasheet and Tinkercad part uses + to −, so you can too.
Ohm's law
15 minOne rule links push, flow and squeeze. You will use it more than anything else in electronics.
- V
- the voltage across the part, in volts
- I
- the current through the part, in amps
- R
- the resistance of the part, in ohms
The push equals the flow times the squeeze. Push harder and more flows. Squeeze harder and less flows.
V = I × R
I = V ÷ R R = V ÷ I
A worked example, one step at a time
- A 9 V battery is connected to a 450 Ω resistor. What current flows?
- We want I, so use I = V ÷ R.
- Put the numbers in: I = 9 ÷ 450.
- Work it out: I = 0.02 A.
- Turn it into mA (× 1,000): 20 mA.
Draw a triangle with V on top and I, R along the bottom. Cover the letter you want. What's left shows the sum: V over R means divide, I next to R means multiply.
Power and heat
8 minPower tells you how much energy a part uses every second. Most of it turns into heat, light or movement.
- P
- power, in watts (W)
- V
- the voltage across the part
- I
- the current through it
Power is push times flow. A strong push with a big flow uses lots of energy.
P = V × I
Why this matters to you
- Normal small resistors can handle ¼ W (0.25 W). More than that and they get hot and can burn.
- Example: 5 V across a 220 Ω resistor. I = 5 ÷ 220 = 0.023 A. P = 5 × 0.023 = 0.11 W. That is fine.
- Example: 9 V across a 10 Ω resistor. I = 0.9 A. P = 8.1 W. Far too much. It would smoke.
- Motors need much more current than an Arduino pin can give, which is why they use a separate driver (see C9).
"Why does my phone charger say 20 W?" is a great opener. 5 V × 4 A = 20 W. Kids love finding the numbers on real chargers.
Series and parallel
15 minThere are only two ways to join parts: one after another, or side by side.
Series: one after another
There is only one path. The same current goes through every part. The voltage is shared out between them.
Resistances add up.
R = R₁ + R₂ + R₃
Parallel: side by side
There are several paths. Every part gets the full voltage. The current splits between the paths.
The total resistance goes down, because there are more ways through.
1 ÷ R = 1 ÷ R₁ + 1 ÷ R₂
- R₁
- the first resistor
- R₂
- the second resistor
- R
- what they act like together
Multiply them. Add them. Divide the first answer by the second.
R = (R₁ × R₂) ÷ (R₁ + R₂)
Lights in a house are wired in parallel. That is why one bulb can blow and the rest stay on. Old Christmas lights were in series, so one dead bulb made the whole string go dark.
Batteries follow the same idea. Two 1.5 V batteries in series (+ to −) give 3 V. In parallel they stay at 1.5 V but last longer.
Parts you will meet
15 minThese are the parts used in almost every beginner project. The drawing is the circuit symbol, the way the part is drawn on a plan.
Battery / power supply
Gives the push. Long line is +, short thick line is −. In Tinkercad: 9V Battery, 1.5V Battery, Coin Cell 3V, or the Arduino's 5V pin.
Resistor
Limits current. Has no + or −, either way round works. Its value is shown by coloured bands (E8). In Tinkercad, click it to type the value.
In the UK and Spain the symbol is usually a plain rectangle. Tinkercad and US books use the zigzag. Both mean the same.
LED (light-emitting diode)
Lights up. It only works one way round. The longer leg (Tinkercad draws it bent) is + (anode). It always needs a resistor.
Switch and pushbutton
Makes or breaks the loop. A slideswitch stays where you put it. A pushbutton only connects while pressed. Its four legs are joined in two pairs.
Potentiometer (knob)
A resistor with a slider. Three legs: two ends and a middle "wiper". Turning it changes the voltage on the middle leg. Perfect for analog input.
Photoresistor (LDR)
A resistor that changes with light. More light means less resistance. Used for night lights and light sensors.
Piezo buzzer
Makes beeps. The Arduino's tone() command makes it play notes. Has + and − legs.
Motor and servo
A DC motor spins. A servo turns to an exact angle, 0° to 180°, set by code. Both need more current than a pin can give.
Capacitor
A tiny short-term energy store. Used to smooth out power. Big round ones (electrolytic) have a − stripe and must go the right way round.
Transistor
An electric switch. A small current into one leg lets a big current flow through the other two. This is how an Arduino controls a motor.
Sensors
Turn the world into signals: TMP36 (temperature), Ultrasonic Distance Sensor, PIR (movement), soil moisture, and more. Most have 3 legs: power, ground, signal.
Microcontroller (Arduino Uno)
A tiny computer that runs one program forever. It reads sensors and switches outputs. Covered fully in Part 4.
Reading and choosing resistors
20 minResistors are too small to print numbers on, so they use coloured bands. The common type has four bands.
- Band 1: first digit.
- Band 2: second digit.
- Band 3: how many zeros to add (the multiplier).
- Band 4: how accurate it is, usually gold (±5%). Gold goes on the right when you read it.
The colours in order, 0 to 9: black, brown, red, orange, yellow, green, blue, violet, grey, white. A kid-safe way to remember: Big Brown Rabbits Often Yawn Gently By Violet Gardens Weekly.
Picking the resistor for an LED
An LED does not limit its own current. Without a resistor it would take far too much and burn out. The resistor's job is to soak up the extra voltage.
- Vs
- the supply voltage (5 V from an Arduino pin)
- Vf
- the LED's "forward voltage": the share it uses, about 2 V for red
- I
- the current you want, in amps. 10–20 mA is normal (0.01–0.02 A)
- R
- the resistor you need, in ohms
Take the LED's share away from the supply. That is what the resistor has to drop. Use Ohm's law on what is left.
R = (Vs − Vf) ÷ I
Resistors only come in set sizes. If your answer isn't a real size, round up to the next one. A bigger resistor means a bit less current, which is always the safe side.
The forward voltages above are typical values. Real LEDs vary, so check the shop page or datasheet. When unsure on 5 V, 220 Ω is a safe choice for almost any LED.
Real-world safety
6 minNothing in Tinkercad can hurt you. When you or your learners move to real parts, these rules matter.
- Never touch mains electricity (the wall socket, 230 V in Spain and the UK). Everything in this course runs on 12 V or less.
- Unplug before rewiring. Disconnect USB or the battery, change the wires, check, then power up.
- Check for shorts first. Trace + to − with your finger before connecting power. If anything gets warm, unplug at once.
- Lithium batteries (phone or drone style) can catch fire if punctured, bent or shorted. Use AA packs or USB power for beginners.
- Polarity parts: LEDs, electrolytic capacitors, buzzers and some sensors only work one way round. A backwards capacitor can pop.
- Hot tools: a soldering iron tip is around 350 °C, and a 3D printer nozzle around 200 °C. Use a stand, work in an airy room, and wash hands after handling solder.
Make "hands off the board while it's plugged in" a class routine, like goggles in a science lab. Say it every session until learners say it for you.
Electricity workbook
Exercises with full step-by-step answers, from changing units to finding faults, plus endless practice. Do Part 1 first, then work through these in order. Each set starts easy and gets harder.
How to solve any problem
15 minEvery electricity question is solved with the same seven steps. Learn them once and every exercise gets easier.
- Read it and draw it. Sketch the circuit, even roughly. Pictures stop mix-ups.
- Write what you know, one per line, with units: V = 9 V.
- Write what you want, with a question mark: I = ?
- Change to plain units: kΩ to Ω, mA to A. Formulas only work in V, A, Ω and W.
- Pick the formula. Write it with letters first, before any numbers.
- Put the numbers in and work it out on a calculator.
- Check it. Is the unit right? Is the size sensible? An LED current of 500 A is wrong.
A worked example
A 12 V supply is connected to a 2.4 kΩ resistor. What current flows?
Type your answer in the box and press Check (or Enter). The unit is already shown, so type only the number. A comma or a dot both work: 0,02 or 0.02.
Stuck? Show step 1 gives you one step at a time, so you can stop as soon as you see the way. Solved exercises turn green and stay ticked in this browser.
Answers within about 2% count as right, so rounding is fine.
Units and prefixes
15 minMost mistakes in electronics are unit mistakes, not maths mistakes. Each step on this ladder is × 1,000.
- Going right (to a smaller unit): multiply. You need more of the small ones, so the number gets bigger.
- Going left (to a bigger unit): divide. The number gets smaller.
- The safe trick: always go to the plain unit first, then to the one you want.
Exercises
Ohm's law practice
40 minThe three versions of the same rule. Cover the letter you want in the triangle (E4) and the rest shows the sum.
Find I
I = V ÷ R
Exercises 1 to 6
Find V
V = I × R
Exercises 7 to 11
Find R
R = V ÷ I
Exercises 12 to 16
Exercises
Power practice
30 minThe main rule is P = V × I. When a question doesn't give you both V and I, use Ohm's law to find the missing one first. That also gives two shortcuts:
Know I and R
P = I × I × R
Because V = I × R, swap it into P = V × I.
Know V and R
P = V × V ÷ R
Because I = V ÷ R, swap it into P = V × I.
Choosing a resistor's power rating: pick one rated at least double the power it will turn into heat. Resistors near their limit get very hot. Common ratings: ¼ W, ½ W, 1 W, 2 W, 5 W.
Exercises
LED resistor practice
30 minThe rule from E8: R = (Vs − Vf) ÷ I. With several LEDs in series, add up all their Vf first.
Resistors are sold in standard sizes. The common set is called E12, and it repeats in every ×10 band:
So the real sizes go 100, 120, 150, 180, 220, 270, 330, 390, 470, 560, 680, 820, then 1 k, 1.2 k, and so on. If your answer falls between two sizes, round up.
Exercises
Series circuits
30 min| In series | Rule |
|---|---|
| Resistance | Add them up: R = R1 + R2 + … |
| Current | The same everywhere in the loop. |
| Voltage | Shared out. Each part's share is I × its own R. The shares add up to the supply. |
Exercises
Parallel circuits
30 min| In parallel | Rule |
|---|---|
| Voltage | Every branch gets the full supply voltage. |
| Current | Each branch: I = V ÷ its own R. Add the branches to get the total. |
| Resistance | Easiest way: total R = V ÷ total I. It's always smaller than the smallest resistor. |
Exercises
Series and parallel together
30 minThe trick: squash the parallel part into one resistor first. Then it's just a series problem.
- Find the parallel pair's combined value: (R2 × R3) ÷ (R2 + R3).
- Add the series resistor to it. That's the total.
- Total current = V ÷ total R.
- Voltage across the series resistor = I × R1. The pair gets what's left.
Exercises
Voltage dividers
30 minFrom C8: Vout = Vin × R2 ÷ (R1 + R2), where R1 is on top and R2 is below, going to GND.
To design one (find R1 for the Vout you want), turn it round:
The same current flows through both resistors, so their voltages are in the same proportion as their resistances. Work out how many times bigger R1's voltage is than R2's, and make R1 that many times bigger.
R1 = R2 × (Vin − Vout) ÷ Vout
Exercises
Kirchhoff's two rules
30 minTwo simple rules, named after the scientist Gustav Kirchhoff, explain every circuit. You've already been using them.
A junction is a place where wires meet. Electrons can't pile up there or disappear. So all the current flowing in must flow out.
I in = I out
Like water in pipes: if 3 litres a second come in, 3 litres a second go out, however many pipes it splits into.
Go round any complete loop. The voltages used by the parts add up to the supply voltage. No push is lost or made up along the way.
Vs = V1 + V2 + …
Like walking down a hill in steps: all the steps together equal the height of the hill.
Exercises
Batteries
30 minOne cell is one chemical unit, like a single AA. A battery is strictly several cells joined, like a 9 V block, which has six small cells inside. Everyday speech calls both "batteries".
Cells in series
Voltages add. Capacity (mAh) stays the same as one cell.
4 × 1.5 V AA = 6 V
Cells in parallel
Capacities add. Voltage stays the same as one cell. Only ever join identical cells this way.
2 × 2,000 mAh = 4,000 mAh
mAh (milliamp-hours) says how much charge a battery holds. 2,000 mAh means it could give 2,000 mA for one hour, or 100 mA for 20 hours, or 1 mA for 2,000 hours. Real batteries give less than the label, so the course uses 70% of the label value.
| Battery | Voltage | Capacity (typical) |
|---|---|---|
| AA alkaline | 1.5 V | about 2,000 mAh at hobby currents |
| AA rechargeable (NiMH) | 1.2 V | about 2,000 mAh |
| 9 V block | 9 V | about 500 mAh |
| CR2032 coin cell | 3 V | about 220 mAh, only for tiny currents |
| 18650 lithium-ion | 3.7 V | 2,000–3,500 mAh |
Real values depend on the brand and on how much current you draw. Check the label or the datasheet.
Exercises
Energy and cost
20 minPower is how fast energy is used. Energy is the total, so it depends on time as well.
- P
- power, in watts (W)
- t
- time, in hours (h)
- E
- energy, in watt-hours (Wh). 1,000 Wh = 1 kWh, the unit on the bill
Multiply the power by the hours it runs. Divide by 1,000 for kWh. Multiply by the price of one kWh for the cost.
E = P × t cost = kWh × price
The exercises use 0.20 € per kWh as an example price. Real prices change; check a bill for the real number.
Exercises
Arduino maths
30 minThe sums you need when writing Arduino code. All of them come from Part 4.
| What | Sum |
|---|---|
| analogRead to volts | V = reading × 5 ÷ 1024 |
| TMP36 volts to °C | T = (V − 0.5) × 100 |
| PWM: how much of the time it's on | % = value ÷ 255 × 100 |
| PWM: average voltage | V = 5 × value ÷ 255 |
| map(x, 0, 1023, 0, 180) | x × 180 ÷ 1023, decimals thrown away |
| Ultrasonic distance | cm = time in µs × 0.0343 ÷ 2 |
| Pin budget | keep all pins together under about 200 mA |
Exercises
Fault finding with readings
30 minA multimeter reading tells a story, if you know three clues:
- Full supply voltage across one part, and 0 V across the others: that part is where the loop is broken. No current flows, so nothing else drops any voltage.
- 0 V across a part that should be working: no current is flowing through it, or it's been shorted out by a wire.
- Something getting hot and a huge current: a short circuit. Disconnect the power first, then look.
Exercises
Endless practice
as long as you likeNew numbers every time, with the same step-by-step answers. Good for revision, or for giving each learner their own problem.
Wires and connectors
How things physically join together: wire, jumpers, plugs, terminals, clips, the multimeter's leads, pin labels and soldering. Every lesson is step by step, for when you or your learners build with real parts.
What's inside a wire
10 minA wire has two parts: a copper core that carries the current, and plastic insulation that stops it touching anything else.
Wire thickness
Thickness is often given in AWG (American Wire Gauge). It works backwards: a bigger number means a thinner wire. Thicker wire can carry more current without getting hot.
| Size | About | Use it for |
|---|---|---|
| 22 AWG solid | 0.64 mm across | Breadboard wiring. The classic size that fits the holes. |
| 24–28 AWG | 0.3–0.5 mm | Jumper wires, ribbon cable, sensor signals. |
| 18–20 AWG | 0.8–1 mm | Motors, LED strips, battery leads: anything carrying a lot of current. |
Wire colours
Your projects (a habit, not a law)
Red: + or 5V. Black: − or GND. Any other colour: signals. Use one colour per job.
House wiring (recognise, never touch)
In Spain, the UK and the rest of Europe: brown live, blue neutral, green and yellow earth. If you see these colours, it's mains: leave it alone.
Stripping wire, step by step
10 minStripping means taking the plastic off the end so the copper can connect. You need wire strippers (pliers with sized notches) and flush cutters (small snips).
- Cut the wire to length with flush cutters, plus a little extra.
- Find the right notch. Strippers have holes marked in AWG or mm. Match your wire. Too small a notch cuts the copper too.
- Put the wire in the notch so the length you want to strip sticks out past the jaws. About 6 mm for a breadboard, 5–7 mm for a screw terminal.
- Squeeze firmly and pull the end of the plastic off in one smooth move.
- Check the copper: shiny, no nicks, no strands cut off. If strands are missing, cut it off and start again.
- Stranded wire only: twist the strands tightly between finger and thumb so none stick out.
- Optional, stranded: "tin" it by melting a little solder into the twist (J11). It then behaves like solid wire.
Never strip wire with your teeth or with a knife pulled towards your hand. A stray strand of copper sticking out is the most common cause of hidden shorts.
Male, female and pitch
10 minAlmost every connector comes in two halves that fit together. Electronics uses two old-fashioned words for them:
- Pin header (male): a strip of pins. Sensor modules often come with one to solder on yourself.
- Socket header (female): a strip of holes. The black strips along the edges of an Arduino Uno are female headers.
- Breadboard holes act like female sockets: they take male pins and part legs.
Pitch: the spacing between pins
Pitch is the distance from the middle of one pin to the middle of the next. Almost all hobby electronics uses 2.54 mm (0.1 inch), exactly the same as breadboard holes. Some small parts use 2.0 mm, 1.25 mm or 1.0 mm. Those won't fit a breadboard, so check the pitch before you buy.
Breaking headers to length, step by step
- Count the pins you need on the module.
- Grip the header with pliers right after the last pin you want.
- Bend it sideways until it snaps cleanly at the notch between pins.
- Female headers don't snap cleanly: cut through one extra socket with flush cutters, then sand the end flat.
Jumper wires
15 minJumper wires (often called Dupont wires) are short wires with a ready-made end on each side. They come in three kinds, named after their two ends.
| Type | Ends | Use it for |
|---|---|---|
| M-M | pin to pin | Breadboard to breadboard, and Arduino Uno to breadboard. The one you'll use most. |
| M-F | pin to socket | A sensor module with pins, to a breadboard or an Arduino Uno. |
| F-F | socket to socket | A module with pins straight to a Raspberry Pi or another board with pins. |
Wiring an Arduino to a breadboard, step by step
- Plan the colours before you start: red for 5V, black for GND, a different colour for each signal.
- Unplug the USB while wiring.
- Push one end of a red M-M jumper fully into the Uno's 5V socket. Push the other end into the breadboard's + rail.
- Same with a black jumper from GND to the − rail.
- Add the signal wires, one at a time, checking each pin number against your plan or your code.
- Tug gently on each one. A good connection doesn't slide out.
- Keep wires short and low. Long loops catch on fingers and pull out.
Cheap jumpers sometimes break inside the plastic, where you can't see it. If a circuit behaves strangely, test the suspect wire with the multimeter's beep mode (J9) before rewriting any code.
Breadboard connections done well
10 minC2 showed which holes are joined. This lesson is about making connections that are reliable and easy to check.
- Wire the power rails first: 5V to the red-striped + rail, GND to the blue-striped − rail. On long breadboards the rails can be split halfway: add a short wire across the gap.
- Straighten legs with pliers before pushing them in. Bent legs miss the hole's metal clip.
- Push straight down until the part sits close to the board.
- LEDs: the long leg is +. If you trim the legs, keep the + one a little longer, or bend it, so you can still tell.
- Resistors: bend both legs down at 90° close to the body. Span 3 or 4 holes so they lie flat.
- Chips: always straddle the middle gap, so each pin gets its own column. The notch or dot marks pin 1.
- Buttons: also straddle the gap. Then the two pins on the same side are the ones that get joined when pressed.
- Check by colour: trace every red wire, then every black one, before plugging in.
Hover over any part's leg to see its name. When you drag a part onto the breadboard, the holes its legs will use light up, so you can see the connection before you let go.
Power connectors
20 minUSB plugs
Every USB plug gives 5 V. The shapes differ:
Barrel jack
A round plug used by power adapters. The Arduino Uno's is 5.5 mm across the outside with a 2.1 mm pin, and it is centre positive: the pin in the middle is +.
Reading the symbol, step by step: find this small drawing on the adapter's label. Follow the line from the dot in the middle. If it leads to +, the adapter is centre positive and safe for an Uno. If it leads to −, don't use it.
Battery leads and holders
- 9 V snap: clips onto a 9 V block. Red wire +, black wire −.
- AA holders: hold 2, 4 or 6 cells in series. Many have an on/off switch and come with bare wire ends or a barrel plug.
- Coin cell holder: for a CR2032. Fine for an LED or a tiny sensor, too weak for an Arduino.
Powering an Arduino Uno, step by step
| Way | Voltage | Steps |
|---|---|---|
| USB socket | 5 V | Plug a USB cable into a computer or a phone charger. Easiest, and you can upload code at the same time. The board has a small fuse that cuts out above about 500 mA. |
| Barrel jack | 7–12 V | 1. Check the adapter is centre positive. 2. Check its voltage is 7–12 V. 3. Plug it in. The board's regulator turns it into 5 V. |
| VIN pin | 7–12 V | For a battery pack with bare wires (like 6 × AA = 9 V). 1. Switch the pack off. 2. Red wire to VIN. 3. Black wire to GND. 4. Switch on. |
| 5V pin | exactly 5 V | Skips all the board's protection. Only for a proper regulated 5 V supply. Leave it for later. |
When the board is powered, its 5V and 3.3V pins are outputs. Never connect a battery to them. More than 12 V on the barrel jack or VIN makes the regulator overheat.
Screw terminals and lever connectors
10 minThese hold bare wire ends firmly. You'll find screw terminals on motor driver boards, power supplies and LED strip controllers.
Screw terminal, step by step
- Strip 5–7 mm off the wire (J2). Twist stranded wire tight.
- Open the terminal: turn the screw anticlockwise a few turns with a small flat screwdriver.
- Push the wire in the front opening until the plastic insulation just touches the terminal. No bare copper should show outside.
- Tighten the screw clockwise, firmly but not hard enough to crush the wire.
- Tug test: pull the wire gently. It should not move at all.
- Check no stray strand reaches the next terminal.
Lever connector, step by step
- Strip the wire to the length printed on the side of the connector.
- Lift the orange lever all the way up.
- Push the wire in until it stops.
- Press the lever down. It clicks.
- Tug test. To undo, lift the lever and pull.
Lever connectors join two to five wires together with no tools, and take solid and stranded wire. Handy for joining battery packs and motor leads.
JST and small plugs
10 minJST is a family of small plastic plugs. They are keyed, meaning their shape only lets them fit one way round, and most of them latch so they can't fall out.
| Type | Pitch | Where you'll see it |
|---|---|---|
| JST-PH | 2.0 mm | Small rechargeable lithium (LiPo) batteries. |
| JST-XH | 2.5 mm | Battery balance leads, many 3D-printer boards. |
| JST-SH | 1.0 mm | Tiny 4-pin sensor plugs (often called Qwiic or STEMMA QT). |
| JST-SM | 2.5 mm | Plugs between sections of LED strip. |
Plugging in a small LiPo battery, step by step
- Find the + and − marks on the board, next to its battery socket.
- Line the plug up without pushing: is the red wire on the + side?
- If you're not sure, measure the plug with the multimeter on DC volts (J9): red probe on the pin you think is +. A positive reading means you're right.
- Push straight in until it clicks.
- To unplug, pull on the plastic housing, never on the wires. A fingernail or small pliers on the housing help.
Different makers wire LiPo JST plugs the opposite way round. The plug still fits, but a reversed battery can destroy a board instantly. Always do step 2, every time you use a battery from a new shop.
Clips, test leads and the multimeter
20 minCrocodile clips
Spring clips with teeth, on short wires. Great for quick tests and for the micro:bit, whose edge has five big rings marked 0, 1, 2, 3V and GND.
Lighting an LED from a micro:bit, step by step:
- Clip one lead onto ring 0. Clip its other end onto a 100 Ω resistor's leg.
- Clip a second lead from the resistor's other leg to the LED's long leg.
- Clip a third lead from the LED's short leg to the GND ring.
- Check no two clips touch each other or two rings at once.
- Code: set pin 0 to on (digital write 1).
The multimeter's leads
A multimeter has two leads with banana plugs, and usually three or four sockets. Getting the leads in the right sockets is the most important step. Pick a job below to see exactly how to set it up.
After measuring current, move the red lead back to the V socket straight away. A meter left in a current socket is a short circuit the next time you measure a voltage, and it blows the meter's internal fuse.
Pin labels and connecting any module
20 minSensor and display modules print short labels next to their pins. Once you know these, you can wire up almost anything.
| Label | Means | Usually goes to |
|---|---|---|
| VCC, V+, VIN, 5V, 3V3 | Power in | Arduino 5V, or 3.3V if the module says 3.3 V only |
| GND, G, −, 0V | Ground | Arduino GND |
| SIG, S, OUT, DO | A digital signal (on/off) | Any digital pin |
| AO, A | An analog signal (a voltage) | A0 to A5 |
| TRIG, ECHO | Ultrasonic sensor send and listen | Two digital pins |
| SDA, SCL | I2C: a two-wire data bus for screens and sensors | On the Uno: SDA to A4, SCL to A5 |
| TX, RX | Serial send and receive | Crossed: module TX to board RX, module RX to board TX |
| MOSI, MISO, SCK, CS | SPI: a fast data bus for SD cards and some screens | On the Uno: 11, 12, 13 and 10 |
| EN | Enable: switches the module on | A pin, or 5V to keep it always on |
| NC | Not connected | Nothing |
Connecting any module, step by step
- Read every pin label. They may be on the back. If there are none, find the module's page in the shop or its datasheet.
- Check its voltage. Some newer modules are 3.3 V only, and 5 V can damage them. If it says 3.3 V, power it from the 3.3V pin.
- Write a pin table before you touch a wire: module pin, Arduino pin, wire colour.
- Unplug the Arduino.
- Power first: VCC with a red jumper, GND with a black one.
- Then the signals, one at a time, ticking them off your table.
- Check for a short: with the beep test, VCC to GND must not beep.
- Power up and test with the simplest example code first, printing readings to the Serial Monitor.
Example: HC-SR04 distance sensor
VCC → 5V
Trig → pin 7
Echo → pin 6
GND → GND
Four M-F jumpers.
Example: I2C LCD screen
GND → GND
VCC → 5V
SDA → A4
SCL → A5
Only 4 wires for a whole screen.
Hover over each pin of any part to see its name. Tinkercad uses the same labels as the real modules, so a pin table you write in Tinkercad works for the real build too.
Soldering, step by step
30 minSoldering joins metal parts with a melted metal called solder. It makes a permanent connection that can't wiggle loose.
You need
- A soldering iron with a stand, ideally with temperature control.
- Lead-free solder wire with flux inside (often marked "rosin core").
- A damp sponge or brass wool to clean the tip.
- Safety glasses, flush cutters, and a fan or an open window.
The tip is around 350 °C. Always put the iron back in its stand, never on the table. The smoke is flux, not metal, but don't breathe it: work with air moving away from you. Wash your hands afterwards.
A through-hole joint (a part's leg in a board)
- Heat up the iron to about 330–350 °C.
- Tin the tip: melt a little solder onto it, then wipe it on the sponge. A shiny tip passes heat well.
- Place the part and bend its legs out slightly underneath so it doesn't fall out.
- Heat the joint: touch the tip so it touches the copper pad and the leg together, for 1–2 seconds.
- Feed the solder into the joint on the opposite side from the tip, not onto the iron. It should flow around the leg.
- Remove the solder first, then the iron, about a second later.
- Don't move it for 2–3 seconds while it sets.
- Check the shape (below), then trim the leg with flush cutters, pointing it away from your face.
- Cold joint (a ball): the pad wasn't hot enough. Reheat it with the tip touching both pad and leg, and add a touch more solder.
- Bridge: drag the hot tip between the pads, or use desoldering braid (copper mesh that soaks up solder) to remove the extra.
Soldering a header onto a module
- Push the header's long pins into a breadboard. The breadboard holds them perfectly straight.
- Sit the module on top, short pins through its holes.
- Solder one pin at one end. Check the module is flat. If not, reheat that pin and straighten it.
- Solder the pin at the other end, then all the rest.
Joining two wires, with heat shrink
- Slide a piece of heat-shrink tube onto one wire first, well away from the joint. (Everyone forgets this once.)
- Strip 6 mm off both wires and twist each one.
- Tin both ends: heat each one and let a little solder soak in.
- Hold them side by side, touching, and heat them until the solder melts them together.
- Let it cool, slide the heat shrink over the joint, and shrink it with a heat gun or the side of the iron (not a flame).
Choosing the right connection
5 min| Situation | Use |
|---|---|
| Trying out an idea on a desk | Breadboard and M-M jumpers |
| A sensor module with pins | M-F jumpers to the breadboard or Arduino |
| Something that moves or shakes | Stranded wire, soldered, or a JST plug that latches |
| A motor or anything over about 1 A | Thicker wire (18–20 AWG) and screw terminals |
| Must unplug often, and polarity matters | A keyed plug that only fits one way: JST or barrel jack |
| A finished project that won't change | Solder, with heat shrink on wire joints |
| A quick test of a battery, LED or micro:bit | Crocodile clips |
| Anything plugged into the wall (mains) | Don't build it. Buy a finished, certified product. |
Tinkercad tour
Tinkercad is a free website by Autodesk. It runs in your browser, so there is nothing to install.
Account and dashboard
7 min- Go to tinkercad.com and sign up. Choose Teacher if you plan to run classes. That choice is permanent, and it unlocks Classes.
- The dashboard on the left lists your 3D Designs, Circuits, Codeblocks, Classes and Collections (folders).
- Press Create to start something new and pick the workspace.
- Your work saves itself every few seconds. There is no save button.
- New designs get silly random names. Click the name at the top left of the editor to rename it. Do this first, every time.
Under-13s should not make their own personal accounts. The easy route is a seat in your class (H1). They join with a link and a nickname, with no email needed.
The four workspaces
8 min3D Design
Build objects by stacking and cutting simple shapes. Export them for 3D printing or laser cutting. Part 3.
Circuits
A virtual electronics bench. Wire parts on a breadboard, program an Arduino or micro:bit, and simulate it live. Part 4.
Codeblocks
Drag code blocks that build 3D shapes for you. Great for patterns and for linking code to design. Part 5.
Sim Lab
Gives your 3D shapes gravity and materials. Drop, roll and throw them to test ideas. Part 5.
Sharing and copying
- Share (top right in an editor) gives you an invite link or lets you make a design public.
- On any public design, Tinker this makes your own copy to change. The original stays safe.
- To give a class a starting point, make one "starter" design, then share it so everyone copies it.
3D Design
Everything in Tinkercad 3D is made from simple shapes. You add solids, cut with holes, and glue them together with Group.
The screen and moving around
10 min| Area | Where | What it's for |
|---|---|---|
| Workplane | The blue grid in the middle | Your build plate. Sizes are in millimetres (mm). |
| Shapes panel | Right side | Basic Shapes, Text and Numbers, Connectors, Shape Generators and more. Drag a shape onto the workplane. |
| View cube | Top left | Click a face to look from that side. Under it: Home view, Fit all, zoom, and a perspective/flat toggle. |
| Toolbar | Top | Copy, paste, duplicate, delete, undo, redo. On the right: Group, Ungroup, Align, Mirror. |
| Shape box | Pops up when a shape is selected | Solid or Hole, colour, and shape settings like sides and roundness. |
| Snap Grid | Bottom right | How far shapes jump when you move them. 1 mm is normal. Use 0.1 mm for fine work. |
Moving the camera
| To do this | Mouse | One-button mouse or trackpad |
|---|---|---|
| Orbit (look around) | Right-drag | Ctrl + drag |
| Pan (slide) | Middle-drag | Shift + right-drag |
| Zoom | Scroll wheel | Pinch, or the + and − buttons |
| Zoom to the selected shape | F | |
Create a new 3D design. Drag a Box and a Cylinder onto the workplane. Orbit all the way round them, then press the Home button to get back.
Shapes, handles and exact sizes
15 minClick a shape to select it. Little handles appear. Each one does one job.
| Handle | What it does |
|---|---|
| White squares at the corners | Stretch length and width together. |
| White squares on the sides | Stretch one side only. |
| White square on top | Change the height. |
| Black cone above the shape | Lift it up off the workplane, or push it down into it. |
| Curved arrows | Rotate. Hold Shift to jump in 45° steps. |
Typing exact sizes
While dragging a handle, numbers appear. Click a number and type the size you want, then press Enter. This is how you make parts that fit.
Handy moves
- Shift while stretching from a corner keeps the shape's proportions.
- Alt while stretching grows it from the centre.
- Arrow keys nudge one grid step. Ctrl + ↑ / ↓ moves up and down.
- D drops a floating shape back onto the workplane.
- Alt + drag makes a copy as you move it.
Make a box exactly 40 × 20 × 5 mm. Then make a cylinder exactly 10 mm wide and 30 mm tall and stand it on the box.
Solids, holes and grouping
15 minThe main trick in Tinkercad: a Hole shape cuts away whatever it overlaps, but only after you group them.
- Place a solid box.
- Place a cylinder so it pokes through the box.
- Select the cylinder, then click Hole in the shape box (or press H). It turns see-through and striped.
- Select both: drag a rectangle around them, or Shift + click each.
- Press Group (Ctrl + G). The hole is cut out.
Groups can be undone at any time with Ungroup (Ctrl + Shift + G). Nothing is lost. This makes Tinkercad very forgiving.
Other ways to combine
- Colour after grouping: a group takes one colour. Turn on Multicolor in the shape box to keep each part's own colour.
- Intersect (Ctrl + I) keeps only the part where shapes overlap. Good for odd curved shapes.
- Lock (Ctrl + L) stops a finished part being moved by accident. Hide (Ctrl + H) gets it out of the way.
Learners often make a hole, see nothing happen, and give up. The hole is a plan, not a cut. Say "the cut happens when you group" until it sticks.
Precision tools
15 min| Tool | Key | What it does |
|---|---|---|
| Align | L | Select two or more shapes, press L, then click the dots to line up their left sides, centres or right sides, in any direction. Click a shape first to make it the one that stays still. |
| Ruler | R | Drop it on a point. Now every selected shape shows exact distances from that point, which you can type into. |
| Workplane | W | Click any face to make it a temporary floor. New shapes then sit on that face, even a sloped one. Click empty space to go back. |
| Mirror | M | Flips a shape. Good for left and right parts. |
| Duplicate and repeat | Ctrl+D | Duplicate, then move the copy. Press Ctrl + D again and Tinkercad repeats the same move. Fast rows of holes or teeth. |
| Cruise | C | Slide a shape over the surface of another one. |
| Notes | N | Sticky notes inside the design. Great for teaching starters. |
Make a 60 × 15 × 3 mm box. Add a 4 mm cylinder hole at one end. Press Ctrl + D, move the copy 10 mm along, then press Ctrl + D four more times. Group. You've made a perforated strip.
Sketch, text and shape generators
15 minSketch: draw your own outline
- Drag the Sketch tool from the Basic Shapes panel onto the workplane. A drawing window opens.
- Draw straight lines (key 1) or curves (key 2, press and drag to bend).
- Join back to the start. A closed shape fills in, which means it's ready.
- Press Finish Sketch. It becomes a 3D shape you can resize like any other.
- Double-click it later to edit the drawing.
There is also a revolve sketch. Draw half an outline and it spins it round a line, like a pottery wheel. Use it for vases, chess pieces and knobs.
Text
Drag Text from Basic Shapes. Type in the shape box and pick a font. Bold, simple fonts print best.
Shape Generators
Pick Shape Generators in the shapes panel to find ready-made shapes with settings: gears, springs, threads, stars and more. Change the numbers, then group with your design.
Import
The Import button brings in SVG drawings (a logo becomes a flat shape you can thicken), and STL or OBJ 3D models.
Designing for 3D printing
15 minA 3D printer (the common kind, called FDM) squeezes hot plastic out of a nozzle, one thin layer at a time, from the bottom up. Most print rules come from that.
| Rule | Good number | Why |
|---|---|---|
| Flat bottom | Big face on the workplane | The first layer has to stick to the printer bed. |
| Wall thickness | at least 1.2 mm, 2 mm for strength | The nozzle is usually 0.4 mm wide, so thinner walls print weak or not at all. |
| Overhangs | no steeper than 45° | Each layer needs something under it. Steeper overhangs droop unless you add supports. |
| Gap for parts that fit | 0.2–0.4 mm on each side | Plastic spreads a little. A lid made the exact same size won't go on. |
| Round holes | add about 0.3 mm | Holes print slightly smaller than designed. |
| Raised text | at least 5 mm tall, 1 mm raised | Small details melt together. |
| Size | fits the printer bed | Many printers are about 220 × 220 mm. Check yours. |
Getting the file out
- Press Export. Choose .STL or .OBJ for 3D printing, .GLB for 3D viewers and game engines, or .SVG for laser cutting.
- SVG export takes the outline of the shapes touching the workplane. Design flat, then export.
- Open the STL in a slicer (the printer's program, like Cura, PrusaSlicer or Bambu Studio). It turns the shape into printer instructions.
Tinkercad exports everything on the workplane, including stray shapes you forgot. Hide or delete extras first, and select only what you want before exporting.
3D builds
2 h totalFour builds, easiest first. Each uses the skills above. Open one to see the steps.
1 · Name keyring
starter20 min
- Drag a Box. Set it to 55 × 18 × 3 mm. In the shape box, raise Radius to round the corners.
- Drag Text. Type a name. Set its height to 2 mm, and size it to fit with 5 mm spare at the left.
- Lift the text 3 mm with the black cone, so it sits on top of the box. Use Align to centre it front to back.
- Add a Cylinder 5 mm wide, make it a Hole, and put it in the spare space at the left, going all the way through.
- Select all, Group. Export STL.
Make it yours: pick a different colour for the text and turn on Multicolor, or swap the box for a star from Shape Generators.
2 · Phone stand
starter25 min
- Box 80 × 70 × 6 mm: the base.
- Box 80 × 6 × 90 mm: the back. Rotate it 15° backwards. Place it near the back of the base, sinking slightly into it.
- Box 80 × 8 × 12 mm: the lip at the front, to stop the phone sliding off.
- Add a Box hole 30 × 20 × 20 mm through the bottom of the back, so a charging cable fits.
- Group, check from every side, export.
Make it yours: measure your own phone's thickness with a ruler and size the gap to it plus 2 mm.
3 · Box with a lid that fits
intermediate30 min
- Box 60 × 40 × 30 mm. This is the outside.
- Box hole 56 × 36 × 30 mm. Lift it 2 mm. Align it to the centre of the first box. Group. You have 2 mm walls and a 2 mm floor.
- Lid: Box 60 × 40 × 2 mm next to it.
- Lip on the lid: Box 55.4 × 35.4 × 4 mm, centred on the lid. That is 0.3 mm smaller than the opening on each side.
- Group the lid parts. Flip nothing: print the lid lip-side up.
The key idea is the 0.3 mm gap. Try 0.2 mm for a tight fit or 0.4 mm for a loose one.
4 · Case for an Arduino project
advanced45 min
- An Arduino Uno board is about 68.6 × 53.4 mm. Add 0.5 mm all round: the inside of your case is 69.6 × 54.4 mm.
- With 2 mm walls, the outside is 73.6 × 58.4 mm. Make it 30 mm tall. Hollow it as in build 3.
- Cut holes in the end wall for the USB socket and the power socket. Measure your own board with a ruler and add 1 mm to each hole.
- Add four cylinder posts inside the floor to rest the board on, 5 mm tall.
- Make a lid with a lip (build 3) and a slot for wires to come out.
This joins Part 3 and Part 4: build a circuit in Tinkercad, then design the box it lives in.
Circuits
Tinkercad Circuits is a virtual electronics bench. Nothing can break, so it's the best place to make mistakes.
The Circuits screen
10 min| Part of the screen | What it does |
|---|---|
| Components panel (right) | Drag parts in. The drop-down switches between Basic, All and Starters (ready-made example circuits). Use the search box for anything else. |
| Start Simulation (top right) | Turns the power on. LEDs light, motors spin, code runs. Stop it before changing wires. |
| Code (top right) | Opens the code panel for an Arduino or micro:bit. |
| Settings box | Click any part to set it: resistor value, LED colour, battery count, and so on. |
Working with wires
- Click a leg or a hole, then click where the wire should end. That's a wire.
- Click on empty space mid-wire to add a bend. Double-click a finished wire to add a bend point you can drag.
- Select a wire to change its colour. Use red for + and black for −/GND, always. Pick other colours for signals.
- Select a part and press R to rotate it.
- Hover over a part's leg to see its name, like "anode" or "GND".
Insist on red and black wire colours from day one. When something doesn't work later, tidy colours turn a 10 minute hunt into a 10 second one.
The breadboard
12 minA breadboard lets you join parts without soldering. Under the holes are metal strips. Holes on the same strip are joined.
- Middle area: each column of 5 holes (a–e) is joined. The f–j half is a separate set. The gap in the middle splits them.
- Power rails: the long rows along the edges, marked + and −. Each one is joined along its whole length.
The classic mistake: both legs of an LED or resistor in the same column. The part is skipped and does nothing. Each leg needs its own column.
On some long real breadboards, the power rails are split in the middle. If half your circuit is dead, add a short wire across the split.
Your first circuit, no code
15 minBattery, resistor, LED, in one loop. This is the same circuit as the live one at the top of the page.
- Create a new Circuit. Drag in a Breadboard Small, a 9V Battery, a Resistor and a red LED.
- Set the resistor to 470 Ω. (9 − 2) ÷ 470 ≈ 15 mA. Check it with Tool 4.
- Put the LED across two columns. Its bent leg is +.
- Put the resistor from the LED's straight leg column to another column.
- Battery + (red) to the LED's bent-leg column. Battery − (black) to the resistor's free column.
- Start Simulation. The LED lights.
Now break it on purpose, one thing at a time: turn the LED round; set the resistor to 10 Ω; take the resistor out and wire straight across. Read Tinkercad's warnings each time. Knowing what broken looks like is half of fault finding.
Add a Slideswitch between the battery + and the LED. You've built a torch.
Measuring with the multimeter
15 minThe multimeter is your eyes inside a circuit. Search the components panel for Multimeter. Click it to choose what it measures.
| To measure | Set it to | How to connect |
|---|---|---|
| Voltage | Voltage | Across the part: one probe on each side of it. Nothing needs unplugging. |
| Current | Current | In the loop: unplug one wire and put the meter in the gap, so the current has to go through it. |
| Resistance | Resistance | Across the part, with the simulation off and the part not powered. |
- A negative number just means the probes are the wrong way round. Swap them.
- A reading of 0 often means the wrong mode is selected.
In your C3 circuit, measure the voltage across the LED and across the resistor. Add them. You get the battery voltage. In a series loop, the voltages always add up to the supply.
Meet the Arduino Uno
12 minAn Arduino is a small computer on a board. It runs one program in a loop, forever. It can switch things on and off, and read sensors.
| Pins | What they do |
|---|---|
| Digital 0–13 | On (5 V, HIGH) or off (0 V, LOW). Can be an output (LED) or an input (button). Avoid 0 and 1: they carry the Serial Monitor. |
| Pins with ~ (3, 5, 6, 9, 10, 11) | Can also fake "half on" with PWM (C8). Use these for dimming and servos. |
| Analog A0–A5 | Read a voltage from 0 to 5 V as a number from 0 to 1023. |
| 5V and 3.3V | Steady power for sensors and the breadboard rail. |
| GND | Ground: the − side. Every circuit must go back to GND. |
A pin can safely give about 20 mA, with 40 mA as the absolute limit. That's one LED with a resistor. Motors, long LED strips and anything bigger need a transistor or driver.
Setting up the breadboard rails
Wire Arduino 5V to the breadboard + rail (red wire) and GND to the − rail (black wire). Now every part can get power from the rails. Do this at the start of every Arduino build.
Code: blocks, text and the Serial Monitor
15 minPress Code with an Arduino in your circuit. The drop-down at the top has three modes:
- Blocks: drag blocks like Scratch. Best for beginners.
- Blocks + Text: blocks on one side, the real Arduino code (C++) on the other. Great for learning to read code.
- Text: type real Arduino code. Switching from Blocks to Text is one way: your blocks get replaced by text.
Every Arduino program has two parts
void setup() { // runs ONCE when the power comes on // tell each pin its job here } void loop() { // runs again and again, forever // the main work goes here }
The Serial Monitor
At the bottom of the code panel is Serial Monitor. It shows text your program prints. Use it to see what's going on inside.
Serial.begin(9600); // in setup(): switch the monitor on Serial.println(42); // in loop(): print a value on a new line
The code panel also has a debugger (the bug icon). Click a line number to set a breakpoint, and the simulation pauses there so you can check values.
| Command | What it does |
|---|---|
| pinMode(pin, OUTPUT) | Make a pin an output. |
| pinMode(pin, INPUT_PULLUP) | Make a pin a button input (see C7). |
| digitalWrite(pin, HIGH) | Pin on (5 V). LOW is off. |
| digitalRead(pin) | Is the pin HIGH or LOW? |
| analogRead(A0) | Read a voltage as 0–1023. |
| analogWrite(pin, 0–255) | Dim with PWM on a ~ pin. |
| delay(1000) | Wait, in milliseconds. 1000 = 1 second. |
| map(x, 0, 1023, 0, 180) | Rescale a number from one range to another. |
| tone(pin, 440, 200) | Play a note: 440 Hz for 200 ms. |
Digital in and out
20 minOutput: blink an LED
Wire: pin 13 → 220 Ω resistor → LED bent leg. LED straight leg → GND.
void setup() { pinMode(13, OUTPUT); // pin 13 sends power out } void loop() { digitalWrite(13, HIGH); // LED on (5 V) delay(1000); // wait 1 second digitalWrite(13, LOW); // LED off (0 V) delay(1000); }
Input: read a button
A pin that isn't connected to anything "floats". It picks up noise and reads random HIGHs and LOWs. INPUT_PULLUP fixes this. It connects the pin to 5 V through a resistor inside the chip, so it reads HIGH when nothing happens.
Wire the button between pin 2 and GND. Pressing it pulls the pin down to 0 V, so pressed reads LOW. This feels backwards at first.
const int BUTTON = 2; const int LED = 13; void setup() { pinMode(BUTTON, INPUT_PULLUP); // button wired between pin 2 and GND pinMode(LED, OUTPUT); } void loop() { if (digitalRead(BUTTON) == LOW) { // LOW means pressed digitalWrite(LED, HIGH); } else { digitalWrite(LED, LOW); } }
A pushbutton in Tinkercad has four legs joined in two pairs. If it seems "always pressed", it's turned the wrong way. Place it across the middle gap of the breadboard and use legs on opposite sides.
Analog in, PWM out
20 minAnalog in: reading a voltage
The Arduino cuts 5 V into 1024 small steps. analogRead() tells you which step the pin is on: 0 at 0 V, 1023 at 5 V.
- r
- the number analogRead gives, 0 to 1023
- V
- the voltage on the pin
One step is 5 ÷ 1024 volts. Multiply the number of steps by the size of one step.
V = r × 5 ÷ 1024
The voltage divider
Two resistors in series split the voltage. The middle point gets a share. This is how a potentiometer works, and how you read an LDR.
- Vin
- the voltage at the top (5 V)
- R1
- the top resistor, between Vin and the middle
- R2
- the bottom resistor, between the middle and GND
- Vout
- the voltage at the middle point
The bottom resistor's share of the total resistance is the share of the voltage you get at the middle.
Vout = Vin × R2 ÷ (R1 + R2)
PWM out: fake "half on"
Digital pins can only be fully on or fully off. PWM (pulse width modulation) flicks the pin on and off about 500 times a second. On for a quarter of the time looks like a quarter brightness. analogWrite(pin, 0–255) sets how much of the time it's on. Only ~ pins can do it.
// Dimmer: potentiometer middle leg to A0, outer legs to 5V and GND. // LED + 220 Ω on pin 9. void setup() { pinMode(9, OUTPUT); Serial.begin(9600); } void loop() { int knob = analogRead(A0); // 0 to 1023 int brightness = knob / 4; // squash to 0 to 255 analogWrite(9, brightness); Serial.println(knob); delay(20); }
Sound, motors and sensors
20 minBuzzer
Piezo + leg to pin 8, − leg to GND. tone(8, 440, 200); plays the note A for 200 ms. 262 is middle C.
Servo
Three wires: brown or black to GND, red to 5V, orange or yellow (signal) to a ~ pin.
#include <Servo.h> Servo arm; void setup() { arm.attach(9); // signal wire on pin 9 } void loop() { int knob = analogRead(A0); int angle = map(knob, 0, 1023, 0, 180); // knob position to angle arm.write(angle); delay(15); }
DC motor
A motor needs far more than 20 mA, so never wire it straight to a pin. Use an NPN transistor or a motor driver (search "L293D" in Tinkercad) between the pin and the motor, and put a diode across the motor to catch the voltage spike when it stops.
Sensors in Tinkercad
| Sensor | Wiring | Read it with |
|---|---|---|
| Temperature Sensor [TMP36] | Power, signal to A0, GND | analogRead, then °C = (V − 0.5) × 100 |
| Photoresistor (LDR) | Divider with 10 kΩ, middle to A0 | analogRead |
| Ultrasonic Distance Sensor | VCC, Trig, Echo, GND | pulseIn on Echo (build 8 below) |
| PIR Sensor | Power, signal, GND | digitalRead: HIGH when something moves |
| Soil Moisture Sensor | Power, signal to A0, GND | analogRead: higher is wetter |
While a simulation runs, click a sensor. A slider or a draggable dot appears so you can change the temperature, light level or distance and watch your code react.
micro:bit in Tinkercad
10 minTinkercad Circuits also has the BBC micro:bit. Search for it in the components panel. It's often used in UK schools in Years 7 to 9.
- It has a 5 × 5 LED screen, two buttons and a few sensors built in, so you can do a lot with no wiring.
- Its code blocks look like Microsoft MakeCode, which learners may know from school.
- It runs on 3.3 V, not 5 V. Redo your LED resistor sums with Tool 4.
- Use it as a friendly first step, then move to Arduino for bigger builds.
Circuit builds
3 h totalEight builds in order. Each one adds one new idea. For every Arduino build, first wire 5V and GND to the breadboard rails (C5).
1 · Torch
starter10 min
New idea: a switch opens and closes the loop.
Parts: 9V battery, slideswitch, 470 Ω resistor, LED.
Wiring: battery + → switch middle leg. Switch side leg → LED bent leg. LED straight leg → resistor → battery −.
Make it yours: add a second LED in parallel. Does it need its own resistor? (Yes. Give each LED its own.)
2 · Blink
starter10 min
New idea: code switches an output.
Parts: Arduino Uno, LED, 220 Ω resistor. Code from C7.
Make it yours: blink SOS in Morse code. Short = 200 ms, long = 600 ms.
3 · Doorbell
starter15 min
New idea: an input decides what happens.
Parts: Arduino, pushbutton (pin 2 and GND), piezo (pin 8 and GND).
void setup() { pinMode(2, INPUT_PULLUP); } void loop() { if (digitalRead(2) == LOW) { // pressed tone(8, 659, 300); delay(300); // ding (E) tone(8, 523, 500); delay(600); // dong (C) } }
Make it yours: add an LED that flashes with the bell.
4 · Dimmer knob
intermediate20 min
New idea: analog in, PWM out.
Parts: Arduino, potentiometer (middle leg to A0), LED + 220 Ω on pin 9. Code from C8.
Make it yours: use the Serial Monitor's graph view to plot the knob value.
5 · Night light
intermediate20 min
New idea: a sensor plus a decision.
Parts: Arduino, photoresistor, 10 kΩ resistor, LED + 220 Ω on pin 9.
Wiring: 5V → LDR → A0 → 10 kΩ → GND. More light means a higher reading.
const int DARK = 300; // change after watching the Serial Monitor void setup() { pinMode(9, OUTPUT); Serial.begin(9600); } void loop() { int light = analogRead(A0); Serial.println(light); if (light < DARK) { digitalWrite(9, HIGH); // it's dark: light on } else { digitalWrite(9, LOW); } delay(100); }
Make it yours: get gradually brighter as it gets darker, using map() and analogWrite().
6 · Servo pointer
intermediate20 min
New idea: moving something to an exact position.
Parts: Arduino, potentiometer on A0, Micro Servo on pin 9. Code from C9.
Make it yours: design a dial face in 3D Design for the pointer to sweep across, like a mood meter.
7 · Reaction game
advanced30 min
New idea: timing with millis() and random numbers.
Parts: Arduino, LED + 220 Ω on pin 9, button on pin 2.
void setup() { pinMode(9, OUTPUT); pinMode(2, INPUT_PULLUP); Serial.begin(9600); randomSeed(analogRead(A5)); // a different game every time } void loop() { Serial.println("Get ready..."); delay(random(2000, 5000)); // wait 2 to 5 seconds digitalWrite(9, HIGH); unsigned long start = millis(); // time in ms since power on while (digitalRead(2) == HIGH) { } // wait for the press unsigned long took = millis() - start; digitalWrite(9, LOW); Serial.print("Your time: "); Serial.print(took); Serial.println(" ms"); delay(2000); }
Make it yours: catch cheaters who press before the light comes on. Keep a best score.
8 · Parking sensor
advanced35 min
New idea: measuring distance with sound.
Parts: Arduino, Ultrasonic Distance Sensor (Trig pin 7, Echo pin 6, VCC 5V, GND), piezo on pin 8.
The sensor sends a click of sound and times the echo. Sound travels about 0.0343 cm every microsecond. It goes there and back, so halve it.
const int TRIG = 7, ECHO = 6, BUZZ = 8; void setup() { pinMode(TRIG, OUTPUT); pinMode(ECHO, INPUT); Serial.begin(9600); } void loop() { digitalWrite(TRIG, LOW); delayMicroseconds(2); digitalWrite(TRIG, HIGH); delayMicroseconds(10); // send the click digitalWrite(TRIG, LOW); long time = pulseIn(ECHO, HIGH); // echo time in µs float cm = time * 0.0343 / 2; Serial.println(cm); if (cm < 100) { tone(BUZZ, 880, 50); delay(cm * 5); // closer = shorter gap = faster beeps } delay(60); }
Make it yours: add green, yellow and red LEDs for far, near and too close.
The eight Computing From Zero builds (binary counter, letters in lights, logic gates, password lock and more) use these same skills to teach computing topics. They live in your interactive guide and build tracker.
Build checker
A practice Arduino and breadboard that checks your wiring like a self-checkout scanner. Copy a Tinkercad circuit onto it, hole by hole, and it tells you exactly what won't work and why: loose wire ends, parts skipped because both legs share a column, backwards LEDs, missing resistors, unpowered rails, shorts, buttons turned the wrong way, and pins that don't match your code.
Check your build
10 min per circuit- Open your Tinkercad circuit next to this page. This board has the same layout as Tinkercad's Breadboard Small: 30 columns, rows a to j, and a + and − rail along the top and bottom.
- Type the pins your code uses in the box under the board, like
13or2, 9, A0. - Copy each part: pick it in the toolbar, then tap the same holes it uses in Tinkercad. For wires, tap where each end goes, including the Arduino's pins.
- Read the results. Tap a problem to see the red marks on the board. Fix it here and in Tinkercad, until it says Ready to run.
- Investigate: in Inspect mode, tap any hole to light up everything electrically joined to it. If two things you expect to be joined don't light up together, that's your broken connection.
The board opens with an example that has mistakes in it. Your own build is saved in this browser. On a phone, turn it sideways and scroll the board left and right.
What the checker looks for
5 min| Check | What it means |
|---|---|
| Wire end goes nowhere | The end sits in a column or rail with nothing else in it. Usually one hole off. |
| Part is skipped | Both legs are in the same column, so current goes round the part. |
| Leg isn't connected | A leg shares its column with nothing else. |
| Rail isn't connected | Parts use a rail, but no wire joins it to 5V or GND. |
| Short circuit | 5V or 3.3V is joined straight to GND. |
| LED backwards | Its + leg leads to GND and its − leg to the power. |
| No resistor | An LED goes from a pin or 5V to GND with nothing limiting the current. |
| Too much or too little current | It adds up the resistors in the LED's path and works out the current. |
| Button always pressed | The pin and GND are on the same pair of always-joined legs. In Tinkercad, hover the button's legs: 1a and 1b are always joined, and so are 2a and 2b. Use Turn 90° so the dashed lines here match. |
| Knob on the wrong pin | The middle leg must go to A0–A5, and the outer legs to 5V and GND. |
| Pins don't match the code | A wire is on a pin your code doesn't use, or your code uses a pin with nothing on it. |
Load an example with mistakes and project it. Ask the room to find the faults before tapping the problems list. Then have learners swap Tinkercad links and check each other's circuits here.
Codeblocks and Sim Lab
Two smaller workspaces that link design to code and to physics.
Codeblocks
15 minIn Codeblocks, blocks don't move a sprite. They build a 3D shape. Press Run and you watch it being made, step by step.
- Create blocks add shapes: box, cylinder, sphere, text.
- Modify blocks move, rotate, scale and colour them, and turn them into holes.
- Control blocks repeat. Math and Data blocks add numbers and variables.
- The finished shape can be exported for printing, or sent into a 3D design.
Make a variable "angle". Repeat 12 times: add a thin box, rotate it by angle, then change angle by 30. You get a 12-spoke wheel. Change 12 and 30 to make new patterns.
Codeblocks is a great bridge for learners who like design but fear code. Loops make sense straight away when you can see 12 copies appear.
Sim Lab
15 minSim Lab adds physics to your 3D designs. Switch to it from a 3D design. If you can't find it, check tinkercad.com/simlab.
- Shapes fall with gravity, bounce and roll.
- Give each shape a material, like wood, rubber or plastic. It changes weight and bounce.
- Set shapes as static (stays put, like the floor) or dynamic (moves).
- Throw shapes at each other, build simple machines, and share the result.
Build a ramp (static) and a ball (dynamic). Change the ramp's angle and the ball's material. Which rolls furthest? It's a full science investigation in ten minutes.
Helping others build
Running a class, planning a session, and helping without taking over.
Helping without taking over
8 minHands off their mouse. Use the smallest help that gets them moving again.
| Step | You say something like |
|---|---|
| 1 Ask | "What did you expect to happen? What happened instead?" |
| 2 Narrow | "Trace the loop from + with your finger. Where does it stop?" |
| 3 Point | "Have a look at this LED's legs." |
| 4 Show | Fix it on your own copy, not theirs, then let them copy the fix. |
- Wait at least five seconds after a question. Thinking takes time.
- Praise the method, not the result: "you checked the multimeter first, that's exactly what engineers do".
- Three people stuck on the same thing? Stop the room and explain it once to everyone.
Fault finder
5 minWhen a circuit doesn't work, check things in this order. It finds most faults in under two minutes. Use it yourself, or go through it with a learner.
For wiring problems, copy the circuit into the Build checker. It finds loose wires, skipped parts, backwards LEDs and unpowered rails for you.
Common mix-ups
8 min| Learners think | Really |
|---|---|
| The battery stores electrons that get used up. | The electrons are already in the wire. The battery pushes them round. Its chemical energy runs out. |
| Current gets used up by the LED, so there's less after it. | Current is the same everywhere in one loop. Energy is used, not current. |
| The resistor must go before the LED. | In series, before or after works the same. The current is the same all round. |
| Bigger resistor = brighter. | Bigger resistor = less current = dimmer. |
| A Hole shape cuts as soon as you place it. | The cut happens when you group. |
| The code is wrong, so I'll rewrite it. | Check wiring first. Most "code" bugs are a wire in the wrong pin. |
| Pressed button = HIGH. | With INPUT_PULLUP, pressed = LOW. |
| A design that looks fine on screen will print fine. | Walls under 1.2 mm, steep overhangs and no flat base all fail on a real printer. |
Your own projects
Tinkercad is where ideas get cheap to test. Here's how to go from idea to a real object on a desk.
The project loop
8 min- One sentence. "A box that beeps when someone opens it." If you can't say it in one sentence, it's two projects.
- Paper sketch. Draw the object and list the inputs (what it senses) and outputs (what it does).
- Simulate the circuit in Tinkercad Circuits. Get the smallest version working first, then add one thing at a time.
- Design the body in 3D Design. Measure real parts with a ruler, not from memory.
- Build it real on a breadboard, then test.
- Fix and repeat. Change one thing per go so you know what helped.
- Share it. A photo, the Tinkercad link and three lines on what you'd do next.
From Tinkercad to real hardware
10 min- Install the free Arduino IDE from arduino.cc.
- In Tinkercad, switch the code panel to Text and copy all the code.
- Paste into a new Arduino IDE sketch. Pick Arduino Uno as the board and the USB port it's on.
- Press Upload (the arrow). Copy the wiring exactly from your Tinkercad screen.
What's different in real life
- Wires come loose, and breadboard holes wear out. Push everything in firmly.
- Real buttons "bounce": one press can read as several. Add
delay(50)after reading a press. - Sensor readings wobble. Read several times and take the average.
- Parts really do burn out. Do the resistor sums every time.
A good first shopping list
Most Arduino starter kits include all of this: Arduino Uno (or a clone), USB cable, 830-hole breadboard, jumper wires, assorted resistors, LEDs, pushbuttons, a 10 kΩ potentiometer, a photoresistor, a piezo buzzer, an SG90 micro servo, an HC-SR04 ultrasonic sensor. Add a cheap multimeter.
Project ideas
5 minMood lamp
RGB LED, three knobs for red, green and blue. 3D-print a frosted shade.
Plant helper
Soil sensor and LED: lights up when the plant needs water.
Escape-room lock
Buttons pressed in the right order open a servo latch. Print the box and lid.
Desk thermometer
TMP36 and a servo needle on a printed dial.
Simon game
Four LEDs, four buttons, four notes. Copy the growing pattern.
Custom game controller
Buttons and a joystick in a printed case. A board like the Arduino Leonardo can act as a USB keyboard.
Door alarm
PIR sensor, buzzer and a keypad code to switch it off.
Mini weather station
Temperature and light logged to the Serial Monitor, then pasted into a spreadsheet.
Project planner
5 minCopy this into a note for each new project, yours or a learner's.
PROJECT:
In one sentence it...
INPUTS (what it senses):
OUTPUTS (what it does):
PARTS LIST:
Power: battery / USB / Arduino 5V
Resistor sums (R = (Vs - Vf) / I):
STEP 1 smallest version that works:
STEP 2 add:
STEP 3 add:
3D BODY: size of the inside (mm) =
gap for lids and fits = 0.3 mm
TESTS: [ ] works in Tinkercad [ ] works on breadboard
[ ] fits in the case [ ] someone else tried it
NEXT TIME I WOULD:Bigger builds
Harder examples that mix several skills at once: more maths, longer programs, more parts, and 3D designs with moving pieces. Do Parts 1, 3 and 4 first.
Harder electricity problems
40 minFour real design problems. Each one is a question you will hit as soon as projects get bigger.
Problem 1: three LEDs on 12 V
You want three red LEDs lit from a 12 V supply. Two ways to wire them:
All in series, one resistor
Each LED uses its own share: 3 × 2 V = 6 V. The resistor drops what's left.
R = (12 − 6) ÷ 0.02 = 300 Ω → use 330 Ω
Total current: about 18 mA. Power from the supply: 12 × 0.018 = 0.22 W.
All in parallel, a resistor each
Each LED gets the full 12 V, so each resistor drops 10 V.
R = (12 − 2) ÷ 0.02 = 500 Ω → use 560 Ω
Total current: 3 × 18 mA = 54 mA. Power: 12 × 0.054 = 0.64 W.
The lesson: series uses a third of the current for the same light, but if one LED fails, all go out. Parallel is more robust but wastes more power as heat in the resistors. Never share one resistor between parallel LEDs: the LED with the lowest Vf hogs the current and burns out first.
Problem 2: switching a motor with a transistor
An Arduino pin gives 20 mA at most. A small motor wants 200 mA. A transistor acts as a switch: a small current into its base lets a big current flow from collector to emitter.
- Ic
- the load current you want to switch (the motor's 200 mA)
- β
- "beta" or hFE: how many times the transistor multiplies the base current. About 100 for a small transistor like the 2N2222 or BC547
- k
- a safety factor, usually 5 to 10, so the transistor switches fully on
- Ib
- the base current you give it
- 0.7
- the voltage the base itself uses, a bit like an LED's Vf
- Rb
- the base resistor
Work out the smallest base current that would do: load ÷ β. Multiply by the safety factor. Then use Ohm's law on the 4.3 V left over from the pin's 5 V.
Ib = k × Ic ÷ β Rb = (5 − 0.7) ÷ Ib
A motor is a coil of wire. When it switches off, it kicks back a voltage spike that can kill the transistor. Always put a diode across the motor, with its stripe (cathode) on the + side. It does nothing in normal running and soaks up the spike.
Problem 3: how long will the battery last?
- C
- the battery's capacity in milliamp-hours (mAh), printed on it or on its datasheet
- I
- the total current your project draws, in mA
- 0.7
- a real-world factor: batteries never give their full label capacity, especially at higher currents
- t
- the running time, in hours
mAh means "this many mA for one hour". Divide what it holds by what you use, then knock off 30% for real life.
t = C × 0.7 ÷ I
Load values are typical. An Uno board alone draws around 45–50 mA. Servos draw far more while moving than while holding still. A NeoPixel can draw up to 60 mA at full white.
Problem 4: capacitor timing
A capacitor fills up through a resistor like a bucket under a tap that slows down as the bucket fills. The bigger the resistor and capacitor, the slower it fills. This is how simple circuits make delays and smooth out bumpy signals.
- R
- the resistor, in ohms
- C
- the capacitor, in farads. 100 µF = 0.0001 F
- τ
- "tau", the time constant, in seconds
- e
- a fixed number, about 2.718. It appears whenever something slows down as it gets close to its goal
- Vc
- the voltage on the capacitor after time t
Multiply R by C to get τ. After one τ, the capacitor is 63% full. After five τ, it's about 99% full, which counts as full.
τ = R × C Vc = Vs × (1 − e−t ÷ τ)
Build it in Tinkercad: 9 V battery, slideswitch, 10 kΩ resistor, 100 µF capacitor (the − stripe to battery −). Search for Oscilloscope, connect it across the capacitor and set its time per division to 500 ms. Flip the switch and watch this exact curve draw itself.
Code patterns for bigger programs
30 minSmall programs can use delay() and a few ifs. Bigger ones need these six patterns. The projects below use all of them.
1 · millis() instead of delay()
delay(1000) freezes the whole Arduino for a second. It can't read a button while it waits. millis() is a clock: the number of milliseconds since power-on. Check the clock instead of waiting, and the loop stays free to do other things.
unsigned long lastBlink = 0; bool ledOn = false; void loop() { if (millis() - lastBlink >= 500) { // has half a second passed? lastBlink = millis(); // remember when ledOn = !ledOn; // flip on/off digitalWrite(13, ledOn); } // other jobs here run thousands of times a second }
2 · Edge detection: "just pressed", not "held"
Reading a button tells you it's down. Often you want to act once, at the moment it goes down. Remember last time's reading and compare.
bool lastBtn = HIGH; void loop() { bool btn = digitalRead(2); if (lastBtn == HIGH && btn == LOW) { // was up, now down: the press moment mode = mode + 1; } lastBtn = btn; }
3 · Debouncing
Metal contacts bounce for a few milliseconds when pressed, so one press can read as five. The easy fix: after you see a press, wait 20–50 ms before reading again. Tinkercad buttons don't bounce, but real ones do, so build the habit now.
4 · Hysteresis: two thresholds, not one
A fan that turns on above 28 °C and off below 28 °C will flick on and off all day when the room sits at 28 °C. Use a gap: on above 28, off below 25. Your home heating thermostat does this.
if (!fanOn && temp > 28) fanOn = true; if ( fanOn && temp < 25) fanOn = false;
5 · Arrays for many pins
Four LEDs means four pins. Put them in a list and loop, instead of writing everything four times.
const int LEDS[4] = {8, 9, 10, 11}; for (int i = 0; i < 4; i++) pinMode(LEDS[i], OUTPUT);
6 · State machines
A machine that behaves differently at different times (waiting, playing, game over) is easiest to write as states. One variable says which state you're in. Each state has its own small block of code, and decides when to move to the next one.
enum State { WAITING, PLAYING, GAME_OVER }; State state = WAITING; void loop() { switch (state) { case WAITING: if (buttonPressed()) state = PLAYING; break; case PLAYING: // game code if (lost) state = GAME_OVER; break; case GAME_OVER: showScore(); state = WAITING; break; } }
Before writing a state machine, draw it on paper: one bubble per state, one arrow per "when this happens, go there". If learners can draw it, they can code it. This is the same skill game designers use for enemy behaviour.
Project: Simon memory game
60 minadvanced Four coloured lights play a pattern. Copy it with four buttons. Every round adds one more step and plays a little faster.
New ideas: arrays, functions, random numbers, a growing sequence, and a game loop.
| Part | Arduino pin | Other side |
|---|---|---|
| Red LED + 220 Ω | 8 | GND |
| Green LED + 220 Ω | 9 | GND |
| Blue LED + 220 Ω | 10 | GND |
| Yellow LED + 220 Ω | 11 | GND |
| 4 pushbuttons (one per colour) | 2, 3, 4, 5 | GND |
| Piezo + | 12 | GND |
Full code
80 lines
const int LEDS[4] = {8, 9, 10, 11}; const int BUTTONS[4] = {2, 3, 4, 5}; const int NOTES[4] = {262, 330, 392, 523}; // C, E, G, high C const int BUZZ = 12; const int MAX_STEPS = 50; int sequence[MAX_STEPS]; // the pattern so far int level = 0; // how long the pattern is void setup() { for (int i = 0; i < 4; i++) { pinMode(LEDS[i], OUTPUT); pinMode(BUTTONS[i], INPUT_PULLUP); } randomSeed(analogRead(A0)); // unconnected pin = random noise = new game each time Serial.begin(9600); } void loop() { if (level == 0) { // a new game is starting for (int i = 0; i < 4; i++) flash(i, 120); delay(600); } sequence[level] = random(4); // add one new random colour (0 to 3) level++; playSequence(); for (int i = 0; i < level; i++) { // now the player copies it int pressed = waitForButton(); flash(pressed, 200); if (pressed != sequence[i]) { gameOver(); return; // back to the top of loop() } } if (level == MAX_STEPS) { // beat all 50: you win Serial.println("You win!"); level = 0; } delay(700); } void flash(int n, int ms) { // light + note for one colour digitalWrite(LEDS[n], HIGH); tone(BUZZ, NOTES[n], ms); delay(ms); digitalWrite(LEDS[n], LOW); delay(80); } void playSequence() { int speed = max(150, 500 - level * 20); // faster each round for (int i = 0; i < level; i++) flash(sequence[i], speed); } int waitForButton() { // stays here until a button is pressed while (true) { for (int i = 0; i < 4; i++) { if (digitalRead(BUTTONS[i]) == LOW) { delay(20); // debounce while (digitalRead(BUTTONS[i]) == LOW) { } // wait for release return i; } } } } void gameOver() { Serial.print("Game over. Score: "); Serial.println(level - 1); tone(BUZZ, 110, 800); for (int k = 0; k < 3; k++) { // flash everything 3 times for (int i = 0; i < 4; i++) digitalWrite(LEDS[i], HIGH); delay(150); for (int i = 0; i < 4; i++) digitalWrite(LEDS[i], LOW); delay(150); } level = 0; delay(1000); }
How it works
sequenceis a list that remembers every colour so far. Each round adds one random number from 0 to 3.playSequence()plays the whole list back. The gap shrinks by 20 ms a round, down to 150 ms.- The
forloop asks for one press per step.waitForButton()sits in a loop until any button goes LOW, then returns which one (0–3). - One wrong press calls
gameOver(), which resetslevelto 0, so the nextloop()starts a fresh game.
Save the high score with EEPROM.put() so it survives power-off. Add a 3-second time limit per press using millis(). Rewrite it as a state machine (A2, pattern 6) so the lights can idle-animate while waiting for a new game.
Project: keypad lock with screen
75 minadvanced Type a code on a 16-key keypad. The screen shows stars as you type. The right code turns a servo to open a latch. Three wrong codes lock it for 30 seconds.
New ideas: a 16 × 2 LCD screen, reading a key matrix by hand, text strings, and a lock-out timer.
How a keypad matrix works
16 keys would need 16 pins. A matrix needs only 8. The keys sit where 4 row wires cross 4 column wires. Pressing a key joins its row to its column. The code switches on one row at a time (by pulling it LOW) and checks which column goes LOW with it. Row 2 + column 3 = key "6".
| Part | Connect |
|---|---|
| Keypad 4x4 rows 1–4 | Pins 10, 9, 8, 7 (hover the keypad pins to see which is which) |
| Keypad columns 1–4 | Pins 6, A1, A2, A3 (analog pins work as digital pins too) |
| LCD 16 x 2: RS, E | Pins 12, 11 |
| LCD: DB4, DB5, DB6, DB7 | Pins 5, 4, 3, 2 |
| LCD: GND, R/W (read/write) | GND |
| LCD: VCC | 5V |
| LCD: contrast (V0) | Middle leg of a 10 kΩ potentiometer between 5V and GND |
| LCD: LED anode / cathode (backlight) | 5V through 220 Ω / GND |
| Micro servo signal | Pin 13 (red to 5V, brown to GND) |
| Green LED / red LED, each with 220 Ω | A4 / A5 |
Full code
100 lines
#include <LiquidCrystal.h> #include <Servo.h> LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // RS, E, D4, D5, D6, D7 Servo latch; const int ROWS[4] = {10, 9, 8, 7}; const int COLS[4] = {6, A1, A2, A3}; const char KEYS[4][4] = { {'1', '2', '3', 'A'}, {'4', '5', '6', 'B'}, {'7', '8', '9', 'C'}, {'*', '0', '#', 'D'} }; const int GREEN = A4, RED = A5, SERVO_PIN = 13; const String SECRET = "2580"; // change me String entry = ""; // what has been typed so far int wrongTries = 0; void setup() { for (int r = 0; r < 4; r++) { pinMode(ROWS[r], OUTPUT); digitalWrite(ROWS[r], HIGH); } for (int c = 0; c < 4; c++) pinMode(COLS[c], INPUT_PULLUP); pinMode(GREEN, OUTPUT); pinMode(RED, OUTPUT); latch.attach(SERVO_PIN); lcd.begin(16, 2); lockDoor(); } void loop() { char key = getKey(); if (key == 0) return; // nothing pressed this time round if (key == '*') { // * clears entry = ""; } else if (key == '#') { // # = enter checkCode(); } else if (entry.length() < 8) { entry += key; } showStars(); } char getKey() { // scan the matrix once for (int r = 0; r < 4; r++) { digitalWrite(ROWS[r], LOW); // switch this row on for (int c = 0; c < 4; c++) { if (digitalRead(COLS[c]) == LOW) { // this column is joined to it delay(20); while (digitalRead(COLS[c]) == LOW) { } // wait for release digitalWrite(ROWS[r], HIGH); return KEYS[r][c]; } } digitalWrite(ROWS[r], HIGH); // switch it off again } return 0; } void showStars() { lcd.setCursor(0, 1); // column 0, line 2 lcd.print(" "); // wipe the line (16 spaces) lcd.setCursor(0, 1); for (unsigned int i = 0; i < entry.length(); i++) lcd.print('*'); } void checkCode() { if (entry == SECRET) { wrongTries = 0; openDoor(); } else { wrongTries++; lcd.clear(); lcd.print("Wrong code"); digitalWrite(RED, HIGH); delay(1000); digitalWrite(RED, LOW); if (wrongTries >= 3) lockOut(30); lockDoor(); } entry = ""; } void openDoor() { lcd.clear(); lcd.print("Welcome!"); digitalWrite(GREEN, HIGH); latch.write(90); // latch open delay(5000); digitalWrite(GREEN, LOW); lockDoor(); } void lockDoor() { latch.write(0); // latch shut lcd.clear(); lcd.print("Code, then #"); } void lockOut(int seconds) { for (int s = seconds; s > 0; s--) { // count down on screen lcd.clear(); lcd.print("Locked out"); lcd.setCursor(0, 1); lcd.print(s); lcd.print(" s"); digitalWrite(RED, HIGH); delay(500); digitalWrite(RED, LOW); delay(500); } wrongTries = 0; }
No text on the screen? Turn the contrast potentiometer. A blank or all-blocks LCD is almost always contrast, not code.
Let the owner change the code: press A, type the old code, then the new one. Store it with EEPROM. Then 3D-print a case with the hinge from A9 and the latch arm from a servo horn.
Project: smart plant station
90 minadvanced Three sensors, three outputs, one screen. It waters the soil when dry, opens a vent when hot, turns on a lamp when dark, and logs everything as a spreadsheet table.
New ideas: several jobs at once with millis(), hysteresis, a transistor-driven motor, a safety cut-out, and data logging.
| Part | Connect | Job |
|---|---|---|
| Soil Moisture Sensor | Signal → A0 | How wet the soil is |
| TMP36 | Signal → A1 | Air temperature |
| Photoresistor + 10 kΩ | Divider middle → A2 | Light level |
| LCD 16 x 2 | As in A4: 12, 11, 5, 4, 3, 2 | Shows readings |
| Micro servo | Signal → 9 | Opens the vent |
| DC motor (the "pump") | Through an NPN transistor, base → 1 kΩ → pin 6 | Waters the plant |
| Diode | Across the motor, stripe to the + side | Protects the transistor |
| LED + 220 Ω | Pin 10 | The grow lamp |
Pump wiring, step by step: motor + → 5V. Motor − → transistor collector. Transistor emitter → GND. Pin 6 → 1 kΩ → transistor base. Diode across the motor's two legs. Use Tool 13 to check the 1 kΩ.
Full code
95 lines
#include <LiquidCrystal.h> #include <Servo.h> LiquidCrystal lcd(12, 11, 5, 4, 3, 2); Servo vent; const int SOIL = A0, TEMP = A1, LIGHT = A2; const int PUMP = 6, VENT_PIN = 9, LAMP = 10; // Settings: tune them by watching the Serial Monitor const int DRY = 300, WET = 600; // start / stop watering const float HOT = 28.0, COOL = 25.0; // open / close vent const int DARK = 250; // lamp on below this const unsigned long MAX_PUMP = 10000; // never pump more than 10 s const unsigned long REST = 30000; // then rest 30 s before trying again int soil, light; float tempC; bool pumping = false, ventOpen = false; unsigned long pumpStart = 0, restUntil = 0, lastRead = 0, lastScreen = 0; int screen = 0; void setup() { pinMode(PUMP, OUTPUT); pinMode(LAMP, OUTPUT); vent.attach(VENT_PIN); vent.write(0); lcd.begin(16, 2); Serial.begin(9600); Serial.println("seconds,soil,tempC,light"); // spreadsheet headings } void loop() { unsigned long now = millis(); if (now - lastRead >= 1000) { // job 1: every second, read and decide lastRead = now; readSensors(); decide(now); logLine(); } if (now - lastScreen >= 3000) { // job 2: every 3 seconds, swap screens lastScreen = now; screen = 1 - screen; showScreen(); } if (pumping && now - pumpStart >= MAX_PUMP) stopPump(now); // job 3: safety } void readSensors() { soil = analogRead(SOIL); light = analogRead(LIGHT); float volts = analogRead(TEMP) * 5.0 / 1024.0; tempC = (volts - 0.5) * 100.0; } void decide(unsigned long now) { // Water, with hysteresis: start when DRY, stop only when WET if (!pumping && soil < DRY && now >= restUntil) { pumping = true; pumpStart = now; analogWrite(PUMP, 200); // about 80% speed } if (pumping && soil > WET) stopPump(now); // Vent, same idea with temperature if (!ventOpen && tempC > HOT) { ventOpen = true; vent.write(90); } if ( ventOpen && tempC < COOL) { ventOpen = false; vent.write(0); } digitalWrite(LAMP, light < DARK ? HIGH : LOW); } void stopPump(unsigned long now) { pumping = false; analogWrite(PUMP, 0); restUntil = now + REST; } void showScreen() { lcd.clear(); if (screen == 0) { lcd.print("Soil "); lcd.print(soil); lcd.setCursor(0, 1); lcd.print(pumping ? "Watering..." : "Pump off"); } else { lcd.print("Temp "); lcd.print(tempC, 1); lcd.print(" C"); lcd.setCursor(0, 1); lcd.print(ventOpen ? "Vent open" : "Vent shut"); } } void logLine() { // one comma-separated row per second Serial.print(millis() / 1000); Serial.print(","); Serial.print(soil); Serial.print(","); Serial.print(tempC, 1); Serial.print(","); Serial.println(light); }
How it works
- There's no
delay()inloop(). Three jobs each check the clock and only run when it's their turn. That's why the safety cut-out can stop the pump at any moment. - The pump starts below 300 and stops above 600. The big gap is hysteresis: no flicking on and off.
- If the soil never gets wet (the tank is empty, or in Tinkercad nobody moves the slider), the pump stops after 10 s and rests for 30 s. Real machines always need a "what if the sensor lies" plan.
- The Serial Monitor prints a comma-separated table. Copy it into a spreadsheet and make a chart.
Start the simulation. Click the soil sensor and drag its slider to dry: the screen says Watering. Drag it to wet: it stops. Click the TMP36 and drag past 28 °C: the vent servo turns. Drag back to 26 °C: it stays open (hysteresis). Below 25 °C: it shuts.
Project: motor speed and direction
50 minadvanced A knob sets the speed. A button reverses the motor, slowing it to a stop first so the gears don't crunch.
New ideas: the H-bridge, a separate motor power supply, PWM speed control and ramping.
The H-bridge
To reverse a DC motor you reverse the current through it. An H-bridge is four switches arranged like the letter H, with the motor as the bar. Close the top-left and bottom-right switches and current flows one way. Close the other pair and it flows the other way. The L293D chip has two H-bridges inside.
| IN1 | IN2 | Motor does |
|---|---|---|
| HIGH | LOW | Turns forward |
| LOW | HIGH | Turns backward |
| LOW | LOW | Coasts to a stop |
| HIGH | HIGH | Brakes |
The enable pin (EN) is the speed control. Feed it PWM: 255 is full speed, 0 is off.
| L293D pin | Connect to |
|---|---|
| 1 (Enable 1,2) | Arduino pin 5 (a ~ pin) |
| 2 (Input 1) / 7 (Input 2) | Arduino pins 7 / 8 |
| 3 (Output 1) / 6 (Output 2) | The two motor legs |
| 4, 5, 12, 13 (GND) | GND, shared by Arduino and battery |
| 16 (VCC 1, the chip's own power) | Arduino 5V |
| 8 (VCC 2, the motor's power) | 9 V battery + |
Also: potentiometer middle leg → A0. Pushbutton between pin 2 and GND. Hover the chip's pins in Tinkercad to check the numbers; pin 1 is next to the notch.
The battery's − must join the Arduino's GND. Without a shared ground, the chip can't tell what "HIGH" means and nothing works. This is the most common fault in any project with two power supplies.
Full code
40 lines
const int EN = 5, IN1 = 7, IN2 = 8, BTN = 2, KNOB = A0; bool forward = true; bool lastBtn = HIGH; int speedNow = 0; // what the motor is getting right now, 0 to 255 void setup() { pinMode(EN, OUTPUT); pinMode(IN1, OUTPUT); pinMode(IN2, OUTPUT); pinMode(BTN, INPUT_PULLUP); setDirection(); Serial.begin(9600); } void loop() { bool btn = digitalRead(BTN); if (lastBtn == HIGH && btn == LOW) { // the moment it's pressed rampTo(0); // slow to a stop first forward = !forward; setDirection(); delay(200); } lastBtn = btn; rampTo(analogRead(KNOB) / 4); // knob 0–1023 → speed 0–255 Serial.println(speedNow); } void setDirection() { digitalWrite(IN1, forward ? HIGH : LOW); digitalWrite(IN2, forward ? LOW : HIGH); } void rampTo(int target) { // change speed one step at a time while (speedNow != target) { speedNow += (target > speedNow) ? 1 : -1; analogWrite(EN, speedNow); delay(2); // 255 steps × 2 ms ≈ half a second } }
Use the L293D's second H-bridge for a second motor and you have a robot car: both forward to drive, one forward and one back to spin on the spot.
Project: dice with a shift register
60 minadvanced Press a button. A 7-segment display spins through numbers, slows down like a real die, and lands on 1 to 6. It uses only three Arduino pins for eight outputs.
New ideas: the 74HC595 shift register, sending data one bit at a time, and storing patterns as binary numbers.
What a shift register does
The 74HC595 turns 3 pins into 8 outputs. You send it 8 bits, one at a time, on the data pin. Each tick of the clock pin pushes the bits along one place, like people shuffling down a bench. When all 8 are in, one pulse on the latch pin copies them to the 8 outputs at the same moment.
Numbers as light patterns
The display has 7 bars named a to g. Each bar is one bit: 1 means lit. So each digit is just an 8-bit number.
| Digit | Bars lit | Bits (g…a) | Hex |
|---|---|---|---|
| 1 | b c | 0000110 | 0x06 |
| 2 | a b d e g | 1011011 | 0x5B |
| 3 | a b c d g | 1001111 | 0x4F |
| 4 | b c f g | 1100110 | 0x66 |
| 5 | a c d f g | 1101101 | 0x6D |
| 6 | a c d e f g | 1111101 | 0x7D |
| 74HC595 pin | Connect to |
|---|---|
| 14 (DS, data) | Arduino pin 4 |
| 12 (ST_CP, latch) | Arduino pin 5 |
| 11 (SH_CP, clock) | Arduino pin 6 |
| 16 (VCC) and 10 (MR, reset) | 5V |
| 8 (GND) and 13 (OE, output enable) | GND |
| Q0 (pin 15), Q1–Q6 (pins 1–6) | Display bars a to g, each through its own 220 Ω |
| Display common pin | GND (set the display to common cathode) |
| Pushbutton | Pin 2 and GND |
Full code
35 lines
const int DATA = 4, LATCH = 5, CLOCK = 6, BTN = 2; // bit 0 = bar a ... bit 6 = bar g. Index = the digit. const byte DIGITS[10] = {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F}; void setup() { pinMode(DATA, OUTPUT); pinMode(LATCH, OUTPUT); pinMode(CLOCK, OUTPUT); pinMode(BTN, INPUT_PULLUP); randomSeed(analogRead(A0)); show(0); } void loop() { if (digitalRead(BTN) == LOW) roll(); } void show(int n) { digitalWrite(LATCH, LOW); // hold the outputs still shiftOut(DATA, CLOCK, MSBFIRST, DIGITS[n]); // send 8 bits, one per clock tick digitalWrite(LATCH, HIGH); // show all 8 at once } void roll() { int wait = 30; for (int i = 0; i < 15; i++) { // spin, slowing down each time show(random(1, 7)); // random(1, 7) gives 1 to 6 delay(wait); wait += 15; } show(random(1, 7)); // the final answer while (digitalRead(BTN) == LOW) { } // wait for release }
This is a perfect bridge to binary. Ask learners to work out the hex for the letter "H" (bars b c e f g) before they type it. Answer: 1110110 = 0x76.
Chain a second 74HC595 (its pin 14 to the first one's pin 9, the "carry out") and a second display. Now shiftOut twice and roll two dice, or show 00 to 99.
Project: NeoPixel light show
45 minadvanced A ring of 12 colour LEDs, each one separately controlled, on a single data wire. A button cycles through a rainbow, a spinner with a fading tail, and a level meter driven by a knob.
New ideas: addressable LEDs, colours as numbers (RGB and hue), animation frames with millis(), and a power budget.
| Part | Connect |
|---|---|
| NeoPixel Ring 12: data in | Pin 6 (add 330 Ω in series on real hardware) |
| NeoPixel power / ground | 5V / GND |
| Pushbutton | Pin 2 and GND |
| Potentiometer middle leg | A0 |
Full code
50 lines
#include <Adafruit_NeoPixel.h> const int PIN = 6, COUNT = 12, BTN = 2, KNOB = A0; Adafruit_NeoPixel ring(COUNT, PIN, NEO_GRB + NEO_KHZ800); int mode = 0; // 0 rainbow, 1 spinner, 2 level meter bool lastBtn = HIGH; unsigned long lastFrame = 0; unsigned long frame = 0; // counts up every frame void setup() { ring.begin(); ring.setBrightness(80); // out of 255: easier on eyes and power pinMode(BTN, INPUT_PULLUP); } void loop() { bool btn = digitalRead(BTN); if (lastBtn == HIGH && btn == LOW) { mode = (mode + 1) % 3; delay(30); } lastBtn = btn; if (millis() - lastFrame < 50) return; // 20 frames a second lastFrame = millis(); frame++; ring.clear(); if (mode == 0) { // rainbow wheel for (int i = 0; i < COUNT; i++) { uint16_t hue = i * 65536L / COUNT + frame * 512; // hue goes 0 to 65535 round the wheel ring.setPixelColor(i, ring.ColorHSV(hue)); } } else if (mode == 1) { // spinner with a fading tail for (int t = 0; t < 4; t++) { int i = (frame + COUNT * 10 - t) % COUNT; ring.setPixelColor(i, ring.Color(0, 0, 255 >> (t * 2))); // 255, 63, 15, 3 } } else { // level meter int lit = map(analogRead(KNOB), 0, 1023, 0, COUNT); for (int i = 0; i < lit; i++) { if (i < 8) ring.setPixelColor(i, ring.Color(0, 150, 0)); // green else if (i < 10) ring.setPixelColor(i, ring.Color(150, 120, 0)); // amber else ring.setPixelColor(i, ring.Color(180, 0, 0)); // red } } ring.show(); // send the whole frame at once }
The power budget
Each NeoPixel can draw up to 60 mA at full white (20 mA each for red, green and blue). 12 × 60 = 720 mA. A computer USB port usually gives 500 mA. So at full brightness this ring could brown out the Arduino. setBrightness(80) cuts the worst case to about 80 ÷ 255 of that: around 230 mA. For long strips, use a separate 5 V supply and join the grounds.
Add a fourth mode: a clock using millis(), with one pixel for the "hour" and one for the "minute". Or 3D-print a diffuser ring in white PLA, 1 mm thick, that sits over the LEDs.
3D project: print-in-place hinged case
60 minadvanced Two trays joined by a hinge that prints already assembled, like a glasses case. It comes off the printer and folds shut straight away. No glue, no screws.
New ideas: clearance between moving parts, interlocking knuckles, and a hinge line placed so the halves close exactly.
Parts that must slide or turn need a gap all round, bigger than for a snug lid. 0.4–0.5 mm on each side is a good start for most printers. Too small and they fuse. Too big and they wobble.
hole diameter = pin diameter + 2 × gap
Steps
- Two trays: each 60 × 40 × 12 mm, hollowed with 2 mm walls and floor (as in D7 build 3). Call them A and B.
- Place them side by side, open side up, with their long back edges facing each other and a 9 mm gap between them.
- Knuckles: a row of 5 cylinders lying on their side along the gap: 8 mm across, 10 mm long each, with a 0.5 mm gap between neighbours. The row is 52 mm long. Centre it in the gap, with its centre line at 12 mm high, level with the tops of the walls. That height is what makes the two rims meet when it folds.
- Join them alternately: each knuckle has 0.5 mm of air to each wall. Fill that air with a small bridge block on one side only: knuckles 1, 3, 5 to tray A, knuckles 2 and 4 to tray B.
- Pin: a 3.5 mm cylinder running through all five knuckles. It belongs to tray A's side.
- Clearance holes: in knuckles 2 and 4, add a 4.5 mm hole cylinder around the pin (3.5 + 2 × 0.5 = 4.5). Group each of these knuckles with its hole before grouping anything else.
- Group tray A with knuckles 1, 3, 5 and the pin. Group tray B with knuckles 2 and 4. Do not group the two sides together, or the gaps get filled.
- Export both sides as one STL, so they print in place. Turn supports off in the slicer, or support plastic will fill the hinge gaps.
Check every gap from several angles with the view cube before exporting. Anywhere a tray-A shape touches a tray-B shape, the hinge prints welded shut. After printing, flex it gently a few times to break any thin strands.
Make the gap a design test: print three small hinges with 0.3, 0.4 and 0.5 mm gaps. Keep the smallest one that turns freely and use that number on every future hinge on that printer. Then add a magnet pocket in each rim (a hole the size of your magnet + 0.2 mm) so the case snaps shut.
3D project: gear train
50 minadvanced Two gears on a base plate, spaced so they mesh exactly. Turning the small one turns the big one slower but with more force.
New ideas: the gear module, centre distance, gear ratio, and trading speed for force.
- m
- the module: how big the teeth are, in mm. Two gears only mesh if they have the same module
- T₁
- teeth on the driving gear (the one you turn)
- T₂
- teeth on the driven gear
- d
- pitch diameter: the size where the teeth meet, not the outside edge
Each gear's pitch diameter is module times teeth. Put the centres half the sum apart. The ratio is how many turns of the small gear make one turn of the big one.
d = m × T centres = m × (T₁ + T₂) ÷ 2 ratio = T₂ ÷ T₁
Steps
- Open Shape Generators and search "gear". Generators differ: some ask for the module, some for a diameter. Use the numbers from Tool 16 for either.
- Make both gears 6 mm thick. Give each a 5.4 mm hole in the centre (a 5 mm pin + 0.4 mm clearance).
- Base plate: a box, with two 5 mm cylinder pins 12 mm tall, exactly the centre distance apart, plus 0.2 mm extra so the printed teeth don't bind.
- Add a small knob (a cylinder off-centre) on top of the driver gear so you can crank it.
- Print the gears flat. Drop them onto the pins.
Let learners feel the ratio: crank the small gear and count. With 12 and 36 teeth it's three turns for one, and the big gear is three times harder to hold back. That's how a bike's low gear helps you up a hill.
3D project: Simon game case
60 minadvanced A case for the A3 Simon game with an Arduino inside, four button holes and LED windows on top, a speaker grille, and a USB opening. This is where the circuit and 3D halves of the course meet.
New ideas: designing around real parts, mounting posts with screw holes, patterns of holes, and labels.
Measure first, design second
| Real part | Typical size | Hole to design |
|---|---|---|
| Arduino Uno board | 68.6 × 53.4 mm | Inside space 70 × 55 mm |
| 12 mm tactile button | 12 × 12 mm body, round cap | Cap diameter + 0.6 mm |
| 5 mm LED | 5 mm, rim 5.8 mm | 5.3 mm hole |
| Piezo buzzer | 12–30 mm across | Grille of 2 mm holes over it |
| M3 screw | 3 mm thread | 2.5 mm hole in a post, so it cuts its own thread |
| Breadboard hole spacing | 2.54 mm (0.1 inch) | Space parts in multiples of 2.54 |
Sizes vary by maker. Use a ruler or calipers on your actual parts and trust that over this table.
Steps
- Shell: outside 120 × 90 × 40 mm, hollowed with 2.5 mm walls. Leave the top open.
- Mounting posts: four cylinders 6 mm across, 6 mm tall, on the floor, where the Uno's mounting holes are (measure them). Each gets a 2.5 mm hole for an M3 screw.
- USB opening: line a box hole up with the board's USB socket in the end wall. Add 1 mm all round.
- Top panel: 120 × 90 × 2.5 mm. Four button holes in a 2 × 2 grid, 30 mm apart. A 5.3 mm LED hole above each button.
- Speaker grille: one 2 mm hole, then Ctrl + D, move 4 mm, Ctrl + D four more times. Select the row, Ctrl + D, move 4 mm down, repeat. A 5 × 5 grille in under a minute.
- Labels: text 1 mm deep as a hole (engraved) reads better than raised text on a top panel.
- Lid fit: add a lip under the top panel, 0.3 mm smaller than the opening on each side (D7 build 3).
Import an SVG of your own logo (D5) and engrave it into the panel. Or design separate button caps in four colours that press down onto the tactile buttons.
Codeblocks project: twisted tower
40 minadvanced A twisted, bulging tower or vase made from 40 stacked layers. Change one number and the whole shape changes.
New ideas: variables that drive a design, loops with maths inside, and parametric design (shapes built from rules, not drawn by hand).
The rule for each layer
| Variable | Starts at | Each layer | What it does |
|---|---|---|---|
| i | 0 | + 1, up to 39 | Which layer this is |
| height | i × 2 | recalculated | Stacks layers 2 mm apart |
| twist | i × 4 | recalculated | Turns each layer 4° more than the last |
| size | 30 | + 1 up to layer 20, then − 1 | Makes it bulge in the middle |
Blocks, in order
- Create variables i and size. Set size to 30.
- Count with i from 0 to 39 by 1. Inside it:
-
- Add a Box. Set its length and width to size, height 2.
- Move it up (Z) by i × 2.
- Rotate it around Z by i × 4 degrees.
- If i < 20, change size by 1. Else change size by −1.
- Press Run. Watch it build layer by layer.
- To make a vase, run the same loop a second time with each box 4 mm smaller, starting at height 2, and make those boxes holes. Group everything.
Swap the box for a 5- or 6-sided polygon. Change the twist from 4° to 9°. Make the size follow a wave using the Math block's sine, if your version has it. Each version is a different object from the same eight blocks.
Capstone: escape-room puzzle box
5 sessionsadvanced One big project that uses everything. A printed hinged case stays locked until players solve three puzzles. Built by a team of 3–4 over five sessions. It also works as a solo project.
The puzzles
- Light puzzle: shine a torch on a hidden photoresistor. A NeoPixel turns from red to green.
- Knob puzzle: turn a potentiometer until a piezo's pitch matches a reference note. Hold it for 2 seconds.
- Code puzzle: the first two puzzles each reveal one half of a 4-digit code on the LCD. Type it on the keypad. The servo latch opens.
Five sessions
| Session | Goal | Done when |
|---|---|---|
| 1 Plan | Draw the box and the state machine. Split jobs: circuit, code, case, puzzle story. | A paper state diagram with every state and arrow. |
| 2 Simulate | Build the whole circuit in Tinkercad. Code each puzzle as its own state. | All three puzzles work in the simulator. |
| 3 Design | Hinged case (A9) with holes for every part (A11). Start the print. | STL exported and printing. |
| 4 Build | Real parts on a breadboard, then into the box. | It works on the desk, outside the box, then inside it. |
| 5 Playtest | Another team plays it without help. Watch and take notes. | Three things to improve, written down. |
// The skeleton: one state per puzzle (A2, pattern 6) enum State { LIGHT_PUZZLE, KNOB_PUZZLE, CODE_PUZZLE, OPEN }; State state = LIGHT_PUZZLE; void loop() { switch (state) { case LIGHT_PUZZLE: if (lightSolved()) { showHalfCode(1); state = KNOB_PUZZLE; } break; case KNOB_PUZZLE: if (knobSolved()) { showHalfCode(2); state = CODE_PUZZLE; } break; case CODE_PUZZLE: if (codeSolved()) { openLatch(); state = OPEN; } break; case OPEN: if (resetPressed()) { closeLatch(); state = LIGHT_PUZZLE; } break; } }
Give each team member a named role with a clear deliverable: Engineer (circuit), Programmer (states), Designer (case), Game master (story and clues). Rotate roles between projects so everyone learns every part.
Pin count. Keypad (8) + LCD (6) + servo, NeoPixel and piezo (3) + photoresistor and potentiometer (2) needs 19 pins. The Uno has 20, but pins 0 and 1 carry the Serial Monitor, so it doesn't fit. Swap to the I2C version of the LCD, which uses only 2 pins (A4 and A5), and you're down to 15. Plan every pin in a table in session 1.
Cheat sheets
Formulas on one page
| What | Equation | In words |
|---|---|---|
| Ohm's law | V = I × R | Push = flow × squeeze |
| Power | P = V × I | Energy per second = push × flow |
| Series | R = R1 + R2 | Add them up |
| Two in parallel | R = R1×R2 ÷ (R1+R2) | Times over plus |
| LED resistor | R = (Vs − Vf) ÷ I | Leftover voltage ÷ wanted current |
| Divider | Vout = Vin × R2 ÷ (R1+R2) | Bottom's share of the voltage |
| Reading to volts | V = r × 5 ÷ 1024 | Steps × step size |
| TMP36 to °C | T = (V − 0.5) × 100 | 0.5 V at 0 °C, plus 0.01 V per degree |
| Ultrasonic distance | cm = time × 0.0343 ÷ 2 | Speed of sound, there and back |
| Transistor base resistor | Rb = 4.3 ÷ (k × Ic ÷ β) | Pin volts left over ÷ base current needed |
| Battery life | hours = mAh × 0.7 ÷ mA | What it holds ÷ what you use, minus 30% |
| Time constant | τ = R × C | 63% full after τ, full after 5τ |
| Gears | centres = m × (T₁ + T₂) ÷ 2 | Ratio = T₂ ÷ T₁ |
| Moving-part hole | hole = pin + 2 × 0.5 mm | Clearance on both sides |
Shortcuts
| 3D Design | |
|---|---|
| Ctrl+G | Group |
| Ctrl+Shift+G | Ungroup |
| H / S | Make hole / solid |
| Ctrl+D | Duplicate and repeat |
| L | Align |
| M | Mirror |
| R / W | Ruler / workplane |
| D | Drop to workplane |
| F | Zoom to selection |
| Ctrl+L | Lock |
| Ctrl+H | Hide |
| Ctrl+Z / Y | Undo / redo |
| Circuits | |
|---|---|
| R | Rotate selected part |
| Delete | Remove part or wire |
| Click, then click | Draw a wire |
| Double-click wire | Add a bend point |
| Ctrl+C / V | Copy / paste parts |
| Ctrl+Z | Undo |
| Wire colours | |
| Red | + / 5V |
| Black | − / GND |
| Other | Signals: pick one per job |
Glossary
- Analog
- A signal that can be any value in a range, like a dimmer.
- Anode / cathode
- The + and − legs of an LED or diode.
- Breadboard
- A board with joined holes for building circuits without solder.
- Conventional current
- Drawing current from + to −. Electrons really go the other way.
- Digital
- A signal that is only on or off: HIGH or LOW.
- Export
- Save a design as a file for another program or a printer.
- FDM printer
- The common 3D printer that melts plastic layer by layer.
- Floating pin
- An input connected to nothing. It reads random values.
- Forward voltage (Vf)
- The voltage an LED uses up when it's on.
- GND (ground)
- The 0 V, − side of a circuit.
- AWG
- Wire thickness. A bigger number means a thinner wire.
- Continuity
- Whether two points are joined. The multimeter's beep test checks it.
- Header
- A strip of pins (male) or sockets (female) at 2.54 mm spacing.
- JST
- A family of small keyed plastic plugs, used on batteries and sensors.
- Junction rule
- Current flowing into a point equals current flowing out.
- Keyed
- Shaped so it only fits one way round.
- kWh
- Kilowatt-hour: 1,000 W for one hour. The unit on the electricity bill.
- Loop rule
- The voltages round a loop add up to the supply.
- mAh
- Milliamp-hours: how much charge a battery holds.
- Pitch
- Centre-to-centre spacing of pins. Usually 2.54 mm.
- Tinning
- Coating a wire end or soldering tip with a thin layer of solder.
- H-bridge
- Four switches around a motor so it can turn both ways.
- Hysteresis
- Using two thresholds (on at one, off at another) to stop flicking.
- millis()
- The Arduino's clock: milliseconds since power-on. Lets code wait without freezing.
- Module (gears)
- Tooth size. Gears only mesh if their modules match.
- Shift register
- A chip that turns 3 pins into 8 outputs by taking bits in one at a time.
- State machine
- Code organised as named states and the rules for moving between them.
- Time constant (τ)
- R × C: how quickly a capacitor fills.
- Transistor
- An electric switch: a small current controls a big one.
- Group
- Join shapes into one. Holes cut when grouped.
- Microcontroller
- A tiny computer on a chip, like the Arduino's.
- Overhang
- Part of a print with nothing under it.
- Parallel
- Parts side by side, each with its own path.
- Polarity
- A part that only works one way round has polarity.
- Pull-up resistor
- Holds an input at HIGH until a button pulls it LOW.
- PWM
- Switching a pin on and off fast to fake in-between levels.
- Series
- Parts one after another, on one path.
- Serial Monitor
- A window showing text sent by the Arduino.
- Short circuit
- A path with almost no resistance. Huge current, heat.
- Slicer
- Program that turns an STL into printer instructions.
- STL
- The most common 3D-printing file type.
- Tolerance
- How far a real part can be from its stated value, like ±5%. In 3D printing, the gap left so parts fit.
- Workplane
- The flat surface new shapes sit on.
Sources
- Tinkercad, Autodesk
- Tinkercad keyboard shortcuts (PDF), Autodesk
- Tinkercad Sketch Workspace tutorial, All3DP, 2025
- Tinkercad adds a revolve sketch function, All3DP, October 2025
- Autodesk adds Sim Lab to Tinkercad, THE Journal
- How to use Tinkercad Classrooms, TSI
- Tinkercad voltage divider and multimeter, Duke University
- Arduino language reference, Arduino
- TMP36 temperature sensor guide, Adafruit
- NeoPixel Überguide (power per pixel, data resistor), Adafruit
- Connector basics (headers, barrel jacks, screw terminals, JST-PH), SparkFun
- Why isn't battery polarity always the same in JST pins?, Particle community
- Arduino Uno Rev3, Arduino
- L293 / L293D datasheet, Texas Instruments
- 74HC595 shift register datasheet, Nexperia