Engineers Garage

  • Electronics Projects and Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

How To Create Custom Characters On LCD Using Arduino- (Part 5/49)

By Ajish Alfred September 27, 2022

The LCD module is the most common output unit in a microcontroller board. It is very effective since it can display messages, values, clock etc. Special kinds of LCD drivers are used to drive the LCD. Two or more of this kind of driver ICs together with the LCD screen forms LCD modules found in embedded systems. The characters displayed in the LCD modules are actually stored in the internal memory locations of those controllers. They are stored in such a way that they exactly resemble the ASCII table. Whenever the microcontrollers send an ASCII value the LCD controllers displays the ASCII character which has been stored corresponding to that value.

The LCD modules can display not only ASCII characters but custom characters also. The user can store the pixel array corresponding to the custom character in an LCD module. The stored custom character can be made to display by sending the corresponding value to the LCD module.The Arduino is an easy prototyping platform in which the hardware is very simple to use and connected with any other circuit. The programing environment is also very easy to start with and has lot of built-in functions for every simple and complex task. The IDE has functions for the LCD interfacing also and among them there are functions which help in creating custom character also. This project demonstrates how it is possible to create the custom characters in an LCD and displaying the same using the Arduino.

 


 

The LCD module has two or more display driver ICs which stores the character pattern to be displayed. Whenever an ASCII value is send to the LCD module the controller loads the corresponding character array and displays it on the LCD screen. To display each character the LCD screen uses 8*5 pixel array in the screen. In the internal memory which all pixels to be turned on for a particular character are stored as 1 and others are kept as 0. An example a character stored in the internal EPROM memory of the common LCD controller HD44780 is shown in the following image;

Character Pattern Stored In EPROM Memory Of LCD Controller HD44780

Fig. 2: Character Pattern Stored In EPROM Memory Of LCD Controller HD44780

The above shown image is the character pattern stored in the internal memory of the LCD controller. The ASCII value for the letter ‘b’ in binary is 0b01100010 and hence the pattern is stored in the location of the memory with the same address. Hence when the microcontroller send the ASCII value of the character ‘b’, the LCD controller loads the character pattern from the same location with the address equal to that ASCII value. The memory where the standard characters are stored is referred to as Character Generator ROM (CGROM). The user cannot write into these locations since it is Read Only Memory (ROM). The LCD controller has another memory block which is a Read Write memory with 64 byte (8*8) storage per location where the user can store their custom characters. The user can write 64 custom characters into this memory referred to as Character Generator RAM (CGRAM).

In this project the Arduino pro-mini board is used which is then programmed with the help of Arduino IDE version 1.0.3 on windows operating system. The image of the Arduino pro-mini board and the Arduino IDE is shown in the following;

Typical Arduino Pro-Mini Board

Fig. 3: Typical Arduino Pro-Mini Board

 Arduino IDE Software Window

Fig. 4: Arduino IDE Software Window

Another hardware which can perform the USB to TTL conversion is used to upload the program into the arduino board.

External USB To TTL Converter Board For Programming Arduino And Serial Communication

Fig. 5: External USB to TTL converter board for programming Arduino and serial communication

It is assumed that the reader has gone through the project how to get started with the arduino and done all the things discussed in it. One has to work out the character of the custom character that needs to be displayed in the LCD screen. The custom characters which are displayed in this project are shown in the following image and the section following it explains how to find out the required character pattern for each custom character.

Custom Characters Created In Project On LCD Using Arduino Circuit Setup On Breadboard

Fig. 6: Custom Characters Created in project On LCD Using Arduino Circuit Setup On Breadboard

The LCD uses 8*8 pixel block to display each character and hence one has to assume an 8*5 array and draw the required custom character and find out the required bit pattern. One can work out with the help of the pixel array and binary array as shown in the following image.

8*5 Pixel And Binary Array For Positive Half Cycle For Custom Character

Fig. 7: 8*5 Pixel And Binary Array For Positive Half Cycle For Custom Character

