I am trying to do this project where I read a temperature from LM35 on analog pin 0 and an electrical resistance (like a photoresistance or potentiometer) on analog pin 1 and display the values on an LCD.
Everything works fine with a tiny bit of a problem: when I change the value of the potentiometer on pin 1, the temperature changes a little. Do analog inputs influence each other? The LM35 is connected to 3V3 pin of the Arduino (do you have any idea why it displays ten Censius degrees more than normal when I connect it to 5V?). I might be using more analog pins in the future and this is annoying.
My understanding is that there is one analog to digital convert that is switched between the 6 analog inputs. If you switch between two inputs, the second reading can contain a residual from the first, this is what you are seeing. The simplest solution is to make a dummy reading every time you switch to a new analog input i.e.
analogRead(TEMP_INPUT); // dont use this one, its the dummy
int nTemp = analogRead(TEMP_INPUT);
analogRead(POT_INPUT); // dont use this one, its the dummy
int nPotValue = analogRead(POT_INPUT);