BIG Font display with 16×2 LCD

Published by MKDas on

In this article we will learn to display big font in LCD display. Normal 16×2 LCD can show small fonts but if you wish to show big font, it is possible too. Many people has displayed big fonts and used in their projects which looks so nice to me. So I make one of mine which I’m sharing here and you can make that too for your project.

Disclaimer: Electricity is always dangerous. Skill required to work with electricity. Do work with your own risk. Author will not be responsible for any misuse or harmful act. This website contents is also copyright protected. Anything copied and directly posted in your website and claiming it as yours is prohibited and nonsensical. Author published all the articles as opensource to help you making your project and learning purpose only. Learn and make one for yourself. If need any help feel free to ask the author. Author will be helpful to you. Thanks.

LCD Display:

There are many types of LCD display in the market. But for electronic projects or some products, 16×2 LCD display are used in very common.

LCD display

We who are working with electronics, this type of LCD display is very common to us. We know what type of character we can show in this display. Today, we’ll learn how to show Big fonts in this display.

Circuit Diagram:

Here I’m using PIC16F877A micro-controller but if you clearly understand the concept and have little experience with programming, I hope you can do this project with almos any micro-controllers. Anyway, here is the circuit diagram what I’ll use for this project:

Circuit Diagram 1
Circuit Diagram 2

Download proteus file of this project.

mikroC code:

/*******************************************************************************
* Program for Big font Display on 16X2 LCD                                     *
* Program Written by_ Engr. Mithun K. Das                                      *
* MCU:PIC16F877A; X-Tal:20MHz; mikroC pro for PIC v7.6.0                       *
* Date:18-04-2020                                                              *
*******************************************************************************/
#include "CustomeChar.h"
// LCD module connections
sbit LCD_RS at RB7_bit;
sbit LCD_EN at RB6_bit;
sbit LCD_D4 at RB5_bit;
sbit LCD_D5 at RB4_bit;
sbit LCD_D6 at RB3_bit;
sbit LCD_D7 at RB2_bit;

sbit LCD_RS_Direction at TRISB7_bit;
sbit LCD_EN_Direction at TRISB6_bit;
sbit LCD_D4_Direction at TRISB5_bit;
sbit LCD_D5_Direction at TRISB4_bit;
sbit LCD_D6_Direction at TRISB3_bit;
sbit LCD_D7_Direction at TRISB2_bit;
// End LCD module connections

unsigned int number1[4],number0[4];
int j=0;
void Disp_temp(unsigned int value)
{
    number1[0] = value/1000%10;
    if(number1[0]!=number0[0])
    {
       LCD_Erase(1,1);
       LCD_BigFont(1,1,number1[0]);
    }
    else  
    {
       LCD_BigFont(1,1,number1[0]);
    }
    
    number1[1] = value/100%10;
    if(number1[1]!=number0[1])
    {
       LCD_Erase(1,5);
       LCD_BigFont(1,5,number1[1]);
    }
    else
    {
       LCD_BigFont(1,5,number1[1]);
    }
    
    number1[2] = value/10%10;
    if(number1[2]!=number0[2])
    {
       LCD_Erase(1,9);
       LCD_BigFont(1,9,number1[2]);
    }
    else
    {
       LCD_BigFont(1,9,number1[2]);
    }


    number1[3] = value%10;
    if(number1[3]!=number0[3])
    {
       LCD_Erase(1,13);
       LCD_BigFont(1,13,number1[3]);
    }
    else
    {
       LCD_BigFont(1,13,number1[3]);
    }
    
    for(j=0;j<4;j++)
    {
       number0[j]=number1[j];
    }
}

unsigned int counter=0;
void main()
{
  ADCON1 = 0x07;
  ADCON0 = 0x00;
  Lcd_Init();
  Lcd_Cmd(_LCD_CLEAR);
  Lcd_Cmd(_LCD_CURSOR_OFF);
  Lcd_Out(1,1,"Big Font LCD");
  Delay_ms(2000);
  Lcd_Cmd(_LCD_CLEAR);
 while(1)
 {

    Disp_temp(counter);
    counter++;
    Delay_ms(1000);
 }
}




//

This is the main code of our project where I used a sub-function “Disp_temp()” and called that in while(1) loop. In this sub-function I simply put number in 4 digits sequentially and erased then printed the digit it it is changed. In this way, we can remove garbage on display. Code is simple and easily understandable. For the custom numbers I used a CustomeChar library file.

Here I simply used a custom library which need to add with the main source file from header file section of mikroC compiler.

