# Need help understanding PNP Base into NPN Collecter circuit for LED Array

I am a novice in circuitry and I'm trying to make an 8x8x8 LED Cube using an instructables guide for a school project. I have ordered all the parts and was testing the grounding circuit for each layer (pictured below). I am trying to understand how the PNP and NPN transistors interact. The PNP is a TIP42C and the NPN is a 2N2222.

The PNP's (O1-O7) Emitter is connected to 5V, the Collector is connected to the cathode end of 64 LEDs, and the Base is connected to 5V through a 10Ω resistor and to the collector of the 2N2222 through a 1kΩ resistor.

The NPN's (T1-T8) base is connected to a MUX through a 1kΩ resistor, the emitter goes to ground, and the collector is from the PNP. I understand how this portion works.

R1-R8 and R17-R24 are 1kΩ. R25-R32 are 10kΩ.

What I don't understand is why the PNP transistor is necessary. I tried to build one line of the diagram:

Green Wire: High/Low to NPN Base Black Wire: Ground from NPN Emitter Orange Wire: Cathode from 64 LED Array (simulated with 3 LEDs) Red Wire: 5V to PNP Emitter White Wire: 5V to LEDs

But the issue I ran into was with the 5V into the Emitter of the PNP (Red wire). If I took that out, the LED's lit up, but the diagram clearly has the emitter of the PNP wired to 5V.

Is there some fundamental property of PNP transistors that I am missing? I calculated the total current of the 64 LEDs (~1.2A). (Is this right?) and would this circuit support that?

FYI, each line from JP2 in the first picture is a ground line from a 64 LED array and the lines from the IC1 are driven by an arduino uno.

I've been racking my brain over this for the last week and can't figure it out so any help would be greatly appreciated! Thank you!

• Hi Duncan, this question has a lot of promise - we can see you put a lot into it. But it's difficult to understand/explain without a schematic. Could you add a schematic of what you built on the breadboard? When editing your question, there is a button which will open a schematic tool... Nov 28, 2018 at 23:31
• Please add a schematic so that people can more easily help you. There's a schematic editing tool in the on-site editor; it's the button with a circuit diagram and a pencil. Nov 28, 2018 at 23:32
• You understand that a PNP acts "backwards" from an NPN? I.e., every voltage that's positive on an NPN is negative on a PNP, and the same thing with currents? Nov 28, 2018 at 23:57

## 1 Answer

Oh, it's simple, you think the circuit provided is the ground control for the leds. It is not. It is the high side control for the leds. Your breadboard is not accurate reflection of the circuit. The PNP is turning on, and you are essentially shorting out the leds with 5V on both sides.

simulate this circuit – Schematic created using CircuitLab

So, when the red wire, 5V is connected to the emitter, and the PNP is ON, the 5V is connected to the collector and you short out the leds. When you remove it, I'm taking an educated guess, you create a ground path from the collector through the base of the TIP 42C, which in turn goes through the NPN that is turned on. This could have damaged the TIP 42C you are testing with, btw. Floating emitter isn't ideal.

In the cube, they are using the 2n2222 (or 2n3904 on the board layout) as npn drivers of the PNP TIP 42C. This controls the led anode. The low side is controlled by the ULN2803 darlington transistor array ICs on the shift register board. This is done to allow a scanning function to control that many leds from a small number of pins of the micro controller.

FYI, each line from JP2 in the first picture is a ground line from a 64 LED array and the lines from the IC1 are driven by an arduino uno.

No, JP2 is the Anodes of the LED array.

• Wow ok, I was way off haha. This makes much more sense now! Thank you so much! Nov 29, 2018 at 5:04