【 Use Potentiometer in Arduino 】 Step by Step Guide ▷ 2022

If you have worked with surely you have already heard about what they are potentiometersa very useful element in this platform that allows you to carry out as it is regulate the intensity of the light of an LED screen, control the position of a servo or in such case the speed of a motor. And it is that it has become one of the most common components used in this electronic platform.

Therefore, potentiometers They are devices that will be used frequently to input analog values ​​to the Arduino board, so they can be used in a wide variety of electronic projects. It should be mentioned that they also have the ability to limit the flow of electrical current variably.

Thus, these devices allow modify the value of the current and the voltage simply by varying what is the resistance value. In accordance with everything mentioned so far, here we are going to teach you a little more What are these components in Arduino and how can you start using them?for this, follow in detail everything that we are going to teach you next in the post.

What is a potentiometer and what are all the types that exist?

They are considered as a device that allows vary its resistance manually between what is a minimum value and a maximum value (Rmin – Rmax) in the case of minimum values, the most common is the 0 ohmwhile in the maximum values ​​the most common are 5k, 10k or 20k ohms.

These devices are internally made up of a mobile contact that moves along a resistive track. In this way, when moving the potentiometer the contact moves along the track and it will vary the length of the section of track with which it is making contact, which causes the resistance varies. potentiometers they usually have three terminalswhere two ends are attached to both track sides.

so both always record the maximum resistance Rmax. While the remaining terminal will correspond to mobile contact. In the case of this terminal, the resistance is varied with respect to the other two terminals as the potentiometer is activated, thus being the sum of resistance to other terminals equals maximum resistance. It should also be mentioned that potentiometers serve to limit what is the flow of electrical current variably.

Causing a voltage drop in relation to resistivity. In the same way, it allows you to modify the value of current and voltage by simply varying the value of the resistance. When it comes to control current and voltage levels within an electrical circuit, must be use the potentiometer. That is why it has an exclusive and characteristic use in those ,LCD, among others.

It is also essential to mention that there are different types of potentiometers and which we are going to show you next in the post:

See also  【 DELETE UBER ACCOUNT 】▷ Step by Step Guide ▷ 2022

Control potentiometers

This type of device is the most suitable to be used as an element of voltage control of electronic devices. For this, the user must act on them in order to be able to vary normal parameters of operation, such as the volume of a sound system.

In addition, there are different types of this control potentiometer such as the following:

  • Sliders: In this case, the resistive track is straight, so the cursor path will also be straight. They have been in fashion for a while now and are used mostly in the graphic equalizers, since the position of their cursors represent the response of the equalizer. However, it should be mentioned that sliders are more fragile than rotary ones and take up more space and are also usually much more sensitive to dust.
  • Rotary potentiometers: They are controlled when its axis rotates, these are the most common, since they are long-lasting and take up much less space than the sliders. In addition, it should be mentioned that they are much more resistant.
  • Multiple potentiometers: These are several potentiometers with coaxial shafts, thus they end up taking up very little space. For this, instrumentation, car radios, among many others, are used.

trim potentiometers

They take care of control preset voltage, normally in factory. In this case users should not touch up, so it is not usually accessible from the outside. there are many encapsulated in plastic as many without capsulesand usually distinguish vertical adjustment potentiometers, where its axis of rotation is vertical and horizontal adjustment potentiometers with the axis of rotation parallel to the printed circuit.

According to the law of variation of resistance, we have the following aspects:

  • logarithmic variation: The resistance will depend logarithmically on the angle of rotation, this is called with the letter A according to current regulations, since it was previously done with the letter B.
  • linear variation: The resistance is directly proportional to the angle of rotation, currently it is called with the letter B, since before it was done with the letter A.
  • sinusoidal variation: In this case, the resistance is proportional to the sine of the angle of rotation, where two sinusoidal potentiometers joined together and turned 90° can provide the sine and cosine of the angle of rotation.
  • Anti-logarithmic variation: Here the resistance is directly proportional to 10 with the power of the angle rotated, generally it is called with the letter F.

printed potentiometers

In this case the law of resistance is achieved by varying the width of the resistive trackwhile in the case of windings, the curve is adjusted to sections with wires of different thickness.

