Stufin
Home Quick Cart Profile

16x2 LCD Module (Green)

Buy Now on Stufin

Component Name

16x2 LCD Module (Green)

Description

The 16x2 LCD Module (Green) is a type of Liquid Crystal Display (LCD) module designed for a wide range of applications, including robotics, automation, and IoT projects. This module is a popular choice for displaying information in a compact and efficient manner.

Functionality

The primary function of the 16x2 LCD Module (Green) is to display alphanumeric characters and symbols on a 16-character wide by 2-line display. The module can be connected to a microcontroller or other digital devices to receive data and display it on the screen.

Key Features

  • Display Characteristics:

Display Type

STN (Super-Twist Nematic) LCD

Display Size

16 characters x 2 lines

Character Size

5x8 pixels

Display Color

Green backlight

  • Interface:

Interface Type

Parallel (8-bit or 4-bit)

Connection Mode

Single-line or Multi-line mode

Bus Width

8-bit or 4-bit

  • Control Functions:

Display On/Off control

Cursor On/Off control

Cursor Blink On/Off control

Display Clear function

Shift function (Left/Right)

  • Physical Characteristics:

Module Size

80x36mm

Mounting Type

Through-hole or SMT (Surface Mount Technology)

Operating Temperature

-20C to 70C

Storage Temperature

-30C to 80C

  • Power Supply:

Operating Voltage

5V 10%

Current Consumption

1mA (typical)

Power Consumption

5mA (maximum)

  • Communication Protocol:

Supports various communication protocols, including SPI, I2C, and UART

  • Additional Features:

Built-in character generator for ASCII characters

Adjustable contrast and backlight brightness

Compatible with various microcontrollers and development boards

Applications

The 16x2 LCD Module (Green) is suitable for a wide range of applications, including

Robotics and automation

IoT projects

Industrial control systems

Medical devices

Consumer electronics

Educational projects

Notes

The module requires a suitable driver circuit or microcontroller to operate.

The display is not backlit; an external backlight source is required for operation.

The module is sensitive to electrostatic discharge (ESD); proper handling and storage procedures must be followed.

By providing a comprehensive overview of the 16x2 LCD Module (Green), this documentation aims to facilitate the understanding and effective use of this component in various applications.

