LCD screen control part i

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 turns ON the screen backlight. Let’s do it practically. The required components are as follows.




Components

Let’s do it step by step.
Step 1
Let us identify these components.

Arduino Uno board

You can be used any other Arduino board.

LCD screen

This component is described above.

Potentiometer

This component is used to control characters’ contrast.

180ohm resistor

This component is used to control the current.

Jumper wires

This project used 12 MALE to FEMALE jumper wires and 4 MALE to MALE jumper wires.

Breadboard

Use this to connect components.




Step 2 

Connect these components using the circuit diagram below.

Step 3

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 first include a library for this. Please include it as follows.
#include <LiquidCrystal.h>
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

Select board and port.

Step 5

Upload code.
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 for this project is given below.




Circuit diagram

Connect the circuit as shown below.

Source code

The complete program of this project – Download

/*LCD Display control.
  created by SriTu Tech team.
  Read the code below and use it for any of your creation
*/


#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. They are then inserted into the invalid loop. 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. Bye-bye.

LCD screen control part i

Similar Posts

Leave a Reply

Your email address will not be published.