See also  【Network Commands in Linux】What are they? + List ▷ 2022

multiturn potentiometers

To carry out the fine adjustments of the resistance there are multiturn potentiometersIn this case, the slider is attached to a multiplier screw, so that several turns of the control unit are needed to complete the travel.

digital potentiometers

This is the name given to an integrated circuit where the operation simulates that of a analog potentiometer. It consists of a divider n+1 resistive resistor with its n intermediate points connected to an analog multiplexer that selects the output. All of this is handled via a serial interface and usually has a tolerance on around 20% and to all this it is necessary to add the resistance due to the internal switches known as Rwiper.

In this case, the most common values ​​are those of 10k and 100kalthough this may vary depending on the manufacturer with 32, 64, 128, 512 and 1024 positions in scale linear or logarithmic. This is handled by several manufacturers, but the main ones in them are Intersil, Maxim and Analog Devices. These devices have the same limitations as DAC converters, such as the maximum current that they can draw and that are in the order of mA, INL and DNL.

What is a potentiometer for and why should you use it when working with Arduino?

potentiometers are an electronic component very similar to the resistors, but this time with a resistance value that instead of being fixed is variable, thus allowing control the intensity of current through a circuit connecting it in parallel and the voltage drop connected in series. It can also be said that they are very similar to the rheostatbut the difference in this case is that the rheostat dissipates more power and is used for circuits with higher current.

Accordingly, potentiometers are mostly used to vary the voltage in a circuit placed in parallel while the rheostats are used in series to vary the current. Therefore, it can be said that potentiometers are used to input analog values on the Arduino board allowing to perform a complete action together with other components.

One of its functions can be the following:

  • They allow to vary the speed of a motorregulate the intensity of light or vary the position of a servo motor.

In this way it can be said that potentiometers are devices that are used very frequently to modify the variables desired either voltage or current. This is how it is very important to be able to know the resolution of the arduino boardsince having a resolution of 10 bit means that you have a maximum value of 1024. Keeping all this in mind, we will teach you how to use it on Arduino from scratch.

Learn step by step how to use a potentiometer with Arduino from scratch

Considering everything mentioned above in the post, here we are going to teach you how to use the potentiometer with Arduino from scratch, taking into account that this is a component that will be very useful when creating and programming projects from this platform.

See also  【Differences Between Privacy and Security】Are They The Same? ▷ 2022

To do this, follow each of the steps that we are going to teach you below:

Using the potentiometer with an Arduino board

In the case of working with the you can count on 6 analog pins, they range from A0 to A5 and its most common use is to read data from analog devices such as the potentiometer. Here you get one 10 bit resolution which implies that you have 1024 values different, that is to say, that it is possible to read a range of tensions that go from 0V to 5V, detecting the possible voltage changes of 0.004V (5/1024).

In this way, the values ​​that will be obtained from ir from 0 to 1023. So that you can understand all this better, here we are going to show you an example through the serial monitor where you can see what values ​​are being obtained in a analog pin according to how the position of the potentiometer is modified.

In the following image you can see the connection:

The code

Keep in mind that you must upload a code to the board, in this case you must upload the following code:

//Variable where we will store the value of the potentiometer Long value; Void Setup() { //we initialize the serial communication Serial.begin(9600) //We write start messages to the serial monitor Serial.println(“Start sketch – potentiometer values”); } Void loop() { //We read from pin Aø value Value = analogRead(Aø) //We print by the serial monitor Serial.print(“the value is = “); Serial.println(value); Delay(1000); }

  • When it’s uploaded the code to the potentiometer on the board, the serial monitor should be opened. In this case the output will depend on the position of the potentiometer, as you turn the wheel you can see how the value is changing.
  • At one end, the resistance will be minimal and will allow the 5 V value analog 1023 and at the other end the resistance will be maximum and let go 0 V analog value of 0.

So that you can understand all this in a better way, here we are going to show you another example of how to use the potentiometer on an Arduino board:

Turn on LEDs with a potentiometer on Arduino

In this case 4 LEDs will be added to the circuitaccording to how the position is modified…

Loading Facebook Comments ...
Loading Disqus Comments ...