Go Down

Topic: Arduino Uno mit Thermistor (TC005-503) (Read 697 times) previous topic - next topic

RaphaelK

Nov 16, 2012, 12:05 pm Last Edit: Nov 16, 2012, 02:13 pm by RaphaelK Reason: 1
Hallo zusammen,  :)

ich versuche jetzt seit paar Tagen schon, das Programm zum Laufen zum bringen,
aber ich stehe noch immer vor einem großen Problem & finde keine Lösung bei google.de..
Wo kriege ich die Koeffizienten von meinem Thermistor (TC005-503) raus?
Im Datenblatt stehen die nicht oder?
http://www.alldatasheet.com/datasheet-pdf/pdf/334623/RFE/TC005-503.html

Das Programm das ich benutzen will:

#include <math.h>

double Thermister(int RawADC) {
double Temp;
Temp = log(((10240000/RawADC) - 10000));
Temp = 1 / (0.001129148 + (0.000234125 + (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;
}

void setup() {
Serial.begin(115200);
}

void loop() {
Serial.println(int(Thermister(analogRead(0))));  // display Fahrenheit
delay(100);
}

Danke schonmal im vorraus!

COOL

Schau mal hier http://hyperphysics.phy-astr.gsu.edu/hbase/electric/restmp.html#c3

Gruß Gerd

RaphaelK

#2
Nov 16, 2012, 01:38 pm Last Edit: Nov 16, 2012, 01:41 pm by RaphaelK Reason: 1
Danke, werde ich sofort mal ausprobieren! ;)
aber brauche doch eig. 3..
a, b & c


COOL

Hallo,
in der Tabelle kann man doch 2 Widerstandswerte bei unterschiedlichen Temperaturen eingeben. Wenn du dann auf  alpha (T(final) klickst, bekommst du den TK-Wert.
Wenn du das Java-Script umschreibst, hast du die Formel
Code: [Select]
<SCRIPT LANGUAGE ="JavaScript">
function rcal(){fh=document.forms[0];def();rr0=fh.r0.value;aalp=fh.alp.value*Math.pow(10,fh.alpp.value);tt0=fh.t0.value;tt=fh.t.value;fh.r.value=rr0*(1-(-1)*aalp*(tt-tt0))}

function r0cal(){fh=document.forms[0];def();rr=fh.r.value;aalp=fh.alp.value*Math.pow(10,fh.alpp.value);tt0=fh.t0.value;tt=fh.t.value;fh.r0.value=rr/(1-(-1)*aalp*(tt-tt0))}

function alpcal(){fh=document.forms[0];def();rr0=fh.r0.value;rr=fh.r.value;tt0=fh.t0.value;tt=fh.t.value;alpc=(rr-rr0)/(rr0*(tt-tt0));fh.alp.value=snb(alpc);fh.alpp.value=snp(alpc)}

function tcal(){fh=document.forms[0];def();rr0=fh.r0.value;rr=fh.r.value;tt0=fh.t0.value;aalp=fh.alp.value*Math.pow(10,fh.alpp.value);fh.t.value=tt0-(-1)*(rr-rr0)/(aalp*rr0)}

function t0cal(){fh=document.forms[0];def();rr0=fh.r0.value;rr=fh.r.value;tt=fh.t.value;aalp=fh.alp.value*Math.pow(10,fh.alpp.value);fh.t0.value=tt-(rr-rr0)/(aalp*rr0)}


<!-- the following routines handle the conversion to and from scientific notation-->
<!-- sn(b,p) converts number with power of 10 to a number-->
function sn(b,p){return b*Math.pow(10,p)}
<!--snp(x) returns the power of 10 for a number-->
function snp(x){return Math.round(Math.log(x)/Math.LN10)}
<!--snb(x) returns the base of number with which to multiply the power of 10-->
function snb(x){return x/Math.pow(10,snp(x))}
<!--svb(b,p) takes input base and power and scales to make base between 1 and 10, returns base-->
function svb(b,p){n=sn(b,p);return snb(n)}
<!--svp(b,p) takes input base and power and scales to make base between 1 and 10, returns power-->
function svp(b,p){n=sn(b,p);return snp(n)}

<!--display(x) checks to see if a number is too small or too large to fit in a 6-space field, and if so, displays ellipsis ...-->
function display(x){xx=x;if(x<Math.pow(10,-4))xx="...";if(x>.99*Math.pow(10,5))xx="...";return  xx}

<!--default values are set for parameters which have zero values-->
<!--There is value in having an overall default function for a calculation to provide values for all parameter which you dont want to default to zero-->
function def(){fh=document.forms[0];if (fh.r0.value==0)fh.r0.value=100;if (fh.r.value==0)fh.r.value=131.2;if (fh.t0.value==0)fh.t0.value=20;if (fh.t.value==0)fh.t.value=100;if (fh.alp.value==0)fh.alp.value=3.9;if (fh.alpp.value==0)fh.alpp.value=-3}

</script>


Gruß Gerd

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy