7 Segment LED reverse voltage problem

Hey guys I need someone's help. I'm new to this and may have the wrong concepts. I bought a 2 digit 7 segment led with common anode. I've done some research here and on YouTube and found that I can hook up the cathode pins to some digital output pins on the arduino and set them to low. Also I've found out that I have to put a current resistor between the cathodes and the digital pins. Also it is recommended to use the 3.3v on the a ;)node side. I'm planning of just using one led to get the basics straight. I'm currently using the arduino uno r1.
Well my question is the following: when I set the output pins to HIGH to turn off the led, wouldn't that cause a reverse voltage on the led?

Thanks, and sorry for my bad English. :wink:

If the Arduino is running from 3V and the common anode is at 3V then there's no reverse bias condition.
If your Arduino is running 5V then have the "CA" at 5V, too.

So you are suggesting to hook up the common anode to 5V and when setting the OUTPUT pin to HIGH I won't have a reverse voltage?

Correct.
It's a component with 5V at both electrodes.
A diode with the anode at +5 and the cathode at +5.
A diode with the anode at +5, the cathode connected to a resistor, and the other end of the resistor at +5.
What's the voltage across? 0V

(NB A resistor is required between each segment/LED and each output pin. You could get by with one resistor in the "CA" line, but you'd have to make certain that only one segment would be on at a time. Stay with a resistor for each until, for now.)

Ok, thanks a lot. I've done that, but now my arduino just resets everynow and then. I gonna check if it is my computer or something else.

                       |
5V------A_K----220?----| output pin
                       |

thanks

I know I'm very late to this party as it's been 8 years now, but I suppose that doesn't prevent revisiting this discussion. I agree with the OP that a reverse bias condition will exist when only using a shift register to drive a multi digit 7 segment display. See the attached image. Let's say we want to light just the DP of the first digit. We enable digit 1 with a high (red), all other digits are disabled with a low (green). Now to light the DP, we have to set the segment cathode to low and set all other segment cathodes high. The blue path indicates current flow to light the DP. But also note the yellow path. We have created a reverse bias condition. The yellow path is just one example, but it exists between all other off cathodes and their corresponding off digit anodes. This could be a problem as I've seen some multi-segment display data sheets that advise against reverse biasing the leds as that can reduce its lifetime.

It could only be a problem if you wire things like in your diagram.

You have no resistors, and wiring the common anode to an Arduino pin is going to fry the Arduino because it can’t supply enough current to drive seven LEDs in parallel.

The common anode should be driven by a high sided switch that can handle the expected current, and no reverse bias will occur.

First off, thank you for your reply!

My diagram was conceptual and intended to focus on the direction of current only which is why I omitted the current limiting resistors. But perhaps to your point, I suppose it's better to be precise than not (notwithstanding that too often I'm accused of providing too much detail).

I've seen where people have driven multi digit 7 segment displays directly from shift registers or directly from controller output pins (and with proper current limiting resistors) which are set in code to be either high or low. It struck me that the OP was trying to do that (ie. limit to high/low values) and correctly pointed out reverse biasing concerns that result from that design.

What you really want is a high impedance state on the cathode rather than a high output to turn it off. That's exactly where I was going and as you correctly pointed out, that using transistors on the common anodes avoids this problem altogether (side note: I believe PNP is a good choice here). Furthermore, and of course, using transistors may also solve the problem of over driving the display directly from logic level outputs.

So unless I've either missed or misconstrued something, I believe we are in violent agreement!

P.S. I will add that if one can drive the display directly from logic level I/O, then changing the output to high impedance by dynamically changing it to an input can solve the reverse bias issue here. Having said that, Charlieplexing uses tri-state logic and yet still reverse biases the leds, so it may not necessarily be a big concern as long as you pay heed to the led data sheet's reverse biasing limits.

4-Digit-7-Segment-LED.png

It was never a problem. The LEDs have a reverse bias specification well over 5 V and we are using a 5 V supply.

The preferred LED driver, the MAX7219 - like the 74HC595 - does drive outputs both HIGH and LOW, so LEDs not selected will be reverse biased - in fact, if the wiring is wrong or the wrong polarity matrix is inserted, all LEDs are illuminated, demonstrating what would be the reverse bias. The reverse bias simply does not matter at all. :grinning:


Your diagram suggests using pin 1 of the Arduino. This is generally inappropriate on an ATmegaxx8-based Arduino as you would likely be using serial communications.

Thank you for responding Paul, you make some very good points. I do feel some clarifications are necessary though:

  1. The OP wrote "Well my question is the following: when I set the output pins to HIGH to turn off the led, wouldn't that cause a reverse voltage on the led?"

