# Using NPN Darlington to switch on PNP

I'm trying to separately switch on the digits of a 2 digit common anode 7 segment display (specifically the Lumex LDD-E2802RD because it's small and cheap). I think that the easiest way of getting my microcontroller (an MSP430G2335) to do this is by connecting A-G,DP through resistors $R(4+i), 0\le i\le 7$. A shift register will switch on transistors $Q(3+i)$ (incorrectly labeled $Q(4+i)$) to turn on individual segments (assuming they're being powered "from above") (figures below).

In order to turn on the individual digits, it seems like a PNP is the way to go. The problem is that I want to supply my LEDs with 6.3V, which is my circuit's $V_{CC}$, because my 3.3V line can't supply a lot of current.

Let's start with what (I think) I know: each segment of the display draws 25mA steady state, with a peak of 150mA for 10us, and has a forward voltage drop of about 2.2V. This means my LED resistors should be $$R_\text{LED} = \frac{V_\text{LED}}{I_\text{LED}} = \frac{V_{CC}-V_f}{I_\text{LED}} = \frac{6.3\text{V}-2.2\text{V}}{25\text{mA}} = 164\Omega \approx 180\Omega$$ and the transistors on the shift register output should be able to handle at least 25mA (ideally more just to be safe -- I'll probably end up using an 8 element Darlington array).

Now for the part where I'd like to make sure I'm not making a mistake. I used http://www.rason.org/Projects/transwit/transwit.htm as a guide for how to use the PNP, as I've really only used NPN and N-channel devices in past designs. The PNP, $Q2$, will need handle at least $8\cdot25\text{mA}=200\text{mA}$ of current flowing through it (plus a little extra just to be safe), so a BC807 seems like an appropriate choice. To calculate $R2$, $$I_B = \frac{I_C}{h_{FE}} = \frac{200\text{mA}}{60} = 3.3\text{mA}$$ so $$R_2=\frac{V_{CC}-V_{BE}}{I_B} = \frac{6.3\text{V}-1.2\text{V}}{3.3\text{mA}} = 1242 \approx 1.2\text{k}$$ The aforementioned PNP guide suggested that $R3 \approx 10\cdot R2$, so $R3=12\text{k}$.

Because my microcontroller's logic high is 3.3V and it can sink/source a maximum of 6mA on each GPIO pin, it seems like a good idea to use an NPN (Darlington) transistor to turn on and off $Q2$. (Maybe 3.3V would be enough to turn off $Q2$ and 3.3mA isn't all that much current, but transistors are incredibly cheap in terms of actual cost and PCB real estate.) It appears that $I_{C_{Q1}} = I_{B_{Q2}}$, so to calculate $I_{B_{Q1}}$ (hereafter $I_B$), I perform similar calculations, this time using values from the BCV27 datasheet. $$I_B = \frac{I_C}{h_{FE}} \approx \frac{4\text{mA}}{4000} = 1\mu\text{A}$$ and $$R_1 = \frac{V_{CC}-V_{BE}}{I_B} = \frac{6.3\text{V}-1.5\text{V}}{1\mu\text{A}} = 3.8M \approx 3.9M$$ although I'm guessing that since $I_B$ is so low, $R_1$ isn't really necessary, although if I wanted to include it, something easier to find like a 1M resistor would do.

So that's about it, right? It just seems a little weird to me that I need to switch on the PNP with the NPN, and I wanted to make sure I'm doing this the right way.

Lumex LDD-E2802RD

Imagined circuit setup

## 2 Answers

Pretty close.

You should give the PNP a lot more base current to make sure it saturates. Use a forced beta of 10-20, which means that the resistor R2 should be more like 470R.

The value of R3 is not critical, 10K would be fine, so would 20K.

You don't need a Darlington to drive the PNP transistor, a regular NPN will be fine. Use a base resistor of more like 10K. The base resistor limits the current- it is determined by the desired base current, not by the gain of the transistor- you do always need it.

Keep in mind these Darlington things won't switch instantly and if you don't allow some dead time in the drive firmware you'll get 'ghosting'.

That seems like a lot of complexity. If you want to do it as an exercise, or a homework, that is fine. I'd do something simpler.

Firstly, P-Channel MOSFETs would be an easy way to drive the common Anodes.

The P-MOSFETs will need their gates to pull-up to the chosen LED supply voltage 6.3V to turn off.

AFAICT the MSP430G2335 MCU doesn't have 6.3V (or higher) tolerant pins. So the MCU pins will need to be isolated from the 6.3V.

Use a couple of NPN transistors to interface the MCU pins with the P-MOSFETs. The P-MOSFET gates will be pulled up with a 1k or bigger resistor (use same value as base resistors), and pulled down by the NPN transistor. To limit base current from the MCU pin, put a 2k or larger resistor between the MCU pin the NPN transistor base.

Use a 'proper' constant current LED display driver for each LED cathode, instead of transistors and current limiting resistors.

For example TI TLC5916 which has a shift register for data load, and 8 constant current drivers. Brightness is set using a single resistor for all 8 LEDs. It will be less wiring, and fewer components even than using a darlington transistor array and resistors.

There are lots of other devices, and other manufacturers make suitable parts too, for example Maxim.

That's it:

• 2 x P-Channel MOSFETs,
• 2 x NPN transistors (almost anything) to pull down the P-MOSFET gates,
• 4 x 2k+ resistors,
• 1 x 8-channel constant current LED display (TI or Maxim),
• 1 resistor to program LED brightness pin of 8-channel LED display driver