Tutorial: Basic 16x2 LCD with Arduino

On this tutorial, we will show you how to connect a basic 16x2 LCD to your Arduino.

Materials List

1x Arduino UNO

1x LCD 16x2

1x Potentiometer 10KΩ

1x Breadboard

Jumper wires

In the LCD datasheet we can check the correct pins of your display.

Connect it like the picture below.

Behind your display, we can see the pin numbers, from 1 to 16. To turn the backlight on, connect the pin 15 to 5V and the 16 to GND.

The Code

#include span style="color: #cc6600;">LiquidCrystal.h> //Include LCDs LibraryLiquidCrystal lcd(12, 11, 5, 4, 3, 2); //Attach LCDs and Arduino pin comunnication 
int time; //Entire variable declaration(time)

void setup()//setup section
{

lcd.begin(16, 2); //LCD begins. dimension: 16x2(Coluns x Rows)
lcd.setCursor(0, 0); // Positions the cursor in the first column (0) and the firt row (1) at LCD
lcd.print("LiquidCrystal.h"); //LCD write comand"LiquidCrystal.h"
lcd.setCursor(0, 1); // Positions the cursor in the first column (0) and the second row (1) at LCD
lcd.print("GarageLab"); // LCD write command "GarageLab"

}

void loop()
{
lcd.setCursor(13, 1); // Positions the cursor on the fourteenth column (13) and the second line (1) LCD
lcd.print(time); // Write the current value of the count variable in the LCD
delay(1000); // Waits for 1 second
time++; // Increment count variable

if(time == 600) // If the variable temp get to 600 (10 minutes), ...
{
time = 0; //... resets the count variable
}

}


Feel free to change the text and see what happens.

References:

http://www.sparkfun.com/datasheets/LCD/GDM1602K.pdf

http://arduino.cc/en/Tutorial/LiquidCrystal

Views: 24122

Tags: arduino, lcd, tutorial

Comment by HaimaN Adel on January 26, 2013 at 8:41am

thank you

done

this my project

Comment

You need to be a member of GarageLab (arduino, electronics, robotics, hacking) to add comments!

Join GarageLab (arduino, electronics, robotics, hacking)

Latest Activity

SANYAM JAIN joined Marcelo Rodrigues's group
Thumbnail

Arduino

Group for the Arduino communitySee More
1 hour ago
GarageLab posted blog posts
6 hours ago
Profile IconSANYAM JAIN, KIRAN, ron wright and 1 more joined GarageLab (arduino, electronics, robotics, hacking)
22 hours ago
james gage replied to Devin Moss's discussion Free-spinning high torque DC motor
"My suggestion is to investigate electromagnetic clutches. You can engage any motor with a logic…"
yesterday
GarageLab posted blog posts
Tuesday
Rey Canedo is now a member of GarageLab (arduino, electronics, robotics, hacking)
Monday
Devin Moss posted a discussion

Free-spinning high torque DC motor

I'm looking for a high-torque DC motor (able to lift 20 pounds) which, when turned off, will spin…See More
Feb 28
Marcelo Rodrigues posted a blog post
Feb 28
Profile IconJack Gromek, pratik and KEKELI LOGAH joined GarageLab (arduino, electronics, robotics, hacking)
Feb 27
GarageLab posted a blog post

Stanford’s cheap nanomaterial filter could solve the air pollution problem

The rapidly increasing industrialization in many parts of the world comes with economic benefits,…See More
Feb 27
GarageLab posted a blog post

Blub Uno Clock Displays Time with One Nixie Tube

We’ve seen our share of Nixie tube clocks, but the Blub Uno is different. This is a clock that…See More
Feb 26
GarageLab's blog post was featured

LEGO X Converts Creations into 3D Models in Real Time: Body and Soul

Created by Gravity Research Club, LEGO X creates a 3D model of whatever you’re building while…See More
Feb 25
sathiyakumar is now a member of GarageLab (arduino, electronics, robotics, hacking)
Feb 24
GarageLab posted blog posts
Feb 24
Profile Iconaymen hleli, gunawan eko, Dean Sanders and 1 more joined GarageLab (arduino, electronics, robotics, hacking)
Feb 23
GarageLab posted a blog post

Street Fighter Played with Pianos: Sound Fighter

Back in 2014 we saw an piano that was turned into…See More
Feb 23
GarageLab posted blog posts
Feb 20
Profile IconRobert Choi and Pierre Gelinas joined GarageLab (arduino, electronics, robotics, hacking)
Feb 20
David Wachter commented on GarageLab's blog post DARPA is developing a sensing bionic hand
"This would be nice for all of the military amputees that have been 'produced' since the…"
Feb 18
GarageLab's blog post was featured

AirBoard: The Flying Segway

Currently up for funding on…See More
Feb 18

© 2015   Created by Marcelo Rodrigues.

Badges  |  Report an Issue  |  Terms of Service