After hours of searching this forum and with Google I'm giving up and asking the great minds directly!
I'm working on a project to control my pool solar water heater with the Arduino (Diecimila) by replacing the existing solar controls. This consists of two 10K thermistors, one in the air/sun, and the other in the water pipeline. It's part of a bigger project to see the world around me - ie, a bunch of DS18B20 sensors and a photocell to see how bright it is outside. Almost everything works fine hardware and software wise, except the analog inputs of the thermistors and photocell.
Maybe it's my lack of electronics experience, but I'm finding that the voltage divider circuit/hookup that works for a single analog input works fine, but adding one or two more and they interfere with each other. As in, if I cover up the photocell then it affects the temperature read from the thermistor.
Am I making an obvious mistake? Any help would be greatly appreciated! Even if it's to send me to a specific web page elsewhere.
The important part of my circuit:
And a snippet of my code:
int photocellPin = 0;
int airThermistorPin = 1;
int waterThermistorPin = 2;
void setup(void) {
// initialize inputs/outputs
pinMode(photocellPin, INPUT);
pinMode(airThermistorPin, INPUT);
pinMode(waterThermistorPin, INPUT);
// start serial port
Serial.begin(9600);
}
void loop(void) {
// Several Serial.print() commands are used between these reads
// to let me know what the values are
photocellValue = analogRead(photocellPin);
airThermistorValue = float(Thermister(analogRead(airThermistorPin)));
waterThermistorValue = float(Thermister(analogRead(waterThermistorValue)));
}
double Thermister(int RawADC) {
double Temp;
Temp = log(((10240000/RawADC) - 10000));
Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp));
Temp = Temp - 273.15; // Convert Kelvin to Celcius
Temp = (Temp * 9.0)/ 5.0 + 32.0; // Convert Celcius to Fahrenheit
return Temp;
}
Thanks in advance for any help!