3

The question seems simple, but there's more to it:

I'm connecting 4 74HC595 shift-registers to an arduino pro micro. 28 of the 32 outputs will be used to control LED segments of numbers. Each segment uses 14-20 LEDs and so I will be using a transistor for each segment. Now here's my problem: With the maximum amount of LEDs activated (at time 08:08), the LEDs will draw nearly 10A. How can I use another transistor to make the shift-registors work with the arduino even though it shouldn't be drawing all current from the arduino, but from an external power source. I have found a suitable adapter from 230V to 5V 12A. The 12A is just to ensure that nothing goes wrong. The LEDs alone will draw 9.76A.

I know how to connect the arduino to the power source, but how do I run extra wires from the power source around the arduino to provide the LEDs their power?

  • Consider using MOSFET as transistor of TTL type. – MatsK Aug 14 '17 at 20:48
  • I don't know but I would support nothing. Not even a guess – Xxx Dec 7 '18 at 15:50
5

First you should consider changing your whole idea so that your LEDs don't draw nearly 10A.

I am assuming that for each segment you have 14-20 LEDs wired in parallel, each with its own current limiting resistor. That is very wasteful.

Instead you should be grouping the LEDs in chains of series LEDs which you then place in parallel.

Assuming you have normal red LEDs with a forward voltage of around 2V and a typical current draw for maximum brightness of 20mA, you can connect them up in chains of, say, 5 LEDs with one current limiting resistor, and power them from 12V not 5V.

3 chains of 5 LEDs (15 LEDs) would be 3x20mA = 60mA per segment. 4 chains of 5 LEDs (20 LEDs) would be 4x20mA = 80mA.

With 08:08 displaying that's 26 segments plus dots. Assuming each segment has 20 LEDs that's a total of 26x4 = 104 chains of 5 LEDs, totalling 520mA.

And then you should do away with the resistors as well, and use constant current LED sinks, such as the TLC59116, which can handle the higher input voltage.

If you don't want to do that, then more transistors will be needed:

schematic

simulate this circuit – Schematic created using CircuitLab

I have only showed 2 digits, 2 segments, 2 chains per segment, and 2 LEDs per chain to save space.

To drive it you need 1 GPIO per segment in one digit and 1 GPIO per digit. So for 4 digits at 7 segments that's 11 GPIO.

  • This is a very good Idea! I actually hadn't thought of the difficulty of the programming. Every minute, I need to change one digit and therefore the arduino somehow needs to know what bitcode to write for the new time outcome. Those shift-registers are fun, but not simple. I might consider using an arduino MEGA instead, so I have enough ports to control every segment without complicated code. – Hendriks3D Aug 14 '17 at 20:52
0

schematic

simulate this circuit – Schematic created using CircuitLab

Change the 74HC595 to TPIC6B595. Each output can sink 150mA from up to a 50V source. Strings of 3 LEDs in parallel powered from a 12V source (with current limit resistor per string) are easily handled, no extra transistors are needed. The 12V positive goes to the + of each string (the top anode), the - (bottom cathode) goes to the TPIC6B595 output. Here is a video of 8 TPIC6B595s running displays made two strings of 3 LEDs in parallel for the large digits, one string of 3 LEDs for the small digit. https://www.youtube.com/watch?v=6HZ0Mr51jUY Each string draws 25 or so mA. The board that drives the display holds up to 12 shift register chips and is controlled by an Atmega328P set up like an Arduino.

The shift registers are easy to use as well. I use SPI.transfer to send data to them. Create an array to map the shift register outputs to the segments:

byte fontArray[] = {
    0b00111111, // 0 with the bits mapped to segments DP-g-f-e-d-c-b-a
    0b00000110, // 1   0 = segment off, 1 = segment on
    etc.
}

The digit layout:

    a
f       b
    g
e       c
    d       and DP if used.

Then to update the display, say you have 4 shift registers all daisy chained:

digitalWrite (ssPin, LOW);
SPI.transfter(fontArray[digit0]);
SPI.transfter(fontArray[digit1]);
SPI.transfter(fontArray[digit2]);
SPI.transfter(fontArray[digit3]);
digitalWrite (ssPin, HIGH); // all outputs update on this rising edge

Dirt simple really. No need for a Mega.

  • Hmm, spacing in didn't turn on code view mode. Is that supported in this forum? – CrossRoads Dec 7 '18 at 18:29
  • 1
    Just paste in your properly indented code, select it all, and click the '{}' symbol on the exit-box toolbar. That will tell the editor to respect your formatting and highlight the section in light-gray. – JRobert Dec 7 '18 at 21:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.