Now and again there’s a need to expand the I/O capabilities of your chosen micorocontroller, and instead of upgrading you can often use external parts to help solve the problem. One example of this is the 74HC4067 16-channel analog multiplexer demultiplexer. That’s a mouthful – however in simple form it’s an IC that can direct a flow of current in either direction from one pin to any one of sixteen pins. Another way to think abou it is that you can consider the 74HC4067 to be a digital replacement to those rotary switches that allow you to select one of sixteen positions.
74HC4067 16-Channel Analog Multiplexer Demultiplexer - [Link]
On my desktop PC I have a speakers and a headphones. Usually I use headphones, but when I need to switch to speakers I need to physically plug in speakers instead of headphones to my PC’s soundcard. I wanted to solve this problem for a long time, but never get around of that until recently I saw this posted on Hackaday.
And so I’ve decided to build my own really simple audio multiplexer.
USB Audio Multiplexer - [Link]
This was actually the first time I ever needed to multiplex analog channels so it was a good opportunity to learn how to use them. My task was to measure the temperature of 32 thermistors (NTC) with a microcontroller and later process that data. Obviously you cant find that much analog input channels on your common microcontroller so you need to multiplex the signals. First I looked for large analog multiplexers with 16 input channels but those are way too expensive. As it turns out its cheaper to use more smaller 8ch multiplexers(example Digikey pricing: 2pcs 16:1 mux from TI is $7.84 while 3pcs of 8:1 mux from TI is $1.53). I was able to get the 74HC4051 at a good price so I started creating the design around it.
74HC4051 Analog Multiplexer - [Link]
OK, so say you have this crazy cool idea where you need to control a ton of LEDs (I know, I know… LEDs). You looked at the multiplexer article, and that was great, but this idea is so cool, you need individual control of each LED, and turning them on one at a time just won’t do. Well again, we are here to help, and now it’s time to introduce you to the Shift Register. Not just any shift register, the super cheap, incredibly awesome 74HC595 8-bit Shift Register!
The 74HC595 8 bit shift register – [Link]