Hiring Partners
Segilola Resources Operating LimitedTaviatech TechnologiesFCMBMTN NigeriaAdvans La Fayette Microfinance BankAboki AfricaFirst Bank of NigeriaOPay
← Fundamentals of Robotics Level Two · Lesson 3 of 8

Sensors and Perception

📖 Every lesson in this course is free to read right here, no account needed. Create a free account to track your progress, take the exam, and earn your certificate.
3
Fundamentals of Robotics Level Two — Module Two: Sensors and Perception

Module Two: Sensors and Perception

Fundamentals of Robotics — Level Two


Module Introduction

Welcome to Module Two! In Module One, you learned how to write programs for robots. You learned about variables, decisions, loops, and sub-programs. You learned how to give your robot clear instructions.

But there is a problem. A robot that only follows instructions is blind. It cannot see. It cannot hear. It cannot feel. It just does what it was told, even if something is in the way.

Imagine you are walking to school with your eyes closed. You would bump into everything! You need your eyes to see where you are going. You need your ears to hear cars coming. You need your skin to feel if something is hot.

Robots are the same. They need sensors to understand the world around them. Sensors are like a robot's eyes, ears, and skin. They help the robot perceive — that means to notice and understand — what is happening around it.

In this module, you will learn about different types of sensors. You will learn how they work. You will learn how to use them in your programs. You will learn how to make your robot react to the world.

This is where robotics becomes really exciting. Your robot will stop being a machine that just follows orders. It will start being a machine that responds to its environment.

Let us begin!


Learning Objectives

By the end of this module, you will be able to:

  1. Explain what a sensor is and why robots need them.
  2. Describe what perception means in robotics.
  3. Identify different types of sensors: touch, ultrasonic, light, sound, and more.
  4. Understand how each sensor works in simple terms.
  5. Write programs that use sensor readings to make decisions.
  6. Use touch sensors to detect collisions.
  7. Use ultrasonic sensors to measure distance.
  8. Use light sensors to follow lines and detect edges.
  9. Use sound sensors to react to noise.
  10. Combine multiple sensors for better robot behaviour.
  11. Apply sensor knowledge to real-life Nigerian examples.
  12. Debug sensor-related problems in robot programs.
  13. Design a robot that uses at least two sensors.
  14. Work in a group to solve a sensor-based challenge.
  15. Create a mini project that demonstrates sensor use.

Warm-Up Story: Emeka and the Blind Robot

Once upon a time, in the city of Aba, Nigeria, there lived a boy named Emeka. Emeka loved building things. His favourite project was a small robot named Nneka.

Nneka was a simple robot. She had two wheels, a small motor, and a computer brain. Emeka could program Nneka to move forward, backward, left, and right.

One day, Emeka decided to show Nneka to his friends. He put Nneka on the floor and pressed START. Nneka began to move forward. She moved straight. She moved fast. She moved proudly.

Then — BANG! Nneka hit the wall. She kept pushing against the wall. Her wheels spun. Her motor made a loud noise. She did not stop. She did not turn. She just kept pushing.

Emeka's friends laughed. "Your robot is blind!" they said.

Emeka felt sad. But then he thought, "They are right. Nneka is blind. She cannot see the wall. She cannot feel the wall. She just follows instructions."

Emeka went home and thought about the problem. How could he make Nneka see? How could he make her feel?

The next day, Emeka went to the market with his father. He saw many things: a trader touching tomatoes to check if they were ripe, a driver looking at the road, a woman listening for her phone ringing.

"Everyone uses their senses," Emeka thought. "Eyes to see, ears to hear, skin to feel. Maybe I can give Nneka senses too."

Emeka went to a computer shop and bought a small touch sensor. It was like a button. When something pressed it, it sent a signal to the robot's brain.

He attached the touch sensor to the front of Nneka. Then he wrote a new program:

Step 1: Move forward
Step 2: IF touch sensor is pressed, THEN stop and turn right
Step 3: Repeat from Step 1

He uploaded the program and pressed START. Nneka began to move forward. She moved toward the wall. She touched the wall. The touch sensor was pressed. Nneka stopped. She turned right. She moved forward again. She avoided the wall!

Emeka's friends were amazed. "Nneka can feel!" they shouted.

Emeka smiled. He had given his robot a sense. He had made Nneka perceive the world.

That is what you will learn in this module. You will learn how to give your robot senses. You will learn how to make your robot perceive the world.

Let us begin!


Lesson 1: What Is a Sensor?

Definition

A sensor is a device that detects something in the environment and sends that information to the robot's brain.

Why It Is Important

Without sensors, a robot is blind and deaf. It cannot react to anything. It just follows its program, even if something goes wrong. Sensors give robots the ability to sense the world and make better decisions.

Simple Explanation

Think of your five senses: sight, hearing, touch, taste, and smell. These senses tell you what is happening around you. A sensor is like a robot's sense. It tells the robot what is happening around it.

Real-Life Example

Your phone has sensors. It has a light sensor that adjusts the screen brightness. It has a motion sensor that knows when you turn the phone.

School Example

A fire alarm has a smoke sensor. When it detects smoke, it makes a loud noise.

Home Example

A refrigerator has a temperature sensor. It knows when the fridge is too warm, so it turns on the cooling system.

Nigerian Example

A generator has a fuel sensor. When the fuel is low, it warns you to buy more fuel.

Illustration

Sensor in a Robot

+-------------------+
|   Environment     |
|   (world)         |
+-------------------+
         |
         | (something happens)
         V
+-------------------+
|   Sensor          |
|   detects it      |
+-------------------+
         |
         | (sends signal)
         V
+-------------------+
|   Robot Brain     |
|   decides what    |
|   to do           |
+-------------------+
         |
         V
