In this tutorial we learn how to display the potentiometer readings on LCD Display using Arduino.

»Read More about LCD 16 x 2 Display

»Read More about Potentiometer

Components List

  LCD 16 x 2 Dispaly
  Arduino Uno
  2 x Potentiometer 10kOhms
  Jumper Wires
  Breadboard
  Resistors

Pin Connections

Pin Connection Of Arduino and LCD

Pin No. LCD Pins Arduino Pins
1 VSS/GND GND
2 VDD/VCC 5v
3 V0 Potentiometer Vout/Wiper
4 RS 12
5 RW GND
6 E 11
7-10 D0-D3 No connection
11 D4 5
12 D5 4
13 D6 3
14 D7 2
15 A/LED+ 5v
16 K/LED- GND

Connect Potentiometer Vin and GND with Arduino 5v and GND respectively.

Pin Connection Of Arduino and Second Potentiometer

Pin No. Potentiometer Pins Arduino Pins
1 5V / Vin 5V
2 GND GND
3 Wiper / Vout A0

 

potentiometer-pinout

Circuit Diagram of Potentiometer with LCD Display

CIRCUIT DIAGRAM OF DISPLAY POTENTIOMETER READINGS ON LCD DISPLAY

Code for Displaying Potentiometer Readings on LCD Display

/*
  The circuit:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * LCD VSS pin to ground
 * LCD VCC pin to 5V
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)
 
  Second Potentiometer connection with Arduino
 * Potentiometer 5v to Arduino 5v
 * Potentiometer GND to Arduino GND
 * Potentiometer Wiper/Vout to Arduino A0(Analog pin 0)
 */

// include the library code:
#include <LiquidCrystal.h>
int sensorValue = 0;

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() 
{
  pinMode(A0, INPUT);
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  Serial.begin(9600);
}

void loop() 
{
  // read the input on analog pin 0:
  sensorValue = analogRead(A0);
  // set the cursor to column 0, line 0:
  lcd.setCursor(0, 0);
  // print out the value at LCD Display:
  lcd.print(sensorValue);
  // print out the value at Serial Monitor:
  Serial.println(sensorValue);
  delay(1000);
  lcd.clear();  
}

Output

OUTPUT OF DISPLAY POTENTIOMETER READINGS ON LCD DISPLAY

Our Youtube Channel