0
\$\begingroup\$

I have been working on designing a board that contains a seven-segment LED display with red and green LEDs driven by PNP and NPN transistors. The red and green LEDs have different voltages but are tied together at the anode. I found that the following configuration works well on both my breadboard and in simulation. The cathodes of the green LEDs are connected to the collector of an NPN transistor and the cathodes of the red LEDs are connected to the emitter of a higher-gain PNP transistor. It is based on this simulation that I made and tested on a bread-board.

The pins are driven by a 5v microcontroller (circled in green). The NPN transistors connected to the GREEN_ENABLE pin on the microcontroller are dotted with green. The base resistors have a value of 1k Ohm. I'm using BC807W-25W-QX and BC817W transistors. When I drive the transistors with the microcontroller I get:

G is the GREEN_ENABLE and R is the RED_ENABLE pin on the microcontroller.

G R Result
H H Red
H L Red
L H Off
L L Green

What I expect is:

G R Result
H H Green
H L Yellow
L H Off
L L Red

My question is specifically, why is there current going through the NPN transistor connected to GREEN_ENABLE when GREEN_ENABLE is low (it also allows current through when I manually connect the base directly to ground)? Also, why does the rest of the table not match up with the results that I expect?

enter image description here

Edit: Adding images of the schematic. enter image description here

enter image description here

\$\endgroup\$
7
  • 4
    \$\begingroup\$ Please post a portion of the schematic of the circuitry in question. \$\endgroup\$
    – qrk
    May 24 at 0:01
  • 2
    \$\begingroup\$ Double check your transistor pinouts. \$\endgroup\$
    – td127
    May 24 at 0:38
  • 2
    \$\begingroup\$ I think red and green are exchanged. The yellow color is missing because red LEDs have lower forward voltages, typically 1.8 V, they receive most of the current if green LEDs are parallel. Move the 50 ohm resistors in the anode path to the cathode path, this will better split the currents. \$\endgroup\$
    – Jens
    May 24 at 0:53
  • \$\begingroup\$ I spent a lot of time trying to fix the uneven forward voltages and found that mixing the PNP and NPN transitors worked best on my breadboard. If I put resistors on the cathodes the brightness changes dramatically depending on how many segments I have lit up. \$\endgroup\$
    – Nathan
    May 24 at 5:21
  • 1
    \$\begingroup\$ When driving red&green in parallel doesn't succeed, consider it 6 digits to multiplex instead of 3. \$\endgroup\$
    – greybeard
    May 24 at 6:31

1 Answer 1

2
\$\begingroup\$

It looks to me like you've mixed up the pinout on the display (or the display is made differently than you think), so red and green are swapped.

If you need to display yellow, I suggest turning the red and green LEDs on at different times. In other words, scan the display with a 1/6 duty cycle rather than 1/3. You may have to alter the segment resistors to maintain similar brightness. You can also change the timing to equalize the apparent brightness between red and green. For example, if red is brighter you can scan the green for 1ms each and the red for 0.5ms each, total 4.5ms or 222Hz.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Yep, it looks like I had the green and red cathodes on the display flipped. I'm not sure why that wasn't the first thing I checked but thanks for the reminder. \$\endgroup\$
    – Nathan
    May 24 at 18:21
  • \$\begingroup\$ The really great thing is that this part of your PCB should work with a couple minor firmware changes. \$\endgroup\$ May 24 at 19:06

Your Answer

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

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