+-------------------+
|   Robot acts      |
+-------------------+

Mini Summary

A sensor is a device that detects something in the environment. It sends information to the robot's brain. Sensors give robots the ability to sense the world.


Lesson 2: What Is Perception?

Definition

Perception is the process of using sensors to understand the world. It is how a robot makes sense of what its sensors tell it.

Why It Is Important

A sensor alone is not enough. The robot must also understand what the sensor means. For example, a touch sensor detects a press. But the robot must understand that the press means "there is an obstacle." That understanding is perception.

Simple Explanation

Imagine you touch a hot pot. Your skin senses heat. But your brain perceives danger. It tells you to pull your hand away. The sensor is your skin. The perception is your brain understanding the danger.

Real-Life Example

When you see dark clouds, your eyes sense the clouds. Your brain perceives that it might rain. You decide to take an umbrella.

School Example

When you hear the school bell, your ears sense the sound. Your brain perceives that it is time for break. You decide to go outside.

Home Example

When you smell burning food, your nose senses the smell. Your brain perceives that the food is burning. You decide to turn off the cooker.

Nigerian Example

When a driver hears a horn behind him, his ears sense the sound. His brain perceives that another car wants to overtake. He decides to move aside.

Illustration

Perception Process

+-------------+
|   Sensor    |
|   detects   |
+-------------+
       |
       V
+-------------+
|   Robot     |
|   brain     |
|   understands|
+-------------+
       |
       V
+-------------+
|   Robot     |
|   decides   |
+-------------+
       |
       V
+-------------+
|   Robot     |
|   acts      |
+-------------+

Mini Summary

Perception is how a robot understands what its sensors detect. It is the bridge between sensing and acting.


Lesson 3: Touch Sensors — Feeling the World

Definition

A touch sensor (also called a bump sensor) detects when something presses against it. It is like a button.

Why It Is Important

Touch sensors help robots detect collisions. When a robot bumps into something, the touch sensor sends a signal. The robot can then stop or turn.

Simple Explanation

Think of a doorbell. When you press it, it makes a sound. A touch sensor works the same way. When something presses it, it sends a signal.

Real-Life Example

Your phone screen is a touch sensor. When you tap an app, the screen senses your touch and opens the app.

School Example

A computer keyboard has touch sensors. When you press a key, the keyboard senses it and sends the letter to the computer.

Home Example

A light switch is a touch sensor. When you press it, it senses your touch and turns the light on or off.

Nigerian Example

A car horn is a touch sensor. When you press it, it senses your touch and makes a sound.

Illustration

Touch Sensor

+-------------------+
|   Robot           |
|   +-----------+   |
|   |  Touch    |   |
|   |  Sensor   |   |
|   +-----------+   |
+-------------------+
         |
         | (robot moves forward)
         V
+-------------------+
|   Wall            |
+-------------------+
         |
         | (sensor is pressed)
         V
+-------------------+
|   Signal sent to  |
|   robot brain     |
+-------------------+
         |
         V
+-------------------+
|   Robot stops     |
|   or turns        |
+-------------------+

Mini Summary

A touch sensor detects when something presses it. It helps robots detect collisions and react to obstacles.


Lesson 4: Ultrasonic Sensors — Measuring Distance

Definition

An ultrasonic sensor uses sound waves to measure distance. It sends out a sound wave and waits for it to bounce back. The time it takes tells the robot how far away something is.

Why It Is Important

Ultrasonic sensors help robots avoid obstacles from a distance. The robot does not need to touch the obstacle. It can sense it from far away and change direction.

Simple Explanation

Imagine you are in a big empty room. You shout "HELLO!" and wait for the echo. If the echo comes back quickly, the wall is close. If the echo takes a long time, the wall is far. Ultrasonic sensors work the same way, but with sound waves that humans cannot hear.

Real-Life Example

Bats use ultrasonic sound to navigate in the dark. They send out sound waves and listen for the echo. That is how they know where obstacles are.

School Example

Some cars have parking sensors. They use ultrasonic waves to detect how close the car is to the wall.

Home Example

Some vacuum cleaners are robots. They use ultrasonic sensors to avoid bumping into furniture.

Nigerian Example

A car reversing in a tight parking space in Lagos uses ultrasonic sensors to avoid hitting other cars.

Illustration

Ultrasonic Sensor

+-------------------+
|   Robot           |
|   +-----------+   |
|   | Ultrasonic|   |
|   | Sensor    |   |
|   +-----------+   |
+-------------------+
         |
         | (sends sound wave)
         V
+-------------------+
|   Obstacle        |
+-------------------+
         |
         | (sound wave bounces back)
         V
+-------------------+
|   Robot receives  |
|   echo            |
+-------------------+
         |
         | (calculates distance)
         V
+-------------------+
|   Robot knows     |
|   how far away    |
+-------------------+

Mini Summary

An ultrasonic sensor uses sound waves to measure distance. It helps robots avoid obstacles from far away.


Lesson 5: Light Sensors — Seeing Brightness

Definition

A light sensor detects the amount of light in the environment. It can tell if it is bright or dark.

Why It Is Important

Light sensors help robots follow lines, detect edges, and react to changes in light. They are very useful in line-following robots.

Simple Explanation

Think of your eyes. When you enter a dark room, your eyes adjust. When you go outside in the sun, your eyes squint. A light sensor does the same thing. It measures how much light is around.

Real-Life Example

Street lights turn on automatically when it gets dark. They use light sensors.

School Example

Some classrooms have automatic lights. When the room is bright, the lights stay off. When it gets dark, the lights turn on.

Home Example

Your phone screen adjusts its brightness based on the light around you. It uses a light sensor.

Nigerian Example

Solar panels use light sensors to know when the sun is shining. They store energy during the day.

