Z-0234

From 52Pi Wiki
Jump to navigation Jump to search

1602 Serial LCD Module Display

Lcd1602blue01.jpg

Description

As we know, the CD1602 is an industrial character LCD that can display 16x02 or 32 characters at the same time.
The principle of the LCD1602 liquid crystal display is to use the physical characteristics of the liquid crystal to control the display area by voltage,
that is, the graphic can be displayed.
In general, the 1602 uses a standard 16-pin interface, and our display module is a module that provides I2C functionality.
I²C uses only two bidirectional open-drain lines, Serial Data Line (SDA) and Serial Clock Line (SCL),
pulled up with resistors. Typical voltages used are +5 V or +3.3 V although systems with other voltages are permitted.
It can be operated as long as it supports the I2C development board.
For example, the common Arduino, raspberry pi, Stm32 and so on.

Features

  • Easy to use.
    Lcd1602blue02.jpg
  • Less I/O ports are occupied
  • Support IIC Protocol.
  • The I2C LCD1602 library is easy to get
  • With a potentiometer used to adjust backlight and contrast
  • Blue backlight
  • Power supply: 5v
  • I2C address is: 0x27

Package include

  • 2 x Blue backlight I2C LCD1602(1602 Serial LCD Module Display
  • 8 x Jump wire

How to connect it to Arduino

  • Connect LCD1602 module to Arduino Uno board as following picture:
I2C LCD1602 Arduino Uno board
GND GND
VCC 5V
SDA A4 /pin 20 mega2560
SCL A5 /pin 21 mega2560
Fritzing-sketch-for-LCD1602-and-Arduino.jpg


How to connnect it to Raspberry Pi

LCDGPIO.png
Lcd1602blue03.jpg


How to program it in Arduino

  • 1.Download the LiquidCrystal_I2C library
  • 2.Open the Arduino IDE,Select Sketch -> Include Library -> Add ZIP Library
  • 3.Find the file LiquidCrystal_I2C which you just download.
  • 4.Click it open and then you'll be prompted by "Library added to your libraries.
  • 5.Check 'Import libraries'”.
  • 6.Open file ->Sketch->Include Library->LiquidCrystal_I2C.
  • 7.Copy the follwing code to the Arduino IDE ,click to the upload icon to upload the code to the control board:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2); // set the LCD address to 0x27 for a 16 chars and 2 line display

void setup()
{
  lcd.init();  //initialize the lcd
  lcd.backlight();  //open the backlight
}

void loop()
{
  lcd.setCursor(3, 0); // set the cursor to column 3, line 0
  lcd.print("Hello GeeekPi");  // Print a message to the LCD
  
  lcd.setCursor(2, 1); // set the cursor to column 2, line 1
  lcd.print("hello world");  // Print a message to the LCD.
}