In this tutorial, we will learn how to make custom characters on an I2C LCD display. Click here to refer to my previous blog and learn about the I2C LCD display basics. Custom characters are non-original figures created from original parts. You can create different figures such as hearts, squares, rectangles, and more.
The I2C LCD display is made up of blocks which are fundamentally 5 dots in a row and 8 dots in a column. The LCD has 32 of those blocks and it makes up the 16X2 LCD. You can program each of the blocks to make any figure you want.

The picture above shows the organization of a single block that is used to make up LCD. To create a custom character, we need to define which dot out of the 5 x 8 block has to be lighted up. This can be done by writing the binary equivalent of each row and column. Each dot is either on or off. We can create figures by turning them off or on. Use this website below to get the understanding on create figures.
https://maxpromer.github.io/LCD-Character-Creator/
The code
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
byte smileyFace[] = {
B00000,
B11011,
B11011,
B00000,
B10001,
B10001,
B11111,
B00000
} ;
void setup()
{
lcd.init();
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("Hello, World");
lcd.createChar(0,smileyFace);
lcd.setCursor(13,0);
lcd.write(0);
}
The program is pretty simple. We are declaring the variable smileyFace which is array of type byte. This array will contain 8 bytes, one for each row in our block. The block is made up by 5X8 dots as mentioned before.We can program those dots by turning them on or off. In this code we write 0 for off and 1 is for on. Writing that, you can create any figure you want! In setup function, we simply turn on the background light of the LCD. Then, we set the cursor to the place you want to display your text, and display it by using the setCursor function of the library.
I found this cool website to easily create our byte array. https://maxpromer.github.io/LCD-Character-Creator/
Just click on the dot which you want to highlight and corresponding bit in byte will turn 1. Cool, huh!! Be creative and create cool custom characters. Be creative!!