Multiplexing with NPN and PNP transistors

Ok, so I am using the schematic attached to this message to multiplex leds. And I am running into problems. Basically, if one of the signals connected to the npn transistors is high, then the the LEDs in that column are high regardless of the signals coming into the pnp transistors. Obviously something is wrong. But I don't know what. Please help

The very first problem is the lack of an attached schematic. :astonished:


If it is from another site, please do not attach it, but insert it into the post as an image link.

Paul__B:
The very first problem is the lack of an attached schematic. :astonished:


If it is from another site, please do not attach it, but insert it into the post as an image link.

So sorry about that. I added it now :slight_smile:

What voltage is VCC.
What voltage are the (PNP) signals.
Leo..

Wawa:
What voltage is VCC.
What voltage are the (PNP) signals.
Leo..

Vcc is 5v and the PNP signals are coming from the I/O pins on an arduino DUE so about 3.3 volts.

That is your problem. There is not enough voltage from the Due to turn the PNP transistor's off.

3.3volt on the base of the PNP transistors and 5volt on the emitters via a 100ohm resistor won't ever turn them off.
You need NPN level shifter between the Arduino and PNP transistors.
PNP: emitter to 5volt, collector via a 100ohm resistor to the LEDs, 10k from base to 5volt, 1k from base to collector of an NPN transistor.
Emitter of the NPN transistor to ground, base via a 10k resistor to the Arduino pin.
Post that drawing for approval.
Leo..

Probably time to give up on the head-banging playing around and get a proper MAX7219 to do the job. :grinning:

Wawa:
3.3volt on the base of the PNP transistors and 5volt on the emitters via a 100ohm resistor won't ever turn them off.
You need NPN level shifter between the Arduino and PNP transistors.
PNP: emitter to 5volt, collector via a 100ohm resistor to the LEDs, 10k from base to 5volt, 1k from base to collector of an NPN transistor.
Emitter of the NPN transistor to ground, base via a 1k resistor to the Arduino pin.
Post that drawing for approval.
Leo..

Thanks a lot for the help! but is it possible that you can post a schematic of that? cuz I am pretty confused on that.

Wawa:
3.3volt on the base of the PNP transistors and 5volt on the emitters via a 100ohm resistor won't ever turn them off.
You need NPN level shifter between the Arduino and PNP transistors.
PNP: emitter to 5volt, collector via a 100ohm resistor to the LEDs, 10k from base to 5volt, 1k from base to collector of an NPN transistor.
Emitter of the NPN transistor to ground, base via a 1k resistor to the Arduino pin.
Post that drawing for approval.
Leo..

Also, I'm assuming this won't work either? Like, wouldn't I much rather do this then add all that level shifting?

I try to avoid Fritzing.

Your original diagram should work on a 5volt Arduino, if you move the 100ohm resistors from "between 5volt and emitter" to "between collector and LEDs".

Here is a level shifter diagram. Only one section is shown.
The NPN level shifter inverts the logic, so your code should also do that.
Leo..

So now you have nine transistors and a lot of resistors (15 so far).

As I said, beyond this "just for the sake of it" playing about, even for a 3 by 3 it makes sense to do it properly and use the MAX7219(, one resistor and two capacitors). :grinning:

Paul__B:
So now you have nine transistors and a lot of resistors (15 so far).

As I said, beyond this "just for the sake of it" playing about, even for a 3 by 3 it makes sense to do it properly and use the MAX7219(, one resistor and two capacitors). :grinning:

Yeah but I would much rather

Wawa:
move the 100ohm resistors from "between 5volt and emitter" to "between collector and LEDs".

Grumpy_Mike:
That is your problem. There is not enough voltage from the Due to turn the PNP transistor's off.

Question. So If I swap out using the arduino DUE with an arduino mega, I should be good to go right?

Yes the 5V output would allow you to turn the transistor off.