There eight rows R0 to R7 and eight columns C0 to C7. The values in all the rows and columns are now zero since all the pixels are turned off. Which all pixels need to be turned on should be given the value 1 and the rest should be kept as 0. Now read the binary pattern and write the same into the CGRAM to generate the custom character. It is advised to store the character pattern in a character array so that it would be easy to use with the C code. The pixel array and the binary array for the first custom character displayed in the project are shown in the following image;

 8* 5 Pixel And Binary Array For First Custom Character

Fig. 8: 8* 5 Pixel And Binary Array For First Custom Character

The 8 byte long character array for the above shown custom character can be defined in the code as given below;

            {

                0b00000,

                0b00000,

                0b00000,

                0b00000,

                0b00000,

                0b00000,

                0b00000,

                0b11111

              };

The pixel array and the binary array for the second custom character displayed in the project are shown in the following image;

8*5 Pixel And Binary Array For Second Custom Character Using Arduino

Fig. 9: 8*5 Pixel and Binary Array For Second custom character using Arduino

The 8 byte long character array for the above shown custom character can be defined in the code as given below;

{

                0b00000,

                0b00000,

                0b00000,

                0b00000,

                0b00000,

                0b00000,

                0b11111,

                0b11111

              };

The pixel array and the binary array for the third custom character displayed in the project are shown in the following image;

 Pixel And Binary Array For Third Custom Character Using Arduino

Fig. 10: Pixel and Binary Array For Third custom character using Arduino

The 8 byte long character array for the above shown custom character can be defined in the code as given below;

  {

                0b00000,

                0b00000,

                0b00000,

                0b00000,

                0b00000,

                0b11111,

                0b11111,

                0b11111

              };

The pixel array and the binary array for the fourth custom character displayed in the project are shown in the following image;

Pixel and Binary Array For Fourth Custom Character

Fig. 11: Pixel and Binary Array For Fourth custom character

The 8 byte long character array for the above shown custom character can be defined in the code as given below;

              {

                0b00000,

                0b00000,

                0b00000,

                0b00000,

                0b11111,

                0b11111,

                0b11111,

                0b11111

              };

The pixel array and the binary array for the fifth custom character displayed in the project are shown in the following image;

Pixel And Binary Array For Fifth Custom Character

Fig. 12: Pixel and Binary Array For Fifth custom character

The 8 byte long character array for the above shown custom character can be defined in the code as given below;

              {

                0b00000,

                0b00000,

                0b00000,

                0b11111,

                0b11111,

                0b11111,

                0b11111,

                0b11111

              };

The pixel array and the binary array for the sixth custom character displayed in the project are shown in the following image;

Pixel And Binary Array For Sixth Custom Character

Fig. 13: Pixel and Binary Array For Sixth custom character

The 8 byte long character array for the above shown custom character can be defined in the code as given below;

              {

                0b00000,

                0b00000,

                0b11111,

                0b11111,

                0b11111,

                0b11111,

                0b11111,

                0b11111

              };

The pixel array and the binary array for the seventh custom character displayed in the project are shown in the following image;

 Pixel And Binary Array For Seventh Custom Character Using Arduino

Fig. 14: Pixel and Binary Array For Seventh custom character using Arduino

The 8 byte long character array for the above shown custom character can be defined in the code as given below;

              {

                0b00000,

                0b11111,

                0b11111,

                0b11111,

                0b11111,

                0b11111,

                0b11111,

                0b11111

              };

The pixel array and the binary array for the eigth custom character displayed in the project are shown in the following image;

Pixel And Binary Array For Eighth Custom Character Using Arduino

Fig. 15: Pixel and Binary Array For Eighth custom character using Arduino

The 8 byte long character array for the above shown custom character can be defined in the code as given below;

              {

                0b11111,

                0b11111,

                0b11111,

                0b11111,

                0b11111,

                0b11111,

                0b11111,

                0b11111

              };

