LED Lamp

LED Lamp

Program the activation of an LED lamp

Tilt sensor

Tilt sensor

Create a tilt sensor to prevent hanging crooked pictures

Fall detector

Fall detector

Learn to build a fall detector with an acceleration sensor

Teaching with Protobject

Physical computing made easy, immediate, and cost-effective.

We have designed a series of activities to teach programming with Protobject. Each activity includes a lesson plan for teachers and explanatory videos of the activities.

Here is the educational path we’ve developed.

Physical computing is an excellent way to develop valuable skills in students, such as problem-solving, critical thinking, and creativity.

1. LED Lamp

In this activity, the functioning of Protobject is introduced through the creation of an LED lamp. It explains what an LED is and how the screen of our smartphone is composed of LEDs.

Subsequently, the Protobject interface is presented, and the student is guided to connect their smartphone to the computer in order to turn it into an LED lamp.

By the end of the activity, the student will be familiar with the Protobject interface and able to turn on an LED lamp.

info outline icon
Operation of Protobject.

2. Light Signals

In this activity, the concept of instructions and the sequence of instructions that define an algorithm is introduced. It also explains what a programming language is and the different types that exist.

Building on the theme of the first activity, students learn to create a programmable light where the mobile phone screen lights up with different colors in sequence.

Additionally, the concept of timing is introduced (including the concepts of seconds and milliseconds), allowing pauses between different sequences of LED lamp turning on and off.

info outline icon
Algorithm; Instruction; Timing.

3. Playing a Melody

This activity changes the topic and shows how to create a melody with a sequence of timed notes.

Furthermore, it introduces the concept of a speaker and explains how it works. Students reinforce the concept of an algorithm as a sequence of steps by creating a simple melody defined with a sequence of timed notes.

At the end, students are asked to reflect on how they can play the melody more quickly, i.e., by reducing the waiting time between notes.

info outline icon
Timing; Musical Notes; Speakers.

4. Playing a Melody with Lights

In this activity, the same theme as the third activity is continued, but lights are added to the musical notes. Students see that it is possible to synchronize and time both music and lights, with the idea of creating a toy for a baby.

Additionally, the concept of a variable is introduced, which is used to quickly change the playback time of the melody. At the beginning, a variable is defined with the wait time, and the delays between notes are defined based on this variable. This way, by changing the value of the variable once, it is possible to change the playback speed of the entire melody.

info outline icon
Timing; Variables; Controlling Multiple Devices; Lights; Musical Notes.

5. Creating a Traffic Light

In this activity, the concept of the main loop is introduced by creating a traffic light.

Students are challenged to create a sequence of lights for the traffic light and are made aware that, since the code repeats, it can be made to repeat with just a main loop.

info outline icon
Main Loop; Timing.

6. Flashing Yellow Light Traffic Light

In this activity, the theme of the traffic light is continued by introducing the repetition loop, which is used within the main loop. Students are asked to create a traffic light where a light flashes.

Once again, it is demonstrated that flashing (on and off) is a repetition, and that a repetition loop can be used within the main loop to repeat the flashing as many times as needed.

info outline icon
Repetition Loop; Main Loop; Timing.

7. Simple Stopwatch

This activity changes the topic and asks students to create a stopwatch.

The concepts of the main loop and variables are reinforced. As for variables, they are used a bit more advanced, as it is explained that a variable can also change during the code’s execution. In fact, a variable is set to zero and is incremented in the main loop every second to display its value on the smartphone screen.

The activity concludes with a challenge: to display minutes along with seconds, and a hint is provided by suggesting the use of a repetition loop that repeats 60 times to increment the seconds, and the main loop to increment the minutes.

info outline icon
Main Loop; Variable; Timing.

8. Anti-Theft Alarm

In this activity, conditionals are introduced in a very simple manner: if, then.

