I'm trying to build a 2-digit 7-segment LED display using a MAX7219 driver, to display some information on my model railroad. I built it with digits 0 and 1 wired, and CLK, DIN and LOAD lines going to the Arduino, as well as +5v and GND. Following this, I tested it on my workbench with a simple count up sketch (below), and it worked. However, I then made the mistake of soldering some additional wires to the Arduino connection, to extend the wires to reach the location it is to be installed. In order to do this, I extended the 5 wires to the Arduino with some CAT5 cable, using 2.5 pairs. A push button was connected to a 6th wire in this cable, with the other side of it going to the GND connection.
Following this, I tested the LED display again, expecting the same result. After all, I haven't added any components. However, at best, all it would do was flicker upon startup, then show blank. Since then, I have taken the following troubleshooting steps:
- Mapped out the wires from the end of the CAT5 cable to the connections to the IC socket - confirmed them correct.
- Tried 3 different MAX7219 chips - all of them brand-new until I put them into the IC socket.
- Tried multiple pins on my test Arduino, and have even soldered wires directly to the pins in order to eliminate a loose contact as a source of the issues. (My particular Arduino had solder pads for this purpose.)
- Tried a second Arduino.
None of the above have produced any result - it just flickers on startup and that's it. Given that I have only added less than 1m of wire, and no other components, between the working and non-working state, I am baffled as to why it is not working. The only change was extending the control wires. Can anyone shed any light on why this may be happening?
I should also mention that the Arduino and MAX7219 are both being driven by a 5V regulated power supply - they have a common ground.
The test sketch is below:
#include <LedControl.h>
/* This is a simple sketch to test a 2-digit LED display driven
* by a MAXX 7219 or 7221 chip.
*/
#define LEDData 3
#define LEDClk 4
#define LEDLoad 5
int counter = 80; //Counter that counts up
LedControl testLED = LedControl(LEDData, LEDClk, LEDLoad, 1);
//Create LedControl object with defined pins.
void setup() {
// put your setup code here, to run once:
testLED.shutdown(0, false);
//Is in power-saving mode on startup - this wakes it up
testLED.setIntensity(0, 8);
//Sets brightness of display to middle of range (0-15)
testLED.clearDisplay(0);
}
void loop() {
// put your main code here, to run repeatedly:
disNumLed(counter); //Update Display
delay(500); //Wait half a second
counter++; //Increment counter
//if (counter > 99){
//counter = 0; //Reset if above 99
//}
}
void disNumLed (int disNum) {
//Takes an integer and displays it on the 2-digit LED display. Will ignore values above 99.
int firstDigit;
int secondDigit;
testLED.clearDisplay(0);
firstDigit = disNum % 10; //Return remainder of division operation (modulus)
testLED.setDigit(0, 0, firstDigit, false);
if (disNum > 9) {
//If int is still greater than 9, then there should be another digit (base 10)
disNum /= 10; //Move to next digit
secondDigit = disNum % 10;
testLED.setDigit(0, 1, secondDigit, false);
}
}
(I've been using different values for the LED pins while doing point 3 of the troubleshooting above - all with the same result.)




