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: 27766

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

Harry Matthie posted a discussion

Garagino JP1

Does anyone know what the JP1 is for on the Garagino?  I found out that the x1 and x2 pins are for…See More
1 hour ago
GarageLab posted blog posts
9 hours ago
Profile IconManikandan and k joined GarageLab (arduino, electronics, robotics, hacking)
10 hours ago
GarageLab posted a blog post
Friday
Donnie Rose replied to Donnie Rose's discussion Building an auto-boat to keep ducks out of the pool!
"Correction, sorry.  RC receiver is not used with this set up.   Battery & motor hooks…"
Thursday
Donnie Rose posted a discussion
Thursday
Profile IconDonnie Rose and Ransona Company joined GarageLab (arduino, electronics, robotics, hacking)
Thursday
GarageLab posted a blog post
Thursday
Jim Kelley commented on GarageLab's blog post HemaVision Smart Thermal Imager Actually Tells You What that Cool (or Hot) Image Means
"This could be a valuable tool for diagnosing temperature and humidity problems in locations where…"
Thursday
Anthony Parker updated their profile
Apr 14
David Braithwaite added a discussion to the group Raspberry Pi
Apr 14
David Braithwaite joined David's group
Thumbnail

Raspberry Pi

This is a place to discuss all things Raspberry Pi.See More
Apr 14
GarageLab posted a blog post

Artificial bee brain used for vision system of a drone

The Green Brain Project is located in Sheffield, England, and it has one key focus: to simulate a…See More
Apr 14
Profile Iconabraham chemweno, Hetcher, Dan Calef and 1 more joined GarageLab (arduino, electronics, robotics, hacking)
Apr 14
Robbie McCreath commented on GarageLab's blog post Tutorial: Stepper Motor + Easy Driver + Arduino
"Hi there, ive been woking on this tutorial and it is exactly what i need, with use of the serial…"
Apr 13
daniel gabriel left a comment for daniel gabriel
"stop this, i know what is next to, you scammer"
Apr 10
GarageLab posted a blog post

HemaVision Smart Thermal Imager Actually Tells You What that Cool (or Hot) Image Means

HemaImaging it’s working on the HemaVision, a standalone thermal imager that will be able to give…See More
Apr 9
Profile Iconfidel, Mauro Pompetti, FRANK KWABENA and 1 more joined GarageLab (arduino, electronics, robotics, hacking)
Apr 9
Anuradha Ranasinghe is now a member of GarageLab (arduino, electronics, robotics, hacking)
Apr 8
GarageLab posted blog posts
Apr 8

© 2015   Created by Marcelo Rodrigues.

Badges  |  Report an Issue  |  Terms of Service