agsdix-fas fa-child

Light signals

With this activity, you will learn how to create a light signal.

To do this, we will use a timing block that allows you to set waiting times before executing new blocks.

Info Outline Icon
Basic Activity; Algorithm; Instructions; Timing. If you know nothing about Protobject, start with the first activity.

What are we going to do?

Are you a teacher?

Lesson Plan

Activity 2

Courses

  • Grades 3-12
  • Courses 3rd grade – 12th grade

Materials

  • Cellphone, tablet, or computer
  • Internet connection

Description

In this activity, students can experiment in an introductory way with Protobject, learning visual programming and computer science with a device safely and playfully.

Educational Objectives

  • Understand the concepts of “LED” and “timing”
  • Create a technological object (prototype) using a device
  • Identify relationships between technology and the surrounding world
  • Evaluate personal and others’ work in individual or team work
  • Discuss and reflect on improvement ideas

Beginning (10 minutes)

Welcome the students to class and briefly introduce the day’s activity: “today we will learn how to prototype a beacon.”

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

To open the class, we can begin with a question:

Do you know why the screen of your cellphone lights up?

You can give students the floor to propose their answers and then complement with the correct answer.

Well, that’s called an LED, and it’s a small but powerful light. Around us, there are different types of LEDs, such as those used to light up a room or a television. The screen of your cellphone is also made up of thousands of small LEDs that emit light, shaping the image you see on the screen. That’s why we can activate them for prototyping with Protobject.

Now, ask them if they remember the previous activity, Do you remember what happened when we tried to turn off the lamp?

When we turned on the LED lamp, we couldn’t turn it off, even when we used the turn-off block.

Why didn’t the turn-off block work?

Give them time to inquire and propose answers. Then, complement with the following:

Have you ever wondered why, if you put the “turn on” and then “turn off” blocks in sequence, the lamp remains off without turning on at any point?

Machines are very fast!

The lamp turned on but turned off so quickly that we couldn’t even see it.

Machines can’t handle ambiguous instructions and can’t understand what we want if we don’t tell them exactly what to do. In this case, the ambiguity was in the fact that we had to tell it how long to wait to turn off the lamp. So, we had to sequence the “turn on,” “wait” (for a specified time), and then “turn off” blocks. We call this action of waiting for a specified time “Timing.”

To make a light blink like a beacon, we need to define a sequence of steps that include wait times or delays between each on and off.

It’s like setting a timer on the microwave or TV to turn off after a certain time, but in this case, we’re telling the light how long to wait before turning on or off again.

How can we set the time?

Time can be measured in many ways, for example, years, days, hours, minutes, seconds, and milliseconds.

  • One day is equal to 24 hours.
  • One hour is equal to 3600 seconds.
  • One second is equal to 1000 milliseconds.

In Protobject, time can be measured in seconds or milliseconds.

To kickstart the prototyping process and make them feel like the protagonists of their learning, ask them:

Do you want to learn how to prototype a beacon?

Development (20-30 minutes)

We connect our device to the Protobject platform; this will allow us to control the screen’s LEDs with programming commands and control the LEDs and time them.

Remember to experiment beforehand yourself before asking students to experiment with Protobject; this way, you can anticipate questions that may arise among students.

To create the beacon, we will add the LAMP device.

Remind them that each block indicates an action. We’ll start by using just one block that allows us to turn on the beacon’s light.

To do this, we drag the TURN ON block to the workspace and assign it a color, in this case, red.

Then, we’ll assign a time during which the screen will be on, in this case, 100 milliseconds with the DELAY block.

Now we need to turn off the beacon; for that, we’ll use the TURN OFF block and assign a time during which it will be off, for example, 40 milliseconds.

We repeat the whole process with the other color, in this case, blue, and repeat it several times to make the color change visible.

To test the prototype, tell the students to click on the activation button. The beacon should light up!

Congratulations!

Closure (5-10 minutes)

Now that you’ve lit up a beacon with Protobject, challenge your students with a question:

In what other situations could we use timing?

Let them explore, and if they can’t think of any, suggest that they could add sound.

Tell them that this is what they will do in the next exercise! Adding sound to a sequence of musical notes.

agsdix-fas fa-book-reader

Learn

What is an LED?

Did you like the previous activity of turning on a lamp? Have you ever wondered what lights up on your cellphone? Well, that’s called an LED, and it’s a small but powerful light.

Around us, there are different types of LEDs, such as those used to light up a room and those used in televisions to display images.

And the cellphone screen?

The screen of your cellphone is also made up of thousands of small LEDs that emit light, shaping the image you see on the screen.

These LEDs on your screen are the ones we control with programming when prototyping with Protobject, meaning the LEDs are the part that turns on and off in your lamp.

Why couldn’t I turn off the lamp?

Did you try to turn off the lamp in the previous activity?

Have you ever wondered why, if you sequence the “turn on” and then “turn off” blocks, the lamp remains off without turning on at any point?

Machines are very fast!

The lamp turned on, but it turned off so quickly that we couldn’t even see it.

Instructions can’t be ambiguous!

Machines cannot receive ambiguous instructions and cannot understand what we want if we don’t tell them precisely what to do.

In this case, the ambiguity was in having to specify how much time to wait before turning off the lamp.

Therefore, we had to sequence the “turn on,” “wait” (for a specified time), and then “turn off” blocks. We call the action of waiting for a specified time “Timing.”

What does “timing” mean?

To make a light flash like a beacon, we need to define a sequence of steps that includes wait times or delays between turning on and off.

It’s like setting a timer on a microwave or a television to turn off after a certain time, but in this case, we’re telling the light how long to wait before turning on or off again.

How can we set the time?

Time can be measured in many ways, such as years, days, hours, minutes, seconds, and milliseconds.

  • One day is equal to 24 hours.
  • One hour is equal to 3600 seconds.
  • One second is equal to 1000 milliseconds.

In Protobject, time can be measured in seconds or milliseconds.

Make

We’re going to create a prototype of a beacon with Protobject.

The first step is to turn our smartphone into a lamp:

1

Press Add device

2

Select Lamp

3

Scan the QR code

If you don’t have a smartphone, you can press Open in this window to open the lamp on the same computer.

Where are the delay blocks located?

Open the Timing category.

Code composition

Click on question circle icon to open the comments that explain the code.

Remember: delay blocks are located in the Timing category.

agsdi-bulb-options

Reflect

Now that you’ve learned how to turn on a beacon with Protobject:

In what other situations could you use timing?

plus square icon

Remember: programming involves a sequence of steps to achieve a goal.

In this case, we achieved the flashing like a beacon!

In our next prototype, we’ll learn to play a melody with a sequence of musical notes!