He is correct here, yet nobody originally acknowledged that. Whether it actually matters in practice is another question, but I noticed that the initial responses seemed to deny that reverse biasing even occurs in this particular situation. I mainly wanted to set the record straight on that. :slight_smile:

  1. For some LEDs, reverse biasing may be a problem according to the data sheet. I have included a link below to a data sheet which warns that "Reverse biasing the dot matrix is not recommended, will cause damage to the leds." (the reverse voltage here is 3v). So I believe the best answer as to whether or not it is an issue is "it depends on what the data sheet indicates" and since the OP didn't specify the leds, we can't be certain if there is a problem or not.

  2. My diagram was "lifted" from elsewhere, I did not mean to specify any actual pin numbers, but your warning is well advised. I should made a few more edits before posting so as not to mislead.

  3. Having said all of the above, I have used Charlieplexing before, and it does require reverse biasing if you max out the capability (ie. use all n*(n-1) possible leds). But, when I do, I make sure to be under spec.

I hope that clarifies things a bit.

AxiomGreg:
The OP wrote "Well my question is the following: when I set the output pins to HIGH to turn off the led, wouldn't that cause a reverse voltage on the led?"

He is correct here, yet nobody originally acknowledged that. Whether it actually matters in practice is another question, but I noticed that the initial responses seemed to deny that reverse biasing even occurs in this particular situation.

Well, as was discussed in the earlier posts, to avoid reverse biasing, you would want to use a driver that only pulls cathodes low and anodes high, such as the MAX7221.

AxiomGreg:
For some LEDs, reverse biasing may be a problem according to the data sheet. I have included a link below to a data sheet which warns that "Reverse biasing the dot matrix is not recommended, will cause damage to the leds." (the reverse voltage here is 3v). So I believe the best answer as to whether or not it is an issue is "it depends on what the data sheet indicates" and since the OP didn't specify the leds, we can't be certain if there is a problem or not.

I do wonder if these LEDs from 2009 are somewhat obsolete! That limitation is unusual.

AxiomGreg:
My diagram was "lifted" from elsewhere, I did not mean to specify any actual pin numbers, but your warning is well advised. I should made a few more edits before posting so as not to mislead.

The thing is, an Arduino can drive individual segments and can be programmed to pull in one direction only, defaulting to INPUT when not driving, but not drive the common return anyway.

AxiomGreg:
Having said all of the above, I have used Charlieplexing before, and it does require reverse biasing if you max out the capability (ie. use all n*(n-1) possible LEDs). But, when I do, I make sure to be under spec.

Charlieplexing is always dependent not only on reverse biasing, but on three times the diode voltage drop exceeding the driving voltage. :astonished:

Well, as was discussed in the earlier posts, to avoid reverse biasing, you would want to use a driver that only pulls cathodes low and anodes high, such as the MAX7221.

That's right. I was referring to the original responses posted almost 8 years ago (not your recent response). And yes, I resurrected this thread very late. :slight_smile:

The thing is, an Arduino can drive individual segments and can be programmed to pull in one direction only, defaulting to INPUT when not driving, but not drive the common return anyway.

Certainly, one could do that too, noting that it must be done when Charlieplexing. The funny thing is that there seems to be so many examples out there where this could be done, but isn't. Instead people just seem to want to set the output to high and low, not even considering that high Z is an option when set to input. But again, perhaps it's a non issue, since reverse biasing works fine in many/most cases.

Charlieplexing is always dependent not only on reverse biasing, but on three times the diode voltage drop exceeding the driving voltage.

Now you've got me wondering about that... isn't it more complex than 3Vf? In the case I believe you're referring to, you've got a single led in parallel with two series leds and you don't want your driving voltage to be so high as to light the series pair. Wouldn't the lower resistance single path tend to starve the two led series path (which is why running leds in parallel is generally not a good thing to do), and wouldn't it also depend on the particular current limiting resistor values used? So yes, there is a limit to the driving voltage, but is it exactly 3Vf?

Paul__B:
Charlieplexing is always dependent not only on reverse biasing, but on three times the diode voltage drop exceeding the driving voltage. :astonished:

Why is that, the voltage across a charlieplexing matrix is never more than one led forward voltage drop, any extra voltage is handled by the resistors and newer reach the matrix.

Actually, I was a bit busy writing that between cases and did not have a chance to elaborate. :astonished:

It is for a Charlieplexed switch matrix that there is the requirement that three times the diode voltage drop exceeds the driving voltage. For this reason, you need to use green(, blue or white) LEDs as the diodes in such a matrix.

For a Charlieplexed LED matrix, you could get phantoms if using red LEDs and a LED that is supposed to be illuminated, is faulty or missing so that it does not limit the voltage. :grinning:

Paul__B:
It is for a Charlieplexed switch matrix that there is the requirement that three times the diode voltage drop exceeds the driving voltage. For this reason, you need to use green(, blue or white) LEDs as the diodes in such a matrix.

I do not see how that would be a problem, except if you press multiple keys.

except if you press multiple keys.

Not many LED matrices have multiple keys to press.

Grumpy_Mike:
Not many LED matrices have multiple keys to press.

It would be a good idea to read a post before commenting on it.

HKJ-lygte:
I do not see how that would be a problem, except if you press multiple keys.

Correct.