Illustration

Light Sensor

+-------------------+
|   Robot           |
|   +-----------+   |
|   |  Light    |   |
|   |  Sensor   |   |
|   +-----------+   |
+-------------------+
         |
         | (detects light level)
         V
+-------------------+
|   Bright or dark? |
+-------------------+
       /       \
     BRIGHT    DARK
     /           \
    V             V
+---------+   +---------+
| Robot   |   | Robot   |
| follows |   | stops   |
| line    |   |         |
+---------+   +---------+

Mini Summary

A light sensor detects brightness. It helps robots follow lines and react to light changes.


Lesson 6: Sound Sensors — Hearing the World

Definition

A sound sensor (also called a microphone sensor) detects sound. It can tell if there is noise and how loud it is.

Why It Is Important

Sound sensors help robots react to claps, voices, or other sounds. They can be used to start a robot with a clap or stop it with a loud noise.

Simple Explanation

Think of your ears. When someone claps, your ears hear it. Your brain understands that it is a clap. A sound sensor does the same thing. It detects sound and sends a signal to the robot's brain.

Real-Life Example

Some toys clap-activated. When you clap, they move or make a sound. They use sound sensors.

School Example

The school bell is like a sound sensor for students. When it rings, students know it is time for break or assembly.

Home Example

Some televisions can be controlled by voice. They use sound sensors to hear your commands.

Nigerian Example

A clap-activated light in a compound uses a sound sensor. When you clap, the light turns on.

Illustration

Sound Sensor

+-------------------+
|   Robot           |
|   +-----------+   |
|   |  Sound    |   |
|   |  Sensor   |   |
|   +-----------+   |
+-------------------+
         |
         | (detects sound)
         V
+-------------------+
|   Was there a     |
|   clap?           |
+-------------------+
       /       \
     YES        NO
     /           \
    V             V
+---------+   +---------+
| Robot   |   | Robot   |
| starts  |   | waits   |
+---------+   +---------+

Mini Summary

A sound sensor detects noise. It helps robots react to claps, voices, and other sounds.


Lesson 7: Colour Sensors — Seeing Colours

Definition

A colour sensor detects colours. It can tell the difference between red, green, blue, and other colours.

Why It Is Important

Colour sensors help robots sort objects by colour. They can also be used in line-following robots that follow coloured lines.

Simple Explanation

Think of a traffic light. Red means stop. Green means go. A colour sensor can detect these colours and tell the robot what to do.

Real-Life Example

Some factories use colour sensors to sort fruits. Red apples go in one box. Green apples go in another.

School Example

In art class, you sort crayons by colour. A colour sensor can do that automatically.

Home Example

A washing machine can sort clothes by colour using a colour sensor. It separates white clothes from coloured clothes.

Nigerian Example

A tomato sorting machine in a market uses colour sensors to separate ripe red tomatoes from unripe green ones.

Illustration

Colour Sensor

+-------------------+
|   Robot           |
|   +-----------+   |
|   |  Colour   |   |
|   |  Sensor   |   |
|   +-----------+   |
+-------------------+
         |
         | (detects colour)
         V
+-------------------+
|   What colour?    |
+-------------------+
       /       \
     RED        GREEN
     /           \
    V             V
+---------+   +---------+
| Robot   |   | Robot   |
| stops   |   | goes    |
+---------+   +---------+

Mini Summary

A colour sensor detects colours. It helps robots sort objects and follow coloured lines.


Lesson 8: Distance Sensors — Knowing How Far

Definition

A distance sensor measures how far away an object is. Ultrasonic sensors are one type of distance sensor. There are also infrared (IR) distance sensors.

Why It Is Important

Distance sensors help robots navigate. They can tell if an obstacle is near or far. This helps the robot decide whether to slow down, stop, or turn.

Simple Explanation

Imagine you are playing a game where you must guess how far a tree is. You look at the tree and estimate. A distance sensor does the same thing, but with more accuracy.

Real-Life Example

Some cars have sensors that beep when you are too close to another car. They use distance sensors.

School Example

A measuring tape is like a distance sensor. It tells you how long something is.

Home Example

A laser measure tool uses a distance sensor to tell you how wide a room is.

Nigerian Example

A danfo driver uses his eyes as distance sensors. He looks at the car in front and decides if he is too close.

Illustration

Distance Sensor

+-------------------+
|   Robot           |
|   +-----------+   |
|   | Distance  |   |
|   | Sensor    |   |
|   +-----------+   |
+-------------------+
         |
         | (measures distance)
         V
+-------------------+
|   How far away?   |
+-------------------+
       /       \
     NEAR       FAR
     /           \
    V             V
+---------+   +---------+
| Robot   |   | Robot   |
| stops   |   | moves   |
+---------+   +---------+

Mini Summary

A distance sensor measures how far away an object is. It helps robots navigate and avoid obstacles.


Lesson 9: Combining Sensors — Better Perception

Definition

Sensor fusion means using multiple sensors together to get a better understanding of the world.

Why It Is Important

One sensor alone can be confused. A touch sensor only knows when something touches it. An ultrasonic sensor only knows distance. But if you combine them, the robot can understand much more.

Simple Explanation

Think of crossing a road. You use your eyes to see cars. You use your ears to hear cars. You use both senses together to decide when it is safe to cross. That is sensor fusion.

Real-Life Example

A self-driving car uses many sensors: cameras, ultrasonic sensors, radar, and GPS. It combines all of them to drive safely.

School Example

When you study for an exam, you use your eyes to read and your ears to listen. You combine both to learn better.

Home Example

When cooking, you use your eyes to see the food and your nose to smell it. You combine both to know when it is ready.

Nigerian Example

A trader at the market uses her eyes to see customers and her ears to hear them. She combines both to serve them better.

