Can I use digital pins like this?

EDIT: I have realized my true stupidity and will try to rework this own my own, thank you for the help though.

Hello,

I have a question regarding the Arduino Uno. I've read a bit about multiplexing and watched some videos but I didn't really understand how they did it with transistors. I would like to multiplex 8 transistors to use 6 pins (I know not much of a difference, but I need to). I would like to connect each row of 4 together to a pin and then each column of two together to a pin (The picture below helps describe this better). I'm wondering if I can set the 4 column pins (pins 3-6 on my drawing) to either LOW/HIGH to control whether current will flow through the transistor or not.
For example, if I want to turn only the third transistor from the left on the top row ON, I would set pin 1 as HIGH and pin 5 as HIGH. All other pins would be set to LOW. This would mean pins 3, 4, and 6 would be acting as ground pins.

My question: Can I use digital input/output pins to do this? (I'm unsure because the current will be flowing in opposite directions in different situations, and i'll be using pins as output sometimes and ground other times). If so, will this setup work the way I intend it to?

Here's my proposed multiplexing of transistors:

Here's the circuit each transistor is controlling (so there would be 7 more of these for each of the transistors):

Thank you for the help and I apologize if I wasn't very clear or this was a silly question :slight_smile:

No... :frowning:

For example, if I want to turn only the third transistor from the left on the top row ON, I would set pin 1 as HIGH and pin 5 as HIGH. All other pins would be set to LOW. This would mean pins 3, 4, and 6 would be acting as ground pins.

All of your base-resistors as well as pins 3,4,5,6 are connected together! If you meant to show only a pair of transistors sharing pin 5, that would still turn-on both transistors at the same time.

A matrix works by current flowing into the columns and out of the rows (or vice-versa). For example, your base-resistor could be the column and the transistor emitter could be the row. Current will flow in the base-emitter junction (turning-on the transistor) only when a particular transistor's column (base) is high and the row (emitter) is low.

In other words, both the row and column have to be "turned-on" in order to turn-on a particular transistor.

Oh geez I get what you're saying. Yea there's no way this will work lol I feel so stupid :blush:

The reason I didnt want to connect the emitter's together is because the emitter will be having about 70mA flow through it and that's too much for the arduino pins. But, if I were to split this with the ground of the battery that would split the current in half correct?

EDIT: I dont think that will work either. My brain has turned to moosh today I don't know what's going on. I'm going to try to learn more about multiplexing on my own then come back to this. Thank you for pointing out my obvious mistake.

See
http://www.thebox.myzen.co.uk/Workshop/LED_Matrix.html