16X2 Display I2C interface with Arduino

I2C_scanner Displays are used to monitor and diagnosis. it is more fun to play with the display’s. lets begin with the lcd module.

LCD DISPLAY

It comes with 16 pins. (GND(1), Vcc(2), Vee(3), RS(4), R/W(5), EN(6), DB0-DB7(7-14), Led+(15)& Led-(16))

new update

Pin Description:

Pin No
 Function
 Name
1
Ground (0V)
Ground
2
Supply voltage; 5V (4.7V – 5.3V)
 Vcc
3
Contrast adjustment; through a variable resistor
 VEE
4
Selects command register when low; and data register when high
Register Select
5
Low to write to the register; High to read from the register
Read/write
6
Sends data to data pins when a high to low pulse is given
Enable
7
8-bit data pins
DB0
8
DB1
9
DB2
10
DB3
11
DB4
12
DB5
13
DB6
14
DB7
15
Backlight VCC (5V)
Led+
16
Backlight Ground (0V)
Led-

I2C LCD INTERFACE

These are the interfacing modules to connect the display with the Arduino. this drive is suitable when there is less number of pins available.

$_12

Features:

  • On board variable resistor to change the contrast of lcd.
  • Power led.
  • Jumper pin for turning on and off the display back light.
  • PCF8574P 8 bit I/O Expander chip.
  • A0, A1 & A2 can be short circuited for varying the address of the display ( Multiple displays).

 

INTERFACING 

solder the I2C interface directly to the display ( NOTE: Pins from the I2C interface module should face out from the lcd module).

20151018_100759

CIRCUIT CONNECTIONS:

In Arduino Uno R3  pin A4 and A5 are the dedicated SDA and SCL pins.

  • Connect GND pin from I2c display interface to Arduino ground pin.
  • Connect Vcc pin from I2c display interface to 5V power supply pin in Arduino.
  • Connect SDA and SCL pins from I2c display interface to A4 and A5 pins respectively.

20151019_142715

Programming

Download the header files and install. you can the header files here.(NOTE: For new Arduino IDE(Late 2015 Versions) download header file here)

open the Arduino IDE, and first we need to find the address of the I2C chip. Use this simple I2C scanner program that helps to find the address. click I2C scanner to download the program.

(Copy the program directly to Arduino IDE)

upload the program and open the serial monitor screen you will find the address of display.

Untitled

Then open the example program from the file menu and change the address and display size

Capture

Thats it!! here is the Example program to demonstrate the different functions of lcd control

20151019_145217

Advertisements

One thought on “16X2 Display I2C interface with Arduino

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s