Illustration

Sensor Fusion

+-------------+     +-------------+
| Touch       |     | Ultrasonic  |
| Sensor      |     | Sensor      |
+-------------+     +-------------+
       \               /
        \             /
         V           V
      +-------------------+
      |   Robot Brain     |
      |   combines both   |
      +-------------------+
               |
               V
      +-------------------+
      |   Better decision |
      +-------------------+

Mini Summary

Sensor fusion means using multiple sensors together. It gives the robot a better understanding of the world.


Lesson 10: Writing Programs That Use Sensors

Definition

A sensor program is a program that reads sensor data and makes decisions based on that data.

Why It Is Important

Sensors are only useful if the robot can react to them. A sensor program tells the robot what to do when a sensor detects something.

Simple Explanation

Imagine you have a touch sensor on your robot. You write a program that says: IF the touch sensor is pressed, THEN stop and turn. That is a sensor program.

Real-Life Example

A doorbell program: IF the button is pressed, THEN play a sound. That is a sensor program.

School Example

A fire alarm program: IF smoke is detected, THEN sound the alarm. That is a sensor program.

Home Example

A fridge program: IF temperature is too high, THEN turn on cooling. That is a sensor program.

Nigerian Example

A generator program: IF fuel is low, THEN show warning light. That is a sensor program.

Illustration

Sensor Program Flow

[ Start ]
    |
    V
[ Read sensor ]
    |
    V
[ Is sensor triggered? ]
    /        \
  YES         NO
  /            \
 V              V
[ Act ]      [ Continue ]
  \            /
   \          /
    V        V
[ Repeat ]

Mini Summary

A sensor program reads sensor data and makes decisions. It tells the robot how to react to the world.


Lesson 11: Calibrating Sensors

Definition

Calibration means adjusting a sensor so it works correctly. It means setting the sensor to understand what is normal.

Why It Is Important

Sensors can be confused. A light sensor might think a shadow is total darkness. Calibration helps the sensor understand the difference between normal light and darkness.

Simple Explanation

Imagine you get a new pair of glasses. At first, everything looks blurry. You adjust them until you can see clearly. That is calibration.

Real-Life Example

When you set an alarm clock, you are calibrating it to wake you at the right time.

School Example

When you adjust the volume on a radio, you are calibrating the sound.

Home Example

When you adjust the temperature on an air conditioner, you are calibrating it to the right coolness.

Nigerian Example

When you tune your radio to a station, you are calibrating it to get clear sound.

Illustration

Calibration Process

[ Sensor gives wrong reading ]
         |
         V
[ Adjust sensor settings ]
         |
         V
[ Test again ]
         |
         V
[ Does it work? ]
     /       \
   NO         YES
   /           \
  V             V
[Adjust]     [Done!]

Mini Summary

Calibration means adjusting a sensor so it works correctly. It helps sensors understand normal conditions.


Lesson 12: Sensor Ranges and Thresholds

Definition

A range is the distance or value a sensor can detect. A threshold is the point where the robot decides something has happened.

Why It Is Important

Every sensor has limits. An ultrasonic sensor might only detect objects up to 4 metres away. A light sensor might only detect a certain range of brightness. Understanding ranges and thresholds helps you write better programs.

Simple Explanation

Imagine you can only see things that are less than 10 metres away. That is your range. If something is 11 metres away, you cannot see it. A threshold is like deciding: "If something is closer than 2 metres, I will stop."

Real-Life Example

Your eyes have a range. You cannot see things that are too far away. You cannot see things that are too small.

School Example

Your ears have a range. You cannot hear sounds that are too quiet. You cannot hear sounds that are too high-pitched.

Home Example

Your nose has a range. You can smell food in the kitchen, but not food in your neighbour's house.

Nigerian Example

A trader's voice has a range. She can call customers near her stall, but not across the whole market.

Illustration

Sensor Range and Threshold

Sensor Range: 0 to 4 metres

0m        1m        2m        3m        4m
|---------|---------|---------|---------|
    NEAR      OK       FAR      TOO FAR

Threshold: 2 metres
If distance < 2m, robot stops.
If distance >= 2m, robot moves.

Mini Summary

Range is how far a sensor can detect. Threshold is the point where the robot decides to act. Both are important for good programming.


Lesson 13: Common Sensor Problems

Definition

Sensor problems are issues that cause sensors to give wrong readings or fail to work.

Why It Is Important

If a sensor gives wrong information, the robot will make wrong decisions. It might stop when it should move, or move when it should stop. Understanding common problems helps you fix them.

Common Problems

Problem Cause Solution
Sensor gives no reading Loose wire or dead battery Check connections and power
Sensor gives wrong reading Needs calibration Recalibrate the sensor
Sensor is too sensitive Threshold is too low Increase threshold
Sensor is not sensitive enough Threshold is too high Decrease threshold
Sensor is affected by noise Environmental interference Move sensor or add filtering

Real-Life Example

If your phone screen is cracked, the touch sensor may not work. You need to fix or replace it.

School Example

If a microphone is too far from the speaker, it may not pick up sound well. You need to move it closer.

Home Example

If a smoke detector keeps beeping even when there is no smoke, it may need cleaning or new batteries.

Nigerian Example

If a generator's fuel sensor is faulty, it may show full when the tank is empty. You need to repair or replace the sensor.

Illustration

Sensor Problem Example

[ Sensor gives wrong reading ]
         |
         V
[ Check connections ]
         |
         V
[ Check power ]
         |
         V
[ Recalibrate ]
         |
         V
[ Test again ]
         |
         V
[ Works? ]
   /    \
 YES     NO
 /        \
V          V
[Done]  [Replace sensor]

Mini Summary

