Electronic – Questions About BJTs in My Circuit

bjtledmultiplexertransistors

I have an LED multiplexer circuit (inspired by https://www.instructables.com/id/Multiplexing-with-Arduino-Transistors-I-made/) in which I have set the resistor values to maximize the current through the LEDs (without exceeding the maximum forward current through the LEDs or the maximum power dissipation in any of the components). It looks like this:

current circuit

current circuit with I labels

The R1, R2, R3, C1, C2, and C3 pins are Arduino digital pins while the 5V pin is the 5V from the Arduino. I have this circuit assembled on my breadboard and it works as expected. (Though please let me know if there is anything atrociously bad about it).

What I want to do is add a potentiometer between the 5V pin and the collectors of the Q-RX NPN BJTs so that I can vary the LED light level from off (or almost off) to "full brightness". It seems to me that this should work in theory. When I replace the 5V pin with GND in my simulation, I get ~0 current through the LEDs, which is what I want:

However, when I test with a single LED enabled and I unplug the 5V pin from the Arduino, the LED dims some but is still fairly bright. I measure ".001 A" with my multimeter (I get 0 with it set it to mA). This must be from current flowing from base to emitter of the Q-RX BJTs. I have been trying to re-familiarize myself with how transistors operate, but I need some help here to understand this. A few questions:

  1. Am I trying to use the NPN BJTs completely incorrectly?
  2. Why does my simulation (I'm using OrCAD Capture Lite) show ~0 current through the LEDs when I can measure it at ~1 mA and there is obviously enough to light the LEDs?
  3. How can I adjust this circuit to achieve my goal? Should logic level MOSFETs be used instead?

Reference:

Side note: I just noticed that my simulation shows ~54 mA at the C1, C2, and C3 pins which exceeds the 40 mA Arduino pin limit, but that is besides the point.

Any help is greatly appreciated! Thanks!

Best Answer

First off your matrix has no current limit on the LEDs you need to add resistors, where you add them depends on how you intend to use the matrix. That instructible has these resistors in the "anode" circuit vetween the collector and the LED anodes. that's suitable for when you turn the rows on one at a time and then light some LEDs on each row.

Am I trying to use the NPN BJTs completely incorrectly?

Not completely incorrectly, but you need to remember that a BJT also looks like a pair of diodes when it's not amplifying signals.

so with "V+" disconnected the BJT will pass the current that arrives through "R-Rx" on to the LED with the BJT grounded via a resistor the B-C diode of the BJT will divert some of the R-Rx curren to ground causing the LED to dim.

Why does my simulation (I'm using OrCAD Capture Lite) show ~0 current through the LEDs when I can measure it at ~1 mA and there is obviously enough to light the LEDs?

Q-Cx can generate negative voltage on the collector due to internally generated photocurrent thus making enough voltage to light the LEDs. I don't think any simulators will simulate this very minor transistor effect.

How can I adjust this circuit to achieve my goal? Should logic level MOSFETs be used instead?

Use PWM to dim the LEDs. I see a matrix:so I'm guessing you've figured out how to scan a matrix. when you want the LEDs dimmer just do each row (or column) faster and then wait for a while before doing the rescan.

you probably don't need trasnsitors on both the rows and columns which ever. is active in parallel doesn't need transistors (but does need resistors), the microcontroller can make enough current to light the LEDs, but where the currents group together you need the transistors.

R-Cx seem to be very low resistance, those resistors would be better used between the collector and the column. put 1K resistor in their place (on the base of the Q-Cx)