Engineers Garage

  • Electronic Projects & 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

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

By Salman Khan March 25, 2014

 

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


Filed Under: Electronic Projects
Tagged With: 8051, LED dot matrix
 

Next Article

← Previous Article
Next Article →

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



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

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

  • System for measuring the amount of Joules delivered from a capacitor discharge.
  • Two sections broadband impedance matching
  • The GaN revolution must now happen?
  • How to find the resonance frequency and impedance of a planar spiral coil in HFSS?
  • PhD for Electronics Designers

RSS Electro-Tech-Online.com Discussions

  • The Analog Gods Hate Me
  • Impact of Tariffs on PCB Fab
  • More fun with ws2812 this time XC8 and CLC
  • I Wanna build a robot
  • Wierd makita battery

Featured – LoRa/LoRaWan Series

  • What is the LoRaWAN network and how does it work?
  • Understanding LoRa architecture: nodes, gateways, and servers
  • Revolutionizing RF: LoRa applications and advantages
  • How to build a LoRa gateway using Raspberry Pi
  • How LoRa enables long-range communication
  • How communication works between two LoRa end-node devices

Recent Articles

  • The top five AI startups to watch in 2025
  • STMicroelectronics unveils SoC based on secure MCU
  • Nexperia’s 48 V ESD diodes support higher data rates with ultra-low capacitance design
  • Taoglas releases Patriot antenna with 18 integrated elements covering 600 to 6000 MHz
  • Amphenol RF introduces SMPM to SMPM assemblies on RG-178 cable

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

  • Electronic Projects & 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