Combining Environmental Data and Robot Reactions

In this lesson, students will integrate data from multiple environmental sensors —temperature/humidity, and light— into their robot’s behaviors. The objective is to teach students how to combine sensor inputs to create more complex, responsive behaviors.

Materials required

  • Lesson slides
  • Otto Starter robots
  • Temp & Humidity, and Light sensors from Sense Expansion
  • Computers with internet and Bluetooth connection

Optional materials

  • Lesson worksheets 

Learning Objectives

  • Explain how sensors enable robots to perceive and respond to their environment or user actions.
  • Recognize real-world applications of sensors in robotics (e.g., smart devices, environmental monitoring, assistive technologies).
  • Write and upload programs to read data from environmental and/or interactive sensors.
  • Combine environmental and/or interactive sensors to create multi-input behaviors.
  • Debug programs to resolve sensor inaccuracies or unexpected behaviors.
  • Refine robot responses through testing and user feedback.

Knowledge required

This activity assumes that students already know how to code environmental sensors: temperature/humidity, and light.

Why is combining sensor data important?

Explain to students how robots that use multiple sensors can make more sophisticated decisions (slide #3). For example, a smart home device might adjust both lighting and temperature based on environmental data. Discuss the concept of “sensor fusion,” where combining different types of sensor inputs allows for more accurate and complex behaviors.

Robots that use multiple sensors can make more sophisticated decisions through sensor fusion, where data from different sensors is combined for more accurate actions. For example, a home control robot might adjust lighting and temperature based on inputs from light and temperature sensors, ensuring the home is comfortable and energy-efficient. Another example could be a delivery robot that uses proximity sensors to avoid obstacles, GPS data for navigation, and temperature sensors to ensure perishable items stay fresh during transit, allowing it to make complex decisions in real time.

Understanding Sensor Fusion

Introduce the concept of sensor fusion (slide #4), explaining that it involves taking data from multiple sensors (e.g., temperature, humidity, and light) and combining this information to influence how the robot behaves.

Use examples such as weather stations or robots that react to different environmental conditions. For instance, a robot could move to a cooler, darker area if it detects high temperature and bright light, or light up LEDs based on a combination of low light and high humidity.

Short explanations

Sensor fusion is the process of combining data from multiple sensors to give a robot a better understanding of its environment and help it make more accurate decisions. For example, a robot with temperature, humidity, and light sensors can gather data on all three environmental factors and decide how to behave based on the combination of that information.

💡 Encourage students to think about how humans naturally combine information from multiple senses to understand and react to the world around us. Just like robots use sensor fusion, we use our senses—like sight, hearing, and touch—together to make decisions and navigate our environment more effectively.

To complete the following activities, ask your students to change the 3D printed top of the robot to use the one that allow them to place two sensors in the top at the same time (slide #5).

Activity: Sensor Fusion Coding

Guide students to combine the code for temperature/humidity, and light sensors (slide #6).

  • Explain the steps for programming the robot to react to multiple environmental conditions:
    • Read data from each sensor.
    • Use conditional statements (if/else) to define how the robot responds when certain conditions are met (e.g., “if the temperature is above 30°C and the light is low, display a blue light”).
    • Code for multiple scenarios where the robot responds to a combination of sensor inputs.

How to combine sensors:

This block of code is an example of how a robot can use sensor fusion to make decisions based on data from two different sensors: a temperature sensor and a light sensor. Here’s how it works:

  • The robot first checks if the temperature is greater than 30°C.
  • At the same time, it checks if the light level is greater than 80% (this is the brightness detected by the light sensor).

The robot is using an “AND” condition, which means both conditions must be true for the robot to react. So, if the temperature is higher than 30°C and the light level is higher than 80%, the robot will take action based on these combined inputs. This allows the robot to behave intelligently in response to its environment, like moving to a cooler, darker area or turning on a fan or lights.

Here is a “full-complex” program that combine 3 sensors:

This code makes the robot move when the temperature is above 30°C and the light is above 80%. While moving, the robot checks if the light is still above 50% and uses an ultrasonic sensor to avoid obstacles. If the conditions aren’t met, the robot stops moving.

 

This is a simple application that allows the robot to avoid high temperatures and bright lighting conditions by seeking a darker place to stay.

Encourage your students to experiment with this program and modify it to fit their local conditions. In some countries, and depending on the season, they may need to adjust the temperature trigger to see their robots meet the conditions. Ask them to add sounds and lights to make the robot’s reactions more interactive.

Activity: Creating Complex Behaviors

Now it’s time for students to design and code their own robot behaviors using data from multiple sensors (slide #7). Challenge them to think about how the robot could respond to different environmental conditions.

Pair students to work on this challenge together, encouraging them to integrate as many components as possible (e.g., servo motors, color lights, buzzer).

Showcase and Feedback

Give students time to showcase their programs to the class.

  • Allow each group to explain their coding process, the sensor data they used, and how they programmed their robot to respond.

  • Provide feedback and encourage students to reflect on the real-world applications of combining sensor data in technology (e.g., smart cities, automated farming, or disaster response systems).

Lesson Evaluation

  • Students can explain how sensor fusion works and why it is important for creating complex robot behaviors.
  • Students successfully combine data from temperature, humidity, and light sensors in their code.
  • Students design and code creative, complex behaviors for their robots based on environmental sensor input.
  • Students participate in discussions and provide meaningful feedback to their peers during the showcase.

The duration of this lesson is approximately one hour. You can find the definition of learning objectives at the bottom of this guide to align with your curriculum requirements.

Materials required

  • Lesson slides
  • Lesson worksheets
  • TV, projector, or big screen to display the class videos
  • Big paper or cardboard (white)
  • Tape (black)
  • Scissors

Computers, tablets or smartphones are optional, they can be used as digital tools for students to do further research and take additional notes.

Connect

The class begins by displaying the first slide and asking the students “What do you see here?’“
[Pause and wait for students to provide answers, which may include mentions of a robot arm and two wheeled robots moving boxes].

The teacher will then guide the class in a conversation about the nature of robots, exploring questions such as: ‘What is a robot?’ ‘When does something turn into a robot and when is it just a machine?’

Moving on to the second slide, the teacher will introduce the topic of the usefulness of robots to humans. Students should share their ideas about how robots can be useful.

[This conversation is expected to last approximately 4-5 minutes]
Afterwards, on the third slide, the students will watch a video that explains the concept of what a robot is. Following the video, they will have the opportunity to share their personal experiences with robots. The teacher can guide the conversation by asking specific questions, such as: ‘Have you ever played with a robot or built one?’ ‘Do you have any robotic devices at home, like a vacuum cleaner, that you consider to be a robot?’

[The video has a duration of 4 minutes, and the discussion about personal experiences is expected to take an additional 3-5 minutes]

On the next slide, the teacher will organize small groups consisting of 2-3 students. Each group will be assigned a specific robot to investigate. The students can conduct their investigation by using the internet or through provided materials, either digital or physical. Some popular real-life robots for the students to explore are:

As a teacher, feel free to research other robots to add to the list. By the time you teach this lesson, there could be some new and popular robots.

During this activity, students will gather information about their assigned robot and gain knowledge about how robots are being utilized in daily life. At the end of the investigation, each group will give a brief presentation about the robot they investigated.

Here the students will use the first worksheet

[This activity is expected to take approximately 10-15 minutes in total, allowing sufficient time for research and presentations]

Make

On the fifth slide, the teacher will introduce the HP Otto robot by showing a video about its features and capabilities. After watching the video, the teacher will demonstrate a built robot to the students, showcasing its physical components and explaining how they contribute to its functionality.

[To further engage the students, the teacher can connect the robot to the Otto web control app, demonstrating how to operate and control the robot using the app’s interface.]

On the next slide, a diagram displaying the internal connections of the robot will be shown. Using the web control app, the teacher will demonstrate how each component of the robot works.

To engage the students, the teacher can actively involve them in the activity. For example:

  • Buzzer: The teacher can play various sounds available on the app and ask students to suggest or choose which sound they would like to hear.
  • LED ring: The teacher can ask students (up to a maximum of 12) about their favorite colors and display them on the LED ring.
  • Ultrasonic sensor: The teacher can activate the avoidance function and make the robot move around the classroom. Students can participate by intercepting the robot’s path with their hands, observing how the robot changes its direction in response.
  • Line sensors: Although the line tracking activity will be conducted later, the teacher can explain how the infrared sensors work at this stage.

In the next activity, the entire group will work together to define a racing track circuit for the robot to navigate. The teacher will guide the students in this process, but it is important to allow the students to make the decisions in order to foster their creativity and engagement. The goal is to define a circuit that includes specific landmarks or areas within the classroom for the robot to move around.

For example, the students may decide to start the circuit in front of the teacher’s desk, then describe a square around James’ seat, move in a zigzag pattern between Eva and Raidy’s seats, and finally return to the teacher’s desk. [To maintain efficiency, the teacher should encourage the students to make quick decisions, aiming to complete the circuit definition within 1-2 minutes]

[Optional]: As an additional challenge, the teacher can allow students to take turns controlling the robot and measure their individual completion times. This can add an element of friendly competition among the students.

The next activity is similar to the previous one, but this time the students will create a line track using ‘tape’ on a large white piece of paper or cardboard.

Lorem ipsum

Scroll to Top
This will be available with the release of this product.