Scoreboard project: Random segments lighting up

I’ve got my scoreboard project nearing completion. I am having a problem though. Random segments will light up and turn off. For instance, I had a test program that just counted up from 00 to 99, with a new number each second. Some numbers would display just fine (like, 02) and then next time through, the 2 might be missing the lower tail. Or one of the segments that isn’t supposed to be lighted, would be.

Somehow it seems to be related to the number of segments that are supposed to be lighted. For instance, sixes, nines and eights almost always have segments missing, but 11 never has a problem. I know my encoding is right (that is, which segments go with which numbers) because a lot of times it will work fine. Of course, I want it to work right all the time.

I am powering the board with a 4S LiPo battery and a 12v and and 9v voltage regulator for the display and arduino respectively.

Based on the symptoms where it seemed to be related to the number of segments, that made me think it was a power problem, so I tried using two batteries, a 5000maH 4S LiPo for the display and a 2100maH 4S LiPo for the arduino. Still, same symptoms.

There are no switches wired up to the board yet. All I am trying to do at this point is successfully count to 99. When I see things happen randomly, it makes me think of a switch that isn’t properly pulled down/up, but that isn’t the case right now.

Here’s the code, but since it works a lot of the time, I don’t think it is code-related. I am really inclined to think it is hardware related.

// Scoreboard is wired like this:
//    A Green
//  --------------
//  |            |
//  | B Lt       | C Brown
//  | Green      |
//  |            |
//  -------------- D Lt Brown
//  |            |
//  | E Orange   | F Lt Orange
//  |            |
//  |            |
//  --------------
//    G Blue
//  Segments are wired in order. A (Green) is connected
//  to output 0. And G (Blue) is connect to output 6.
//  Output 7 is not used.
//  A 0000 0001  -- 1
//  B 0000 0010  -- 2
//  C 0000 0100  -- 4
//  D 0000 1000  -- 8
//  E 0001 0000  -- 16
//  F 0010 0000  -- 32
//  G 0100 0000  -- 64

//  Digits are made like this:
//              GFE DCBA
//  0  GFE CBA 0111 0111  -- 119d 77h
//  1   F  C   0010 0100  -- 36d  24h
//  2  G EDC A 0101 1101  -- 93d  5Dh
//  3  GF DC A 0110 1101  -- 109d 6Dh
//  4   F DCB  0010 1110  -- 46d  2Eh
//  5  GF D BA 0110 1011  -- 107d 6Bh
//  6  GFED BA 0111 1011  -- 123d 7Bh
//  7   F  C A 0010 0101  -- 37d  25h
//  8  GFEDCBA 0111 1111  -- 127d 7Fh
//  9  GF DCBA 0110 1111  -- 111d 6Fh

