Are you a teacher?
Lesson Plan
Courses
- Grades 3-12
- Courses from 3rd grade to 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 in a safe and playful manner.
Educational Objectives
- Understand the concepts of “if-else” and “Cartesian plane.”
- Create a technological object (prototype) using a device.
- Identify relationships between technology and the surrounding world.
- Evaluate personal work and the work of others in individual or team tasks.
- Engage in dialogue and reflection on improvement ideas.
Start (10 minutes)
Welcome the students to the class and briefly introduce the day’s activity: “Today we will learn to prototype a ‘fall detector’.”
We will start the class by providing technical knowledge to the students for meaningful learning of the practical activity.
To begin the class, we can start with a question:
Do you remember what conditionals are in programming?
You can let the students propose their answers and then supplement with the correct answer.
It’s a way to instruct the computer to do different things depending on whether something is true or false.
For example, you can tell the computer to turn off the light if it’s daytime, and if not, turn it on.
If you have doubts, you can review conditionals “if-then-else” in activity 9.
But what if we want to add more than two options?
Give them time to inquire and propose answers. Then, add:
The “elif” structure is a way to add more options to a decision being made in the “if-then-else” structure. You can think of this as choosing between different paths.
For example: imagine you have to feed your dog, and depending on the time of day, you’ll decide whether to give breakfast, lunch, or dinner.
- IF it’s before 9:00 am, THEN you have to give breakfast.
- ELIF it’s between 9:00 am and 6:00 pm, THEN you have to give lunch.
- ELSE it’s at a different time, THEN you have to give dinner.
“Elif” is used to choose between different options based on different conditions. If one condition is true, then the computer will do one thing. If another condition is true, then the computer will do something else. And so on, following the order you programmed it (sequence).
Finally, to initiate the prototyping process and make them feel like protagonists of their learning, ask them:
Do you want to learn to prototype a fall detector?
Before prototyping, you can review the complementary content:
The Cartesian plane is a way to represent different positions in a two-dimensional space using two perpendicular lines that intersect at a point. These lines are called axes and are labeled with the letters X and Y.
You may have seen it used to represent two different values on a graph, and today we will use it to represent up-and-down movement, i.e., on the Y-axis.
Development (20-30 minutes)
We will connect our equipment to the Protobject platform. For this exercise, we will use the motion sensor SMARTPHONEMOTION and the lamp LAMP.
Remember to experiment on your own before asking the students to experiment with Protobject in this way. This way, you can anticipate questions that may arise from the students.
First, we will program it to tell our monitor that if the movement on the Y-axis is less than 6, the green light should turn on.
We will repeat the same steps for the yellow light with movement less than 20 and the orange light with movement less than 40. Finally, we use an ELSE-IF (“SINOSI”) statement to indicate that if none of the other conditions are met, the red light should turn on.
Finally, we will place everything inside a loop to repeat the condition indefinitely.
To test the prototype, tell the students to click the activation button.
Congratulations!
Closure (5-10 minutes)
Now that you have prototyped a fall detector with Protobject, challenge your students with a question:
- What would happen if we changed the Y-axis to the X-axis?
To solve the problem posed at the end of the activity, simply remember that color is represented using the three primary colors: Red, Green, and Blue. You can use the value of each axis of the Accelerometer to control each primary color. This way, if you move the phone in a direction, the light will turn on with the respective colors.
Check the challenge solution.