Pin Configuration

  • 16x2 LCD Module (Green) Pinout Explanation
  • The 16x2 LCD Module (Green) is a widely used display component in IoT projects. It has 16 pins, which are used to interface with a microcontroller or other electronic devices. Below is a detailed explanation of each pin, their functions, and how to connect them.
  • Pinout Structure:
  • The 16x2 LCD Module (Green) has a single row of 16 pins, which can be divided into three categories: Power, Control, and Data.
  • Power Pins (4):
  • 1. VCC (Pin 1): +5V power supply pin. Connect to the positive terminal of the power source (e.g., Arduino's 5V pin).
  • 2. GND (Pin 2): Ground pin. Connect to the negative terminal of the power source (e.g., Arduino's GND pin).
  • 3. V0 (Pin 3): Contrast adjustment pin. Connect to a potentiometer or a voltage divider to adjust the display's contrast.
  • 4. A (Pin 15): Backlight anode pin. Connect to the positive terminal of the backlight power source (e.g., 5V).
  • Control Pins (4):
  • 1. RS (Pin 4): Register Select pin. Connect to a digital pin on the microcontroller (e.g., Arduino's digital pin 12).
  • Low state (0V): Instruction mode (writes commands to the display).
  • High state (5V): Data mode (writes data to the display).
  • 2. RW (Pin 5): Read/Write pin. Connect to a digital pin on the microcontroller (e.g., Arduino's digital pin 11).
  • Low state (0V): Write mode (microcontroller writes data to the display).
  • High state (5V): Read mode (microcontroller reads data from the display).
  • 3. EN (Pin 6): Enable pin. Connect to a digital pin on the microcontroller (e.g., Arduino's digital pin 10).
  • High state (5V): Enables the display to receive data or instructions.
  • Low state (0V): Disables the display.
  • 4. BL (Pin 16): Backlight cathode pin. Connect to the negative terminal of the backlight power source (e.g., GND).
  • Data Pins (8):
  • 1. D0 (Pin 7): Data bit 0 pin. Connect to a digital pin on the microcontroller (e.g., Arduino's digital pin 9).
  • 2. D1 (Pin 8): Data bit 1 pin. Connect to a digital pin on the microcontroller (e.g., Arduino's digital pin 8).
  • 3. D2 (Pin 9): Data bit 2 pin. Connect to a digital pin on the microcontroller (e.g., Arduino's digital pin 7).
  • 4. D3 (Pin 10): Data bit 3 pin. Connect to a digital pin on the microcontroller (e.g., Arduino's digital pin 6).
  • 5. D4 (Pin 11): Data bit 4 pin. Connect to a digital pin on the microcontroller (e.g., Arduino's digital pin 5).
  • 6. D5 (Pin 12): Data bit 5 pin. Connect to a digital pin on the microcontroller (e.g., Arduino's digital pin 4).
  • 7. D6 (Pin 13): Data bit 6 pin. Connect to a digital pin on the microcontroller (e.g., Arduino's digital pin 3).
  • 8. D7 (Pin 14): Data bit 7 pin. Connect to a digital pin on the microcontroller (e.g., Arduino's digital pin 2).
  • Connection Example:
  • Here's an example of how to connect the 16x2 LCD Module (Green) to an Arduino board:
  • VCC (Pin 1) to Arduino's 5V pin
  • GND (Pin 2) to Arduino's GND pin
  • V0 (Pin 3) to a potentiometer or voltage divider (for contrast adjustment)
  • A (Pin 15) to 5V (for backlight)
  • RS (Pin 4) to Arduino's digital pin 12
  • RW (Pin 5) to Arduino's digital pin 11
  • EN (Pin 6) to Arduino's digital pin 10
  • BL (Pin 16) to GND (for backlight)
  • D0-D7 (Pins 7-14) to Arduino's digital pins 9-2, respectively
  • Remember to use a suitable resistor or voltage regulator to power the backlight, and adjust the contrast using the V0 pin.

Code Examples

16x2 LCD Module (Green) Documentation
Overview
The 16x2 LCD Module (Green) is a widely used liquid crystal display module that provides a convenient way to display text and characters in various embedded systems and IoT projects. This module features a 16-character x 2-line display, making it an ideal choice for displaying short messages, status updates, and sensor readings.
Technical Specifications
Display Type: ST7066U
 Display Size: 16 characters x 2 lines
 Display Color: Green
 Interface: HD44780
 Operating Voltage: 5V
 Operating Temperature: -20C to 70C
 Dimension: 80mm x 36mm x 12mm
Pinout
The 16x2 LCD Module (Green) has a 16-pin interface, with the following pinout:
VSS (Pin 1): Ground
 VDD (Pin 2): 5V Power Supply
 VE (Pin 3): Contrast Adjustment
 RS (Pin 4): Register Select (Data or Command)
 RW (Pin 5): Read/Write Control
 EN (Pin 6): Enable Signal
 D0-D7 (Pins 7-14): 8-bit Data Bus
 A (Pin 15): Anode (Backlight)
 K (Pin 16): Cathode (Backlight)
Example 1: Basic Display Using Arduino
This example demonstrates how to use the 16x2 LCD Module (Green) with an Arduino board to display a simple message.
```c
#include <LiquidCrystal.h>
// Define the LCD pins
const int lcdRS = 12;
const int lcdEN = 11;
const int lcdD4 = 5;
const int lcdD5 = 4;
const int lcdD6 = 3;
const int lcdD7 = 2;
LiquidCrystal_I2C lcd(lcdRS, lcdEN, lcdD4, lcdD5, lcdD6, lcdD7);
void setup() {
  lcd.begin(16, 2); // Initialize the LCD
  lcd.setCursor(0, 0); // Set the cursor to the first row
  lcd.print("Hello, World!"); // Print the message
}
void loop() {
  // Do nothing
}
```
Example 2: Displaying Sensor Readings Using Raspberry Pi
This example demonstrates how to use the 16x2 LCD Module (Green) with a Raspberry Pi to display temperature and humidity readings from a DHT11 sensor.
```python
import RPi.GPIO as GPIO
import time
import dht11
# Define the LCD pins
lcd_rs = 17
lcd_en = 23
lcd_d4 = 24
lcd_d5 = 25
lcd_d6 = 8
lcd_d7 = 7
# Initialize the GPIO library
GPIO.setmode(GPIO.BCM)
GPIO.setup(lcd_rs, GPIO.OUT)
GPIO.setup(lcd_en, GPIO.OUT)
GPIO.setup(lcd_d4, GPIO.OUT)
GPIO.setup(lcd_d5, GPIO.OUT)
GPIO.setup(lcd_d6, GPIO.OUT)
GPIO.setup(lcd_d7, GPIO.OUT)
# Initialize the DHT11 sensor
dht_sensor = dht11.DHT11(pin=14)
while True:
    # Read temperature and humidity from the DHT11 sensor
    temp, humidity = dht_sensor.read()
# Clear the LCD
    GPIO.output(lcd_rs, 0)
    GPIO.output(lcd_en, 1)
    time.sleep(0.01)
    GPIO.output(lcd_en, 0)
# Set the cursor to the first row
    GPIO.output(lcd_rs, 0)
    GPIO.output(lcd_en, 1)
    GPIO.output(lcd_d4, 0)
    GPIO.output(lcd_d5, 0)
    GPIO.output(lcd_d6, 0)
    GPIO.output(lcd_d7, 0)
    time.sleep(0.01)
    GPIO.output(lcd_en, 0)
# Print the temperature reading
    GPIO.output(lcd_rs, 1)
    for char in "Temp: {:.1f}C".format(temp):
        GPIO.output(lcd_en, 1)
        GPIO.output(lcd_d4, (ord(char) >> 4) & 1)
        GPIO.output(lcd_d5, (ord(char) >> 3) & 1)
        GPIO.output(lcd_d6, (ord(char) >> 2) & 1)
        GPIO.output(lcd_d7, (ord(char) >> 1) & 1)
        time.sleep(0.01)
        GPIO.output(lcd_en, 0)
# Set the cursor to the second row
    GPIO.output(lcd_rs, 0)
    GPIO.output(lcd_en, 1)
    GPIO.output(lcd_d4, 0)
    GPIO.output(lcd_d5, 1)
    GPIO.output(lcd_d6, 0)
    GPIO.output(lcd_d7, 0)
    time.sleep(0.01)
    GPIO.output(lcd_en, 0)
# Print the humidity reading
    GPIO.output(lcd_rs, 1)
    for char in "Humidity: {:.1f}%".format(humidity):
        GPIO.output(lcd_en, 1)
        GPIO.output(lcd_d4, (ord(char) >> 4) & 1)
        GPIO.output(lcd_d5, (ord(char) >> 3) & 1)
        GPIO.output(lcd_d6, (ord(char) >> 2) & 1)
        GPIO.output(lcd_d7, (ord(char) >> 1) & 1)
        time.sleep(0.01)
        GPIO.output(lcd_en, 0)
time.sleep(1)
```
Example 3: Displaying Menu Using ESP32
This example demonstrates how to use the 16x2 LCD Module (Green) with an ESP32 board to display a simple menu.
```c
#include <WiFi.h>
#include <LiquidCrystal_I2C.h>
// Define the LCD pins
const int lcdRS = 22;
const int lcdEN = 21;
const int lcdD4 = 18;
const int lcdD5 = 19;
const int lcdD6 = 23;
const int lcdD7 = 5;
LiquidCrystal_I2C lcd(lcdRS, lcdEN, lcdD4, lcdD5, lcdD6, lcdD7);
const char menuItems[] = {"Item 1", "Item 2", "Item 3"};
void setup() {
  Serial.begin(115200);
  lcd.begin(16, 2); // Initialize the LCD
  lcd.setCursor(0, 0); // Set the cursor to the first row
  lcd.print("Menu:"); // Print the menu title
}
void loop() {
  static intmenuItemIndex = 0;
  lcd.setCursor(0, 1); // Set the cursor to the second row
  lcd.print(menuItems[menuItemIndex]); // Print the current menu item
  delay(1000);
  menuItemIndex = (menuItemIndex + 1) % 3; // Cycle through the menu items
}
```
Note: These examples are for illustration purposes only and may require modifications to work with your specific hardware setup.