Engineers Garage

  • Projects and Tutorials
    • Circuit Design
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Components
  • Articles
    • EG Blogs
    • Insight
    • Invention Stories
    • How to
    • What Is
    • News
      • EE Design News
      • DIY Reviews
      • Guest Post
      • Sponsored Content
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • Video
    • White Papers
    • Webinars
  • EE Learning Center
  • Women in Engineering

Interfacing LED Dot Matrix with 8051 Microcontroller- (Part 5/45)

March 25, 2014 By Salman Khan

 

An LED dot matrix display consists of a matrix of  LED’s arranged in a rectangular configuration. The desired character or graphics can be displayed by switching ON /OFF  a desired configuration of LED’s. Common display configurations available are 7×5, 8×8, 7×15, etc. LED dot matrix can be used in simple display applications where the resolution is not a big concern.  The figure below shows the arrangement of LEDs in a typical 7×5 dot matrix display.Any individual LED or a group of LEDs in the matrix can be activated by switching the required number of rows and columns.

Circuit Diagram of Dot Matrix LED Display

Fig.1: Circuit Diagram of Dot Matrix LED Display                   

 

Working

Light-emitting diodes (LEDs) provide a cheap and convenient way to display information electronically. LEDs are tiny light sources that are illuminated solely by the movement of electrons in semiconducting materials. They emit light when forward-biased, fit easily into an electrical circuit, and are durable. LEDs are often arranged in patterns to display information. The seven-segment configuration of an LED arranged in the form of the digit 8 can be restrictive in that it does not adequately allow the display of some alphanumeric characters. By contrast, the versatility of a dot-matrix arrangement allows an LED unit to display complicated shapes.

Representational Image of Dot Matrix LED Display

Fig. 2: Representational Image of Dot Matrix LED Display

Stable Character

      This diagram is for practice and programming, wants you have it working you can put transistors and resistors on. Here we put the letter A on the display as you can see in video, using a breadboard.

        Let’s understand how it works. First connect row and column to the microcontroller PORT P3 and PORT P2 respectively. Then by using programing sends data to first column and at same time sends data to row and then after some milli-seconds change the column and send data to row again. And do this till last column and then repeat it again and again around speed of greater then 20 frame per second.

Image displaying stable character formation on Dot Matrix LED Display

Fig. 3: Image displaying stable character formation on Dot Matrix LED Display

 

Moving Character

