Build an 8-digit display using Seven-segment Display and 74HC138

arduinoled

I am trying to create an 8 digit, 7 segment display using an Arduino, 2 4-digit displays and an 74HC138 demux. The 4 displays each have 12 pins: 4 common cathodes, 7 segments and one dot. I thought I would use 8 of the Arduino's digital pins and wire them to the segment and dot pins on the displays, and then use the of the Arduino's digital outputs to control the 74HC138 demux and use that to select the subdisplay. The IC outputs a LOW on the output pin, and so I need to wire a transistor so that it connects the common cathode to ground only when the base current is LOW. Is that correct? How would I wire the components to do that and what transistor do you recommend for this? Should I add any resistors between Arduino's +5V and the LED displays or the IC output and the base terminal of the transistor?

The pinouts for the IC

The 4-digit LED display

Best Answer

Using an external decoder for digit selection is a good idea, since it will save on Arduino pins (but you'll still need 3 address pins). And you are correct that you'll need boost transistors. Connecting a decoder with active-low outputs, like a 74HC138 to transistors to provide active-low display drive is not exactly simple for beginners, since you'll need 2 transistors per channel. You can do it like this

schematic

simulate this circuit – Schematic created using CircuitLab You'll notice that it takes 2 layers of function. Since you're already buying a decoder, you can save some circuitry if you instead use the 74HC238. This is identical to the 138 except that the outputs are active high, and you can do this

schematic

simulate this circuit instead. Using the components shown, you'll have no trouble drawing 50 mA per cathode, and 100 mA is entirely reasonable.