arduino_proteus

How to Display Character ‘A’ on an LED Dot Matrix Using Arduino and 74HC595 Shift Register

In this post, I will demonstrate how to display the character ‘A’ on an LED dot matrix using an Arduino UNO and the 74HC595 shift register. This simple project utilizes shift registers to control the LED matrix, allowing us to efficiently display characters with fewer Arduino pins.

Components Required

Here is the list of components you will need for this project:

  • LED Bar (used to simulate the dot matrix display)
  • Arduino UNO Board
  • Default Arduino Pins
  • 74HC595 Shift Register (to control the LEDs with fewer pins)

Source Code

The following code is used to display the character ‘A’ on the LED dot matrix using the 74HC595 shift register. We utilize two shift registers: one for the rows and another for the columns.


const byte CLOCK_C = 13, DATA_C = 12, LATCH_C = 11; 
const byte CLOCK_R = 10, DATA_R = 9, LATCH_R = 8; 

int a;
int seq_row[] = {0xFF, 0xE0, 0xD7, 0xB7, 0xB7, 0xD7, 0xE0, 0xFF}; // Rows to represent 'A'
int seq_col[] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; // Column pattern

void setup() { 
  for (a = 8; a <= 13; a++) { 
    pinMode(a, OUTPUT); // Set the pins as outputs for the shift register
  } 
} 

void loop() { 
  for (a = 0; a <= 7; a++) {   
    senddata_col(seq_col[a]);  // Send column data
    senddata_row(seq_row[a]);  // Send row data
    delay(1);                  // Short delay for stability
  } 
} 

void senddata_row(int recv) { 
  digitalWrite(LATCH_R, LOW); 
  shiftOut(DATA_R, CLOCK_R, MSBFIRST, recv); 
  digitalWrite(LATCH_R, HIGH); 
} 

void senddata_col(int recv) { 
  digitalWrite(LATCH_C, LOW); 
  shiftOut(DATA_C, CLOCK_C, MSBFIRST, recv); 
  digitalWrite(LATCH_C, HIGH); 
}


Code Explanation

  • Pins Definition: The CLOCK_CDATA_C, and LATCH_C are connected to the shift register that controls the columns, while CLOCK_RDATA_R, and LATCH_R are for the rows.

  • Character ‘A’ Pattern: The seq_row[] array defines the row pattern for the letter ‘A’, and seq_col[] defines the column activation.

  • senddata_row() and senddata_col() Functions: These functions send data to the shift registers to turn on the appropriate rows and columns to form the character on the dot matrix.

Results (Circuit Diagram)

To help visualize the connections and setup, below is the circuit diagram for this project. The diagram shows the connections between the Arduino UNO74HC595 shift registers, and the LED bar.

After setting up the circuit in Proteus and uploading the source code, you can run the simulation. The character ‘A’ should be displayed on the LED bar as intended.

Conclusion

In this project, we successfully displayed the character ‘A’ on an LED bar using an Arduino UNO and 74HC595 shift register. This setup demonstrates the power of shift registers in controlling a large number of LEDs with minimal Arduino pins, making it a scalable solution for projects involving multiple LEDs.

Feel free to modify the code and experiment with different patterns or characters. If you have any questions or suggestions, feel free to leave a comment below!


Comments

Leave a Reply

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