A burglar alarm is created. Firstly, it explains what a motion sensor is and how the camera of our smartphone can be used as a motion sensor. Then, it explains that this sensor provides a value that depends on motion and introduces the concept of a conditional, indicating that if this value exceeds a predefined limit, then the alarm is triggered.

Finally, students are asked to reflect on the limitations of this type of sensor and whether it would work at night with all the lights turned off.

info outline icon
Simple Conditional; Main Loop; Motion Sensor; Camera.

9. Turn On the Light

In this activity, a slightly more advanced conditional is introduced: if, then, else.

A lamp is created that turns on when a switch is pressed, and it is explained that when the switch is pressed, the lamp should turn on; otherwise, it should turn off.

It concludes with a challenge asking students to create a project where, in addition to a light, a song is also played.

info outline icon
Conditionals; Main Loop.

10. Alarm with a Switch

In this activity, the concept of an event is introduced with an activity very similar to Activity 9, where an alarm is activated by pressing a switch.

In this case, instead of using the main loop to constantly check the switch’s status, events are used, and the difference is explained.

Subsequently, students move on to program the prototype and it ends with another challenge, where the student must record (in a variable) the number of times the alarm has been triggered and display this number on another smartphone.

info outline icon
Conditionals; Main Loop.

11. Manual People Counter

In this activity, practical differences between the main loop and events are shown, along with the advantages of using events in certain contexts.

A device to count people entering a place by pressing a button is created. It is explained that by pressing the button, the variable defining the number of people should increase by one to update the count. Afterwards, students are asked to reflect and create the same prototype using the main loop, and they are asked why the numbers increase uncontrollably in this case, unlike when using events.

Finally, a challenge is presented where students are asked to count the people exiting as well, not just those entering a place.

info outline icon
Events; States; Main Loop; Conditional.

12. Volume Control with Potentiometer

In this activity, the concept of a potentiometer is introduced, which is used to control the volume of a song.

Students are taught to use the main loop to adjust the volume, although they are encouraged to explore how the same thing can be done using events.

At the end of the activity, a challenge is presented where students are asked to display the volume value on the screen of another smartphone.

info outline icon
Events; Conditionals; Variables; Differences between events and the main loop.

13. Lamp with Variable Intensity

In this activity, a lamp with variable intensity that can be controlled using a potentiometer is created.

It is explained that the brightness of the lamp is actually changed with different levels of gray, and how these levels of gray are generated through additive synthesis, where different levels of gray depend on the intensity of the primary colors red, green, and blue.

The activity concludes with a challenge where students are asked to modify the project to play a song when the potentiometer value exceeds 80.

info outline icon
Sound Player; Potentiometer; Main Loop;

14. Colors on the Screen

In this activity, a lamp that can change color based on three potentiometers associated with the primary colors (red, green, and blue) is created.

Subtractive synthesis and additive synthesis are further explored, showing the differences in color representation on paper, where light is reflected, and on the screen, where light is generated by the LEDs that compose it.

The activity concludes with a challenge asking students to create a lamp that gradually changes color using a repetition loop and a variable that increments its value associated with different lamp colors.

info outline icon
Potentiometer; Events; Colors; Gray Scale.

15. Tilt Sensor

In this activity, more complex conditionals of the type “if, else if, else” are introduced by creating a device that indicates the tilt of frames through screen color.

If there is no tilt, the screen lights up in green. With a little tilt, it lights up in yellow. With more tilt, it lights up in orange, and with a significant tilt, it lights up in red.

The concept of an accelerometer for measuring smartphone tilt is introduced.

info outline icon
Potentiometer; Main Loop; Color Representation.

16. Fall Detector

In this activity, a fall detector is created using the accelerometer.

In order to do this, the operation of the accelerometer is explained in more detail, and it is explained that to detect falls, it is not necessary to know the direction of acceleration or from which side this acceleration is coming. For this reason, the absolute values of acceleration in each direction are taken and added.

info outline icon
Multiple Conditionals; Tilt Sensor; Main Loop.