Sensors can have problems. Common issues include loose wires, wrong calibration, and incorrect thresholds. Learning to fix these problems is part of robotics.


Lesson 14: Sensors in Real Robots

Definition

Real robots use many sensors together to do complex tasks.

Why It Is Important

Understanding how real robots use sensors helps you design your own robots better.

Examples of Real Robots and Their Sensors

Robot Sensors Used Purpose
Vacuum Robot Touch, ultrasonic, cliff sensors Avoid obstacles, detect stairs
Self-Driving Car Camera, radar, ultrasonic, GPS Navigate roads, avoid accidents
Mars Rover Camera, temperature, radiation Explore Mars, collect data
Surgical Robot Force sensors, cameras Perform precise surgery
Drone Gyroscope, accelerometer, GPS Fly stably, navigate

Real-Life Example

A robot vacuum cleaner uses touch sensors to know when it bumps into a chair. It uses cliff sensors to know when it is near stairs.

School Example

A school science project robot might use a light sensor to follow a black line on a white board.

Home Example

A robotic toy uses sound sensors to respond to claps.

Nigerian Example

A Nigerian-made robot used in a university might use ultrasonic sensors to navigate a maze.

Illustration

Real Robot: Vacuum Cleaner

+-------------------+
|   Robot Vacuum    |
|   +-----------+   |
|   | Touch     |   |
|   | Sensor    |   |
|   +-----------+   |
|   +-----------+   |
|   | Ultrasonic|   |
|   | Sensor    |   |
|   +-----------+   |
|   +-----------+   |
|   | Cliff     |   |
|   | Sensor    |   |
|   +-----------+   |
+-------------------+
         |
         V
  Cleans floor safely

Mini Summary

Real robots use many sensors together. Each sensor helps the robot understand a different part of the world.


Lesson 15: Designing a Sensor-Based Robot

Definition

Designing a sensor-based robot means choosing the right sensors and writing programs that use them.

Why It Is Important

Not all sensors are right for all tasks. You must choose the best sensor for the job.

Steps in Designing a Sensor-Based Robot

  1. Decide what the robot needs to do.
  2. Identify what the robot needs to sense.
  3. Choose the right sensors.
  4. Mount the sensors on the robot.
  5. Write programs that read the sensors.
  6. Test the robot.
  7. Fix any problems.
  8. Improve the design.

Real-Life Example

If you want a robot to follow a line, you need a light sensor. If you want a robot to avoid walls, you need an ultrasonic sensor.

School Example

If you want a robot to sort coloured balls, you need a colour sensor.

Home Example

If you want a robot to open the door when someone claps, you need a sound sensor.

Nigerian Example

If you want a robot to help farmers detect ripe tomatoes, you need a colour sensor.

Illustration

Sensor-Based Robot Design

[ What should robot do? ]
         |
         V
[ What must it sense? ]
         |
         V
[ Choose sensors ]
         |
         V
[ Mount sensors ]
         |
         V
[ Write program ]
         |
         V
[ Test and improve ]

Mini Summary

Designing a sensor-based robot means choosing the right sensors for the job and writing programs that use them.


Key Vocabulary

Word Simple Definition
Sensor A device that detects something in the environment.
Perception Understanding what sensors detect.
Touch Sensor A sensor that detects when something presses it.
Ultrasonic Sensor A sensor that uses sound waves to measure distance.
Light Sensor A sensor that detects brightness.
Sound Sensor A sensor that detects noise.
Colour Sensor A sensor that detects colours.
Distance Sensor A sensor that measures how far away something is.
Sensor Fusion Using multiple sensors together.
Calibration Adjusting a sensor so it works correctly.
Range How far a sensor can detect.
Threshold The point where the robot decides to act.
Sensor Program A program that reads sensor data and makes decisions.

Important Concepts

  1. Sensors are like senses: They help robots see, hear, and feel.
  2. Perception is understanding: It is how the robot makes sense of sensor data.
  3. Different sensors for different jobs: Touch, ultrasonic, light, sound, and colour sensors each have a purpose.
  4. Sensor fusion is powerful: Combining sensors gives better understanding.
  5. Calibration is important: Sensors need to be adjusted to work correctly.
  6. Ranges and thresholds matter: Every sensor has limits. The robot must know when to act.
  7. Sensor programs make robots react: Programs read sensor data and decide what to do.
  8. Problems can happen: Sensors can fail or give wrong readings. Debugging is important.
  9. Real robots use many sensors: They combine sensors for complex tasks.
  10. Design starts with the task: Choose sensors based on what the robot needs to do.

Step-by-Step Explanations

How to Write a Sensor Program

  1. Choose your sensor. Example: touch sensor.
  2. Mount the sensor on the robot. Example: attach it to the front.
  3. Write a program that reads the sensor. Example: "Read touch sensor."
  4. Add a decision. Example: "IF touch sensor is pressed, THEN stop."
  5. Add an action. Example: "Turn right."
  6. Test the program. Run the robot and see what happens.
  7. Fix any problems. Adjust the sensor or the program.
  8. Test again. Repeat until it works correctly.

Real-Life Examples

Concept Real-Life Example
Sensor Your phone's light sensor adjusts screen brightness.
Perception You see dark clouds and perceive that it might rain.
Touch Sensor A doorbell button detects your press.
Ultrasonic Sensor Bats use sound waves to navigate in the dark.
Light Sensor Street lights turn on automatically when it gets dark.
Sound Sensor Clap-activated toys respond to sound.
Colour Sensor Factories sort fruits by colour.
Distance Sensor Cars beep when you are too close to another car.
Sensor Fusion Self-driving cars use many sensors together.

Nigerian Examples

