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