Home16x2 LCD Display Module with I2C
16x2 LCD Display Module with I2C
16x2 LCD Display Module with I2C16x2 LCD Display Module with I2C16x2 LCD Display Module with I2C
Standard shipping in 7 working days

16x2 LCD Display Module with I2C

₹250
₹165
Saving ₹85
34% off
Product Description

The 16x2 LCD with I2C interface is a great option for reducing the number of pins needed to control a standard 16x2 character LCD, making it a popular choice for Arduino and Raspberry Pi projects. With the I2C interface, you can control the LCD using only two data pins, which simplifies wiring and saves microcontroller I/O pins for other tasks.

What is I2C?

I2C (Inter-Integrated Circuit) is a communication protocol that allows multiple devices (e.g., sensors, displays, EEPROMs) to communicate with a microcontroller using only two wires:

  • SDA (Serial Data Line) – The data line used to send and receive data.
  • SCL (Serial Clock Line) – The clock line that synchronizes the data transfer.

With I2C, devices are addressed using a 7-bit address. Multiple I2C devices can share the same bus, and each device is uniquely identified by its address.

Pinout of the 16x2 LCD with I2C:

Here’s a quick overview of the pins on the 16x2 LCD with I2C module:

PinFunctionDescription1GNDGround pin2VCCPower pin (typically 5V or 3.3V depending on your system)3SDAData line (connected to the SDA pin on your microcontroller)4SCLClock line (connected to the SCL pin on your microcontroller)5AAnode pin for backlight (optional for some models)6KCathode pin for backlight (optional for some models)

How I2C Works with a 16x2 LCD:

  • The I2C module attached to the LCD reduces the number of data pins you need to control the display. Without I2C, you would need 6-11 pins to control a 16x2 LCD (depending on whether you're using 8-bit or 4-bit mode).
  • The I2C module acts as an intermediary between your microcontroller and the LCD, simplifying communication by converting the I2C signals into parallel signals that the LCD understands.
  • The module includes a small PCF8574 I/O expander chip that allows the LCD to be controlled over the I2C bus.

I2C Address of the LCD:

The I2C address of the LCD module is usually one of the following:

  • 0x3F or 0x27 (most common addresses)

If your LCD isn't working with one address, try the other.

You can find the I2C address of your module using an I2C scanner sketch (especially if you're unsure about the address).

Wiring the 16x2 LCD with I2C to an Arduino:

Here’s a simple guide for wiring the 16x2 LCD with I2C to an Arduino:

  1. Connect the pins:
  • GND to Arduino GND.
  • VCC to Arduino 5V (or 3.3V, depending on your module).
  • SDA to Arduino A4 (on most Arduinos, like the Uno).
  • SCL to Arduino A5 (on most Arduinos, like the Uno).
  1. Backlight control:
  • A and K pins are typically optional and are used to control the backlight. If they're connected, the backlight will turn on automatically when the LCD is powered. If you're using a separate power supply for the backlight, you can leave these pins unconnected.

Installing the LiquidCrystal_I2C Library:

To control the LCD, you will need the LiquidCrystal_I2C library. It simplifies the communication between the Arduino and the I2C LCD.

  1. Open the Arduino IDE.
  2. Go to SketchInclude LibraryManage Libraries.
  3. In the Library Manager, search for LiquidCrystal_I2C and install it.

Alternatively, you can manually download the library from GitHub LiquidCrystal_I2C on GitHub.

Example Code:

Here’s an example code to display "Hello, World!" on the 16x2 LCD with I2C:

#include <Wire.h>                // Include the Wire library for I2C communication
#include <LiquidCrystal_I2C.h>    // Include the LiquidCrystal_I2C library

// Initialize the LCD with I2C address 0x3F, 16 columns, and 2 rows
LiquidCrystal_I2C lcd(0x3F, 16, 2);

void setup() {
  lcd.begin();                   // Initialize the LCD
  lcd.backlight();                // Turn on the backlight (optional)
  lcd.setCursor(0, 0);            // Set cursor to the first column, first row
  lcd.print("Hello, World!");     // Display message on the screen
}

void loop() {
  // No code needed in loop for static text
}

Explanation of the Code:

  • Wire.begin(): Initializes I2C communication.
  • lcd.begin(): Initializes the LCD. In this case, lcd(0x3F, 16, 2) tells the Arduino that the LCD is connected with address 0x3F, and it has 16 columns and 2 rows.
  • lcd.setCursor(x, y): Sets the position of the cursor (x = column, y = row). The position is 0-indexed, so setCursor(0, 0) places the cursor at the top-left corner.
  • lcd.print("Hello, World!"): Prints the message to the LCD at the current cursor position.

Adjusting the Contrast:

If the display is too faint or not visible, adjust the contrast by turning the small potentiometer (usually located on the back of the I2C module). This allows you to adjust the voltage going to the V0 pin, which controls the contrast.

How to Find the I2C Address (If You Don’t Know It):

If you're unsure about the I2C address of your LCD module, you can upload the following I2C Scanner sketch to your Arduino to detect the address:

#include <Wire.h>

void setup() {
  Wire.begin();
  Serial.begin(9600);
  Serial.println("\nI2C Scanner");
  
  for (byte address = 1; address < 127; address++) {
    Wire.beginTransmission(address);
    byte error = Wire.endTransmission();
    
    if (error == 0) {
      Serial.print("I2C device found at address 0x");
      if (address < 16) {
        Serial.print("0");
      }
      Serial.println(address, HEX);
    }
    delay(100);
  }
}

void loop() {
  // Empty loop
}

Upload this code to your Arduino, and open the Serial Monitor. It will scan all I2C addresses from 0x01 to 0x7F, and it will print the address of any I2C devices it finds, including your LCD.

Applications of 16x2 LCD with I2C:

  • Displaying sensor data (e.g., temperature, humidity, motion, etc.)
  • Home automation systems (e.g., showing system status, time, etc.)
  • User interfaces in embedded systems.
  • Feedback display in various robotic applications.

Advantages of Using I2C with 16x2 LCD:

  • Reduced Pin Usage: Only two pins (SDA and SCL) are needed for communication, freeing up more pins for other components.
  • Easy to Use: I2C simplifies the wiring and reduces complexity compared to parallel communication.
  • Multiple Devices: You can connect multiple I2C devices (e.g., sensors, other displays) to the same two lines.

Considerations:

  • Power: Ensure your power supply is sufficient, especially if you're using multiple I2C devices.
  • I2C Address Conflicts: Make sure no two devices on the same I2C bus have the same address, as this can cause communication issues.


Brand:- Generic

Origin:- China

Share
Customer Reviews

Secure Payments

Shipping in India

Cash on Delivery

Great Value & Quality