7 Segment Display issues using 74HC595 and ULN2803A

I am using two large 2.3 in 7 segment displays. The part number is SA23-12YWA. I am using two 74hc595D shift registers that then go to two ULN2803A that actually turn off and on the segments. It is my understanding that the SA23-12YWA is capable of 140ma per segment if I am reading the datasheet correctly. The 2803 can handle up to 500ma per pin. The issue I am having is it runs fine for a good while then the segments on one is still nice and bright but the wrong segments displays and the other display only shows one or two segments are are very low. Am I reading the datasheets incorrectly? I have attached my schematic. J1 is 5v input, J2 is my 12V input, J3 is the clock latch and data from the arduino and J4 is just another 2803 that goes out to three superbright LEDS. Am I reading the datasheets wrong or is my schematic jacked up somewhere?

I cannot decipher your image, resolution is much too low :frowning:

Most probably your problem resides in the shift register power supply. It may help to add caps at the shift register power pins. Also prevent LED current running through the logic Gnd. Connct -12V directly to the ULN drivers, not somewhere else.

Rubbish! Excellent resolution. Click on it!

Basic design mistake: ULN2803 is obsolete. Usable at 12 V, not 5 but the proper pick is a TPIC6B595 to replace the HC595 and ULN2803.

Code problems another matter. :roll_eyes:

Rubbish! You clearly are not reading the datasheet correctly. 30 mA per segment.

Can it? How many pins?

In any case, your 160 Ohm (peculiar choice!) resistors are just fine.

OK, so I may be being harsh (well, I am :face_with_raised_eyebrow:), I haven't really addressed your problem, just the obvious design mistakes but if you don't understand what you are doing, it might be better to come here and ask first!

How do you view the image in high resolution? Even if I try to save it it's 647px × 500px :frowning:

Tap/click on the image to get the Hi res version.

1 Like

Thanks, FF is very picky in viewing images :frowning:

It may depend on the Linux I'm actually using. That's the first time I have trouble with an image resolution.

Okay, so I was using the peak current, so .30mA it is....

That being said, how can my resistors be fine if each segment is .30mA, doesn't 12v using 160 Ohm resistor equal .75mA?

As far as not understanding what I am doing and coming here and asking first, that is what I am doing; asking.

If I am reading your link correctly for the TPIC6B595 and your comment, it replaces the HC595 AND the ULN2803? Sweet! As far as my code, I have no issues there. I am a software developer by trade and it actually works fairly well, it just craps out the display after a while.

