A sensor opens the door: “if — then” logic

A ball rolls down a ramp and bumps a sensor, which turns green and removes the support under a second ball. Built from blocks.

2D Age 8+10 min Logic & robotsMomentum & collisions
A sensor opens the door: “if — then” logic
Loading simulation…

Press “Run”. Bodies move by the laws of physics: gravity, friction, elasticity.

What the experiment shows

Robots follow rules: “if the sensor fires — do an action”. Here the condition is a touch, the actions are a colour change and the support disappearing.

How to run it

  1. Open the “Logic” tab on the left and read the rule.
  2. Press “Run” and wait for the sensor touch.
  3. Change the condition to “key is pressed” and open the door yourself.

Questions to discuss

  • What is the sensor and what is the actuator in this chain?
  • How to open the door only when both balls arrive?

The science

Automation is made of conditions and actions: a sensor measures, a rule decides, an actuator acts. Shop doors, traffic lights and robot vacuums work this way.

Try it at home

Set up dominoes so that the last one hits a lamp switch.

What to change in the editor

  • Add a second rule: when the sensor fires, push the prize ball.