Step-By-Step LCD Wiring (4 Bit Mode) and Programming Examples For Arduino
Step-By-Step LCD Wiring (4 Bit Mode) and Programming Examples For Arduino
(http://cdn.instructables.com/FS6/X7OF/H1JUGSKG/FS6X7OFH1JUGSKG.LARGE.jpg)
About This Instructable
Posted:
59,979 views Apr 30, 2012
28 favorites License:
Kev_MacD
(/member/Kev_MacD/)
Follow 26
(http://cdn.instructables.com/FPT/TOJ5/H1JUGSJR/FPTTOJ5H1JUGSJR.LARGE.jpg)
(/member/Kev_MacD/)
More by Kev_MacD
(/id/Wiring-and-
programming-an-Electric-Imp-with-an-
Show All 7 Items
(http://cdn.instructables.com/FOF/1YY3/H1JUGSJU/FOF1YY3H1JUGSJU.LARGE.jpg) LCD)
(http://cdn.instructables.com/FAF/S0N6/H1JUGSJS/FAFS0N6H1JUGSJS.LARGE.jpg)
(/id/Wiring-and-
This instructable will guide a user step-by-step in wiring and programming a Hitachi programming-the-Parallax-RFID-Serial-
HD44780 (or a compatible) chipset LCD screen to an Arduino, using the Ca)
LiquidCrystal Library. Programming examples are provided for all the Library calls.
(http://cdn.instructables.com/FXW/GTDB/H1JUGSJW/FXWGTDBH1JUGSJW.LARGE.jpg)
4- Current(http://cdn.instructables.com/FEZ/P1T1/H1JUGSJX/FEZP1T1H1JUGSJX.LARGE.jpg)
limiting resistor for the backlight (10 Ohm) LCD (/tag/type-id/category-technology/keyw ord-lcd/)
5- 10K trim pot for the contrast LiquidCrystal (/tag/type-id/category-technology/keyw ord-liquidcrystal/)
6- 16 pin Male 0.01 Headers
Group
1. Ground
2. VCC (+3.3 to +5V)
3. Contrast adjustment (VO)
4. Register Select (RS). RS=0: Command, RS=1: Data
5. Read/Write (R/W). R/W=0: Write, R/W=1: Read
6. Clock (Enable). Falling edge triggered
7. Bit 0 (Not used in 4-bit operation)
8. Bit 1 (Not used in 4-bit operation)
9. Bit 2 (Not used in 4-bit operation)
10.Bit 3 (Not used in 4-bit operation)
11.Bit 4
12.Bit 5
13.Bit 6
14.Bit 7
15.Backlight Anode (+)
16.Backlight Cathode (-)
(http://cdn.instructables.com/FOF/1YY3/H1JUGSJU/FOF1YY3H1JUGSJU.LARGE.jpg)
(http://cdn.instructables.com/FXW/GTDB/H1JUGSJW/FXWGTDBH1JUGSJW.LARGE.jpg)
Solder the headers onto the LCD panel and insert the LCD Panel into a solderless
breadboard.
Wire the Breadboard with 5V and GND from the Arduino
Add jumpers from 5V to pin 15 on the LCD, and insert the 10 Ohm Resistor into Pin
16 on the LCD. Jumper the other end of the resistor to GND.
Power up the Arduino and the backlight should light up. Progress!
(http://cdn.instructables.com/FZV/XP47/H1JUGSJZ/FZVXP47H1JUGSJZ.LARGE.jpg)
Apply power to the unit and adjust the trim pot until you see rectangles appear on
the screen. (See Photo)
Step-By-Step
Step 4: Control LCD
Wireswiring (4 Wires
and Data Bit Mode) and Programming examples for
Arduino
by Kev_MacD (/member/Kev_MacD/)
Download (/id/Step-By-Step-LCD-wiring-4-Bit-Mode-and-Programmi/?download=pdf)
(/id/Step-By-Step-LCD-wiring-4-Bit-Mode-and-Programmi/) 8 Steps
Before anything shows up on the LCD, you will need to load the Library and sketch
provided in the next 2 steps onto the Arduino.
http://arduino.cc/en/Reference/Libraries (http://arduino.cc/en/Reference/Libraries)
Create a new sketch window enter the information below. If you display is not a 16
character by 2 line display, please modify
#define LCDColumns 16
#define LCDRows 2
Upload the sketch to your Arduino to get the display to read "Hello, World!"
#include <LiquidCrystal.h>
#define RSPin 6
#define EnablePin 7
#define DS4 9
#define DS5 10
#define DS6 11
#define DS7 12
#define LCDColumns 16
#define LCDRows 2
void setup()
{
lcd.begin(LCDColumns, LCDRows); //Configure the LCD
lcd.setCursor(0,0);
lcd.print("Hello, World!");
}
void loop()
{
LCD_Instructable_Hello_World.ino
(/files/orig/FN3/ECFC/H1JUGSWV/FN3ECFCH1JUGSWV.ino)369 bytes
In the example we used define statements to set the pin values and then called
LiquidCrystal using the define'd values
#define RSPin 6
#define EnablePin 7
#define DS4 9
#define DS5 10
#define DS6 11
#define DS7 12
#define LCDColumns 16
#define LCDRows 2
LiquidCrystal lcd(RSPin, EnablePin,DS4,DS5,DS6,DS7);
#define LCDColumns 16
#define LCDRows 2
...
lcd.begin(LCDColumns, LCDRows);
setCursor(col, row) - Positions the cursor. setCursor(0,0) to the top left of the
display
flag
flag
FEATURED CHANNELS
Life Hacks Beauty Woodworking Minecraft Breakfast Laser Cut Organizing Arduino
(/tag/type- (/tag/type- (/tag/type- (/tag/type- (/tag/type- (/tag/type- (/tag/type- (/tag/type-
id/category- id/category- id/category- id/category- id/category- id/category- id/category- id/category-
Intel IoT home/channel- home/channel- workshop/channel-play/channel- food/channel- workshop/channel-home/channel- technology/channel-
(/id/intel/) life-hacks/) beauty/) woodworking/) minecraft/) breakfast/) laser-cutting/) organizing/) arduino/)
Newsletter
Join 2 million + to receive instant
inspiration in your inbox.
Mobile
Download our apps!
Android (https://play.google.com/store/apps/details?id=com.adsk.instructables)
iOS (https://itunes.apple.com/app/instructables/id586765571)
Windows (http://apps.microsoft.com/windows/en-us/app/7afc8194-c771-441a-9590-54250d6a8300)
About Us Find Us
Who We Are (/about/) Facebook (http://www.facebook.com/instructables)
Advertise (/advertise/) Youtube (http://www.youtube.com/user/instructablestv)
Contact (/about/contact.jsp) Twitter (http://www.twitter.com/instructables)
Jobs (/community/Positions-available-at-Instructables/)
Pinterest (http://www.pinterest.com/instructables)
Help (/id/how-to-write-a-great-instructable/)
Google+ (https://plus.google.com/+instructables)
Tumblr (http://instructables.tumblr.com)
Resources
For Teachers (/teachers/)
Artists in Residence (/air)
Gift Pro Account (/account/give?sourcea=footer)
Forums (/community/)
Answers (/tag/type-question/?sort=RECENT)
Sitemap (/sitemap/)