LCD Screen Control Part 1

by STEAM-DIY in Circuits > Arduino

71 Views, 3 Favorites, 0 Comments

LCD Screen Control Part 1

lcd.jpg

Hello friends, Welcome back to my blog. We described the LED bulb display in a previous post. It is very difficult to show what we want with this LED display. The LCD screen we are going to talk about today can easily show everything. It can display letters, symbols, words, etc.

What is an LCD screen?

LCD is a liquid crystal display. This type of display is made by inserting some liquid between two plates. Using these LCDs we can easily see Arduino outputs. Everything shown on the Arduino IDE Serial Monitor can be displayed on this LCD screen. There are two main types of LCD screens. That is a 16*2 and 16*4. Today we will be using a 16 * 2 type LCD display for our project.

We can display 32 characters on this LCD screen. It has 16 pins to provide input. Of these 16 pins, VSS and VDD pins are used to power it. The contrast of the letters can be controlled by the VO pin. For that, It must be powered by a potentiometer. The PIN named RS selects the registry where the data should be stored. The R / W pin should be connected to the GND pin. The enable pin is called the E-pin. That PIN is required to send data. The D0 to D7 pins are used to send data to the LCD screen. All eight pins are used to send data via an 8-bit mode. D4 to D7 pins are used for the 4-bit model. Today we will use the 4-bit mode for this project. The A and K pins are used to turn ON the screen backlight.

Supplies

Let’s do it practically. The required components are as follows.

  1. Arduino Uno board 
  2. LCD screen
  3. Potentiometer
  4. 180ohm resistor
  5. Jumper wires
  6. Breadboard

Let’s Look at the Code.

#include <LiquidCrystal.h>
LiquidCrystal lcd(9, 8, 4, 5, 6, 7);
void setup() {
lcd.begin(16, 2);
}
void loop() {
lcd.setCursor(0,0);
lcd.print("sritu tech");
}

To work with this LCD screen, you must include the LCD library for this. Please include it as follows.

(adsbygoogle = window.adsbygoogle || []).push({});

#include <LiquidCrystal.h>

LCD screen control part i

You will then need to create an object for this library. I created it as ‘dis’.Then we included the used pins. They are in order RS, E, D4, D5, D6, and D7.

LiquidCrystal lcd(9, 8, 4, 5, 6, 7);

The code in the void setting sets the size of the LCD screen used.

void setup() {
lcd.begin(16, 2);
}

You must then specify the location to be displayed on the LCD.

lcd.setCursor(0,0);

This code can display what we need. This should be written in double quotes.

lcd.print(“sritu tech”);


Step 4

Now, select the board and port. After, click the upload button.

LCD screen control part i

Please change this code and enjoy it.

The following is an improved project of this code. I have not used a potentiometer for that. OK let’s look at this project. The circuit diagram and source code are as follows.


Circuit Diagram

Connect the circuit as shown below.


LCD screen control part i


Source Code


/*LCD Display control.
created by Zorro
*/
#include <LiquidCrystal.h>//Include library path---Sketch -> Include Library -> LiquidCrystal
#define t 4000//delay time
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);//arduino pin(rs=2,e=3,D4=4,D5=5,D6=6,D7=7)
void setup() {
lcd.begin(16, 2);// set up the LCD's number of columns and rows
}
void loop() {
intro();
//ends(); //Uncomment and enjoy it
//thumbnail();//Uncomment and enjoy it
}
void intro() { //Function
lcd.setCursor(2, 0);//set print point
lcd.print("Hello TikTok!");//print text
delay(t);//delay
lcd.clear();//clear dispaly
lcd.setCursor(0, 0);
lcd.print("Please like and");
lcd.setCursor(4, 1);
lcd.print("Share me");
delay(t);
lcd.clear();
}
void ends() {//Function
lcd.setCursor(0, 0);
lcd.print("Thanks for Watching");
lcd.scrollDisplayLeft();//scroll text left
delay(250);
lcd.setCursor(0, 1);
lcd.print("Please like share and subscribe");
lcd.scrollDisplayLeft();//scroll text left
delay(250);
}
void thumbnail() {//Function
lcd.setCursor(2, 0);
lcd.print("LCD tutorial");
}


This code includes three functions. Please remove the backslash one by one and run this code. Please watch the video below for more details. We will meet in the next post.




Have a good day.