Leds not fully off

I’m building a scoring display with home-made seven segment characters. There are going to be 3 or 4 5mm series leds per segment. I think 74hc595 shift registers aren’t going to be up to the job, so I ordered some tpic6b595 ICs instead, except I messed up and got tpic6c595 ICs instead. So I figured I’d try and test it by only wiring up one segment so far (ie 3 series leds) but somethings not working properly. When the leds should be fully on, that’s fine, but when they should be off they’re still half on.

This is my curcuit.

If I connect the base of the BJT to either Vcc or Gnd the leds switch on and off fine, but when it’s connected to DRAIN0 (pin3) of the shift register, I get the problem.

I saw something about the tpic6c595 having constant current outputs so may not need current limitting resistors compared to the tpic6b595, so I’ve tried various different values of resistors and no resistor at all, but nothing seems to make a difference. Do I need to change my circuit for the 6c or do I need to use 6b instead?

Well to start with, your BC327 is wired wrongly. Arrow on the emitter always points to the more negative. So a PNP has the emitter at positive and an NPN has the emitter to negative.

Since you are - when properly connected - using transistor buffers, the current carrying capacity of the TPIC6C595 is perfectly adequate.

It is absolutely not a constant current driver. You are confusing the various maximum current specifications for the A, B and C versions. You most certainly require a resistor. :astonished:

The LEDs remain on due to wiring the transistors in reverse.

Don't use a transistor. A TPIC is perfectly capable to drive that LED string on it's own.

A TPIC can only sink current, so the load must be between supply (not ground) and pin. Use the "string of three LEDs and resistor" between 9volt and TPIC output. Leo..

Excellent point - assuming he hasn’t already wired the segments as common cathode.

Thought putting the resistor in the cathode end suggests he hasn’t.

9V battery? PP3 size?

@AJLElectronics I think that was just my Fritzing ****-up. I hadn't noticed the part was EBC (not CBE) in the breadboard view.

@Paul__B Not sure where I saw the 6C was constant current and didn't need resistors. I can't find it now. It must have been the tequila! LOL

@Wawa & @Paul__B The plan is to have 6 digits with common anode and two shift registes: one to control which segments come on and the other to control the digits via the common anode. I hadn't apreciated the TPIC can only sink current, but doesn't that mean I have to use a transistor with the "digit" shift register connected to the base.

@PaulRB I'm only using a PP3 battery at the moment, but in the long run it will probably run off a wall wart or a 12v lead acid battery and a voltage regulator.

The TPIC family is just N-channel mosfet switches to ground, no internal current limiting resistors.

Best way is to use six TPIC chips (any) for six common anode displays. No matrixing, max brightness.

Can use your diagram, but with emitter to supply and collector to LED string. But you must add a second resistor between supply and base, otherwise the leakage (off) current of the mosfet switches will be amplified by the BC327. Can use 10k for that. The 4k7 base CL resistor might need to be lowered to 1k if you want to switch 7*20mA with the BC327. Leo..

I'm only using a PP3 battery at the moment, but in the long run it will probably run off a wall wart or a 12v lead acid battery and a voltage regulator.

PP3 batteries have a very high internal resistance and low current capability. You may find that when many segments are on at once, the battery's voltage will sag badly, maybe causing the Arduino to reset unexpectedly. Get rid of it and replace with for example 6xAA holder.

For 12V operation you may not need a regulator, simply adjust the led series resistors. That way, the heat can be dissipated across many resistors instead of one regulator. The Uno's regulator should be able to cope with 12V ok so long as it only has to supply itself and the tpic chips, and all the LEDs are powered from the 12V rail. Also you may be able to make your digits larger with 12V, perhaps 4 or 5 LEDs in series per segment.

fenghuang: I think that was just my Fritzing ****-up. I hadn't noticed the part was EBC (not CBE) in the breadboard view.

But wiring the transistor backwards resulting in reverse breakdown could explain LEDs being on when they should not.

fenghuang: Not sure where I saw the 6C was constant current and didn't need resistors. I can't find it now. It must have been the tequila! LOL

Plausible explanation. :grinning:

fenghuang: The plan is to have 6 digits with common anode and two shift registers: one to control which segments come on and the other to control the digits via the common anode. I hadn't appreciated the TPIC can only sink current, but doesn't that mean I have to use a transistor with the "digit" shift register connected to the base.

You want to play with multiplexing? I - as well as Wawa and others - would advise you that it is not worth the trouble in the long run. Use six TPICs, one per digit, common anode, no transistors, three control pins. You just write to all the digits and leave it alone. Best brightness, easiest code.

fenghuang: I'm only using a PP3 battery at the moment, but in the long run it will probably run off a wall wart or a 12v lead acid battery and a voltage regulator.

We remain surprised it works at all. :astonished: Why would you need a regulator to go to 9 V when you have 12? Just size the resistors to match.

I do caution against using "Vin" or the "barrel jack" as on a UNO. In fact, I advise against a UNO as a Nano is more practical. Especially at 12 V, the regulator is barely able to maintain the processor itself; when you start adding other things and expecting them to run from the 5 V (the TPICs are harmless as they require virtually no current) - as you almost certainly will - you will get apparently intermittent failures. Chase up a small switchmode "buck" regulator to provide your 5 V from 12 or whichever.

Oh, by the way, don;t buy one buck regulator. Two or three ready for the next projects. :sunglasses:

Thanks. Can you point me at an example for 1 shift register per 7 segment display? I've struggled to find something appropriate.

Multiplexing seems to be a standard thing to do. What makes it a bad idea?

