Scrolling Text on LED Matrix 8x8 using Arduino

Buy This Simulation Hello friends, Hope you all are fine and having fun with your lives. In today's post, I am going to show How to display a Scrolling Text on LED Matrix 8x8 using Arduino in Proteus ISIS. We all know about LED Matrix but if you don't know then google it. :P LED Matrix is used to display long messages, the best thing about LED Matrix is you can combine then in serial way and can make it of any size you want. Like in this post I have combined 8 LED matrices and then displayed my message on them. I have given all the details here but as you can see we have done a great effort in designing this simulation so I haven't posted it free but have placed a very small amount of $20 on it and you can buy it quite easily from our shop by clicking the above button.

I have used Proteus software for the simulation purposes and have use Arduino board as a microcontroller. We know that Proteus doesn't support Arduino but we have a library for it. So, first of all, read Arduino library for Proteus so that you can easily add the Arduino board in your Proteus software and then must also read How to get Hex file from Arduino which we will be uploading in our Proteus software. Its quite easy and you will get it don't in the first attempt. Anyways let's get started with Scrolling Text on LED Matrix 8x8 using Arduino in Proteus ISIS.

Hardware Design of LED Matrix 8x8 using Arduino in Proteus ISIS

  • First of all let's have a look on the hardware design of LED Matrix 8x8 using Arduino in Proteus ISIS, which is shown in below figure:
 
  • So, if you have a closer look on it by clicking it then you can see I have used 8 LED matrices and have used MAX7219.
  • MAX7219 is a shift register which is of real importance here, it takes data serially in and parallel out.
  • It is also known by the name serial in parallel out shift register. We send data to it using single pin which is the data pin and this data is edge triggered by the clock pulse.
  • So when our clock pulse goes from low to high the data is sent to the shift register.
  • We have connected these shift registers in a row as you can see in above figure, the first register is connected to second register via Dout pin.
  • So suppose I have connected two shift register then in this case now I am sending data to two shift register and my output will be of total 16 bits.
  • So, in this way we can add as many shift registers as we want and here I have added total 8 shift registers so my output is total of 64 bits and I am controlling these 64 bits via single pin of Arduino which is data pin of course.
  • Clock Pin and Load Pin are also used here which are used to send the data and then load it in sequence so in short using just 3 pins of Arduino I can control any number of shift register.
  • Now, each shift register is controlling each LED Matrix 8x8 and the reason I am using 8 shift registers is because I am using 8 LED Matrix 8x8.
  • It's a bit tricky but quite simple. So, now we have complete overview of this shift register and how it works, now let's move on to our simulation.

Scrolling Text on LED Matrix 8x8 using Arduino in Proteus ISIS

  • First of all, download the Arduino library for LED Matrix 8x8 by clicking on the below button.

  • Now design a complete circuit as shown in below figure in your Proteus ISIS software:
  • Next thing you are gonna need is the code for Arduino board which is posted below, so copy it and paste it in your Arduino software:
#include <MD_MAX72xx.h>  
#define     MAX_DEVICES   8 
 
#define     CLK_PIN      13  
#define     DATA_PIN     11  
#define     CS_PIN       10  

MD_MAX72XX mx = MD_MAX72XX(DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);  
  
#define SCROLL_DELAY     200
 
#define     CHAR_SPACING     1  
#define     BUF_SIZE     75  
char curMessage[BUF_SIZE];  
char newMessage[BUF_SIZE];  
   
uint8_t scrollDataSource(uint8_t dev, MD_MAX72XX::transformType_t t)  
{  
  static char        *p = curMessage;  
  static uint8_t     state = 0;  
  static uint8_t     curLen, showLen;  
  static uint8_t     cBuf[8];  
  uint8_t colData;  
  
  switch(state)  
  {  
  case 0:  
    showLen = mx.getChar(*p++, sizeof(cBuf)/sizeof(cBuf[0]), cBuf);  
    curLen = 0;  
    state++;  
    
    if (*p == '\0')  
    {  
      p = curMessage;  
    }  
  case 1:       
    colData = cBuf[curLen++];  
    
    if (curLen == showLen)  
    {  
      showLen = CHAR_SPACING;  
      curLen = 0;  
      state = 2;  
    }  
    
    break;  
  case 2:  
    colData = 0;  
    curLen++;  

    if (curLen == showLen)  
     state = 0;  
    
    break;  
    default:  
    state = 0;  
  }  
  return(colData);  
}  
  
void scrollText(void)  
{  
  static uint32_t     prevTime = 0;  
  if (millis()-prevTime >= SCROLL_DELAY)  
  {  
    mx.transform(MD_MAX72XX::TSR);       
    prevTime = millis();  
  }  
}  
  
