See 74HC4051 multiplexer / demultiplexer. That describes how you can use a multiplexer chip to multiplex analog inputs.
The 74HC4051 multiplexes 8 inputs into one, and the 74HC4067 multiplexes 16 inputs into one. Thus you would only use one analog input, plus 3 or 4 pins to tell the chip which input you want at a particular moment.
The general way a multiplexer works is like this:
By outputting a binary pattern to the A/B/C pins you select which input you want active at a particular moment. That is then copied to the output pin (pin 3 in this case). You would connect that to your analog port on the Arduino.
The code would rotate between each of the 8 pins (or 16 pins with the bigger chip), and then do an analogRead.
Example wiring
Example code
// Example of using the 74HC4051 multiplexer/demultiplexer
// Author: Nick Gammon
// Date: 14 March 2013
const byte sensor = A0; // where the multiplexer in/out port is connected
const byte addressA = 5; // the multiplexer address select lines (A/B/C)
const byte addressB = 6;
const byte addressC = 7;
void setup ()
{
Serial.begin (115200);
Serial.println ("Starting multiplexer test ...");
pinMode (addressA, OUTPUT);
pinMode (addressB, OUTPUT);
pinMode (addressC, OUTPUT);
} // end of setup
int readSensor (const byte which)
{
// select correct MUX channel
digitalWrite (addressA, (which & 1) ? HIGH : LOW);
digitalWrite (addressB, (which & 2) ? HIGH : LOW);
digitalWrite (addressC, (which & 4) ? HIGH : LOW);
// now read the sensor
return analogRead (sensor);
} // end of readSensor
void loop ()
{
// show all 8 sensor readings
for (byte i = 0; i < 7; i++)
{
Serial.print ("Sensor ");
Serial.print (i);
Serial.print (" reads: ");
Serial.println (readSensor (i));
}
delay (1000);
} // end of loop
That only does 8 ports, but the 16-port chip would be conceptually similar.