Concept Nigerian Example
Sensor A generator's fuel sensor warns when fuel is low.
Perception A driver hears a horn and perceives another car wants to overtake.
Touch Sensor A car horn responds when you press it.
Ultrasonic Sensor A car reversing in Lagos uses parking sensors.
Light Sensor Solar panels use light sensors to know when the sun is shining.
Sound Sensor A clap-activated light in a compound.
Colour Sensor A tomato sorting machine separates ripe and unripe tomatoes.
Distance Sensor A danfo driver uses his eyes to judge distance.
Sensor Fusion A trader uses eyes and ears to serve customers.

Fun Examples Children Can Relate To

  • Sensor: Your game controller senses when you press a button.
  • Perception: Your game character sees an enemy and knows to attack.
  • Touch Sensor: A dance pad senses your footsteps.
  • Ultrasonic Sensor: A robot vacuum uses sound to avoid furniture.
  • Light Sensor: Your phone screen dims when you cover the top.
  • Sound Sensor: A toy that moves when you clap.
  • Colour Sensor: A game that sorts coloured blocks.
  • Distance Sensor: A drone that avoids trees.
  • Sensor Fusion: A VR headset uses many sensors to track your head.

Everyday Examples

Concept Everyday Example
Sensor Your phone's fingerprint sensor unlocks the phone.
Perception You smell food and know it is ready.
Touch Sensor A light switch responds to your touch.
Ultrasonic Sensor A car parking sensor beeps when you are close.
Light Sensor Your phone screen adjusts brightness automatically.
Sound Sensor A baby monitor picks up sounds.
Colour Sensor A washing machine sorts clothes by colour.
Distance Sensor A measuring tape tells you how long something is.

Parent Tips

  1. Explore sensors at home. Show your child the sensors in your phone, TV, and car.
  2. Ask questions. "How does the doorbell know you pressed it?"
  3. Encourage observation. Ask your child to notice sensors in everyday life.
  4. Build together. If possible, get a simple robot kit with sensors.
  5. Be patient. Learning about sensors takes time.
  6. Connect to Nigerian life. Use examples from markets, buses, and home.
  7. Watch videos. Find kid-friendly videos about sensors and robots.
  8. Celebrate mistakes. Let your child know that mistakes are part of learning.
  9. Ask "what if" questions. "What if the sensor was dirty? What would happen?"
  10. Have fun. Learning should be enjoyable.

Interesting Facts

  1. Bats use ultrasonic sensors (echolocation) to navigate in the dark.
  2. Your phone has more than 10 different sensors inside it.
  3. The Mars rover uses sensors to study rocks and soil.
  4. Some robots can sense human emotions using cameras and sound sensors.
  5. A self-driving car can have over 100 sensors.
  6. Ultrasonic sensors are used in hospitals to take pictures of unborn babies.
  7. Some robots can smell using chemical sensors.
  8. Light sensors are used in solar panels to track the sun.
  9. Touch sensors are used in ATMs to detect when you press buttons.
  10. Sound sensors are used in noise-cancelling headphones.

Did You Know?

  • Did you know that a robot can "see" using a camera sensor and computer vision?
  • Did you know that sensors can detect things humans cannot, like infrared light?
  • Did you know that some robots use GPS sensors to know where they are?
  • Did you know that sensors can be as small as a grain of sand?
  • Did you know that a robot's sensor can be affected by weather?
  • Did you know that sensor fusion is used in smartphones for navigation?
  • Did you know that sensors can help robots learn from their environment?
  • Did you know that some sensors use lasers to measure distance?
  • Did you know that sensors are used in space to detect radiation?
  • Did you know that sensor technology is improving every year?

Remember This

  • A sensor detects something in the environment.
  • Perception is understanding what sensors detect.
  • Touch sensors detect physical contact.
  • Ultrasonic sensors measure distance using sound.
  • Light sensors detect brightness.
  • Sound sensors detect noise.
  • Colour sensors detect colours.
  • Distance sensors measure how far away something is.
  • Sensor fusion means using multiple sensors together.
  • Calibration means adjusting a sensor to work correctly.
  • Range is how far a sensor can detect.
  • Threshold is the point where the robot decides to act.
  • Sensor programs read sensor data and make decisions.

Common Mistakes

Mistake Why It Is Wrong How to Fix It
Not calibrating sensors Sensor gives wrong readings. Calibrate before use.
Using the wrong sensor The robot cannot do the task. Choose the right sensor for the job.
Ignoring sensor range The robot misses obstacles far away. Know the sensor's range.
Setting thresholds wrong Robot reacts too early or too late. Adjust thresholds carefully.
Not testing sensors Problems go unnoticed. Test sensors before using them.
Mounting sensors poorly Sensors cannot detect correctly. Mount sensors in the right position.

Best Practices

  1. Choose the right sensor. Match the sensor to the task.
  2. Calibrate sensors. Adjust them before use.
  3. Know the range. Understand how far the sensor can detect.
  4. Set good thresholds. Make sure the robot reacts at the right time.
  5. Test sensors. Check them before using them in a program.
  6. Mount sensors properly. Position them where they can detect best.
  7. Use sensor fusion. Combine sensors for better perception.
  8. Debug sensor problems. Find and fix issues quickly.
  9. Keep sensors clean. Dirt can affect readings.
  10. Document your work. Write down what sensors you used and why.

More ASCII Illustrations and Diagrams

Diagram: How Sensors Connect to a Robot

+-------------------+
|   Robot Brain     |
|   (computer)      |
+-------------------+
    |    |    |    |
    |    |    |    |
    V    V    V    V
+-----+ +-----+ +-----+ +-----+
|Touch| |Ultra| |Light| |Sound|
|Sens | |Sonic| |Sens | |Sens |
+-----+ +-----+ +-----+ +-----+

