DIY Inventor
Published

Arduino Potentiometer Controlled Text Display on LCD 16x2

This project is going to tell How to display the potentiometer controlled text on LCD. With this, you can also display sensor value on LCD.

BeginnerFull instructions provided1,769
Arduino Potentiometer Controlled Text Display on LCD 16x2

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Alphanumeric LCD, 16 x 2
Alphanumeric LCD, 16 x 2
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
10K
×1
Resistor 1k ohm
Resistor 1k ohm
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE
LiquidCrystal.h Library

Story

Read more

Schematics

Circuit Diagram

Connection of LCD

Connect the First pin from the left of LCD (GND pin) with GND pin of Arduino.
Connect the Second pin from the left of LCD (VCC pin) with VCC pin of Arduino.
Connect the Third pin from the left of LCD (V0 pin) with GND pin of Arduino.
Connect the Fourth pin from the left of LCD (RS pin) with 11 pin of Arduino.
Connect the Fifth pin from the left of LCD (R/W pin) with GND pin of Arduino.
Connect the Sixth pin from the left of LCD (E pin) with 10 pin of Arduino.
Connect the Eleventh pin from the left of LCD (D4 pin) with 5 pin of Arduino.
Connect the Twelveth pin from the left of LCD (D5 pin) with 4 pin of Arduino.
Connect the Thirteen pin from the left of LCD (D6 pin) with 3 pin of Arduino.
Connect the Fourteenth pin from the left of LCD (D7 pin) with 2 pin of Arduino.
Connect the Fifteenth pin from the left of LCD (5V pin) with 1 K Resistor with 2 pin of Arduino.
Connect the Last pin from the left of LCD (GND pin) with GND pin of Arduino.
Connection of Potentiometer

Connect the first pin from the left of Potentiometer (GND Pin) with GND Pin of Arduino
Connect the middle pin from of Potentiometer (Output) with GND Pin of Arduino
Connect the last pin from the left of Potentiometer (5V Pin) with 5V Pin of Arduino

Code

COde

C/C++
/*
Inventor DIY Inventor (Krishna Agarwal)
Coder DIY Inventor (Krishna Agarwal)
Designer DIY Inventor (Krishna Agarwal)
*/



#include <LiquidCrystal.h>
int sensorValue = 0;

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(11, 10, 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);
 lcd.begin(16,2);
  lcd.print("Starting System");
   delay(1000);
lcd.clear();
lcd.print("System On");
   delay(1500);  
  
lcd.clear();

}

void loop() 
{
  

  sensorValue = analogRead(A0);
  Serial.println(sensorValue);




  if (sensorValue>= 0 && sensorValue <=200 ){

    lcd.setCursor(0,0);
  lcd.print("  DIY Inventor  ");
    lcd.setCursor(0,1);
    lcd.print("0 to 200    ");  
  lcd.setCursor(13,1);
lcd.print(sensorValue);  


}

  else if (sensorValue>= 201 && sensorValue <=400 ){

    lcd.setCursor(0,0);
  lcd.print("  DIY Inventor  ");
    lcd.setCursor(0,1);
    lcd.print("200 to 400  ");  
  lcd.setCursor(13,1);
lcd.print(sensorValue);  
/// lcd.clear();

}

  else if (sensorValue>= 401 && sensorValue <=600 ){

    lcd.setCursor(0,0);
  lcd.print("  DIY Inventor  ");
    lcd.setCursor(0,1);
    lcd.print("400 to 600  ");  
  lcd.setCursor(13,1);
lcd.print(sensorValue);  
/// lcd.clear();

}
  else if (sensorValue>= 601 && sensorValue <=800 ){

    lcd.setCursor(0,0);
  lcd.print("  DIY Inventor  ");
    lcd.setCursor(0,1);
    lcd.print("600 to 800  ");  
  lcd.setCursor(13,1);
lcd.print(sensorValue);  
/// lcd.clear();

}


  else if (sensorValue>= 801 && sensorValue <=1000 ){

    lcd.setCursor(0,0);
  lcd.print("  DIY Inventor  ");
    lcd.setCursor(0,1);
    lcd.print("800 to 1000  ");  
  lcd.setCursor(13,1);
lcd.print(sensorValue);  
/// lcd.clear();

}

}

Credits

DIY Inventor

DIY Inventor

0 projects • 17 followers
Hello Guys, My name is Krishna Agarwal , and I'm passionate about Making DIY Projects. Here I make Arduino and Robotics related projects.

Comments