schematics

Hardware configurations and initialization

Here you can find some of the most common LCD connection configurations. All these configurations have been tested with the library and should work well.

4 bit parallel connection

This is the basic parallel conection to an LCD, using 4 IO for data and 2 to control the LCD.

Board layout

4 bit connection

The pin assignement is arbitrary and can be mapped to suit your application. Take care when initialising the LCD and make sure you pass the correct IO assignement to the LiquidCrystal constructor ("variable" initialization).

#include <LCD.h>
#include <LiquidCrystal.h>

LiquidCrystal iLCD ( 12, 11, 5, 4, 3, 2 );

void setup ( )
{
   iLCD.begin ( 16, 2 );

   // your code here...
}

void loop ()
{
   // your code here ...
}

I2C connection

The I2C supported by this library is based on the PCF8575 ASIC and has been tested with the schematic below. The library has proven to work with this pin assignement but it can be changed during class construction. Get one pre-assembled from here: electroFUN

Other ASICs are not supported, but it should be straight forward to do so.

Board layout

PCF8574 I2C schematic

#include <LCD.h>
#include <LiquidCrystal_I2C.h>

#define I2C_ADDR     0x38

LiquidCrystal_I2C iLCD(I2C_ADDR);

void setup ( )
{
   iLCD.begin ( 16, 2 );

   // your code here...
}

void loop ()
{
   // your code here ...
}

ShiftRegister connection

The library has been tested with varios configurations and shiftregisters. Please see schematics below for information.

Other ASICs are not supported, but it should be straight forward to do so.

Non Latching Shift Register

Schematics from the original project home: Shift Register project home

Two wire non latching Shift Register Schematic. 2 wire

#include <LCD.h>
#include <LiquidCrystal_SR.h>

// constructor prototype parameter:
//  LiquidCrystal_SR lcd(DataPin, ClockPin);
LiquidCrystal_SR lcd(2, 3);

void setup ( )
{
   lcd.begin ( 16, 2 );

   // your code here...
}

void loop ()
{
   // your code here ...
}

Three wire non latching Shift Register Schematic. 3 wire

#include <LCD.h>
#include <LiquidCrystal_SR.h>

// constructor prototype parameter:
//  LiquidCrystal_SR lcd(DataPin, ClockPin, EnablePin);
LiquidCrystal_SR lcd(2, 3, 4);

void setup ( )
{
   lcd.begin ( 16, 2 );

   // your code here...
}

void loop ()
{
   // your code here ...
}

Latch Shift Register

Two wire latch Shift Register Schematic. Get one pre-assembled from here: electroFUN 2 wire latch

#include <LCD.h>
#include <LiquidCrystal_SR.h>

// constructor prototype parameter:
//  LiquidCrystal_SR lcd(DataPin, ClockPin);
LiquidCrystal_SR lcd(2, 3);

void setup ( )
{
   lcd.begin ( 16, 2 );

   // your code here...
}

void loop ()
{
   // your code here ...
}

Three wire latch Shift Register Schematic. 3 wire latch

#include <LCD.h>
#include <LiquidCrystal_SR.h>

// constructor prototype parameter:
//  LiquidCrystal_SR lcd(DataPin, ClockPin, EnablePin);
LiquidCrystal_SR lcd(2, 3, 4); 
void setup ( )
{
   lcd.begin ( 16, 2 );

   // your code here...
}

void loop ()
{
   // your code here ...
}

Other configurations

Here is how to initialize the driver for other boards.

DFRobot

Courtesy of PeterSek

//this is for dfrobot i2c LCD board
//                    addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address

Pin configuration

		DFRobot
I2C address	0x27
RS		P0
RW		P1
E		P2
D4		P4
D5		P5
D6		P6
D7 - 		P7
Backlight - 	P3
Bl Polarity	POSITIVE

mjkdz

Courtesy of PeterSek

//this is for mjkdz i2c LCD board
//                    addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
LiquidCrystal_I2C lcd(0x20, 4, 5, 6, 0, 1, 2, 3, 7, NEGATIVE);  // Set the LCD I2C address

Pin configuration

		Mjkdz
I2C address	0x20	
RS		P6	
RW		P5	
E		P4	
D4		P0	
D5		P1	
D6		P2	
D7  		P3	
Backlight  	P7	
Bl Polarity	NEGATIVE

Updated

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.