If I bump the resistors to 400 Ohm (or should I do a tad higher to account for a full 12v Battery which can reach a tad over 13v, is the rest of my schematic solid? I will change the resistors to use up the boards I had made with the 2803 and 595 and see if I can redo using the chip you suggested.

I'm using it here (of course :sunglasses:) . Works just fine. :grin:

Yes, your electronic comprehension is lacking. :grin: The datasheet indicates that the display segment (except DP) uses about 8.4 V out of your 12 (could be 10 V, and the obsolete ULN2803 drops at least another Volt which the TPIC6B595 does not), so the voltage across the resistor is more like 3.6 V, so I calculated about 22 mA.

The resistors are correct.

But it appears you went and built it first! :worried:

So TBH, I haven't looked at the code (yet) but unable to see anything actually fatal in the hardware (other than perhaps the secret power supply) I am tending to suspect the code. :grin:

Your expertise in software development does not necessarily confer to microcontrollers.

Oh, you mention a (12 V) battery. What battery would this be?

So am i.
All the misunderstandings about the hardware, combined with a circuit diagram containing over 20 'labels' that make it a little hard to read , (i think you could do a bit better than what you've done so far using the software you've used, but that is a different matter) do not account for the symptoms you describe.
ULN2803's may be obsolete, but if that's what you have already, using them certainly beats a run to the shop to get something else.

I thought we prefer people to first try and and show us what they've come up with, but i am flexible on the matter.

'Nonsense' is a tad more polite.

This was mentioned before, you should look at the total current it can sink for all pins combined as well. Mind you with the application you are anyway well within range.

As i said before, it seems ok, but with a connecting wire running thru a component and a lot of 'parts' of the schematic only referring to other parts thru labels, it is possible to miss something.

Which usually is related to a software issue. If it works initially, that tends to signify that the hardware works.
Show us the code, there are things that are totally OK on a big machine that can cause problems on a small MCU. We anyway need to have All information so we can also exclude the software as a cause.

I doubt it. I use Mint. :+1:

@mscientist33 Display spec;

Tom... :smiley: :+1: :coffee: :australia:

I think he actually got it. :grin:

(OK, ".30mA" doesn't make sense but ... :roll_eyes:)

Okay, here is my code. It suppose to start up with just two dashes "- -" on the display. Once the countdown reaches 00, it lights up an LED (not coded yet). It will cycle through 3 leds at the end of each countdown. This is still a work in progress....

It is powered by a 12V 3.4amp hr battery. The LED connector J4 just goes to another board that has nothing but LEDS and a resistor for each.

int latchPin = 6; //pin 12 on the 595 
int dataPin = 5; //pin 14 on the 595 
int clockPin = 7; //pin 11 on the 595 
const char common = 'a';    // common anode
//const char common = 'c';    // common cathode
byte num10s;
byte  num1s;

void setup()
    pinMode(dataPin, OUTPUT);
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);

   myfnUpdateDisplay(B00000010); //clear display but leave - - 

void loop()
  for (int x = 99; x>0; x--)
    num10s = x / 10;
    num1s = x % 10;


byte myfnNumToBits(int someNumber) {
  switch (someNumber) {
    case 0:
      return B11111100;
    case 1:
      return B01100000;
    case 2:
      return B11011010;
    case 3:
      return B11110010;
    case 4:
      return B01100110;
    case 5:
      return B10110110;
    case 6:
      return B10111110;
    case 7:
      return B11100000;
    case 8:
      return B11111110;
    case 9:
      return B11110110;

void myfnUpdateDisplay(byte eightBits) {
  if (common == 'c') {                  // using a common anonde display?
    eightBits = eightBits ^ B11111111;  // then flip all bits using XOR 
  digitalWrite(latchPin, LOW);  // prepare shift register for data
  shiftOut(dataPin, clockPin, LSBFIRST, eightBits); // send data
  digitalWrite(latchPin, HIGH); // update display

I replaced the display board and it worked for a while with the above code, then all of a sudden it started acting up again. Attached is a picture of the display. Notice the middle segment on the right display. It turned really dim.

Set latchPin high then low again only after shifting out all 16 bits.

For a diagnosis a scope shot of the dim segment voltage were interesting.

Oddly enough, with the 160 ohm resistors the displays were putting off a lot of heat. I had some 1k smt resistors handy and replaced all the 160 ohm resistors and its been running for about an hour now without any issues and not hot at all. The display definitely isn't as bright as I need it to be but it does seem to point to a current issue. I will order some resistors around 430 ohm and see if I can brighten it up and keep the heat down.

As a quick test you can wire two 1k resistors in parallel for 500 Ohm.

Well you can probably order 430 Ohm resistors, and they probably are available, but the classic value is 470 Ohm and you would never notice the difference. :grin:

Why did you delete your confession in #14? :rofl:

470R would be the way to go.
How did you arrive at 160 to begin with ? Cause if i apply 12v and want to limit the current to 30mA , it works out to 400R. Sure i've not taken the voltage drop into account, but i would prefer to be on the safe side, and that is just extra margin.
Not to mention that with 160R , at 12v you get 75mA as a current (Ok, Ok the voltage drop will matter ) and at 12v that would result in 0.9 Watt (P = V * I ) By now the voltage drop is squared, but that does explain why the resistor got a little hot.
Use 470R or 2x1K and measure the current. Calculate what comes close enough to that 30mA, although maximum brightness is probably reached at 20mA already. And i would try and keep it below 1/4 Watt, or make sure the resistor is up to the task.

@Paul_B , yes, it was a confession, but then further testing showed that the code wasn't the issue... it was just inverting the output.

@Deva_Rishi , it was the displays getting hot, not the resistors.