Using analogReference(INTERNAL) and multiple analog buttons

Hey guys,

I am working on an aquarium controller and I am just looking for advice on how to make this work. So I have three buttons from my menu on my LCD that are in one analog pin. I measure the resistance to tell which button is being pressed. I have that all working just fine. However, I need to use analogReference(INTERNAL) to get an accurate reading from my LM35 Temperature Sensor (as of right now for testing purposes), but when I put that line in it changes the resistance of the buttons. I have limited knowledge in electrical engineering, but knowledgeable in software programming. Is there a way to fix this?

Normal Serial output of my buttons being pressed:
Button 1: > 650 & < 750
Button 2: > 750 & < 850
Button 3: > 950

Serial output with analogReference(INTERAL):
Button 1: 1023
Button 2: 1023
Button 3: 1023

The internal reference is about 1.1V, your buttons are connected to 5V perhaps?

Solution is to not use internal reference when reading the buttons, only when reading
the sensor.

Remember to call analogRead() twice after changing the reference, the first
measurement after changing the reference is garbage.

MarkT,

Thanks that didn't even cross my mine that I could change the internal reference multiple times. Maybe I need to take a break for a little while. Haha.

Thanks again