Add header file in mikroC project file

Here is that header file which I used here.

char CUL[] = {7,15,31,31,31,31,31,31};
char UP[] = {31,31,31,0,0,0,0,0};
char CUR[] = {28,30,31,31,31,31,31,31};
char CDL[] = {31,31,31,31,31,31,15,7};
char DOWN[] = {0,0,0,0,0,31,31,31};
char CDR[] = {31,31,31,31,31,31,30,28};
char EIGHT_UP[] = {31,31,31,0,0,0,31,31};
char i=0;

void Disp_0(char row, char column)
{
        Lcd_Cmd(64);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CUL[i]);
        Lcd_Chr(row, column, 0);
        Lcd_Cmd(72);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(UP[i]);
        Lcd_Chr(row, column + 1, 1);
        Lcd_Cmd(80);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CUR[i]);
        Lcd_Chr(row, column + 2, 2);
        Lcd_Cmd(88);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CDL[i]);
        Lcd_Chr(row + 1, column, 3);
        Lcd_Cmd(96);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(DOWN[i]);
        Lcd_Chr(row + 1, column + 1, 4);
        Lcd_Cmd(104);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CDR[i]);
        Lcd_Chr(row + 1, column + 2, 5);
}
void Disp_1(char row, char column)
{
        Lcd_Cmd(72);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(UP[i]);
        Lcd_Chr(row, column, 1);
        Lcd_Cmd(80);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CUR[i]);
        Lcd_Chr(row, column + 1, 2);
        Lcd_Cmd(96);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(DOWN[i]);
        Lcd_Chr(row + 1, column, 4);
        Lcd_Chr(row + 1, column + 1, 255);
        Lcd_Cmd(96);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(DOWN[i]);
        Lcd_Chr(row + 1, column + 2, 4);
}
void Disp_2(char row, char column)
{
        Lcd_Cmd(112);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(EIGHT_UP[i]);
        Lcd_Chr(row, column, 6);
        Lcd_Cmd(112);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(EIGHT_UP[i]);
        Lcd_Chr(row, column + 1, 6);
        Lcd_Cmd(80);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CUR[i]);
        Lcd_Chr(row, column + 2, 2);
        Lcd_Cmd(88);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CDL[i]);
        Lcd_Chr(row + 1, column, 3);
        Lcd_Cmd(96);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(DOWN[i]);
        Lcd_Chr(row + 1, column + 1, 4);
        Lcd_Cmd(96);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(DOWN[i]);
        Lcd_Chr(row + 1, column + 2, 4);
}
void Disp_3(char row, char column)
{
        Lcd_Cmd(112);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(EIGHT_UP[i]);
        Lcd_Chr(row, column, 6);
        Lcd_Cmd(112);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(EIGHT_UP[i]);
        Lcd_Chr(row, column + 1, 6);
        Lcd_Cmd(80);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CUR[i]);
        Lcd_Chr(row, column + 2, 2);
        Lcd_Cmd(96);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(DOWN[i]);
        Lcd_Chr(row + 1, column, 4);
        Lcd_Cmd(96);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(DOWN[i]);
        Lcd_Chr(row + 1, column + 1, 4);
        Lcd_Cmd(104);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CDR[i]);
        Lcd_Chr(row + 1, column + 2, 5);
}
void Disp_4(char row, char column)
{
        Lcd_Cmd(88);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CDL[i]);
        Lcd_Chr(row, column, 3);
        Lcd_Cmd(96);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(DOWN[i]);
        Lcd_Chr(row, column + 1, 4);
        Lcd_Cmd(80);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CUR[i]);
        Lcd_Chr(row, column + 2, 2);
        Lcd_Cmd(104);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CDR[i]);
        Lcd_Chr(row + 1, column + 2, 5);
}
void Disp_5(char row, char column)
{
        Lcd_Cmd(88);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CDL[i]);
        Lcd_Chr(row, column, 3);
        Lcd_Cmd(112);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(EIGHT_UP[i]);
        Lcd_Chr(row, column + 1, 6);
        Lcd_Cmd(112);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(EIGHT_UP[i]);
        Lcd_Chr(row, column + 2, 6);
        Lcd_Cmd(96);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(DOWN[i]);
        Lcd_Chr(row + 1, column, 4);
        Lcd_Cmd(96);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(DOWN[i]);
        Lcd_Chr(row + 1, column + 1, 4);
        Lcd_Cmd(104);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CDR[i]);
        Lcd_Chr(row + 1, column + 2, 5);
}
void Disp_6(char row, char column)
{
        Lcd_Cmd(64);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CUL[i]);
        Lcd_Chr(row, column, 0);
        Lcd_Cmd(112);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(EIGHT_UP[i]);
        Lcd_Chr(row, column + 1, 6);
        Lcd_Cmd(112);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(EIGHT_UP[i]);
        Lcd_Chr(row, column + 2, 6);
        Lcd_Cmd(88);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CDL[i]);
        Lcd_Chr(row +1, column, 3);
        Lcd_Cmd(96);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(DOWN[i]);
        Lcd_Chr(row + 1, column + 1, 4);
        Lcd_Cmd(104);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CDR[i]);
        Lcd_Chr(row + 1, column + 2, 5);
}
void Disp_7(char row, char column)
{
        Lcd_Cmd(72);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(UP[i]);
        Lcd_Chr(row, column, 1);
        Lcd_Cmd(72);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(UP[i]);
        Lcd_Chr(row, column + 1, 1);
        Lcd_Cmd(80);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CUR[i]);
        Lcd_Chr(row, column + 2, 2);
        Lcd_Cmd(104);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CDR[i]);
        Lcd_Chr(row + 1, column + 2, 5);
}
void Disp_8(char row, char column)
{
        Lcd_Cmd(64);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CUL[i]);
        Lcd_Chr(row, column, 0);
        Lcd_Cmd(112);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(EIGHT_UP[i]);
        Lcd_Chr(row, column + 1, 6);
        Lcd_Cmd(80);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CUR[i]);
        Lcd_Chr(row, column + 2, 2);
        Lcd_Cmd(88);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CDL[i]);
        Lcd_Chr(row + 1, column, 3);
        Lcd_Cmd(96);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(DOWN[i]);
        Lcd_Chr(row + 1, column + 1, 4);
        Lcd_Cmd(104);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CDR[i]);
        Lcd_Chr(row + 1, column + 2, 5);
}
void Disp_9(char row, char column)
{
        Lcd_Cmd(64);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CUL[i]);
        Lcd_Chr(row, column, 0);
        Lcd_Cmd(112);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(EIGHT_UP[i]);
        Lcd_Chr(row, column + 1, 6);
        Lcd_Cmd(80);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CUR[i]);
        Lcd_Chr(row, column + 2, 2);
        Lcd_Cmd(96);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(DOWN[i]);
        Lcd_Chr(row + 1, column + 1, 4);
        Lcd_Cmd(104);
        for (i = 0; i<=7; i++) Lcd_Chr_CP(CDR[i]);
        Lcd_Chr(row + 1, column + 2, 5);
}

