Hi Everyone!
I hope you're doing well.
I have a project in which I am trying to control 121 LEDs with Arduino. The LEDs are arranged in a 11x11 setup (11 rows and 11 columns). Each row (consisting of 11 LEDs) is controlled by 2 Shift Registers of type 74HC595. The first shift register of each row controls 6 LEDs and the other one controls the remaining 5.
The 22 Shift Registers are all daisy chained, meaning the output (Qh') of the first shift register is connected to the SER pin of the second one. Similarly, the output (Qh') of the second shift register is connected to the SER pin of the third shift register. And so on... (Please find attached the PCB layout of my project, both top and bottom layers )
Concerning the Arduino Code, I am using the "MultiShiftRegister" library that can be found on GitHub to control my LEDs.
The problem is the following: I am able to successfully control the LEDs connected to the very first shift register. But then, when I want to control any of the LEDs connected to the second shift register (or any other one really) things get weird and I get some random LEDs lighting up (Some in the 3rd row sometimes).
Here's my (simple?) Arduino code:
#include <MultiShiftRegister.h>
//Pin connected to ST_CP of 74HC595 (RCLK)
int latchPin = 8;
//Pin connected to SH_CP of 74HC595 (SRCLK)
int clockPin = 12;
////Pin connected to DS of 74HC595
int dataPin = 11;
// How many 8 bit shift registers we're talking to.
// Two 8 bit registers can host 16 individually
// addressable binary outputs.
int numberOfRegisters = 22;
MultiShiftRegister msr (numberOfRegisters , latchPin, clockPin, dataPin);
void setup() {
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}
void loop() {
// Prepare to turn on pin 5.
// Pin 6 is still low/off.
msr.set(6);
// Shift data out, with appropriate latches.
// Pin 6 is now high/on.
msr.shift();
delay(1000);
// Turn pin 6 back off.
msr.clear(6);
msr.shift();
delay(1000);
}
PCB_PCB_FYP_Control_Layout_6_2023-07-09.pdf (813.0 KB)
PCB_PCB_FYP_Control_Layout_6_2023-07-09 (2).pdf (695.7 KB)
Can you please help me in figuring out the problem?
Your help is much appreciated! Thank you!!