By ShilpBot Team · 7 min read · Updated
Every robot, from a hobby line follower to a warehouse arm, does the same three things: it senses its surroundings, decides what to do, and acts. Sensors handle the first step and actuators handle the last. Understanding both is the quickest way to make sense of any robot design.
The sense-think-act loop
A robot runs a continuous cycle. Sensors measure something about the world or about the robot itself. A controller (a microcontroller or computer) reads those measurements and decides on a response. Actuators then carry out that response, which changes the world, and the cycle starts again. A robot vacuum is a good everyday example: bump and cliff sensors detect obstacles, software decides to turn, and the wheel motors execute the turn.
What sensors measure
Sensors fall into two groups. Proprioceptive sensors measure the robot itself, such as wheel rotation, joint angle or battery voltage. Exteroceptive sensors measure the environment, such as distance, light, sound or images.
| Sensor | What it measures | Typical use | Watch out for |
|---|---|---|---|
| Ultrasonic distance sensor | Distance from echo time | Obstacle avoidance | Soft or angled surfaces reflect poorly |
| Infrared reflectance sensor | Surface brightness | Line following | Ambient light changes readings |
| Rotary encoder | Wheel or shaft rotation | Speed and position tracking | Wheel slip causes drift |
| IMU (accelerometer and gyroscope) | Acceleration and rotation rate | Balancing, orientation | Gyro drift builds up over time |
| Camera | Images | Vision tasks | Needs significant processing |
| Limit switch | Contact or end of travel | Homing an arm | Mechanical wear |
Noise and calibration
Real sensor readings are never perfectly clean. Two readings taken a moment apart can differ even when nothing moved. Robots handle this by averaging several readings, applying filters, and calibrating sensors against known references. When a robot behaves strangely, noisy or uncalibrated sensor data is one of the first things to check.
What actuators do
An actuator converts energy, usually electrical, into motion or force. Most small robots use one of three motor types.
| Actuator | How it works | Strength | Limitation |
|---|---|---|---|
| DC motor | Spins freely when powered | Simple and cheap, good for wheels | No built-in position feedback |
| Servo motor | Motor plus feedback, moves to a commanded angle | Easy precise angles | Limited range on hobby servos |
| Stepper motor | Moves in fixed small steps | Precise open-loop positioning | Can lose steps under heavy load |
Larger machines also use hydraulic and pneumatic actuators, which move fluid or compressed air to produce high force, as in construction equipment and some industrial grippers.
Torque, speed and gearing
A motor trades speed for torque through gearing. A geared motor turns slower than a bare motor but pushes much harder. When a wheeled robot stalls on a slope, the usual fix is a higher gear ratio or a stronger motor rather than more battery.
Matching sensors and actuators to a task
Start from the behaviour you want, then work backwards:
- Write the task in one sentence, for example "drive forward until something is 20 cm ahead, then turn."
- List what the robot must know to do it (distance ahead) and what it must be able to do (drive and turn).
- Pick the simplest sensor that provides the information and the simplest actuator that provides the motion.
- Check power: motors draw far more current than sensors and often need a separate supply or motor driver.
Common beginner mistakes
- Powering motors directly from a microcontroller pin. Use a motor driver board instead, because the pin cannot supply enough current.
- Trusting a single sensor reading. Average a few readings or filter them.
- Ignoring mounting. A distance sensor tilted slightly toward the floor will report obstacles that are not there.
What to learn next
Once you understand sensing and acting, the next question is how a robot turns measurements into smooth, stable motion. That is the job of feedback control, covered in Control Loops and PID.
Frequently asked questions
What is the difference between a sensor and an actuator?
A sensor measures something, such as distance, light or rotation, and passes data to the controller. An actuator takes a command from the controller and produces motion or force, such as turning a wheel or moving a joint.
Should a beginner use a servo or a stepper motor?
Hobby servos are the easiest way to get a precise angle, such as for a small arm or a camera mount. Steppers suit applications that need accurate positioning over many rotations, such as 3D printers, but they need a dedicated driver.
Why does my robot need a motor driver?
Microcontroller pins can only supply a few milliamps, while motors draw far more. A motor driver acts as a switch that lets a small control signal switch a much larger current from a separate power source.
