Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

Arduino Leonardo Controlled LCD Display with I2C Interface

Image of Arduino Leonardo Controlled LCD Display with I2C Interface

Circuit Documentation

Summary

This circuit integrates an Arduino Leonardo with two LCD modules: a generic LCD 16x2 (Wokwi Compatible) and an LCM1602 IIC module. The Arduino Leonardo serves as the microcontroller, controlling the LCD displays via I2C communication. The LCM1602 IIC module is used as an interface between the Arduino and the generic LCD, facilitating easier communication through the I2C protocol. The circuit is designed to display text on the LCD screen.

Component List

Arduino Leonardo (Rev3b)

  • Microcontroller board based on the ATmega32u4
  • Offers 20 digital input/output pins (of which 7 can be used as PWM outputs and 12 as analog inputs)
  • Features I2C (TWI) and SPI communication
  • Operates at 5V

LCD 16x2 (Wokwi Compatible)

  • A 16x2 character LCD display
  • Operates at 5V
  • Includes backlight and contrast adjustment pin

LCM1602 IIC

  • An LCD interface module with I2C communication
  • Simplifies the connection between the LCD and microcontroller
  • Includes pins for backlight control

Wiring Details

Arduino Leonardo (Rev3b)

  • GND connected to LCM1602 IIC GND
  • 5V connected to LCM1602 IIC VCC
  • SDA connected to LCM1602 IIC SDA
  • SCL connected to LCM1602 IIC SCL

LCD 16x2 (Wokwi Compatible)

  • VSS connected to LCM1602 IIC K
  • VDD connected to LCM1602 IIC A
  • V0 connected to LCM1602 IIC D7
  • RS connected to LCM1602 IIC D6
  • RW connected to LCM1602 IIC D5
  • E connected to LCM1602 IIC D4
  • D0 connected to LCM1602 IIC D3
  • D1 connected to LCM1602 IIC D2
  • D2 connected to LCM1602 IIC D1
  • D3 connected to LCM1602 IIC D0
  • D4 connected to LCM1602 IIC E
  • D5 connected to LCM1602 IIC RW
  • D6 connected to LCM1602 IIC RS
  • D7 connected to LCM1602 IIC V0
  • A connected to LCM1602 IIC VDD
  • K connected to LCM1602 IIC VSS

LCM1602 IIC

  • LED_A connected to LED_B (Backlight control)

Documented Code

#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  lcd.begin();
}

void loop() {
  lcd.setCursor(0, 0);
  lcd.print("TEST LCD i2C");
  lcd.setCursor(0, 1);
  lcd.print("KelasRobot.com");
}

Code Description

  • The code is written for the Arduino Leonardo using the LiquidCrystal_I2C library.
  • It initializes an lcd object with the I2C address 0x27 for a 16x2 LCD.
  • In the setup() function, it begins communication with the LCD.
  • The loop() function sets the cursor to the beginning of the first line and prints "TEST LCD i2C".
  • It then sets the cursor to the beginning of the second line and prints "KelasRobot.com".
  • This loop runs indefinitely, updating the display with the static text.