Potentiometer Module

../_images/08_potentiomete_module.png

Introduction

The potentiometer module is an electronic component that changes its resistance depending on the position of the twist knob.It can be used for various purposes, such as controlling the volume of a speaker, the brightness of a LED, or the speed of a motor.

Principle

Potentiometer is also a resistance component with 3 terminals and its resistance value can be adjusted according to some regular variation.

Potentiometers come in various shapes, sizes, and values, but they all have the following things in common:

  • They have three terminals (or connection points).

  • They have a knob, screw, or slider that can be moved to vary the resistance between the middle terminal and either one of the outer terminals.

  • The resistance between the middle terminal and either one of the outer terminals varies from 0 Ω to the maximum resistance of the pot as the knob, screw, or slider is moved.

Here is the circuit symbol of potentiometer.

../_images/08_potentiometer_symbol_2.png

The functions of the potentiometer in the circuit are as follows:

  1. Serving as a voltage divider

    Potentiometer is a continuously adjustable resistor. When you adjust the shaft or sliding handle of the potentiometer, the movable contact will slide on the resistor. At this point, a voltage can be output depending on the voltage applied onto the potentiometer and the angle the movable arm has rotated to or the travel it has made.

  2. Serving as a rheostat

    When the potentiometer is used as a rheostat, connect the middle pin and one of the other 2 pins in the circuit. Thus you can get a smoothly and continuously changed resistance value within the travel of the moving contact.

  3. Serving as a current controller

    When the potentiometer acts as a current controller, the sliding contact terminal must be connected as one of the output terminals.

Usage

Hardware components

  • Arduino Uno R4 or R3 board * 1

  • Potentiometer Module * 1

  • Jumper Wires

Circuit Assembly

../_images/08_potentiometer_module_circuit.png

Code



Code explanation

  1. This line of code defines the pin number to which the potentiometer is connected on the Arduino board.

    const int sensorPin = A0;
    
  2. The setup() function is a special function in Arduino that is executed only once when the Arduino is powered on or reset. In this project, the Serial.begin(9600) command initiates serial communication at a baud rate of 9600.

    void setup() {
      Serial.begin(9600);
    }
    
  3. The loop() function is the main function where the program runs repeatedly. In this function, the analogRead() function reads the analog value from the potentiometer and prints it to the serial monitor using Serial.println(). The delay(50) command makes the program wait for 50 milliseconds before taking the next reading.

    void loop() {
      Serial.println(analogRead(sensorPin));
      delay(50);
    }
    

Additional Ideas

  • Control an LED’s brightness: The potentiometer’s analog value could be used to control the brightness of an LED connected to a PWM-enabled pin on the Arduino.

  • Control a Servo Motor’s Position: By mapping the analog value to the range of the servo’s position (usually 0 to 180 degrees), the potentiometer could be used as a controller for the servo motor.

More Projects