hi andrew,
This Sketch is set for your thermistor.
It outputs Cdeg, Rth, ADCv, ADCcount as csv format string.
Use a program like Tera Term or Termite as a text logger on the serial output.
You can then load the csv file into a spreadsheet if required.
E
BTW: you edit the Tamb step from 5C to 1C and the 'i' cntr limit to 100 in order to see one degree increments.
This Sketch is set for your thermistor.
It outputs Cdeg, Rth, ADCv, ADCcount as csv format string.
Use a program like Tera Term or Termite as a text logger on the serial output.
You can then load the csv file into a spreadsheet if required.
E
BTW: you edit the Tamb step from 5C to 1C and the 'i' cntr limit to 100 in order to see one degree increments.
C-like:
/* thermistor temperature profile 14/05/2023 ESP57
*/
#define ADCin1 0
float Rser = 10000; // Series resistor with Therm
float R0 = 10000; // Therm resistance at 25C
float Bval = 3977; // Therm Beta value
float Ak = 14.6337; // Therm constants, enter as positive values
float Bk = 4791.842;
float Ck = 115334;
float Dk = 3.730535E6;
float Rth = 0;
float ADCvolt = 0;
int ADCcnt = 0;
float Vss = 5.0; // supply Volts
float TambAvg = 0;
float Tamb = 25.0;
int i = 0;
int avg = 0;
void setup()
{
Serial.begin(115200);
Serial.println("NTCLE100E3 Vishay Thermistor");
}
void loop() {
Tamb = 0;
Serial.println("Cdeg Rth ADCv Count"); // column header
for (i = 0; i <= 20; i++) { // reading 0C thru 100C at 5deg intervals
Rth = R0 * exp(-Ak + Bk / (Tamb + 273.15) - Ck / (pow((Tamb + 273.15), 2)) - (Dk) / (pow(Tamb + 273.15, 3)));
ADCvolt = Vss * (Rth / (R0 + Rth));
ADCcnt = (ADCvolt / Vss) * 1024;
Serial.print(Tamb);
Serial.print(",");
Serial.print( Rth);
Serial.print(",");
Serial.print( ADCvolt);
Serial.print(",");
Serial.println( ADCcnt);
Tamb = Tamb + 5; // step 5 Cdeg's
delay(1000);
}
}
Last edited:
