The purpose of this instructable is to give a step by step instruction on implementing multiplexing using transistors. The first few steps will introduce Multiplexing, Transistors and when to use them.
I was working on a binary clock project at techshop and I decided to make a instructable on Multiplexing with Transistors. I plan later to also make an instructable on Multiplexing using shift registers when finished I will Link it .
To copy my example in the later steps you will need the following.
9 - LEDs
6 - NPN transistors
6 - 1k ohm resistors
3 - current limiting resistors (220 ohm)
I will always recommend tayda electronics for these parts, they have great pricing and products for hobbyists. Sometimes if you check their facebook page they give 15% coupons on entire orders! http://www.taydaelectronics.com/
Step 1: Transistors Background
Transistors play multiple roles but they are basically a electronic switch. That is exactly how we are going to use them for multiplexing.
I'm not really going to go into how they work or anything but just think of it as an electric switch. I will be using NPN Transistors, which are generally most commonly used. There is a Emitter, Base and Collector, make sure you know which pin is which when putting a circuit together. Current flows from the Collector to the Emitter and the Base enables / disables this current flow. This is essentially what allows it to be a switch.
This also is useful if you want to have two different power sources or you need a lot of current. Since the Base is separate from the Collector and Emitter they can be powered separately. How is this useful? Well all microcontrollers have a Digital Pin (GPIO) maximum output current which usually doesn't go much higher than 200mA. If you have multiple LEDs on at once then you may exceed the 200mA which is not good for the microcontroller. So using a transistor, the microcontroller doesn't need to supply the current to the actual component such as an LED. Not really related to multiplexing but you can also use transistors to have a microcontroller control a different power source, also how a relay is used.
The second image above is the basic schematic for the anode and cathode schematic using transistors. (Note: the capacitor on the Anode circuit isn't required). The circuit isn't actually a anode or cathode, however I refer to them like that because the output of the anode circuit connects to the anode of the LED. While the cathode circuit connects to the cathode of the LED. The anode of an LED is where current comes into the component and the cathode is where current leaves the component. So of course the anode transistor circuit supplies the VCC and the cathode transistor circuit supplies the Ground.
Transistors I'm using: http://www.taydaelectronics.com/2n3904-npn-general-propose-transistor.html