Flowchart: Robot Using Touch Sensor

        ( Start )
            |
            V
    +----------------+
    | Move forward   |
    +----------------+
            |
            V
    +----------------+
    | Touch sensor   |
    | pressed?       |
    +----------------+
        /       \
      YES        NO
      /           \
     V             V
+---------+   +-----------+
| Stop    |   | Keep      |
| and turn|   | moving    |
+---------+   +-----------+
     \             /
      \           /
       V         V
    ( Repeat )

Table: Comparison of Sensors

Sensor Detects Best For
Touch Physical contact Collision detection
Ultrasonic Distance using sound Obstacle avoidance
Light Brightness Line following
Sound Noise level Clap control
Colour Colours Sorting objects
Distance Distance Navigation

Timeline: Steps in Using a Sensor

Step 1: Choose sensor
    |
    V
Step 2: Mount sensor
    |
    V
Step 3: Calibrate sensor
    |
    V
Step 4: Write program
    |
    V
Step 5: Test sensor
    |
    V
Step 6: Fix problems
    |
    V
Step 7: Done!

Summary After Every Lesson

Lesson 1 Summary

A sensor detects something in the environment. Sensors give robots the ability to sense the world.

Lesson 2 Summary

Perception is how a robot understands what its sensors detect. It is the bridge between sensing and acting.

Lesson 3 Summary

A touch sensor detects when something presses it. It helps robots detect collisions.

Lesson 4 Summary

An ultrasonic sensor uses sound waves to measure distance. It helps robots avoid obstacles from far away.

Lesson 5 Summary

A light sensor detects brightness. It helps robots follow lines and react to light changes.

Lesson 6 Summary

A sound sensor detects noise. It helps robots react to claps, voices, and other sounds.

Lesson 7 Summary

A colour sensor detects colours. It helps robots sort objects and follow coloured lines.

Lesson 8 Summary

A distance sensor measures how far away an object is. It helps robots navigate.

Lesson 9 Summary

Sensor fusion means using multiple sensors together. It gives the robot a better understanding of the world.

Lesson 10 Summary

A sensor program reads sensor data and makes decisions. It tells the robot how to react.

Lesson 11 Summary

Calibration means adjusting a sensor so it works correctly. It helps sensors understand normal conditions.

Lesson 12 Summary

Range is how far a sensor can detect. Threshold is the point where the robot decides to act.

Lesson 13 Summary

Sensors can have problems. Common issues include loose wires, wrong calibration, and incorrect thresholds.

Lesson 14 Summary

Real robots use many sensors together. Each sensor helps the robot understand a different part of the world.

Lesson 15 Summary

Designing a sensor-based robot means choosing the right sensors for the job and writing programs that use them.


End-of-Module Summary

In this module, you learned about sensors and perception. You learned that sensors are like a robot's senses. They help the robot detect the world around it.

You learned about many types of sensors: touch sensors, ultrasonic sensors, light sensors, sound sensors, colour sensors, and distance sensors. You learned how each one works and what it is used for.

You learned about perception — how the robot understands what its sensors detect. You learned about sensor fusion — using multiple sensors together. You learned about calibration, ranges, and thresholds.

You learned how to write sensor programs and how to design a sensor-based robot. You learned about common sensor problems and how to fix them.

Most importantly, you learned that sensors are what make robots truly interactive. Without sensors, a robot is blind and deaf. With sensors, a robot can understand and react to the world.

In the next module, you will learn about actuators and motion systems. You will learn how robots move and how to control their movement precisely. You will learn about motors, gears, and PID control.

But for now, take a moment to celebrate what you have learned. You have taken another big step in your journey to becoming a robotics expert. Well done!


Frequently Asked Questions (10 Questions)

  1. What is a sensor?
    A sensor is a device that detects something in the environment and sends information to the robot's brain.
  2. Why do robots need sensors?
    Robots need sensors to understand the world around them and react to changes.
  3. What is perception?
    Perception is how a robot understands what its sensors detect.
  4. What is a touch sensor?
    A touch sensor detects when something presses against it.
  5. How does an ultrasonic sensor work?
    It sends out sound waves and waits for them to bounce back. The time tells the distance.
  6. What is a light sensor?
    A light sensor detects the amount of light in the environment.
  7. What is a sound sensor?
    A sound sensor detects noise and sound levels.
  8. What is sensor fusion?
    Sensor fusion means using multiple sensors together for better understanding.
  9. What is calibration?
    Calibration means adjusting a sensor so it works correctly.
  10. What is a threshold?
    A threshold is the point where the robot decides to act based on sensor data.

Matching Exercises

Match the sensor on the left with what it detects on the right.

Sensor Detects
1. Touch Sensor A. Colours
2. Ultrasonic Sensor B. Physical contact
3. Light Sensor C. Noise
4. Sound Sensor D. Distance using sound
5. Colour Sensor E. Brightness
6. Distance Sensor F. Distance

Answers: 1-B, 2-D, 3-E, 4-C, 5-A, 6-F


Scenario-Based Exercises

  1. Scenario: Your robot keeps bumping into walls. What sensor should you add?
    Answer: Add an ultrasonic sensor or touch sensor to detect walls.
  2. Scenario: Your robot needs to follow a black line on a white floor. What sensor should you use?
    Answer: Use a light sensor to detect the line.
  3. Scenario: Your robot needs to start when you clap. What sensor should you use?
    Answer: Use a sound sensor to detect the clap.
  4. Scenario: Your robot needs to sort red and green balls. What sensor should you use?
    Answer: Use a colour sensor to detect the colours.
  5. Scenario: Your robot's sensor gives wrong readings. What should you do?
    Answer: Calibrate the sensor and check connections.

Group Activity

Title: Design a Sensor-Based Robot

