Last year your device sat on the desk in front of you. This year it does not.
You put it on a roof, in a corridor, in a store room. You walk away. You come back a week later and find out what it did while nobody was watching.
That one change — leaving the room — makes almost everything harder, and it is the whole point of Level 3. A device you are standing next to can be rescued. A device on a roof cannot. It has to survive a dropped WiFi connection, a power cut, a sensor that goes strange at 3am, and a week of nobody looking at it.
You move from the Arduino Uno to the ESP32. It is faster, has far more memory, and — the reason we are using it — it has WiFi built into the chip. No extra module, no shield. It can join a network, and it can be a network.
The Uno ran at 5 volts. The ESP32 runs at 3.3 volts, and it is not tolerant about it.
Putting 5 V onto an ESP32 input pin can destroy the pin, and sometimes the whole board. There is no fuse, no warning, no smell. It just stops working, usually a week later.
| What you see | Why | What to do |
|---|---|---|
| A sensor marked 3.3V | Safe. Wire it exactly as the diagram shows. | Power from the 3V3 pin, not VIN. |
| A sensor marked 3–5V | Safe. Most modern modules are. | Still power it from 3V3 unless the book says otherwise. |
| A sensor marked 5V only | Its output will be 5V. Not safe on an input pin. | Ask your teacher. It needs a divider or a level shifter. |
| Motors, relays, pumps | Never from the board, at any voltage. | Own supply, common ground. Same rule as Level 2. |
Same five parts as Level 2, plus one that only matters now that your device leaves the room.
Your school's WiFi may or may not let a small device talk to the wider internet. That is a decision made by people who are not in this room, and it can change. So this book teaches both paths from Session 2 onward, and everything after that works either way.
You will test which of these you have in Session 2, in about ten minutes.
Reference · keep this page
One program, all year. Your teacher gives you the file. You do not retype it, and you do not change anything that is not inside a slot.
The WiFi lines are from session 2. Serving a page is session 3. An address that does something is session 4, and the style is session 5. Nothing on the next page is new to you — it is the five things you built separately, put in one file and given eight marked gaps.
| Slot | What goes in it | Looks like |
|---|---|---|
| 1 | A library your part needs | #include <DHT.h> |
| 2 | Your parts, your chosen numbers, and any function of your own | DHT sensor(4, DHT11); |
| 3 | Read a sensor. Return text. | return String(t) + " C"; |
| 4 | What the page says | "<h1>" + reading() + "</h1>" |
| 5 | Start a part, once, at switch-on | sensor.begin(); |
| 6 | Another address the page can link to | server.on("/open", handleOpen); |
| 7 | An extra line in the page's head | auto-refresh, in session 17 |
| 8 | The page's background colour | red when something is wrong |
You may use a chatbot to help write what goes in a slot. There are two conditions and they are not negotiable.
Find the comment line. Type underneath it. Leave the comment where it is, so you and your teacher can both still find the slot next week.
| What you see | Why | What to do |
|---|---|---|
| It will not compile and points at a library | Slot 1 is empty, or the library is not installed. | Add the #include, then Tools → Manage Libraries. |
'sensor' was not declared | Slot 2 is empty. | The part has to be declared in slot 2 before slot 3 can use it. |
The page says nothing yet | Slot 3 still has the staple's own line in it. | Your return has to replace that one, not sit under it. |
| It compiled yesterday and not today | A brace was deleted with a slot comment. | Compare against a fresh copy of the staple. Keep one unopened. |
| A chatbot's line will not compile | It invented a function. | Expected. Check the function exists in the library's own documentation, then fix or drop the line. |
Reference pages