int encodedSsd[] = {

//Pin connected to RCK (ST_CP) of TPIC (Pin 7)
int latchPin = 8;
//Pin connected to SRCK (SH_CP) of TPIC (Pin 8)
int clockPin = 11;
////Pin connected to SER IN (DS) of TPIC (Pin 18)
int dataPin = 10;

//Pin 8, 10, 11

void setup() {

  //set pins to output so you can control the shift register
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);

void loop() {
  for (int i=0; i<100; i++) {
    DisplayFourDigitScore(i, i);

void DisplayFourDigitScore(int homescore, int guestscore) {
  int homeOnesDigit = homescore % 10;
  int homeTensDigit = (homescore - homeOnesDigit) / 10;
  int guestOnesDigit = guestscore % 10;
  int guestTensDigit = (guestscore - guestOnesDigit) / 10;
  digitalWrite(latchPin, LOW);
  // shift out the bits:
  shiftOut(dataPin, clockPin, MSBFIRST, encodedSsd[homeOnesDigit]);
  shiftOut(dataPin, clockPin, MSBFIRST, encodedSsd[homeTensDigit]);
  shiftOut(dataPin, clockPin, MSBFIRST, encodedSsd[guestOnesDigit]);
  shiftOut(dataPin, clockPin, MSBFIRST, encodedSsd[guestTensDigit]);
  //take the latch pin high so the LEDs will light up:
  digitalWrite(latchPin, HIGH);

52 posts, read posting instructions.

Show your schematic.
Show a good picture of the wiring.

Do you have latches?

Schematic is here (you did this for me, LarryD, thanks!)

Here’s some photos of the build (no comments on the messy dining room table, please. My wife is mad enough)

The RJ45 jack is where I will be connecting the control switches to change the score. The red-black-white jumper is where I power the arduino and the LED lights. The red is 9v and goes to the aarduino, and the white is 12v and goes into the 10pin header so I can send the power out to the display.
The 10 pin header is what connects to the display through a ribbon cable.

Inside of the display board. Four TPIC shift registers.

The 0.1uF caps are best placed as close as possible to the Vcc and GND pin of the TTL IC Chips.

When I worked in Field Service eons ago, we would see long ttl signal level bus lines... and one thing the designers had to deal with was ttl fanout and signal to noise ratios.

TTL Fanout (how many input pins a single output pin can drive) issues were solved by installing a Buffer/Driver IC where the signal originated from the controller. Like 74HC244

Signal to noise issues were trickier. Often, the designers would isolate signal pins in a ribbon cable from each other by running GND signal every other wire so all data pins were separated by a GND pin.

Your problems might be related to any of these things... or not... just food for thought.

I don't see the .1 decoupling caps.
The wires should be as short as reasonable.
What do you measure on the 5 volts pin for each chip?

Show the foil sides.

I assumed that the green blob near the header pins on picture 10 and 11 were the 0.1 caps.

i agree "The wires should be as short as reasonable."

Maybe I have the wrong datasheet... I thought pin 2 was vcc not pin 3

I assumed that the green blob near the header pins on picture 10 and 11 were the 0.1 caps.

You may be right, I thought these were short jumpers.
On NE package pin 17 is VCC.
Pin 3 is tied high, SRCLR'

The OP should confirm they are using TPIC6A595-NE
It is the 20 pin package.

You can see TPIC6A595 in one of the pictures.
Control signal-wise, would have been smarter to have the 4 shift registers colocated, then cable out the shift registers outputs to the LED strings, where the drive signal is not critical.

You can see my 12-digit driver card here, with wires going to an adapter card to the ribbon cable connector on the backs of digits.
8 digit display wiring.jpg
These digits started out as 3 & 6 LED strips as segments, after wiring that up a few times some digit boards were made instead.
8 digit display.jpg
Link to youtube video testing 5 digits.

I'd suggest lots more decoupling for lots of LEDs - 33uF electrolytics on every board as well as per-chip 0.1uF?

LEDs switch at logic speeds, yet carry (en masse) currents of the order of magnitude of amps, when
they all switch together (the usual case for multipling) that's far more dI/dt than a small decoupling
cap can hope to handle.

Pattern sensitivity in LED displays is typical symptom of inadequate decoupling. When you have circuitry
distributed over multiple boards you should have an electrolytic bulk-decoupling cap per board anyway,
just good practice.

The longer the wiring the more important decoupling will be, since the stray inductance of the supply
wires becomes large.

I added a 33uF cap on each of the TPIC boards, and I still have erratic segments. Do you guys really think I need to look at shortening wires? Which wires should I shorten first? The ones in the display? Or the wires on the TPIC boards? Those wires aren’t especially long, and I don’t think I could really cut much more than half a centimeter out of them, which just doesn’t seem like it could possibly make a difference.

Show a picture where and how the .1uf decoupling capacitors are soldered


The cap in the upper right is the .1uF. The power for the board comes in on the ribbon cable. The red wire is the ground and you can just make out the +5 wire just above it. Vcc for the TPIC is the red jumper wire right between the cap and the power in from the ribbon cable on that power rail.

Here's another view from the other side. The clear gunk all over the place is hot glue. The wires from the ribbon are very small, so I wanted to give them a little strength. All four of the boards are wired the same.

Those need to be .1uf (100nf) (104) "ceramic" capacitors, see image:
Cut leads as short as possible.
They need to be soldered right at pin 17 (+5V) to pin 14 (GND).

There is no way that cap is 0.1uF, it is an electrolytic cap. You are miss reading it.
Use one like the picture above, it HAS to be a ceramic type.

I want to make sure I am ordering the right this. How's this:

Would someone mind explaining to me what the functional difference will be in the circuit? Also, how confident are you guys that making this swap will fix the problem?

LarryD, when you say "soldered right at the pin", do you mean the same hole in the perfboard as the pin, or is the hole next to the pin good enough?

By the way, the caps I have installed do indeed say "0.1 uF" on the side. Of course, that doesn't do me any good since they are the wrong type.



Would someone mind explaining to me what the functional difference will be in the circuit? Also, how confident are you guys that making this swap will fix the problem?

Dave just did it:
Dave Jones (eevblog) explains decoupling-capacitors.

// Per.


I gave you credit for having a tiny green 0.1uF cap near the header connector...

Wrong location anyway... I stand by what I said. Place the 0.1uF cap as close to the IC's Vcc and GND pins as possible... I have often solved this on bad PCB designs by attaching the capacitor leads directly to both pins on the underside of the board.

Oh yeah, I meant to mention that yesterday. That green thing by the header pin is just a jumper wire. I can see how it would look like a small cap though.

Boy, I am really hoping that I have the same luck and that when I get these caps in, all of my problems will be solved.

The picture in post 13 is what you need.
Butt solder the capacitor to the same pads as the pins on 17 (+5) an 14 (LGND).