0
\$\begingroup\$

I've created a circuit using a shift register to drive a 7-segment display which is all controlled by an Arduino Uno. The circuit appears to work fine, I have a sketch running which simply counts from 0 to 9 over and over. Attempting to put this together on my tiny breadboards was a bit of a challenge due to the number of comonents and connections necessary.

My question is, are all the components I used necessary? Could the circuit be simplified by re-arranging and removing some of the components?

The circuit

schematic

simulate this circuit – Schematic created using CircuitLab

Datasheets for the display and shift register:

About the design

I was unsure from the datasheets whether or not I could drive the LED display directly from the outputs of the shift register. Based on the resistors I had available, I calculated that each segment would draw roughly 11mA. If all 7 segments were on that would then be a total current of 77mA. From what I see the datasheet for the shift register, Absolute Maximum Continuous output current is 25mA, but it's not clear to me if that is per-output-pin or combined. I assumed combined.

In order to try and avoid pushing too much power through the shift register I decided to use it to drive transistors instead. The only way I could see to get the transistor to work as an on/off switch was to tie it between the resistor and the segment display. With this arrangement I figured when the transistor was closed, current would bypass the display and flow through the transistor resulting in the display being off. When the transistor was open the current would instead flow through the display and turn the segment on.

\$\endgroup\$
0
\$\begingroup\$

You can drive the display directly from the shift register. Using an HC595 is better because you can load the serial SR with all the data before transferring it to the output so you won't get 'ghosting' (segments which should be off showing as slightly lit as a result of updates).

For future reference, you could also simplify the circuit as follows if you wanted more current than the shift register could supply:

schematic

simulate this circuit – Schematic created using CircuitLab

This saves 7 resistors by using the transistors as emitter followers. The transistors also dissipate a bit of heat, but not enough to worry about at 10mA. In this case, high = on for the SR outputs. The SR runs from 3.3V, not 5V. Off segments draw no current, which is better.

In your case, I believe you are running the SR at a 5V supply voltage and using 3.3V signals to drive it. This should work okay, but it's close to the 3.5V minimum high input voltage and may cause the SR to draw more current than necessary.

\$\endgroup\$
0
\$\begingroup\$

The preferred method for using a NPN or N-MOSFET transistor as a switch is to locate it between the switched device & ground.This method tends to be easier to understand, and much more energy efficient.

  • Easier for 'on' signals to activate your display, than having to 'think backwards' and 'turn off' every segment you're not using;

  • Also, think of the power being wasted on heating up your resistors & transistors when shorting (bypassing) LED drive current to ground through the resistor & transistor.

Instead, try using either of these 2 exaple circuits. On the left is an LED being driven by an NPN BJT transistor (like you're already using), and on the right is an LED being driven by an N-channel FET. Notice that, due to the FET's extremely high gate impedance, it does not need a resistor between the shift-register drive pin & itself.
Transistor-controlled LEDs

\$\endgroup\$
0
\$\begingroup\$

At the current levels you're using, the simplest approach would be not to use the transistors at all.

schematic

simulate this circuit – Schematic created using CircuitLab

You are trying to get about 10 mA per segment from your display. If you look up a 74HC164 datasheet, look for VOH (voltage output high). You'll see that what you want is not exactly specified, but for 6 volts and 5.2 mA, the typical drop in output voltage from the supply is only about 0.2 volts. At 10 mA, you might expect about twice that, let's call it 0.5 volts. This is only a few tenths of a volt worse than the transistors would drop in saturation, which means you'd expect something like a 10% reduction in current. This sort of variation is almost invisible (unless you're comparing 2 segments side by side) so I wouldn't worry about it. Additionally, the spec sheet lists a maximum output current level of 25 mA, so there should be no obvious danger to the shift register. It may get a bit warm, but the worst-case total power ought to be in the vicinity of $$ P = 7 \times .5\times .01 = 0.35 \text{ watts} $$ and this is well within the capabilities of the package (0.5 watts), although it is a bit warm.

If you want to play it safe, increase the limiting resistors to about 470 ohms, and see if that's bright enough for you.

\$\endgroup\$
  • 1
    \$\begingroup\$ Your assumption that doubling the current will only double the voltage drop is ill-founded; many devices have a voltage drop which is very low for currents below a certain level and increases enormously beyond that. On the other hand, if behavior is specified at 5.2mA, and if a resistor would limit current to 10mA, the actual current will likely be between 5.2mA and 10mA, which should be adequate. \$\endgroup\$ – supercat Feb 12 '16 at 20:57
0
\$\begingroup\$

We use 74HC595 Shift Registers to drive LEDs directly in many of our Industrial Control panels.

One board has 40 pcs of Red LED driven from cascaded HC595 Shift Registers. Because this board has so many LEDs, there is a separate SMPS buck converter that supplies 4 Vdc to the current limit resistors that then feed the LEDs. These LEDs are all driven active LOW - when the SR output is LO, the LED is ON. There are several reasons for this but the main reason is that the shift registers are powered from a low-current 5V rail.

Because these are Red LEDs, the forward voltage is about 1.7V. We run the LEDs somewhere around 15 - 20 mA.

This has been reliable in hundreds of control panels (thousands of boards) for several decades.

Other boards have varying numbers of LEDs driven directly from HC595 Shift Registers. Boards that use large numbers of Green or Blue LEDs run the LEDs from a 5V rail because of the higher forward-voltage requirement of those LEDs. But the current is significantly less - under 0.5mA for most of those Blue and Green LEDs. Even then, they are often blindingly-bright.

Driving the LEDs active LO allows mixing of the LED supply voltage rails if necessary. The LEDs running from a lower supply voltage than the Shift Register are reverse-biased when OFF but well within their spec rating (worst case is reverse-bias of 1V and typical LED spec is reverse bias less than 5V)

You mention wanting to reduce component count. If you drive your LEDs directly from the Shift Register output, you can then use a bussed SIP resistor network for the current-limit resistors. This brings your total component count for 8 LEDs down to the LEDs + 1- HC595 + 1- 10-pin buss SIP resistor network. 3 components plus the LEDs for each group of 8 LEDs (including the 100n bypass cap at the HC595).

If you need either higher current or higher voltage (or both) than a HC595 can handle, you may want to consider using TPIC Power Shift Registers from TI. We use the TPIC6595 (250mA, 50 Vdc Open Drain) and the TPIC6C595 (similar to 6595 but 16-pin package and 100mA max).

We use the TPIC Shift Registers for driving relays and other higher-voltage or higher-current loads.

If your LEDs are contained in displays, be sure to choose Common Anode displays.

\$\endgroup\$

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.