agsdix-fas fa-child

Presentation pointer

When giving a presentation, it’s very common to use pointers to highlight something in the presentation itself. Did you know that you can use a smartphone to create a pointer? In this activity, you will learn how to create a pointer to indicate countries on a world map.

info outline icon
Basic Activity; Address; Sensor Fusion; Accelerometer; Gyroscope; Magnetometer; Events; Main Loop; Drawing; Coordinates; Mathematics.

What are we going to do?

Are you a teacher?

Lesson Plan

Courses

  • Grades 9-12
  • 1st grade – 4th grade courses

Materials

  • Cell phone, tablet, or computer
  • Internet connection

Description

In this activity, students can implement a whiteboard where they draw using motion controls.

Educational Objectives

  • Understand what phone motion sensors are and how they work.
  • Be able to position elements on a Cartesian plane.
  • Understand the concept of a computable function.
  • Evaluate personal and others’ work in individual or team work.
  • Engage in dialogue and reflection on ideas for improving and expanding the prototype.

Introduction (10 minutes)

In this class, students will learn to interact with the device’s motion and gyroscope sensors by developing an interactive whiteboard controlled by motion.

We’ll start the class by providing technical knowledge to the students for meaningful learning of the practical activity.

To kick off the class, we can begin with a question:

Did you know that your phone knows where it is in relation to the surrounding space?

For the phone, being upside down is not the same as being upright, it can even detect if it’s flipped.

How does the phone know this?

Common in games and other applications, the phone has motion and orientation sensors that provide a representation of where the phone is in the surrounding space.

Do you have any idea how they work?

In this case, internally, acceleration, rotation, and magnetic field sensors are used to determine the device’s position and orientation in space. But these sensors provide only numbers! Interpreting these results is necessary to use them.

Let’s see how the sensors work! Let’s create a pointer that draws on the screen.

Finally, to start the prototyping process and make them feel like the protagonists of their own learning, ask them:

Do you want to learn how to prototype a motion whiteboard?

Development (20-30 minutes)

We connect our device to the Protobject platform, which will allow us to perceive the phone’s motion and orientation and enable us to visualize the movement of an object on our interactive whiteboard.
How does the phone know where it’s looking?


Put yourself in the phone’s place. Imagine being in an entirely empty room with your eyes blindfolded. You’d probably still be able to indicate where “up” and “down” are or where “forward” and “backward” are… Even though you have no visual reference!

To position ourselves in space, we need to “feel” various things, like gravity and our body’s position. In the phone’s case, it’s similar, it also needs to “feel” things to position itself. For this, the phone uses sensors:

  • On one side, we have the gyroscope, which allows us to detect the smartphone’s rotation, i.e., which way it’s facing. For example, it detects if the screen is facing upwards, sideways, tilted, etc. It does this by combining the phone’s specific rotation on each axis.
  • On the other side, we have the magnetometer, which allows us to know the phone’s general rotation concerning the Earth’s magnetic field, like a compass.
  • Finally, we have accelerometers, which detect if the phone has moved, in which direction, and at what speed.

However, each sensor knows only very specific information about the phone, so they are of no use on their own. They must work together! This is called Sensor Fusion.

So, by combining the information obtained from the three sensors, we can identify where the phone is looking.

However, what the sensor detects is just a bunch of numbers, so it’s our task to give them meaning so that they can be useful for our project.

By moving the phone along a specific axis, the numbers can increase or decrease. For example, if we move horizontally to the right (X-axis), this number will increase, and if we move to the left, it will decrease.

Given this, we need to determine where we will start measuring, i.e., what the “initial” position of the phone is. This could be, for example, in the middle of the screen or in a corner.

In a Cartesian plane… What is the initial position? The center! That is, when the value of the X-axis and the Y-axis is 0.

To carry out the practical part of the activity, you should follow the steps in the “Prototyping” section. Remember to experiment on your own in advance so that you can anticipate the questions that may arise from the students.

Closure (5-10 minutes)

Now that you’ve completed the exercise, here are some reflection questions:

What do the numbers detected by the sensors mean? What happens if I move the phone in a certain way?

The idea is to let them try and learn by discovering what happens. The answer they might deduce is: These numbers indicate the phone’s position, and depending on how we move the phone, they increase or decrease.

What happens if the SimpleButton is not enabled?

Same as the previous case, they should try to find out for themselves. It wouldn’t be possible to reset the position of the red point on the interactive whiteboard, and the cursor might go off the screen.

Which sensors in the smartphone allow visualizing the movement on the interactive whiteboard?

This question is for summarization purposes. In this case, the direction sensor is used, which has a component on the X and Y coordinates, allowing you to observe how the point moves on the interactive whiteboard.

agsdix-fas fa-book-reader

Learn

How does the phone know which way it’s looking?
Imagine we’re in a completely empty room with our eyes blindfolded. You’d probably still be able to point out where ‘up’ and ‘down’ are… Even though we have no visual reference!

Just like us, the phone needs to ‘sense’ things to position itself, such as gravity and its position relative to its surroundings.

How does the phone “sense”?

Accelerometer

An accelerometer is a sensor that measures the linear acceleration of a smartphone in all directions. This sensor can detect phone movements or vibrations and can be used to determine the device’s orientation or trigger motion-based functions.

Gyroscope

The gyroscope is a sensor that measures and detects changes in the rotation angle of a smartphone. This sensor identifies changes in the phone’s orientation relative to its previous position, allowing it to recognize the device’s rotations.

Magnetometer

A magnetometer is a sensor used to measure the magnetic field in a specific area. It can detect the direction and intensity of the Earth’s magnetic field, which is useful for the operation of a compass, or surrounding magnetic fields.

Let’s work together!

Since each sensor provides very specific information about the phone, they need to work together to detect certain types of data, such as the direction the phone is facing, for example.

This collaboration is called Sensor Fusion. By combining the information collected by the three sensors, we can determine the phone’s orientation.

Cartesian coordinates

However, the result of Sensor Fusion is numerical values, so our task is to give them meaning and make them useful for our project.

By moving the phone along a specific axis, these values can increase or decrease. For example, if we move to the right along the horizontal axis (Axis X), these values will increase, and if we move to the left, they will decrease. The same applies to vertical movements (Axis Y)

Make

Let’s create the prototype: we will need a smartphone and a computer/tablet.

1

Include the Direction and TouchButton devices on the same smartphone.

2

Add the device WriteDraw by opening it on the same computer/tablet by clicking Open in this window (it’s easier to view the map on the computer rather than on another smartphone).

We are ready to start prototyping!

Code composition

Click on question circle icon to open the comments explaining the code.
agsdi-bulb-options

Reflect

Now that you’ve managed to program a motion whiteboard with Protobject…

What do the numbers obtained from the sensors mean? What happens if I move the phone in a certain way?

What happens if the SimpleButton is not enabled?

Which sensors in the smartphone allow us to visualize motion on the interactive whiteboard?

Can you imagine what else can be done with the direction sensor?

How could we enable two people to draw simultaneously with different colors?

Can you think of another way to achieve this?

plus square icon

Challenge: Let’s program two pointers simultaneously so that two people can independently point to different areas on the map!

We are ready to continue prototyping!