void LCD_BigFont(char row, char column,char number)
{
    if(number==0)
    {
       Disp_0(row,column);
    }
    if(number==1)
    {
       Disp_1(row,column);
    }
    if(number==2)
    {
       Disp_2(row,column);
    }
    if(number==3)
    {
       Disp_3(row,column);
    }
    if(number==4)
    {
       Disp_4(row,column);
    }
    if(number==5)
    {
       Disp_5(row,column);
    }
    if(number==6)
    {
       Disp_6(row,column);
    }
    if(number==7)
    {
       Disp_7(row,column);
    }
    if(number==8)
    {
       Disp_8(row,column);
    }
    if(number==9)
    {
       Disp_9(row,column);
    }
}


void LCD_Erase(char row, char column)
{
  Lcd_Chr(row,column,' ');
  Lcd_Chr(row,column + 1,' ');
  Lcd_Chr(row,column + 2,' ');
  Lcd_Chr(row + 1,column,' ');
  Lcd_Chr(row + 1,column + 1,' ');
  Lcd_Chr(row + 1,column + 2,' ');
}

I’ve done all the coding for number display here. You just need to use this.

Download mikroC file from here.

Practical Result:

In simulation, display doesn’t show good but in real, it looks fine. Here was my result in practical testing:

Big Font in 16×2 LCD

A video clip is here:

Simulation in proteus

I hope you enjoyed this article and made one for yourself. If you need any help feel free to contact with me. Thank you.


MKDas

Mithun K. Das; B.Sc. in EEE from KUET. Blog: https://labprojectsbd.com

3 Comments

Chandana · July 31, 2020 at 2:13 am

Excellent Explanation. Many Thanks for Your Hard Works

    Mithun K. Das · July 31, 2020 at 7:01 am

    You are welcome

Chathuranga · August 17, 2020 at 3:09 am

Sir. you are master of pic programming…

Leave a Reply

Your email address will not be published. Required fields are marked *