void setup()  
{  
  mx.begin();  
  mx.setShiftDataInCallback(scrollDataSource);  
  mx.control(MD_MAX72XX::INTENSITY, 10);
  strcpy(curMessage, "www.TheEngineeringProjects.com");

  newMessage[0] = '\0';  
}  
   
void loop()   
{  
  scrollText();  
}
  • Now after uploading the code in Arduino software, get the Hex file for Arduino and upload it in your Arduino board in Proteus ISIS.
  • Now when you upload it to your Arduino board and run your simulation you will get something as shown in below figure:
  • Now let's have a look at How it scrolls, I really have to work hard to make the below figure but it looks cool isn't it. :)
  • So, that's how our website link is gonna scroll from right to left and you can scroll any kind of text.
  • You can buy the complete simulation along with Arduino code and hex file by clicking on below button.

Buy this Proteus Simulation

That's all for today. I hope you guys get some knowledge out of it. Let's meet in the next tutorial, till then take care!!! :)

Interfacing of Keypad with Arduino

Hello friends, hope you all are fine and having fun with your lives. In today's post we will have a look at How to interface keypad with Arduino in Proteus ISIS. Keypad is used almost in every engineering project. If you even look around you will find keypad in many electronic appliances. For example, a simple ATM machine has a keypad on it using which enter our pin code and give commands to the ATM machine. Similarly, calculator also has keypad on it. So, in short there are numerous applications of keypad. You should also read the Real Life examples of Embedded Systems and you will find Keypad in them as well.

Keypad is used where you need to used numerical buttons or you need to use lots of buttons for sending commands so like in some application I need to use 10 buttons so instead of using separate 10 buttons I would prefer to use keypad instead as it will save a lot of time both in hardware as well as programming. So today we will have a detailed look on How keypad works and How we can Interface keypad with Arduino in Proteus ISIS. Proteus also gives keypad component in its database using which we can easily simulate it in Proteus and can save our time. So first simulate it and then design the hardware. After today's post I will also share an Automatic Lock system project using keypad. Anyways let's get started with Interfacing of Arduino with keypad:

How keypad works ??

  • Keypad uses matrix system in order to work.
  • For example, I am using a keypad which has 12 buttons on it as shown in below figure:
  • Now you can see its a 12 button keypad so it has total 3 columns and 4 rows and similarly there are 7 pins to control these 12 buttons.
  • So, the simple formula is total number of pins = Number of Rows + Number of Columns.
  • Now if we look at the internal circuitry of this 12 button keypad then it will look something as shown in below figure:
  • Columns and rows are connected with each other now suppose I press button "1" on the keypad then first row and the first column will get short and I will get to know that button "1" is pressed.
  • Same is the case with other buttons, for example I press button "8" then second column and the third row will get short so this code will remain unique for each button.
  • In simple words, on each button press different column and row will get short we need to detect which one gets short in order to get the pressed button.
Quite simple, isn't it ?? You should also have a look at these Arduino Projects for Beginners. So that's how a keypad works, now let's have a look at How to Interface this keypad with Arduino in Proteus ISIS.

Interfacing of Keypad with Arduino in Proteus ISIS

  • So, now we are gonna interface this keypad with Arduino in Proteus ISIS which is as always my favorite simulator.
  • In Proteus design a circuit as shown in below figure:
  • So, we have an Arduino UNO board along with keypad and LCD.
  • So I have done the programming in such way that whenever you press any button on the keypad, it will get displayed on the LCD.
Note:
  • Now, copy the below code and paste it in your Arduino software and get the hex file from it.
#include <LiquidCrystal.h>
#include <Keypad.h>

const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
    {'1','2','3'},
    {'4','5','6'},
    {'7','8','9'},
    {'*','0','#'}
};

byte rowPins[ROWS] = {10, 9, 8, 7}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {13, 12, 11}; //connect to the column pinouts of the keypad

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(A0, A1, A2, A3, A4, A5);
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(20, 4);
  lcd.setCursor(1,2);
  lcd.print("www.TheEngineering");
  lcd.setCursor(4,3);
  lcd.print("Projects.com");
  lcd.setCursor(0,0);
}

void loop() {
char key = keypad.getKey();

    if (key) {
        lcd.print(key);
    }
}
  • Now upload the hex file in your Arduino UNO in Proteus ISIS and hit the RUN button.
  • If everything goes fine then you will get something as shown in below figure:
  • Now, when you press any button on the keypad it will also appear on the LCD as shown in below figure:
That's all for today. In the coming post I am gonna share a small project in which we will design a automatic locking system using this keypad. So stay tuned and have fun. :)
Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir