I was looking at the schematic for one of the projects(Color Mixing Lamp) in the Arduino tutorial book and I noticed they connected a photoresistor in series with a resistor and then used analog inputs to read the voltage in the node between the two components. I am slightly confused as to why they did this. Why was the photoresistor connected in series with the 10kOhm resistor??
The analog inputs of the Arduino board can measure a voltage, but the photoresistor does not output a voltage, it changes its resistance when the amount of light changes.
How can a Arduino measure a change in resistance ? The only way is to let a small current flow through the photoresistor and measure the voltage over the photoresistor. The 10k resistor is used to create that small current.
It does not matter if the 10k is connected to 5V (and the photoresistor to GND) or to GND (and the photoresistor to 5V). It also does not matter if the voltage over the 10k resistor is measured with the Arduino, or the voltage over the photoresistor. All of that can be solved in the sketch.
The analogRead() measures the voltage at the input pin. The input pin itself does not use a current, it only measures the voltage. Inside the microcontroller (the main chip on the Arduino board) is a "ADC" (Analog to Digital Converter), that converts the voltage to a number of 0...1023.
Another point is that there is a maximum current the photoresistor can tolerate - a series resistor
will also guarantee a limit to the current flowing in bright-light conditions.
Another way to read the photoresistor is to drive it with a constant-current circuit, then the voltage
across the photo-resistor will be a linear function of its resistance, which might be useful sometimes.