The Arduino IDE has a library called <LiquidCrystal.h> which provides lot of functions to access the LCD module. Few of those functions which are very useful is small applications are already discussed in the previous project on how to interface an LCD, how to display sensor value on LCD, how to connect the LCD with the PC and how to make an LCD scrolling display.

The code written for this project has a function lcd.createChar() which helps to create the custom characters in an LCD screen. The details of the lcd.createChar() function are discussed in the following section.

lcd.createChar()

The function lcd.createChar() can be used to write a custom character to the required location in the CGRAM. The function has two parameters in which the first parameter is the location in the CGRAM memory where the character array corresponding to the custom character need to be stored and the second parameter is the character array itself. For example if there is a custom character array called ‘cc’ and it need to be stored in the 5th location of CGRAM one can use the following statement;

lcd.createChar(5, cc);

The above statement writes the character array to the 5th location of the CGRAM of the LCD controller from where it can be displayed by calling the lcd.write() function discussed in the projects on how to connect the LCD with the PCand how to make an LCD scrolling display.

lcd.write(5);

 

You may also like:


  • What are the top development boards for AI and ML?

  • Sensor value display on TFT LCD using Arduino: Part I

  • What are the top tools for developing embedded software?

  • What is the Modbus protocol and how does it work?

  • What are the top open-source software systems for home automation?

  • What is MicroPython?

Project Source Code

###




/*================================= EG LABS =======================================

 Receive a character through the serial port of the PC and display the same cahracter

 in a 16*2 LCD in scrolling manner along with glowing an LED each time

 

 The circuit:

 * LED attached from pin 5 to ground through a 1K resistor

 

 LCD:

 * LCD RS pin to digital pin 12

 * LCD Enable pin to digital pin 11

 * LCD D4 pin to digital pin 5

 * LCD D5 pin to digital pin 4

 * LCD D6 pin to digital pin 3

 * LCD D7 pin to digital pin 2

 * LCD R/W pin to ground

 * 10K resistor:

 * ends to +5V and ground

 * wiper to LCD pin 3

 * LED anode attached to digital output 6

 * LED cathode attached to ground through a 1K resistor

//================================= EG LABS =======================================*/


// include the library code:

#include 


// initialize the library with the numbers of the interface pins

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);


//----------------- store the custom characters in arrays ---------------------//

byte cc1[8] = 

              {

                0b00000,

                0b00000,

                0b00000,

                0b00000,

                0b00000,

                0b00000,

                0b00000,

                0b11111

              };


byte cc2[8] = 

              {

                0b00000,

                0b00000,

                0b00000,

                0b00000,

                0b00000,

                0b00000,

                0b11111,

                0b11111

              };


byte cc3[8] = 

              {

                0b00000,

                0b00000,

                0b00000,

                0b00000,

                0b00000,

                0b11111,

                0b11111,

                0b11111

              };


byte cc4[8] = 

              {

                0b00000,

                0b00000,

                0b00000,

                0b00000,

                0b11111,

                0b11111,

                0b11111,

                0b11111

              };


byte cc5[8] = 

              {

                0b00000,

                0b00000,

                0b00000,

                0b11111,

                0b11111,

                0b11111,

                0b11111,

                0b11111

              };


byte cc6[8] = 

              {

                0b00000,

                0b00000,

                0b11111,

                0b11111,

                0b11111,

                0b11111,

                0b11111,

                0b11111

              };


byte cc7[8] = 

              {

                0b00000,

                0b11111,

                0b11111,

                0b11111,

                0b11111,

                0b11111,

                0b11111,

                0b11111

              };


byte cc8[8] = 

              {

                0b11111,

                0b11111,

                0b11111,

                0b11111,

                0b11111,

                0b11111,

                0b11111,

                0b11111

              };

//----------------- store the custom characters in arrays ---------------------//


// give the LED pin a name:

int led = 6;


void setup()