I figured using a 12v lead acid battery was a bad idea as, freshly charged, they're over 13v. I believe the Uno's voltage regulator is theoretically rated to something like 25v, but the Uno's spec says 12v max. In my head that makes a single 7809 regulator for the Uno's Vin and the displays a sensible way to go.

At the moment I only have a couple of Unos. I could probably switch to a Nano later.

I've no idea what a buck regulator is yet :-) but I'll look into them.

I can share some code tomorrow. But it's pretty simple. Much simpler than multiplexing code.

For small, low voltage (<5V) displays, multiplexing can significsntly reduce the circuit complexity (chips, pins, other components) at the cost of code complexity, and that's cheaper overall. Almost all small multi digit 7-seg displays are wired in such a way that you have no choice but to multiplex.

For larger, higher voltage displays, the circuits necessary to switch the anodes and cathodes, that would be needed for multiplexing, are more complex, often involving discrete components. So the circuit is not much simpler or cheaper overall, compared to not multiplexing. Also, large displays are often used outdoors or need to be seen from a distance, so brightness is important. Multiplexing typically reduces brightness.

"Buck" regulators are switching regulators. Linear regulators like 7805/7809 and those found on Uno are linear regulators. Linear regulators are inefficient, they work by simply burning off power to reduce the voltage. This also means they are susceptible to overheating. If you use a linear regulator to turn 10V into 5V, that can only ever be 50% efficient at best. If the 5V circuit needs 1A, the linear regulator draws 1A at 10V, supplies 5W power to the circuit and wastes the other 5W as heat. A switching regulator reduces the voltage by switching the input voltage on and off at high speed adjusting the duty cycle to achieve the desired average output voltage, which is then smoothed. Its a more complex circuit, and can produce radio interference, but it's much more efficient, often 80~90% efficiency. So to supply 1A at 5V to a circuit, a switching regulator would only draw maybe 0.55A from a 10V input and waste only 0.5W as heat.

TPIC large display drivers on these pages, including example code. Leo..

This board can control up to 12 digits, not multipexed.


Here it is driving 8 digits from 12V source. ~20mA/segment for the small digits, ~40mA for the large digits.

328P on board bootloaded like an Uno, just plug on an FTDI Basic for code downloads.
https://www.youtube.com/watch?v=6HZ0Mr51jUY
(forum may add some extra characters to start and end of the link)

Uses TPIC6B595 for up to 150mA @ 50V. I’ve only tested at 24V and a large number of series LEDs for a hockey scoreboard from the Detroit Redwings stadium.

Just use SPI.transfer to load the shift registers up when the data changes

// something changed?
digitalWrite (ssPin, LOW);
for (x=0; x<12; x=x+1){
SPI.transfer(digitArray[x]);
}
digitalWrite (ssPin, HIGH); // outputs change on this rising edge

I usually use a fontArray as well to look up the bit to segment mapping so digitArray can just hold 0 to 9 and whatever letters you want to use, such as A,b,C,c,d,E,F,g,h,H,I,J,L,o,P,r,S,U,u, maybe Y?

SPI.transfer(fontArray[digitArray[x]]); // look up font and shift it out
byte fontArray[] = (
0b00111111; // 0  DP-g-f-e-d-c-b-e
0b00000110; // 1
// etc.
};

Standard segment names a f b g e c d

fenghuang: Multiplexing seems to be a standard thing to do. What makes it a bad idea?

It's a great idea within the limits explained by the others, when brightness is not absolutely critical and when it is done for you by purpose-designed hardware such as the MAX7219. There is a very limited case for performing the multiplexing with the microcontroller itself which substantially increases the complexity of the coding and would still - as in your case - require significant extra hardware to drive the display. It is difficult to "save on parts" this way and still have it work properly.

fenghuang: At the moment I only have a couple of UNOs. I could probably switch to a Nano later.

Start buying the Nanos now - they will take a while to arrive at present from eBay or Aliexpress. Buy in bulk - at least half a dozen. :astonished:

MAX7219 can't do 9V or 12V tho, just 5. TPIC6x595 can handle the higher voltage, and current if needed.

Maxim has an App note if you want to use it and wire in a bunch of additional transistors

https://www.maximintegrated.com/en/design/technical-documents/app-notes/1/1196.html

Lot more straightforward to just use TPIC6x595s

Thanks again, all.

PaulRB: I can share some code tomorrow. But it's pretty simple. Much simpler than multiplexing code.

OK, I'm sold on the idea of not mux'ing and buck convertors. [Reaches for de-solderin braid. :( ] I get that you can cascade shift registers, but I struggling to get my head around how to drive 6 digits wth just 3 pins, and pass variables to the display without a lot of code.

Wawa: TPIC large display drivers on these pages, including example code. Leo..

That looks like an expensive way to buy a TPIC6C595 and header pins. :confused:

CrossRoads: MAX7219 can't do 9V or 12V tho, just 5. TPIC6x595 can handle the higher voltage, and current if needed.

TPIC6c595 datasheet says max Vcc and Vi is 7v. Confused.

fenghuang: That looks like an expensive way to buy a TPIC6C595 and header pins. :confused:

TPIC6c595 datasheet says max Vcc and Vi is 7v. Confused.

TPIC6C59*6* (SMD version), but yes. You can buy TPIC6B595 chips for about US$5 for 10 on ebay.

There is a voltage for power(5volt) and data (5volt or 3.3volt), and another one for the mosfet outputs. The 6B outputs are limited to 50volt, the 6C to 33volt.

Lots of tutorials for 74HC595 shift registers. Leo..