Session 8 — Build a Smart Gadget
Duration: 75 min · Format: live online · Ages: 12–15
Session goal: by the end, students can combine a sensor, a decision, and an output into a working gadget in the simulator, tune its threshold, and document it like an engineer.
Before class — prep (5 min)
- Open Tinkercad Circuits in a tab, signed in and ready to Create new Circuit — you'll demo and screen-share.
- Have the diagram below ready to share (Sense → Think → Act).
- Have the decision sketch below open so you can paste it live.
Agenda
| Time | Segment |
|---|---|
| 0:00 | Hook — a gadget that decides for itself (5 min) |
| 0:05 | Teach — plan it: Sense → Think → Act (10 min) |
| 0:15 | Teach — code the decision (the if) (15 min) |
| 0:30 | Activity — build, test & tune the gadget (30 min) |
| 1:00 | Check for understanding (8 min) |
| 1:08 | Wrap-up + homework (7 min) |
0:00 · Hook (5 min)
Ask the class (chat or unmute):
- "A night-light turns itself on when the room gets dark — how does it decide?"
Let them guess, then reveal: it has all three pieces they've met — a sensor to sense, code to think, and an output to act. Tell them today they snap those pieces into their own real gadget.
0:05 · Teach — Plan it: Sense → Think → Act (10 min)
Explain: every gadget starts with a plan. Share the diagram and have each student pick one idea to build.
Share this diagram:
Offer three starter ideas:
- Automatic night-light: if it's dark → turn the LED on.
- Heat alarm: if temperature is high → sound the buzzer.
- Door reminder: if the button is pressed → blink an LED.
Ask: have each student finish this sentence in the chat — "My gadget will sense ___, think (if ___), and act by ___."
0:15 · Teach — Code the decision (the "Think") (15 min)
Explain: the magic is an if statement — it lets the gadget decide for itself. Walk through the code line by line, naming the Sense, Think, and Act.
Build/type this together:
void setup() {
pinMode(13, OUTPUT);
}
void loop() {
int light = analogRead(A0); // SENSE
if (light < 400) { // THINK: is it dark?
digitalWrite(13, HIGH); // ACT: light ON
} else {
digitalWrite(13, LOW); // ACT: light OFF
}
}
⚠ Watch for the #1 misconception: students expect it to work perfectly first try and give up when it doesn't. Reframe — the number
400is a threshold you tune, and real engineers spend most of their time testing and adjusting, not getting it right the first time.
Ask: "What happens if we make the threshold 900 instead of 400? When would the LED come on then?" (Answer: it turns on much more easily — almost all the time.)
0:30 · Activity — Build, test & tune (30 min)
Students build their gadget in the simulator. Demo the first build, then circulate.
- In Tinkercad Circuits, add the Arduino, a sensor (e.g., photoresistor on A0), and an output (LED on pin 13 with a resistor). Wire it up.
- Add the decision code above (adapt it to their chosen gadget).
- Start Simulation. Cover the sensor — does the LED turn on?
- Tune the threshold: the number
400decides when it triggers. Too sensitive, or not enough? Change it and re-test. This tuning is engineering.
Circulate and ask: "What threshold worked for your gadget? How did you know?"
Debrief: have 2–3 students share their gadget, their threshold, and one thing they changed while testing.
1:00 · Check for understanding (8 min)
Ask these aloud or drop them in the chat. Answer key (for you):
- What are the three parts of a smart gadget? → Sense → Think → Act — a sensor, an
ifdecision, and an output. - What does the
ifstatement do? → It lets the gadget decide between options based on the sensor reading. - What is the threshold? → The value that triggers the action (here,
400) — you tune it by testing.
1:08 · Wrap-up + homework (7 min)
- Ask one student to explain their gadget in one sentence: what it senses, decides, and does.
- Homework — Finish the project checklist and keep it for the portfolio:
- [ ] I wrote my Sense → Think → Act plan
- [ ] I built the circuit in Tinkercad
- [ ] I wrote code with an
ifdecision - [ ] I tested it and tuned the threshold
- [ ] I took a screenshot for my portfolio
- [ ] I can explain how it works in one sentence
Teaching notes
- Correct this misconception: "It should work perfectly the first time." Reframe — engineers test and tune; the threshold almost always needs adjusting, and that iteration is the real skill.
- Fast finishers (extension): make it their own and document it like an engineer. Have them (1) design an independent prototype — a different sensor + output (temperature + buzzer, distance + LED) and add a second condition with
else if; and (2) write a one-page engineering report: Problem → Design (Sense/Think/Act) → Build → Test results (what threshold worked) → Next steps. (Prefer software? They can build a data prototype instead — a mini analysis or model with a short report, same structure.) - Low-tech fallback: if devices are limited, build one gadget as a class in shared Tinkercad, taking student directions for the wiring, the
ifdecision, and the threshold to tune.
Vocabulary
| Term | Meaning |
|---|---|
if statement |
Code that decides between options |
| Threshold | The value that triggers an action |
| Prototype | A first working version |
| Debug | Finding and fixing problems |
| Iterate | Test → tweak → test again |
Resources
- Tinkercad Circuits — build, code, and simulate.
- Arduino Project Hub — ideas to make yours cooler.
- Arduino
ifreference — the language guide.
Next session
Block 3 — Competition & Portfolio: the finale — students turn their work into a competition entry, a research paper, and a standout presentation.