{

  //---- create custom characters ----//

  lcd.createChar(1, cc1);

  lcd.createChar(2, cc2);

  lcd.createChar(3, cc3);

  lcd.createChar(4, cc4);

  lcd.createChar(5, cc5);

  lcd.createChar(6, cc6);

  lcd.createChar(7, cc7);

  lcd.createChar(8, cc8);

  //---- create custom characters ----//

  

  // initialize the led pin as an output.

  pinMode(led, OUTPUT);

  

  // set up the lcd's number of columns and rows: 

  lcd.begin(16, 2);

}


void loop()

{

  lcd.print("EG LABS ");  

 

  lcd.write(1);                    // dispaly custom character

  //---- blink LED -----//

  digitalWrite(led, HIGH);       

  delay(1000);

  digitalWrite(led, LOW);

  delay(1000);

   //---- blink LED -----//

   

  lcd.write(2);                   // dispaly custom character

  //---- blink LED -----//

  digitalWrite(led, HIGH);       

  delay(1000);

  digitalWrite(led, LOW);

  delay(1000);

  //---- blink LED -----//

  

  lcd.write(3);                   // dispaly custom character

   //---- blink LED -----//

  digitalWrite(led, HIGH);       

  delay(1000);

  digitalWrite(led, LOW);

  delay(1000);

   //---- blink LED -----//

   

  lcd.write(4);                   // dispaly custom character

  //---- blink LED -----//

  digitalWrite(led, HIGH);       

  delay(1000);

  digitalWrite(led, LOW);

  delay(1000);

  //---- blink LED -----//

     

  lcd.write(5);                   // dispaly custom character

  //---- blink LED -----//

  digitalWrite(led, HIGH);       

  delay(1000);

  digitalWrite(led, LOW);

  delay(1000);

  //---- blink LED -----//

  

  lcd.write(6);                   // dispaly custom character

  //---- blink LED -----//

  digitalWrite(led, HIGH);       

  delay(1000);

  digitalWrite(led, LOW);

  delay(1000);

  //---- blink LED -----//

  

  lcd.write(7);

  //---- blink LED -----//

  digitalWrite(led, HIGH);       

  delay(1000);

  digitalWrite(led, LOW);

  delay(1000);

  //---- blink LED -----//

  

  lcd.write(8);                   // dispaly custom character

  //---- blink LED -----// 

  digitalWrite(led, HIGH);       

  delay(1000);

  digitalWrite(led, LOW);

  delay(1000);

  //---- blink LED -----//

 

  lcd.clear();

}

###

 

Circuit Diagrams

Circuit-Diagram-Creating-Custom-Characters-LCD-Using-Arduino

Project Components

  • Arduino Pro Mini
  • LCD
  • LED
  • Resistor

Project Video


Filed Under: Arduino Projects, Electronic Projects
Tagged With: Arduino, custom characters, lcd
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • How can I get the frequency please help!
  • Elektronik devre
  • 12VAC to 12VDC 5A on 250ft 12AWG
  • SPI speed pic18f66j15
  • Antiparallel Schottky Diodes VDI-Load Pull

RSS Electro-Tech-Online.com Discussions

  • compatible eth ports for laptop
  • how to work on pcbs that are thick
  • How to repair this plug in connector where wires came loose
  • Actin group needed for effective PCB software tutorials
  • Kawai KDP 80 Electronic Piano Dead

Featured – Designing of Audio Amplifiers part 9 series

  • Basics of Audio Amplifier – 1/9
  • Designing 250 Milli Watt Audio Power Amplifier – 2/9
  • Designing 1 Watt Audio Power Amplifier – 3/9
  • Designing a Bass Boost Amplifier – 4/9
  • Designing a 6 Watt Car Audio Amplifier – 5/9
  • Design a low power amplifier for headphones- 6/9

Recent Articles

  • ITG Electronics releases gate drive transformers with 200 – 450 V DC capability
  • Stackpole introduces HCJ jumpers with 70.7 amp continuous current capability
  • Infineon releases MCU with 128K flash and multi-sense capabilities
  • ST introduces 600V GaN gate drivers with 300 ns start-up time
  • ABLIC releases S-19116 automotive voltage detector with 6.8μs response time

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronics Projects and Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe