A toy that follows rules, and a test for learning

·

Kids build a small toy that reacts to sound or movement with rules they wrote, then they try to fool it.

Title and one-line promise

Kids will make a physical toy that lights or beeps when a sensor crosses a line they chose, and they will learn the difference between following a rule and learning. A threshold is a rule. Calling it AI does not make it learn.

You need a board, a sensor, and the honesty to name what the toy is doing. No camera and no account.

Learning goals

Kids will be able to:

  • State the rule their toy follows, in one sentence a younger child could repeat.
  • Trick the toy with a case the rule did not really understand, and explain why the trick worked.
  • Say what would have to be different if the toy were actually learning from examples.

Age and time

About 75 minutes. Ages 8 and up do the build. Younger children play the trick-the-toy game while an adult runs the board. Pairs, six to eight kids. Volume stays low.

  • 5–7: The adult handles the board, the sensor and the battery, and kids explore, touch and describe what the toy did: light, beep, nothing.
  • 8–11: Kids build with supervision and follow a simple test routine: cause the trigger, cause a near miss, write the rule.
  • 12–15: Kids plan, measure and document the threshold they picked, and they can use AI for research with an adult nearby.
  • 16+: Kids lead the design, run fair tests and critique their own results when they notice the toy never changed its rule by itself.

Materials

Basic list

  • A microcontroller board you already know how to program at a simple level, or a board you pre-load with “if the sensor is above this number, turn the light on”.
  • A sound sensor or a motion sensor. One is enough.
  • An LED. A buzzer only if you have tested it quietly and can leave it off.
  • A battery pack made for the board, or USB power from the computer.
  • A card that says: “Our rule is: ___.”

Low-cost or reused

Pre-program one board and let pairs swap the threshold card even if they do not edit code. The thinking is in the rule and the trick.

Prepare in advance

Set the buzzer soft or remove it. Do not use a camera and do not record audio. Write a first rule from your own test, such as “If the sound number goes over 200, the light turns on.” Your number will differ.

How to run it

Step 1. Say the rule before the story. The card gets a sentence. If the group cannot say it, they do not have a project yet, they have a gadget. Fill the card.

Step 2. Cause it, on purpose. A clap, a wave, a torch. The light should match the rule. If it does not, use the failure script and change one thing: the threshold, the distance, or the sensor’s aim.

Step 3. Trick it. Ideas: clap softly, rustle paper, wave where the sensor is not looking, cover the sensor, make a sound that is not the one you had in mind. Each trick gets a line: “We did __. The rule said __. The toy did ___.”

Step 4. Ask whether it learned. After five tricks, look at the card. If the sentence is the same, it did not learn. It followed a rule, including when the rule was silly. That is the lesson. Do not upgrade the word to AI to make the toy sound grander.

Step 5. What learning would require. Many examples, a way to change the rule from those examples, and a check on new examples. You will not build that today. Older students can write what they would have to collect, and why they would not record children.

Facilitator script: opening.

“Today we’re going to make a toy that reacts to sound or movement. By the end, I want us to answer one question: is it following a rule we wrote, or is it learning? There are no wrong first tries. We’ll test, notice what happens, and change something.”

Facilitator script: when something fails.

“Great, that didn’t work. What did you expect, and what happened instead? What’s one small thing we could change?”

Facilitator script: using AI live with kids.

“Let’s ask the AI together. First we decide exactly what to ask. Then we read the answer out loud. Then we check it: does it match what we see? Can we find the same information somewhere else? Can an adult confirm it?”

Three questions to ask the kids

  1. Is the toy following rules or learning? Look at the card. If nobody changed the rule from examples, it is following rules. Say that without embarrassment.
  2. How could we trick it? The best tricks sit near the line: almost loud enough, motion in the wrong place. A trick that breaks the sensor is less interesting than a trick that obeys the letter of the rule.
  3. What would it need to do better? Better might mean a clearer rule, a better aim, or a second sensor. “Make it AI” is not a specification. Ask what it should get right that it now gets wrong.

Common mistakes

  • Calling a simple rule “AI”. Use the words on the card. If you want older students to meet a careful definition, use a classroom source you trust and then compare it with the toy in front of you. The toy still does what the card says.
  • A threshold copied from the internet. Your room, your sensor and your clap are different. Set the number from a test you just did.
  • Recording children “so it can learn”. Do not. This project does not need microphones left on or photos of faces.
  • A buzzer that dominates the room. Light first. If you use sound, test it before anyone arrives and keep it soft.
  • Moving the sensor and the threshold at the same time. One change, then a trick again, or you will not know what improved.

Safety first

Keep the volume low. Use low-voltage power only. Do not record children. No cameras, no saved audio, no names on the card. If a battery or board feels hot, stop and remove the power. Do not open speakers or borrow a high-powered amp to “hear it better”. The LED is the output that scales to a full room without hurting anyone’s ears.

Safety comes first. An adult supervises every session. Check tools, batteries, heat and sharp edges before kids touch them. If a project feels unsafe for the age group, simplify it or skip it. Never let anyone solder, use hot tools, or handle mains electricity without proper supervision and training.

Sensors on cables can poke. Tape them to the table. Children do not wear the toy as a headset.

Finding answers with AI

Teach this routine for checking any answer: Ask, read, test, compare, confirm. If an answer affects safety, an adult makes the final call. Recording people is that kind of answer. The decision is not to record.

Sample prompt:

“I’m 12 and building a toy with a microcontroller, a sound sensor and an LED. Our rule is: if the sound number is high, the light turns on. Explain the difference between following that rule and learning in simple words. Give me two ways to test your answer, and tell me what could go wrong.”

One thing to check. After you read the answer, look at your card and your log of tricks. If the AI calls your toy learning, and the rule never changed from examples, the AI is wrong about your project. Trust the card. You can compare the wording with a definition in a book or a lesson you already use, then come back to the same test: did the rule change because of examples, or did a person edit it?

AI can help you find answers fast, but it doesn’t know everything. It can be wrong, outdated, or confidently mistaken. Treat its answers as a starting point. Check them against a trusted source, test them in real life, and ask an adult when safety is involved. Don’t share names, photos, addresses or school details with an AI tool.

Questions? Reach out.

Stuck or unsure? Send your question to eran@goldmanmalka.com, or search for it live with an AI tool and check the answer using the routine above.

If you want people who already run sessions like this, start with Code Club Luxembourg and STEM.lu. The Code Club network, from the Raspberry Pi Foundation, publishes club formats you can adapt. There is more about school and club work on the about page.