3
\$\begingroup\$

I've got a common cathode, two digit seven segment display (LDD-N512RI-RA) hooked up to the GPIO pins of a microcontroller (Coldfire MCF52233 DEMO). The problem is that the brightness of the display varies with the number of segments lit. As more segments are activated, the display becomes dimmer. From what I've read, this happens if you try to use a single resistor for the common cathode instead of using one for each anode. However, I am using one for each anode.

I have very little experience with electronics and know very little about electricity, unfortunately. So until I learn more (which I want to do), I can only guess what the problem might be. In the meantime, can anyone suggest what is going wrong here?

More information: The GPIO pins provide 3.3V. The forward voltage/current of the segments is 2.2V/10mA. I'm using 100 Ohm 1/2W resistors for each of the segments. I've got the common cathodes hooked up to GPIO pins as well, and I set the pins to the cathodes to low to activate the displays (I'm not sure if that is the correct way to go about it.). I am alternating between displaying the left/right digit using a high frequency timer interrupt, which I realize may not be the best way to do it. I am already using the timer interrupt, though, so I hoped that I could tack on some simple digit alternating logic without a problem. The board is powered via a USB line to my computer. I'm happy to provide any other relevant information, just let me know exactly what is relevant.

\$\endgroup\$
  • \$\begingroup\$ Do you have one resistor on the cathode side because it seems intuitive? Because as your segments light up you end up pulling more current, therefore more voltage drop and less light. \$\endgroup\$ – Grady Player Mar 2 '13 at 16:17
  • 1
    \$\begingroup\$ Show a real schematic. This hand waving leaves too many details unclear. \$\endgroup\$ – Olin Lathrop Mar 2 '13 at 16:25
6
\$\begingroup\$

My first assumption from the symptom is that you have a single cathode resistor, which would explain everything. However, you say this is not the case and that you have individual 100 Ω resistors on each anode line.

The answer then must be that whatever is driving the cathode can't handle the combined current. Apparently you are driving the cathode with just a microcontroller output, which has insufficient current sink capability. Do the math. You want 10 mA thru each of 7 segments. That means whatever is holding the cathodes low has to be able to handle 70 mA. A microcontroller pin is very very unlikely to do that. See the datasheet.

The solution is to add a transistor that can sink the current from each of the cathode connections:

70 mA is easy for any discrete transistor you will be able to get. Let's say the transistor has a minimum guaranteed gain of 50. That means the base current needs to be 70mA / 50 = 1.4 mA. Figure the B-E junction drops 700 mV. With 3.3 V drive from the micro, that leaves 3.3 V - 700 mV = 2.6 V accross the base resistor. 2.6 V / 1.4 mA = 1.9 kΩ, which is the absolute maximum allowed base resistor. Given that, I'd use 1 kΩ between the digital output and the base.

Note that this will invert the common cathode logic from what you had. The microcontroller output now has to go high to enable a digit.

\$\endgroup\$
  • 1
    \$\begingroup\$ One could also use a PNP transistor for each segment as an emitter follower. This would eliminate the need for the resistor, and would keep the logic polarity the same as without the resistor. The biggest consequence would be that the resistors would have 0.7 fewer volts across them. \$\endgroup\$ – supercat Mar 2 '13 at 20:38
  • \$\begingroup\$ @super: Right, the 700 mV is a issue considering we only have 3.3 V to start with and the LEDs need 2.2 V. That's why is recommended a saturated NPN, which should only drop 200 mV or so. \$\endgroup\$ – Olin Lathrop Mar 2 '13 at 22:31
  • \$\begingroup\$ +1 - Excellent suggestion to add NPN cathode buffers. A small N-FET such as 2N7002 may be a suitable candidate too. \$\endgroup\$ – Michael Karas Mar 3 '13 at 2:10
  • 1
    \$\begingroup\$ @OlinLathrop: 3.3 volts minus 2.2 minus 0.7 would seem to leave 0.4 volts for the resistor. Not a huge amount, but if one sizes the resistors suitably it should be adequate. \$\endgroup\$ – supercat Mar 3 '13 at 2:39
  • 1
    \$\begingroup\$ @Supe: You still have to consider the anode switches. Like you said, it is doable, but in this case, especially considering the OP's expertise level, I think a saturated switch is better. It could be the right kind of FET too, but those need to be carefully chosen parts and much less likely to be in someone's junk box. For my circuit, just about any small NPN transistor you will find will work. I still think this is the right tradeoff in this case considering the wider issues, not just purely electronic. \$\endgroup\$ – Olin Lathrop Mar 3 '13 at 14:07

protected by W5VO Mar 3 '13 at 0:56

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.