analogRead issues

I am having a horrible time trying to read two thermistors for a recent project. If I only read one analog pin then I get an accurate result. When I add a second call to a different pin the second pin is off by 10-20 units. If i switch the two calls in code the second one is always the one thats wrong. I know that other people have had analogRead issues but I can’t seem to find an answer in the forums that solves my problem. Here is a rough snippet of my code.
void loop() {

temp = thermistor_temp(analogRead(A5));
delay(100);
temp2 = thermistor_temp(analogRead(A7));
}

Would building locally on my mac help this?
Thanks!
David

Hi @jdmaharrey

What is the nominal resistance of the thermistors? Are 100kohm?

The Spark analog inputs are fairly low-impedance (~ 40k) so a 10k thermistor will work a lot better. You can add an op-amp to buffer the inputs and get great results with high-impedance sensors.

Hey @bko,
Thanks for the response. The sensors are maverik thermistors from a bbq thermometer. I think that they are 10k thermistors. I am having trouble wrapping my mind around why one would work and the other not (I can switch the probes out in code and physically with the same result). Thanks for the help and I’ll look into the opamp.

So I have a “fix” that I can’t explain, but it works. If I add an analogRead(A6) (a pin that has nothing connected and is free floating) then I get accurate reads on the two pins (A5,A7) that I,m concerned with. Anyone have an idea why this is happening?

I have a same problem.

I will try this