How to scroll a character across the display? The trick is to build one character on the display by scanning the columns very fast, and let say each 20 times (20 frames) scroll it one position to the left, this will give the effect of a walking text across the dot-matrix display. So first build one frame, repeat this 20 times, and after that, read the data one address later, if you do this 5 times (5 columns) the character scroll from right to left from the display. (The refresh goes so fast that your brain can’t keep up, and what you see is the A scrolling over the display

Image displaying animation of characters on Dor Matrix LED Display

Fig. 4: Image displaying animation of characters on Dor Matrix LED Display

Moving String

    And in third part of the code, here is displaying  “Dot Matrix Display By Saddam Khan”.  The working of displaying string of character on Dot matrix display is also same as last paragraph.

Components Used

89S52 microcontroller

A microcontroller is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. The Program memory in the form of NOR flash or OTP ROM is also often included on chip, as well as a typically small amount of RAM. Microcontrollers are designed for embedded applications, in contrast to the microprocessors used in personal computers or other general purpose applications.

Fig 1.3: Microcontroller (AT8051)

Image of 8051 Microcontroller

Fig. 5: Image of 8051 Microcontroller

Dot Matrix LED display

            Light emitting diodes aligned in a form of matrix constitute a dot matrix display. It is commonly used to display time, temperature, news updates and many more on digital billboards. Dot Matrix Display is manufactured in various dimensions like 5×7, 8×9, 128×16, 128×32 and 128×64 where the numbers represent LEDs in rows and columns, respectively.

Arrangement of the LEDs in the matrix pattern is made in either of the two ways: row anode-column cathode or row cathode-column anode. In row anode-column cathode pattern, the entire row is anode while all columns serve as cathode and vice-versa pattern is there in row cathode-column anode. LED wafers are glued to the bottom of the segments and glow when powered ON. The interesting part is that 35 LEDs are controlled by using a combination of 14 pins. Conductor tracks are laid all over the board to power each LED. Let’s proceed to know in depth about how a dotmatrix display works.

Internal Circuit Diagram and Image of Dot Matrix LED Display

Fig. 6: Internal Circuit Diagram and Image of Dot Matrix LED Display

 

Project Source Code

###



#include<reg51.h>
char col[5]={0x01,0x02,0x04,0x08,0x10};
char raw[5]={0xc1,0xb7,0xb7,0xc1,0xff};
void delay(unsigned int a)
{
 unsigned int i,j;
 for(i=0;i<a;i++)
 for(j=0;j<500;j++);
}
void main()
{
 unsigned int l;
 P2=0x00;
 P3=0x00;
 while(1)
 {
 for(l=0;l<5;l++)
 {
  P2=col[l];    // column
  P3=raw[l];    // row  
  delay(1);       
 }
}
}




Moving Char




#include<reg51.h>
char col[5]={0x01,0x02,0x04,0x08,0x10};
char raw[5]={0xc1,0xb7,0xb7,0xc1,0xff};
void delay(unsigned int a)
{
 unsigned int i,j;
 for(i=0;i<a;i++)
 for(j=0;j<1275;j++);
}
void main()
{
 unsigned int i,j,k,l;
 P2=0x00;
 P3=0x00;
 while(1)
 {
 for(l=0;l<5;l++)
 {
 for(j=0;j<30;j++)
 {
  for(i=0;i<5;i++)
  {
  if(k==5){k=0;}
  P2=col[i];    // column
  P3=raw[k];    // row  
  delay(1); 
  k++;        
 }
}
 k=5-l;
}
}
}




Moving String




#include<reg52.h>
void delay()
{
 unsigned char j;
 for(j=0;j<100;j++);
}
 unsigned char col[6]={0x10,0x08,0x04,0x02,0x01,0x20};
 unsigned char idata dot[236]={
 0xff,0xff,0xff,0xff,0xff,   //
 0xff,0xff,0xff,0xff,0xff,   //
 0x81,0xbd,0xbd,0xc3,0xff,   //d
 0xc3,0xbd,0xbd,0xc3,0xff,    //o
 0xff,0xbf,0x81,0xbf,0xff,    //t
 0xff,0xff,0xff,        //
 0x81,0xcf,0xcf,0x81,0xff,   //m
 0xc1,0xb7,0xb7,0xc1,0xff,   //a
 0xff,0xbf,0x81,0xbf,0xff,    //t
 0x81,0xb7,0xb3,0xcd,0xff,    //r
 0xff,0xbd,0x81,0xbd,0xff,    //i
 0x99,0xe7,0xe7,0x99,0xff,   //x
 0xff,0xff,0xff,           //
 0x81,0xad,0xad,0xd3,0xff,    //b
 0x8d,0xf3,0xf7,0x8f,0xff,    //y
 0xff,0xff,0xff,                 //
 0xdb,0xad,0xb5,0xdb,0xff,   //s
 0xc1,0xb7,0xb7,0xc1,0xff,   //a
 0x81,0xbd,0xbd,0xc3,0xff,   //d
 0x81,0xbd,0xbd,0xc3,0xff,   //d
 0xc1,0xb7,0xb7,0xc1,0xff,   //a
 0x81,0xcf,0xcf,0x81,0xff,   //m
 0xff,0xff,                //
 0x81,0xe7,0xdb,0xbd,0xff,   //k
 0x81,0xf7,0xf7,0x81,0xff,   //h
 0xc1,0xb7,0xb7,0xc1,0xff,   //a
 0x81,0xcf,0xf3,0x81,0xff   //n
 };
void main()
{
 unsigned char k,l,m=0,n;
 while(1)
 {
  for(n=0;n<100;n++)
  {
   for(k=0;k<6;k++)
   {
    P2=col[k];
   P3=dot[l];
   delay();
   l++;
   if(l==126){l=0;}
  }
  l=m;
  if(m==126){m=0;}
  }
 m++;
 l=m;
 }
}

###

 


Circuit Diagrams

Circuit-Diagram-8051-Microcontroller-Based-Dot-Matrix-LED-Display-Controller
Circuit-Diagram-8051-Microcontroller-Based-Dot-Matrix-LED-Display-Controller_0

Project Video

Related Articles Read More >

Wireless distance measurement using ultrasonic sensor
Computerized wireless Pick and Place Robot
Designing an Arduino-based ECG monitor using an AD8232 ECG sensor
Controlling Appliances Wirelessly using RF Technology

Featured Tutorials

  • Screenshot of Raspbian OS on Raspberry Pi RPi Python Programming 03: Raspberry Pi as Linux System
  • Raspberry Pi Models RPI Python Programming 02: Raspberry Pi Models
  • Raspberry Pi 4 RPi Python Programming 01: Introduction to Raspberry Pi 4
  • RPi Python Programming 05: Introduction to Python
  • RPi Python programming 04 RPi Python programming 04: Setting up Raspberry Pi Linux computer
  • Python Basics RPi Python Programming 06: Python basics

Stay Up To Date

Newsletter Signup

EE Training Center Classrooms

“ee

“ee

“ee

“ee

Recent Articles

  • Arduino’s L293D motor driver shield guide
  • NXP launches its first Wi-Fi 6E Tri-Band system-on-chip
  • Nexperia launches industry’s first 80 V RETs for high-voltage bus circuits
  • TDK releases low-profile medical sensors
  • Getting started with Raspberry Pi
...

RSS EDABOARD.com Discussions

  • Power controll on 230V with zero switching and PWM?
  • hysteresis variation mc sim
  • Creepage distance from primary to secondary of offline SMPS
  • HSPICE Simulation refuses to match the Spectre Simulation
  • Same geometry but slightly different results

RSS Electro-Tech-Online.com Discussions

  • How do I find the value of an exploded ceramic capacitor?
  • Any advice on identifying the HV wires on an old flyback.
  • How are you managing with the Covid-19 pandemic?
  • zener diode problem
  • Where has the fun gone?
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2021 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 | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Circuit Design
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Components
  • Articles
    • EG Blogs
    • Insight
    • Invention Stories
    • How to
    • What Is
    • News
      • EE Design News
      • DIY Reviews
      • Guest Post
      • Sponsored Content
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • Video
    • White Papers
    • Webinars
  • EE Learning Center
  • Women in Engineering