Potentiometer: everything you should know

potentiometer

El potentiometer it is nothing more than a variable resistor that you can adjust. This type of Electronic components can be used for multiple applications, such as a dimmer switch. In the case of a recurring application with Arduino, it is usually a good match for LCD screens, in which you can regulate the brightness of the same with it.

If you are interested know a little more about this element, here is a complete guide with which to learn the basics to start using it in your future projects and to write your first sketch with Arduino to test how it can work ...

What is the potentiometer?

operation

Un potentiometer is an electronic component similar to resistors or conventional resistors, but of a variable value. This makes it possible to control the intensity of current that passes through a circuit to which it is connected in parallel, or to control the voltage drop in case of being connected in series.

The potentiometer is similar to the lagging, with the difference that the lagging dissipates more power and is used in higher current circuits.

To do this, use a resistive material of a certain length. And with a cursor, which will be the one that can be manipulated by hand, it will make it move in contact with said resistive material. As the cursor is electrically connected to the output, it will make the current have to go through a greater length (more resistance) or a shorter length (less resistance).

When it is totally closed, that is, the minimum of travel, then we obtain the maximum voltage at the exit (the one at the entrance). While if it is fully open, at the end of the tour, the minimum will be obtained. In an intermediate position it would be a voltage at the output that would correspond to a fraction of that at the input.

Applications

DJ table, or mixer

The applications of a potentiometer are the most varied, and in your day to day you use many of these elements almost without realizing it. For example:

  • In sound equipment, you have seen the famous knobs or rotary actuators with which the volume is controlled, for example. Or also in equalizers, etc. These are all potentiometers.
  • In lighting you will see it in light intensity regulators, changing the intensity of the bulbs.
  • They can be used as sensors, since the angular movement exerted on them will cause the resistance and therefore the voltage to vary. Then, by calibrating the system and measuring the output, it can be determined how much it has moved.
  • They can also be used as control elements.

Types of potentiometers

potentiometer pinout symbol

Several types of potentiometersalthough not all are very practical for common applications. The most common are:

  • Linear variation potentiometer: it is a type whose resistance will vary linearly, that is, proportionally to the angle of rotation. That is to say, in this type of potentiometer, when the half of the trip has been covered, there will be 50% resistance. This type is the most common, and the ones that are usually used with Arduino and in most circuits, dimmers, etc.
  • Logarithmic variation potentiometer: in this case, it will vary logarithmically to the angle of rotation, so the increment will be higher than the previous one. This can be used for other types of applications that require this type of response. In this case, they are often used for sound circuits, since the human ear perceives logarithmic and non-linear increases in volume, as you should already know.

Of course, these potentiometers will have a maximum typical resistance. For example, they can be 10 kΩ. In that case, when they are at the maximum of their travel they will give said maximum resistance.

pinout

As you can see in the previous image, the connection of this element is very simple. It only has three pins, or pins, that is, one more than conventional resistors. In this case, template 1 will be the voltage input, while 2 will be the output, and 3 will be connected to GND (ground).

Integrate the potentiometer with Arduino

Screenshot of Arduino IDE

With a Arduino board and a potentiometer A lot of things can be done. But before that, you should know that, to make a simple example with which to begin to see the operation of the potentiometer, you can use any of the analog pins on your board. For example, in a Arduino UNO you can use from A0 to A5.

Since they have a 10-bit resolution, that implies that you have 1024 possible values (0000000000-1111111111), and as the available voltage range is from 0v to 5v, then it can be calibrated so that 0000000000 (or 0) is 0V and 1111111111 (or 1023) is 5v, so it could detect voltage surges of 0.004v (5/1024).

Yes, the connection, you can simply do the following:

  • Connect the input of the potentiometer to the 5V of the board.
  • The potentiometer output will be connected to one of the analog inputs. For example, A1.
  • As for the other remaining pin of the potentiometer, you must connect it to GND.

Once that is done, you can create a small sketch in Arduino IDE to be able to test how a potentiometer works. With this code, what you will get is to be able to read the voltage values ​​obtained at the output as you turn the cursor on the potentiometer.

//Ejemplo de prueba de potenciómetro
long valor;

void setup() {
  //Inicializamos la comunicación serial
  Serial.begin(9600);
  
  //Escribir el valor leído por el monitor serie
  Serial.println("Inicio de sketch - Valores del potenciómetro");

}

void loop() {
  // Leer los valores del A1
  valor = analogRead(A1);

  //Imprimir en el monitor serie
  Serial.print("Valor leído = ");
  Serial.println(valor);
  delay(1000);

}

Yes, more information, Can download the Arduino programming course...


The content of the article adheres to our principles of editorial ethics. To report an error click here!.

Be the first to comment

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.