Instructions:

  1. Form groups of 3–4 students.
  2. Choose a task for your robot. Example: avoid obstacles, follow a line, react to sound.
  3. Identify what the robot needs to sense.
  4. Choose the right sensors.
  5. Draw a diagram of your robot with sensors.
  6. Write a simple program for your robot.
  7. Present your design to the class.

Example:

Task: Robot avoids obstacles

Sensors needed:
- Ultrasonic sensor (to detect distance)
- Touch sensor (to detect collision)

Program:
1. Move forward
2. IF ultrasonic sensor detects obstacle, THEN turn right
3. IF touch sensor is pressed, THEN stop and turn
4. Repeat from Step 1

Individual Activity

Title: Sensor Scavenger Hunt

Instructions:

  1. Look around your home or school.
  2. Find at least 5 devices that use sensors.
  3. Write down what each sensor detects.
  4. Draw a simple diagram of each device.
  5. Share your findings with the class.

Example:

Device Sensor What It Detects
Phone Touch sensor Your finger press
Doorbell Touch sensor Button press
TV remote Infrared sensor Remote signals
Fridge Temperature sensor Coldness
Car Parking sensor Distance to objects

Mini Project

Title: Build a Line-Following Robot

Goal: Create a robot that follows a black line on a white surface using a light sensor.

Steps:

  1. Attach a light sensor to the front of your robot.
  2. Calibrate the sensor to detect black and white.
  3. Write a program:
    • IF sensor sees black, THEN turn left.
    • IF sensor sees white, THEN turn right.
    • Repeat.
  4. Test the robot on a line.
  5. Fix any problems.
  6. Present your robot to the class.

Deliverables:

  • A working line-following robot.
  • A written program.
  • A short report explaining how it works.

Practical Assignment

Title: Build an Obstacle-Avoiding Robot

Instructions:

  1. Using a robot kit or simulation app, attach an ultrasonic sensor to the front of your robot.
  2. Write a program that:
    • Moves the robot forward.
    • Checks the distance to obstacles.
    • Turns if an obstacle is detected within 20 cm.
    • Repeats.
  3. Test your robot at least 3 times.
  4. Fix any bugs you find.
  5. Write a short report explaining what you did.

Grading Criteria:

Criteria Points
Robot avoids obstacles correctly 40
Uses ultrasonic sensor properly 20
Program uses if/else and loops 20
Report is clear 20
Total 100

Key Takeaways

  • A sensor detects something in the environment.
  • Perception is how a robot understands what its sensors detect.
  • Touch sensors detect physical contact.
  • Ultrasonic sensors measure distance using sound.
  • Light sensors detect brightness.
  • Sound sensors detect noise.
  • Colour sensors detect colours.
  • Distance sensors measure how far away something is.
  • Sensor fusion means using multiple sensors together.
  • Calibration means adjusting a sensor to work correctly.
  • Range is how far a sensor can detect.
  • Threshold is the point where the robot decides to act.
  • Sensor programs read sensor data and make decisions.
  • Sensors make robots interactive.

Classroom Discussion Questions

  1. Why do robots need sensors?
  2. What is the difference between sensing and perception?
  3. What sensor would you use to detect a wall?
  4. How does an ultrasonic sensor work?
  5. What is a light sensor used for?
  6. Why is calibration important?
  7. What is sensor fusion?
  8. What are some common sensor problems?
  9. How do real robots use sensors?
  10. What sensors would you put on a robot that cleans your room?

Preparation for the Next Module

In Module Three, you will learn about Actuators and Motion Systems. You will learn how robots move and how to control their movement precisely.

You will learn about:

  • Different types of motors: DC motors, servo motors, stepper motors.
  • Drive trains and how they work.
  • Gear ratios and speed/torque trade-offs.
  • PID control for precise motion.

To prepare for Module Three:

  • Think about how you move your body. How do your muscles work? How do you control your speed?
  • Look at machines around you that move. Examples: fans, cars, washing machines.
  • Write down three things you would like a robot to do that require movement.
  • Review what you learned in this module about sensors. You will need them in Module Three.

Get ready for an exciting journey into the world of robot movement!


Comprehensive Module Summary and Transition to Module Three

Congratulations! You have completed Module Two of Fundamentals of Robotics Level Two. You have learned about sensors and perception.

You learned that sensors are like a robot's senses. They help the robot detect the world. You learned about touch sensors, ultrasonic sensors, light sensors, sound sensors, colour sensors, and distance sensors.

You learned about perception — how the robot understands what its sensors detect. You learned about sensor fusion, calibration, ranges, and thresholds.

You learned how to write sensor programs and how to design a sensor-based robot. You learned about common sensor problems and how to fix them.

You also learned many examples from Nigeria, from your home, from school, and from everyday life. You learned through stories, illustrations, and activities.

Now you are ready for Module Three: Actuators and Motion Systems. In Module Three, you will learn how robots move. You will learn about motors, gears, and how to control movement precisely. You will learn how to make your robot move smoothly and accurately.

But before you move on, take a moment to review this module. Make sure you understand the key ideas. Practise writing sensor programs. Draw diagrams. Test your sensors. The more you practise, the better you will become.

You are doing great. Keep learning. Keep exploring. Keep building. The world of robotics is waiting for you!


End of Module Two

Next: Module Three — Actuators and Motion Systems

🏆 Get Certified

🔒

Earn this certificate

Every lesson is already free to read. Sign up, finish the lessons, pass the exam (₦2,000 or 20,000 coins), and get a verified certificate with your name on it.

🎓 Sign Up to Get Certified
🛠️ Practice Tools
Hands-on simulators & labs - subscription required.
→
🎯 Internship Tasks
Real-world tasks to build your portfolio - unlock them with a subscription.
→