Hello,
We’re absolute beginners when it comes to multiplexing in particular, so please forgive us our ignorance because we just wanted to learn a bit about this topic with this project. Please also let us know if we forgot any crucial bit of information.
Our plan
We want to make a 10 x 10 LED matrix controlled by daisy-chained shift registers. The idea is that each register pin can control one row or one column of the LEDs so we can use multiplexing to show some patterns. The standard stuff.
The problem at the moment is although the goal is generally achieved in the sense I can display a pttern, the LEDs are always flickering at a high frequency and also relatively faint, which affects all LEDs at the same time. In addition, there also lower frequency flickering that affects whole rows. This in in principle could be less than perfect connections because so far we only wired it with breadboards. Tomorrow I was planning to use perfboard. The LEDs are currently connect via 330 Ohm resistors is that too much?
Solutions tried so far
- Powering everything from the Arduino Nano or plugging a USB-c power jacket/power data module doesn’t really matter.
- We also played extensively with the delays.
- We also placed the Arduino Nano with an old Arduino Uno.
- Maybe my knowledge is too limited but in other posts and tutorials I didn’t find many differences (e.g. Multiplexing With Arduino and the 74HC595 : 14 Steps (with Pictures) - Instructables ).
Components
The led we uses are green (the shop says 3-3.4 V) and an Arduino Nano. The transistors are BC547.
Wiring diagram
Code
const int latchPin = 3; // RCLK (shared)
const int clockPin = 4; // SRCLK (shared)
const int dataPin = 5; // SER
// Matrix dimensions
const int NUM_ROWS = 10;
const int NUM_COLS = 10;
// Corrected heart animation frames (10x10 matrices)
bool heartFrames[4][10][10] = {
{ // Frame 0: Small heart
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,1,1,0,0,0,0},
{0,0,0,1,1,1,1,0,0,0},
{0,0,0,1,1,1,1,0,0,0},
{0,0,0,0,1,1,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0}
},
{ // Frame 1: Medium heart
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,1,0,0,1,0,0,0},
{0,0,1,1,1,1,1,1,0,0},
{0,1,1,1,1,1,1,1,1,0},
{0,1,1,1,1,1,1,1,1,0},
{0,0,1,1,1,1,1,1,0,0},
{0,0,0,1,1,1,1,0,0,0},
{0,0,0,0,1,1,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0}
},
{ // Frame 2: Large heart
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,1,1,1,1,0,0,0},
{0,0,1,1,1,1,1,1,0,0},
{0,1,1,1,1,1,1,1,1,0},
{1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1},
{0,1,1,1,1,1,1,1,1,0},
{0,0,1,1,1,1,1,1,0,0},
{0,0,0,1,1,1,1,0,0,0},
{0,0,0,0,1,1,0,0,0,0}
},
{ // Frame 3: Full heart
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,1,1,1,1,0,0,0},
{0,0,1,1,1,1,1,1,0,0},
{0,1,1,1,1,1,1,1,1,0},
{1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1},
{0,1,1,1,1,1,1,1,1,0},
{0,0,1,1,1,1,1,1,0,0},
{0,0,0,1,1,1,1,0,0,0}
}
};
void setup() {
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}
void loop() {
// Persistent scanning of current frame, change frame by elapsed time
static int frame = 0;
static unsigned long lastFrameChange = 0;
unsigned long now = millis();
unsigned long frameInterval = 500; // Faster animation
displayMatrixFrame(heartFrames[frame]);
if (now - lastFrameChange > frameInterval) {
frame = (frame + 1) % 4;
lastFrameChange = now;
}
}
void displayMatrixFrame(bool matrix[10][10]) {
for (int row = 0; row < 10; row++) {
uint16_t rowPattern = (1 << row);
uint16_t colPattern = 0;
for (int col = 0; col < 10; col++) {
if (matrix[row][col]) {
colPattern |= (1 << col);
}
}
uint32_t pattern = ((uint32_t)colPattern << 10) | rowPattern;
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, (pattern >> 16) & 0xFF);
shiftOut(dataPin, clockPin, MSBFIRST, (pattern >> 8) & 0xFF);
shiftOut(dataPin, clockPin, MSBFIRST, pattern & 0xFF);
digitalWrite(latchPin, HIGH);
// No delay for maximum speed
}
}



