Monday, May 16, 2016

Projet Using LCD16x2 And Arduino

LCD 16x2 ARDUINO REVIEW










The 2x16 LCD screen which is 2x16 chars big, can run on every arduino. It has a custom start message and it can have a custom design while measuring. It has a backlight LED and it requires 5V.
» Pin 1(GND) -> 0V
» Pin 2(VCC) -> +5V
» Pin 15 Backlight Anode(A) -> 330R -> +5V
» Pin 16 Backlight Cathode(K) -> GND
















LCD Pin#
LCD PIN NAME
Arduino Pin
1
VSS
GND
2
VDD
5V
3
VE
Pot Center Pin
4
RS
Pin 12
5
RW
GND
6
E
Pin 11
7
DB0
NOT CONNECTED
8
DB1
NOT CONNECTED
9
DB2
NOT CONNECTED
10
DB3
NOT CONNECTED
11
DB4
Pin 5
12
DB5
Pin 4
13
DB6
Pin 3
14
DB7
Pin 2
15
Backlight LED +V
5V
16
Backlight LED GND
GND




VSS : For ground for LCD.
VDD : For giving Vcc (+5 volt).
VEE : For adjusting brightness of lcd screen. We can use rheostat to give variable voltage to change the brightness.
RS : RS stands for resister select. If RS is HIGH then data at data bus treat as a data or if RS is LOW data at data bus treat as a command.
E : E stand for lcd enable pin.
D0-D7 : D0-D7 are data pin.
Now see the interfacing of LCD with Arduino Uno
 Now we look some important Arduino command to display our data at LCD.
begin():  this begin() command is used for initializes the LCD screen, and specifies the dimensions of the display. The important thing we should remember that begin() command needs to be called before any other LCD library commands.
Syntax: lcd.begin(cols, rows)
print() : This print() command is used to prints text to the LCD.
Syntax: lcd.print(data), lcd.print(data, BASE)
clear() : Clear() command is used to clears the LCD screen and set the cursor positions in the upper-left corner.
Syntax: lcd.clear()
write()  : write() command is used to write a character to the LCD.
Syntax: lcd.write(data)
rightToLeft() : By using this command we can flow text to the left from the cursor.
leftToRight() : By using this command we can flow to the right from the cursor.
setCursor() : this command used for set the position the LCD cursor.
Syntax: lcd.setCursor(col, row)
 So in our project Interfacing LCD with arduino Uno we want to display “NBCAFE” in first row and our websiteaddress WWW.NBCAFE.In at second raw. In bellow see the complete programming of our project Interfacing LCD with arduino Uno.
Embedded C Code
// Name : Interfacing LCD with arduino Uno 
// Author : Subham Dutta
// Date : 12-01-16
// Website : www.nbcafe.in
#include// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);void
 setup() {
// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);}void
 loop() {
lcd.setCursor(5, 0);
//
 Print a message to the LCD.
lcd.print(“NBCAFE”);
lcd.setCursor(1, 1);
//
 Print a message to the LCD.
lcd.print(“WWW.NBCAFE.IN”);
}
}

No comments:

Post a Comment