How do I extend the number of analog (input) pins available to me?

If you're already familiar with digital multiplexer chips, good news! They can be used for analog signals as well.

http://playground.arduino.cc/Learning/4051

The basic premise is exactly like with digital signal multiplexing. You use the 4051 chip as a "lane changer" and read the signal of whatever lane you tell the chip to switch to. the 4051 uses 3 digital pins and 1 additional analog (or digital) pin on the arduino to create up to 8 lanes of input. Some multiplexers are chainable, so you can fairly easily add 8 more signals without needing to keep taking them away from the arduino itself.

It is exactly like the technique you already know for digital signals, just hook up the channel you read from to an analog pin instead of a digital one, then cycle through the binary states and read the analog values.

I made an animated gif for you.

enter image description here


It may be important to remember that the Arduino's ATmega chip itself is using an analog MUX. The Uno-based (ATmega328) chips only have a single ADC. The 6 analog inputs are actually a MUX that connects to that one ADC.

This is why you can only read 1 analog input at a time.

When expanding analog inputs, it may be necessary to consider how much time it takes to do all of this MUXing and whether or not additional external ADCs are necessary in your application.