16x2 LCD Module (Green)
16x2 LCD Module (Green)
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.
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.
STN (Super-Twist Nematic) LCD
16 characters x 2 lines
5x8 pixels
Green backlight
Parallel (8-bit or 4-bit)
Single-line or Multi-line mode
8-bit or 4-bit
Display On/Off control
Cursor On/Off control
Cursor Blink On/Off control
Display Clear function
Shift function (Left/Right)
80x36mm
Through-hole or SMT (Surface Mount Technology)
-20C to 70C
-30C to 80C
5V 10%
1mA (typical)
5mA (maximum)
Supports various communication protocols, including SPI, I2C, and UART
Built-in character generator for ASCII characters
Adjustable contrast and backlight brightness
Compatible with various microcontrollers and development boards
| 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
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.
16x2 LCD Module (Green) DocumentationOverviewThe 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 SpecificationsDisplay 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 12mmPinoutThe 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 ArduinoThis 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 PiThis 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 ESP32This 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.