← Introduction to Robotics: Build, Code, Create
Free lesson

The Sense-Think-Act Loop

One Loop, Every Robot

Every robot — from a robot vacuum to a Mars rover — repeats the same three-step loop, often many times per second:

SENSE → THINK → ACT → (back to SENSE)

Let's break down a real example: a robot vacuum cleaner.

Sense

The vacuum has sensors on its bumper (touch), sometimes a camera or laser scanner (to see the room), and a sensor on its underside (to detect stairs so it doesn't fall). Every fraction of a second, it's checking: "Did I just bump into something? Is there a drop-off below me?"

Think

The vacuum's tiny computer takes that sensor information and makes a decision using rules a programmer wrote, such as: "If the bumper sensor is pressed, back up and turn." "If the floor sensor detects a drop-off, stop and turn the other way." This decision-making is called logic, and it's just a set of if-this-then-that rules.

Act

The vacuum turns its wheel motors to actually back up, or turn, or keep going straight. This is the only part of the loop the vacuum's OWNER ever notices — but it's the smallest of the three jobs.

Why It's a Loop, Not a One-Time Thing

The vacuum doesn't sense once, think once, and act once. It repeats this loop constantly — sensing, thinking, and acting dozens of times per second, which is why it can react instantly to a bump instead of getting stuck.

Matching Parts to Jobs

As you build robots in this course, every physical part you add does ONE of these three jobs:

JobRobot Parts That Do It
SenseLight sensors, distance sensors, touch sensors, microphones
ThinkThe microcontroller (the robot's tiny brain — we'll meet it in Module 4)
ActMotors, LEDs, speakers, servos

Key Takeaway

Whenever you're confused about what a part does or why a piece of code exists, ask: "Is this sensing, thinking, or acting?" That question alone will make the rest of this course click into place.

Enjoying it?

Sign up free to carry on with the course, with an AI tutor to help you.

Continue the course