Bonjour,
Je suis débutant et je me pose une question sur des mesures de températures.
J'ai fait un montage avec deux thermistances 10kΩ (Vishay NTCLE213E3) et 2 résistances 10kΩ.
J'ai systématiquement une différence de température (de 0,3°C à 0,8°C) entre les deux températures. T1 est plus élevé que T2. Si j'inverse les deux thermistances j'ai toujours cette même différence (T1>T2) donc l'erreur ne provient pas du composant en lui même.
Est-ce que ceci est dû à la conception de mon circuit ?
Merci d'avance pour votre aide
J'ai utilisé le code suivant
// https://learn.adafruit.com/thermistor/using-a-thermistor
// which analog pin to connect thermistor 1
#define THERMISTORPIN A0
// which analog pin to connect thermistor 2
#define THERMISTORPIN_2 A1
// how many samples to take and average, more takes longer
// but is more 'smooth'
#define NUMSAMPLES 5
// the value of the 'other' resistor
#define SERIESRESISTOR 10000
//
float logR2, logR3, R2, R3, T, T2;
float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07;
int samples[NUMSAMPLES];
int samples_2[NUMSAMPLES];
void setup(void) {
Serial.begin(9600);
// connect AREF to 3.3V and use that as VCC, less noisy!
analogReference(EXTERNAL);
}
void loop(void) {
uint8_t i;
float average;
float average_2;
// take N samples for thermistor 1 in a row, with a slight delay
for (i=0; i< NUMSAMPLES; i++) {
samples[i] = analogRead(THERMISTORPIN);
delay(10);
}
// take N samples for thermistor 2 in a row, with a slight delay
for (i=0; i< NUMSAMPLES; i++) {
samples_2[i] = analogRead(THERMISTORPIN_2);
delay(10);
}
// average all the samples out
average = 0;
for (i=0; i< NUMSAMPLES; i++) {
average += samples[i];
}
average /= NUMSAMPLES;
// average all the samples out
average_2 = 0;
for (i=0; i< NUMSAMPLES; i++) {
average_2 += samples_2[i];
}
average_2 /= NUMSAMPLES;
R2 = SERIESRESISTOR * (1023.0 / (float)average - 1.0);//calcul de la resistance de la thermistance
logR2 = log(R2);
T = (1.0 / (c1 + c2*logR2 + c3*logR2*logR2*logR2));//calcul temperature
T = T - 273.15;
R3 = SERIESRESISTOR * (1023.0 / (float)average_2 - 1.0);//calcul de la resistance de la thermistance2
logR3 = log(R3);
T2 = (1.0 / (c1 + c2*logR3 + c3*logR3*logR3*logR3));//calcul temperature 2
T2 = T2 - 273.15;
Serial.print("temperature 1 = ");
Serial.print(T);
Serial.print(",");
Serial.print("Temperature 2 = ");
Serial.println(T2);
delay(1000);
}