0

I am using this 4-digit 7-segment display.

segment pinout

So my circuit is basically 220 ohm resistors for all the segments (display pins 6 through 16 on the bottom each go through a resistor before going to a digital output pin on the arduino)

I read online that each segment should have its own resistor instead of having one resistor for all to maintain even brightness. The segments are rated for max 25 mA. Assuming the digital pins output 5V, this requires resistance of 200 ohms I think? Well I don't really know because there are multiple resistors in parallel. I don't understand how the current per pin adds up.

Display pins 2-5 are directly connected to arduino digital pins 2-5. The reason I did this was so I could multiplex which pin is LOW for each digit.

I was under the assumption that digital output LOW was the same as GND. So since I never to multiplex the colon (D3/D4), I figured I could connect display pin 1 (COM) directly to ground. But the colon ends up noticeably brighter than the other digits and brighter than if I connected the colon pin to a digital pin outputting LOW. So is there a voltage difference or current difference? I noticed the whole display unit has no ground pin, meaning everything is coming from an arduino digital pin either driven LOW for COM or HIGH for the segments.

2
  • So is there a voltage difference or current difference? ... neither ... it is the ON time difference
    – jsotola
    Commented Jul 29 at 5:54
  • @jsotola that totally escaped me yesterday, that a multiplexed digit would be dimmer. it is totally obvious to me now
    – qwr
    Commented Jul 29 at 14:55

1 Answer 1

1

The relation to Arduino is small, because you connect to its pins. However, this issue is an electrical engineering issue at the end of the day.


Static drive vs multiplexed drive

If you use a GND connection on pin 1 and drive pin 6 statically HIGH, the LEDs will be on all the time.

In contrast, the digits are multiplexed and are on only during their time slot, and off during the other time. This reduces the effective brightness roughly by the number of time slots.


Calculating the resistor

Your calculation "5 V divided by 25 mA gives 200 Ω" is correct by Ohm's law. But your assumption of 5 V at the resistor is wrong.

Each LED has a "forward voltage" that depends on the specific model, roughly on its color and technology. The data sheet tells us 4.0 V typically at 20 mA (for the digits, as they have 2 LEDs in series). It raises with the current, but not linearly, to about 4.05 V at 25 mA. Please be aware that these are typical values, the concrete values can differ a lot!

The dots' LEDs are single LEDs, you can assume a forward voltage of about 2 V for them. Take this into account when you calculate the resistor(s).

Assumed that the Arduino's pin would output 0 V for LOW and 5 V for HIGH, which is idealized, the remaining voltage at the resistor is about 1 V. Divided by 25 mA results in a resistance of 40 Ω.

Now the multiplexing comes into play. Since you use 4 digits, most probably each of them is driven roughly during 1/4 of the time. To have the average of 25 mA, you need to multiply the current by 4, giving 100 mA. The resistor will have 10 Ω then.

But the display does not allow this according to the data sheet. Unfortunately it does not say anything about a duty cycle of 1/4, only 1/10. If you accept potentially reduced life time, you can drive it with 100 mA nevertheless. If you don't, reduce the current.


Driving capabilities of the Uno's pins

When multiple segments are on per digit, the HIGH side of each segment still carries 100 mA as calculated above. But on the LOW side (the common cathode) the current is the sum of all driven segments, up to 7. Outputting an "8" will result in 700 mA!

The pins of your Uno cannot source or sink a lot of current. If you try to do more, real world effects according to physics jump in and make the mental model invalid. According to this answer on SE/EE, the maximum current per pin is 40 mA.

If the current is higher, a LOW will not hold the voltage near GND. It will be significantly higher. The same is true for HIGH. The data sheet of your Uno's MCU will tell you more, look for "pin driver strength".

This reduces the usable voltage on resistor and LEDs. This leads to less current, until some balance point is reached. Please be aware that you are using the device outside the specifications here, which could damage it permanently.

Therefore you will want to use driver stages (ICs or transistors) to be able to use more current. But this design is not clearly not Arduino-related. Please do your own research.

6
  • 1. The schematic shows that the segments A–G are pairs of LEDs in series, while the dots (D1–D5) are single LEDs. The quoted VF is presumably for the A–G segments (2 V is typical for a red LED). Thus the dots need higher resistances in series. 2. The “typical characteristics” curves in the datasheet show that the digital outputs have a typical resistance around 25 Ω. Thus OUTPUT LOW is not quite GND if you sink significant current. Commented Jul 29 at 9:58
  • @EdgarBonet Thanks, edited. Point 2 was already indicated. Commented Jul 29 at 10:26
  • Thanks for the thorough answer. I have questions about the resistor calculation. 1. For the part that says "the remaining voltage at the resistor is about 1 V. Divided by 25 mA results in a resistance of 40 Ω", we divide by 25 mA if we wanted to use that current and find the resistance? Suppose I made no changes and left my 220 ohm resistor. Then the current across the LED is 4.5 mA, which is way below the max, correct?
    – qwr
    Commented Jul 29 at 19:05
  • 2. For multiplexing, Do you mean "multiply by 4 to get the same average current as if the digit were continuously powered?" Otherwise, I don't see why I would need an average 25 mA across an entire multiplexing cycle. My thought was that 1/4 of the time, there is 25 mA through the segments, then 3/4 of the time it is off. The brightness is fine for my purposes.
    – qwr
    Commented Jul 29 at 19:10
  • 3. If each arduino COM pin can only provide 40 mA, then when outputting an "8" each segment will only get 40 / 7 = 5.7 mA. Are you saying the circuit will change LOW voltage until it gets say 25 mA per segment, or the segment will simply only get 5.7 mA? I don't think I am pulling anywhere near 700 mA in this whole display.
    – qwr
    Commented Jul 29 at 19:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.