Ep-1.3 21mca2001
Ep-1.3 21mca2001
Design the circuit and write a program to Interface of 16*2 LCD with Arduino Uno to print the
message on LCD
• Hardware Required:
• LCD 16*2
• Resistor
• Arduino UNO3
• Breadboard
• Potentiometer
• Theory:
Arduino Uno is a microcontroller board that allows you to build electronics
projects by connecting sensors and other components to it. It is easy to use
and comes with a programming environment that simplifies the process of
writing code. It is used in a variety of applications, including robotics, home
automation, and many other projects.
A breadboard is a prototyping board used to build and test electronic
circuits. It has a grid of holes into which electronic components, such as
resistors, capacitors, and integrated circuits, can be inserted and connected
without the need for soldering. The holes are typically arranged in a series of
parallel rows and columns, allowing for easy circuit design and
modification. Breadboards come in various sizes and can be reused multiple
times for different projects. They are widely used by hobbyists, students, and
professionals for electronics prototyping and testing.
LCD stands for Liquid Crystal Display, and it is a type of display screen
commonly used in electronic devices, including Arduino boards. The 16x2
LCD is a type of LCD display that has 16 columns and 2 rows, allowing it to
display up to 32 characters at once.
The LCD display works by using a backlight to illuminate the display and
liquid crystals to block or allow light to pass through, creating the characters
or images on the screen. The LCD display can be controlled using an
Arduino board by connecting it to the board's digital pins and using a
specialized library that provides a set of functions for controlling the display.
A potentiometer is a type of variable resistor that is commonly used to
control the flow of electrical current in a circuit. It has a three-terminal
design, with one terminal connected to the input voltage or current, one
terminal connected to the ground or reference voltage, and the third terminal
connected to the output or load.
Implementation Steps:
Here are the step-by-step instructions to connect a 16x2 LCD display to an Arduino
Uno using a potentiometer and displaying a text:
Arduino Code:
// C++ code
//
#include <LiquidCrystal.h>
LiquidCrystal lcd(2, 3, 4,5,6,7); //Pins connected to LED
void setup()
{
lcd.begin(16, 2);
}
void loop()
{
int i = 0; //Initial position of text
bool forward = true; // Boolean to change the direction of
text
while(i >= 0){ //Loop to shift the text forward and backward
if(i == 4)
forward = false; //text reach the end and reverse
direction