Go Down

Topic: Scoreboard project: Random segments lighting up (Read 2263 times) previous topic - next topic

MrGibbage

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.

Code: [Select]

// 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[] = {
  119,
  36,
  93,
  109,
  46,
  107,
  123,
  37,
  127,
  111
};

//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() {
  Serial.begin(9600);

  //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);
    delay(1000);
  }
}

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);
}


larryd

52 posts, read posting instructions.

Show your schematic.
Show a good picture of the wiring.
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

aarg

  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

MrGibbage

#3
Mar 10, 2016, 01:24 pm Last Edit: Mar 10, 2016, 07:08 pm by MrGibbage
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)
1.


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.

2.


3.


4.


5.


6.


7.


Inside of the display board. Four TPIC shift registers.

8.


9.


10.


11.


12.


13.


14.


15.


16.


17.

pwillard

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.

larryd

#5
Mar 10, 2016, 05:13 pm Last Edit: Mar 10, 2016, 05:40 pm by LarryD
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.

No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

pwillard

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

larryd

#7
Mar 10, 2016, 06:03 pm Last Edit: Mar 10, 2016, 06:19 pm by LarryD
Quote
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.
.
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

CrossRoads

#8
Mar 10, 2016, 06:27 pm Last Edit: Mar 10, 2016, 06:29 pm by CrossRoads
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.

These digits started out as 3 & 6 LED strips as segments, after wiring that up a few times some digit boards were made instead.

Link to youtube video testing 5 digits.
https://www.youtube.com/watch?v=smtbPy0EWrE

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

MarkT

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 will NOT respond to personal messages, I WILL delete them, use the forum please ]

MrGibbage

#10
Mar 11, 2016, 01:41 am Last Edit: Mar 11, 2016, 01:47 am by MrGibbage
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.

larryd

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

.
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

MrGibbage

#12
Mar 11, 2016, 03:17 am Last Edit: Mar 11, 2016, 03:22 am by MrGibbage
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.

http://pelorus.org/files/scoreboard/2016-03-11%2002.04.57.jpg

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.

http://pelorus.org/files/scoreboard/2016-03-11%2002.06.08.jpg

larryd

#13
Mar 11, 2016, 04:27 am Last Edit: Mar 11, 2016, 07:11 am by LarryD
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).
.
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

Grumpy_Mike

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.

Go Up