Re: Problem reading two sensors with analogRead()
Re: Problem reading two sensors with analogRead()
bswift5528 wrote:Yeah, I just finished that up now. Works great! Still don't know why the bandgap reference isn't stable, or why the 1.05 was in the original calculation,
Still, Sensor 2 seems to be acting up...this time, reading a few deg higher than the other two, and not just being noisy. Has anyone had problems of this nature with a TMP36 before? Thanks again!
Re: Problem reading two sensors with analogRead()
adafruit wrote:which means you should probably stop thinking about it
electronic temperature sensors are precise to only about 1 or 2 degrees.
Re: Problem reading two sensors with analogRead()
Re: Problem reading two sensors with analogRead()
Re: Problem reading two sensors with analogRead()
Re: Problem reading two sensors with analogRead()
Re: Problem reading two sensors with analogRead()
Re: Problem reading two sensors with analogRead()
I can't think of a situation where I would choose to use an analog-output temperature sensor IC over a digital-output sensor.
Re: Problem reading two sensors with analogRead()
Re: Problem reading two sensors with analogRead()
int sensorPin0 = 0;
int sensorPin1 = 1;
int sensorPin2 = 2;
int sensorPin3 = 3;
void setup()
{
Serial.begin(9600);
}
void loop()
{
analogRead(0);
delay(10);
int reading0 = analogRead(sensorPin0);
float voltage0 = reading0 * 5.0 / 1024;
float tempC0 = (voltage0 - 0.5) * 100;
Serial.print("A"); Serial.print(tempC0,0); Serial.print(";");
delay(10);
analogRead(1);
delay(10);
int reading1 = analogRead(sensorPin1);
float voltage1 = reading1 * 5.0 / 1024;
float tempC1 = (voltage1 - 0.5) * 100;
Serial.print("B"); Serial.print(tempC1,0); Serial.print(";");
delay(10);
analogRead(2);
delay(10);
int reading2 = analogRead(sensorPin2);
float voltage2 = reading2 * 5.0 / 1024;
float tempC2 = (voltage2 - 0.5) * 100;
Serial.print("C"); Serial.print(tempC2,0); Serial.println(";");
delay(10);
//int reading3 = analogRead(sensorPin3);
//float voltage3 = reading3 * 5.0 / 1024;
//float temperatureC3 = (voltage3 - 0.5) * 100 ;
//Serial.print("D"); Serial.print(temperatureC3, 0); Serial.println(";");
//delay(10);
delay(1000);
}
Re: Problem reading two sensors with analogRead()
Re: Problem reading two sensors with analogRead()
adafruit_support wrote:Without changing any wiring, if you just read sensor 0 or sensor 2, do they give you 17/18 like sensor 1?
Re: Problem reading two sensors with analogRead()
Re: Problem reading two sensors with analogRead()
Hmm that was strange, I was positive that it should have, but its doesnt!