agsdix-fas fa-child

Volume control with potentiometer

Con esta actividad aprenderás a crear un potenciómetro que regula el volumen.

Icono de contorno de información Actividad básica; Reproductor de audio; Potenciómetro; Bucle principal;

What are we going to do?

Are you a teacher?

Lesson Plan

Courses

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

Materials

  • Cellphone, tablet, or computer
  • Internet connection

Description

In this activity, students can experiment with Protobject, learning visual programming and computer science in a safe and fun way using a device.

Educational Objectives

  • Understand the concept of a potentiometer.
  • 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 projects.
  • Engage in dialogue and reflection on improvement ideas.

Introduction (10 minutes)

Welcome students to the class and briefly introduce the day’s activity:

Today, we will learn how to create a potentiometer that controls the volume.

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

To kick off the class, we can ask a question:

Do you know what a potentiometer is?

A potentiometer allows us to gradually modify the current intensity of a device. By turning its knob, it changes its electrical resistance, thereby modifying the amount of current passing through it.

Using this component, we can give an example of how to use the main loop and understand how a potentiometer works in real life.

Development (20-30 minutes)

Connect our equipment to the Protobject platform. This will allow us to use the screen we want to create with programming commands to display the timer.

To carry out the practical part of the activity, follow the steps in the “Prototyping” section. Remember to experiment by yourself before asking the students to experiment with Protobject. This way, you can anticipate questions that may arise in students.

Closure (5-10 minutes)

Now that you have created a potentiometer, ask yourself:

What other values could we regulate with a potentiometer?
What other prototype ideas do you have with this new information?
How could we store the values of the potentiometer?

We are ready to continue programming!

To solve the challenge presented, simply add a “Draw and Write” component where the knob’s volume is recorded.

See the solution to the challenge.

agsdix-fas fa-book-reader

Learn

What is a potentiometer?

Have you ever had to adjust the volume of a radio?

Or adjust the brightness of a light bulb?

If the answer is yes, then you’ve probably used a potentiometer.

In general, you manage it with a knob!

Operation of the potentiometer

A potentiometer allows for the gradual modification of the current intensity of a device.

By turning its knob, it changes its resistance to electricity, thus modifying the amount of current passing through it.

In the case of a speaker, you can adjust the electric current passing through it, increasing or decreasing the volume.

And how do we program it?

To make the potentiometer work, we need to constantly know its value… Does that sound familiar?

Here, we use the concept of the Main Loop! If you don’t remember what it is, you can review this previous activity.

By moving the potentiometer, we can change the value it indicates.

Then, it’s the job of the Main Loop to execute the code with the modified value.

And can we replace the Main Loop with events?

Of course! In programming, there are always different solutions to the same problem.

Let’s get to work!

In this activity, we will be adjusting the volume of a song using a potentiometer in the phone’s interface. We will select the song through a YouTube link, and the potentiometer will be represented as a knob that you can turn according to your preference.

Make

We are going to create a prototype that allows us to control the volume of a song using a potentiometer.

The first step is to add two devices that will enable us to (1) play music and (2) simulate a potentiometer.

1

Press Add Device and select Knob

2

Press DevicesAdd Device and select AudioPlayer

3

Remember that if you don’t have a smartphone to scan the QR codes, you can press Open in this window to open the components on the same computer.

plus square icon

Suggestion: In Protobject, you can add more components on the same smartphone by pressing the SCAN button as many times as needed.

We’re ready to start prototyping!

Code composition

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

Remember: you can replace the main loop with the event that triggers when the knob is turned.

agsdi-bulb-options

Reflect

Now that you’ve created a potentiometer, ask yourself:

What other values could we regulate with a potentiometer?

plus square icon

Challenge: Let’s create a visualizer that allows us to see the volume as a number!

Hint: You could use the DrawWrite component to write the value of the potentiometer.

In the next activity, we will see what else we can control with a potentiometer.