How to Use an LCD - Arduino
Intro: How to Use an LCD - Arduino
Let's learn how to use an LCD (Liquid Crystal Display) with an Arduino board.
STEP 1: Hardware Needed
-An Arduino Uno
-A breadboard
-Jumper wires
-A 10K potentiometer
-And an LCD of course !
You won't need any tool.
STEP 2: Build the Circuit
The steps here correspond to the image above...
First, pin your LCD on the breadboard and power the breadboard by connecting a wire from "5V" (power) on your Arduino to the positive row on the breadboard and another one from "GND" (ground or 0V) to the negative row.
Then connect the LCD to the Arduino:
LCD pin 4 - Arduino pin 2
Pin 6 - pin 3
Pin 11 - pin 4
Pin 12 - pin 5
Pin 13 - pin 6
Pin 14 - pin 7
After that, power the LCD:
LCD pin 1 = GND on the breadboard
Pin 2 = 5V
Pin 5 = GND
Pin 15 = 5V
Pin 16 = GND
Then connect pin 3 on your LCD to the central pin of the 10K potentiometer.
Finally, power the potentiometer with one pin on GND and the other one on 5V (on the breadboard).
STEP 3: Code
Now let's write the code...
#include <LiquidCrystal.h> //Include the library that enables you to use the LCD.
LiquidCrystal lcd(2,3,4,5,6,7);//Declare that your LCD is connected to pins 2,3,4,5,6 & 7 on your arduino.
void setup() { lcd.begin(16, 2);//16 by 2 are the dimensions of the LCD (in number of characters) lcd.print("My name is Bond");//print "My name is Bond," on the LCD lcd.setCursor(0, 1); //break a line lcd.print("controlled LCD!");//print "James Bond" on the second line of the LCD. } void loop() { }
4 Comments
Otech2012 8 years ago
I would like learn Arduino / LCD microcontrllemicrcontroller
Programming
Thanks
Hugo Trombert 8 years ago
It is interesting to start with 123d circuits because you can program, design, and simulate your project for free. And the Arduino starter kit is cool because it has a great book inside, many components and it is not very expensive...
Otech2012 8 years ago
I am new to programming. Can you please tell me where to start ? Thanks
Hugo Trombert 8 years ago
Hi,
Would you like to start learning computer programming (apps, games...) or electronic programming (microcrontrollers like Arduino, small electronic devices like LCDs...) ?