Real-Time Data Display

This lesson will teach students how to display real-time data from the robot’s sensors on the OLED screen. They will learn how to pull data from the ultrasonic and line sensors and show that data as text or visuals on the OLED display. By the end of the lesson, students will be able to create a program where the robot can show its surroundings in real-time, visually representing what it detects using both types of sensors.

Materials required

  • Lesson slides
  • Otto Starter robots
  • OLED Display of Expansion Kit 
  • Ultrasonic sensor (already included in the starter kit) 
  • Line sensors (already included in the starter kit) 
  • Computers with internet and Bluetooth connection

Optional materials

  • Lesson worksheets

Learning Objectives

  • Identify the key components of a robot and explain their functions. 
  • Identify the problem to be solved and develop a plan to address it using the Otto robot components. 
  • Use an iterative design process to improve the robot’s performance. 
  • Communicate ideas and results clearly and professionally to peers and teachers. 

Adding back the ultrasonic sensor

An activity in this lesson will require combining the OLED display + the ultrasonic sensor. Since there is not a 3D printed module that joins both, students will need to open the top of the robot and use it uncovered while experimenting with both. 

Why is Real-Time Data Important in Robots?

Introduce the concept of real-time data and explain how robots use sensors to gather information from their surroundings (slide #3). For example, the robot can detect objects in front of it using the ultrasonic sensor, or sense different color surfaces with the line sensors. These readings can be displayed on the OLED in real-time, helping users understand what the robot is detecting (slide #4). 

Real-time data is information that a robot collects and shows as things happen. Robots use sensors to gather details from their surroundings, like an ultrasonic sensor that detects objects in front of it by measuring distance, or line sensors that identify different colors on the ground. This data can be shown on an OLED screen instantly, helping users see what the robot is sensing and understand how it’s reacting to its environment. 

Understanding Ultrasonic and Line Sensors

Recap the basics of how the ultrasonic sensor detects the distance between the robot and objects in front of it, while the line sensors can detect differences in the ground. Walk through how this data can be visually represented on the OLED display. For instance:

  • The ultrasonic sensor data can be shown as distance in centimeters.
  • The line sensors can indicate the differences in the ground’s illumination.

Show students the blocks in Word Blocks for reading sensor data from both types of sensors (slide #5). 

Activity: Displaying Ultrasonic Sensor Data

Challenge students to display the ultrasonic sensor data on the OLED screen. In theory, what they need to do is: 

  • Step 1: Use the show x y “text” block to display the phrase “Distance: “.
  • Step 2: Combine it with a block that reads the ultrasonic sensor value and displays the distance in real-time. 

The easiest way to display the ultrasonic sensor value in the OLED is:  

 

With this code, it will keep displaying the ultrasonic value forever (refreshing every half of a second). However, the number from the ultrasonic block comes with several decimal points (e.g. 30.14159473), which is not really useful for the final user.  

We can control it by rounding the number with the block:

Just place the ultrasonic distance block inside. 

Allow students to experiment by placing objects at different distances from the robot and seeing how the display updates the distance accordingly. 

ℹ️ Stylish Visualization 

Encourage your students to go beyond just displaying data. Inspire them to add a personal and creative flair by “decorating” the display space. For example, they can “frame” the data within rectangles for a neat, organized look. 

Adding fun elements like eyes or other simple designs can also enhance the display and make it more engaging! 

Activity: Displaying Line Sensor Data

Next, guide students to show line sensor data on the OLED display: 

  • Step 1: Program the OLED to show “Left: ” and “Right: ” on the screen for the left and right line sensors.
  • Step 2: Program the line sensors to display a “1” if an object is detected on the side and a “0” if there is no object.  

Students can test this by bringing objects close to either side of the robot and watching how the OLED display reflects the sensor status. 

Activity: Integrating Both Sensors

Guide students to create a complete program that integrates both sensor types, displaying real-time data from both the ultrasonic and line sensors: 

  • Step 1: Display “Distance: “, “Left: “, and “Right: ” on the OLED screen.
  • Step 2: Continuously update the data based on sensor readings. 

Encourage students to experiment by moving the robot closer to and away from obstacles while observing the real-time feedback on the OLED display. 

ℹ️ Advanced Stylish Visualization 

Instead of simply displaying sensor values as text, students can create more dynamic and engaging visualizations by using shapes to represent data changes. For example, try this code: 

In this example, rather than showing the numeric value of the ultrasonic sensor’s distance, the radius of a circle adjusts based on the distance measured. The circle will be smaller when the object is close and larger when the object is farther away. 

If the distance is too large, the circle’s radius will exceed the screen dimensions and eventually turn into a full-screen rectangle! 

Encourage your students to test this and other ways to represent sensor data! 

Lesson Evaluation

  • Students can explain the importance of real-time data display in robot behavior. 
  • Students can successfully program the OLED display to show real-time data from the ultrasonic and line sensors. 
  • Students understand the relationship between sensor data and the visual output on the OLED. 

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.