Custom 7 Segment digit multiplexing

I want to build a 7 segment display with 2 digits.
Using Arduino nano, 7 pins (a,b,c,d,e,f,g) for segments control and 2 pins(D1,D2) to switch between the digits.
is the attached schema correct? or there is a better way to do that!

thanks
Capture

What is the purpose of the build?

Big size digit and fun

This Jameco page shows how to wire 2 multiplexed 7 segment displays.https://www.jameco.com/Jameco/workshop/TechTip/working-with-seven-segment-displays.html

Look for the Multiple digit displays (multiplexing) section.

2 7 seg display

here the display run at 5V, but in my case VCC is 9V (or 12V in case I need more Leds), this is why I used transistor to drive one segment but I'm not sure if this is correct!

It is correct. But, it's much easier to purchase the driver modules. Each one has 7 or 8 segment drivers for one digit. Or use WS2811 mini modules, each one can drive 3 segments and has open drain outputs for the high voltage.

I think it will work, but you might try replacing the two segment resistors with a single one in the emitter line. That would control both the base current and the collector current, and would automatically give you the maximum gain the transistor will deliver. I think. So you would eliminate R2, and move R1 over to the emitter of Q1. And I don't think it needs to be as low as 20 ohms. You don't need more current to drive more LEDs, you just need enough voltage. LEDs in series - the only free lunch in electronics. :slight_smile:

Yes, but that reduces the available drive voltage by about 5V.

I would suggest using a tpic6b595 chip for each digit. Easier to wire up than 16 transistors plus base resistors, far less voltage drop, brighter, no multiplexing, and only 3 Arduino pins needed.

1 Like

I'd also consider the alternative of only one tpic6b595 and only 7 current limiting resistors and two p-channel mosfets to switch the digit common anodes. It would mean a few extra lines of code to multiplex these but the hardware would be quite simple.

My pick as well. :grin: Vastly simpler overall.

20 Ohm resistors in the first diagram looks wrong.

this is what I did:
9V - (2.0v4 + 0.2v2) / 20mA = 30 Ohm
9V - (2.1v4 + 0.2v2) / 20mA = 10 Ohm

so I picked the middle 20 Ohm !!

9 volts is very close to the combined forward voltage of strings of 4 LEDs in series.
You have other options: parallel / series combinations of the leds. What colour, incidentally, are the LEDs ?

For 9v each segment is 4 Red Led.
But I will go to 12V, 5 Leds, one TPIC6B595 and 2 Mosfets its the best and flexible choice so far I got 1 extra useful segment.

Care to explain that figure in detail? :face_with_raised_eyebrow:

Would 2 more n-channel mosfets or npn transistors be required to control the gates of those p-channel mosfets?

in my first schematic exact R2 = (9V - (2.0v x 4 + 0.2v x 2)) / 20mA = 30 Ohm

  • 20mA desired current
  • 4 red Leds drop 2.0v x 4
  • 2 transistors drop 0.2v x 2 (Vce sat @ 20mA from chart in data sheet)

Oh yes. That is also correct. This would be a classic high side switch. I'd use two 2n3904 or similar NPN transisitors. Similar to this:

You are "sailing too close to the wind" with this circuit. What if your LEDs actually have a 2.1V drop, and you use 30R, what would the current be then? What if the LEDs were 1.9V? How much current then? If you work out the current for 1.9V and 2.1V you will see they are very different from the 20mA you intended. Would the LEDs be damaged?

Next, calculate what the series resistor would be for a 12V supply. Then work out what the current would be if the LEDs were 1.9V or 2.1V. You should find that the currents are much closer to the 20mA you intended. This is a much more stable circuit.

So that circuit would be 1 tpic6b595 chip, 2 npn transistors, 2 p-channel mosfets and 4 resistors, plus 7 series resistors for the LEDs. Plus a 0.1uF bypass cap for the chip, of course. So 17 components and 5 Arduino pins.

If 2 X tpic6b595 were used, 2x 0.1uF and 14x series resistors. 18 components and only 3 Arduino pins. One more component, but the circuit is simpler, the code is simpler, the LEDs are brighter because there is no multiplexing.

@imla the choice is yours!