I2C Liquid Crystal Displays

All you need to know about I2C LCD screens on an Arduino Uno.

projectImage

Things used in this project

 

Hardware components

HARDWARE LIST
1 DFRobot I2C 16x2 Arduino LCD Display Module
1 Arduino UNO
1 Male/Female Jumper Wires

Software apps and online services

 

Arduino IDE

Story

 

This project is for people who have an I2C lcd screen and can’t find any videos or projects on how to code them.

The first step is to find a working library of them. I use liquid crystal I2C, and wire. link for liquid crystal here, link for wire here [https://www.resistorpark.com/content/Arduino_Libraries/wire.zip]

 

The second step is to add the libraries to your arduino ide, to do that you go to sketch-> include library -> add zip library then find it in files. If it works, you should get a message saying it worked.

 

the third step is to wire it up wire up as follows

 

GND-> ground

 

VCC-> +5V

 

SDA-> A4

 

SCL-> A5

 

The last step is to upload the code

 

(be sure to delete everything from your blank sketch before pasting the sketch into it)

Schematics

 

wiring diagram

projectImage

Code

 

Code for screen

CODE
// |———————————————————————————————————————————————————————| 
// |  made by Arduino_uno_guy 11/13/2019                   |
// |   https://create.arduino.cc/projecthub/arduino_uno_guy|
// |———————————————————————————————————————————————————————|


#include LiquidCrystal_I2C.h

#include Wire.h

//initialize the liquid crystal library
//the first parameter is the I2C address
//the second parameter is how many rows are on your screen
//the third parameter is how many columns are on your screen
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  
  //initialize lcd screen
  lcd.init();
  // turn on the backlight
  lcd.backlight();
}
void loop() {
  //wait for a second
  delay(1000)
  // tell the screen to write on the top row
  lcd.setCursor(0,0);
  // tell the screen to write “hello, from” on the top row
  lcd.print(“Hello, From”);
  // tell the screen to write on the bottom row
  lcd.setCursor(0,1);
  // tell the screen to write “Arduino_uno_guy” on the bottom row
  // you can change whats in the quotes to be what you want it to be!
  lcd.print(“Arduino_uno_guy”);
  
}

The article was first published in hackster, November 13, 2019

cr: https://www.hackster.io/arduino_uno_guy/i2c-liquid-crystal-displays-5b806c

author: arduino_uno_guy

License
All Rights
Reserved
licensBg
1