Go Down

### Topic: NTC Thermistor Integration (Read 9601 times)previous topic - next topic

#### robtillaart

#15
##### Apr 13, 2012, 10:20 am
So the multimeter gives the same voltage as the Arduino, at least that is consistent.

But seen the values of the resistors there should be a ration of 1:6 somehing like 0.7V - 4.3V

2 new measurements:

1) Can you measure the current low through the two resistors ?
expected value 5V / 2500 ohm = 2 mA

2) Can you please measure the resistors again. I know it sounds stupid but still ..

you can always send a picture ..

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

#### Rico

#16
##### Apr 13, 2012, 10:59 am
OK, it turns out that Rtop was indeed wrong.  3500 instead of 350.  I apologize for that.  Also turns out that Rbottom was off reported resistance by the 1% it said it could have, so I replaced it.  Now, here is the following to report:

Code: [Select]
`#include <math.h>void setup() {  Serial.begin(9600);}int delaySeconds = 5;int masterDelay = 1000 * delaySeconds;float Rtop = 3500;float Vin = 5;                            // input voltage  void loop() {  float sensorValue = analogRead(A0);                    // read sensor  float Vout = (sensorValue/1024) * Vin;  float Rbottom = -Rtop + Rtop * (Vin/Vout);  // float myTemp = (-32.228 * log(Rtop) + 323.17);          // thermistor trendline  float VRatio = Vout/Vin;  float RRatio = Rtop/(Rtop + Rbottom);    Serial.print("SensorValue: ");  Serial.print(sensorValue);    Serial.print("/Vout: ");  Serial.print(Vout);  Serial.print("/Rbottom: ");  Serial.print(Rbottom);    Serial.print("/VoltRatio: ");  Serial.print(VRatio);    Serial.print("/RRatio: ");  Serial.print(RRatio);         Serial.println("");  delay(masterDelay);}`

Result:  SensorValue: 403.00/Vout: 1.97/Rbottom: 5393.30/VoltRatio: 0.39/RRatio: 0.39

So the ratios are good.  The measured Voltage is good.  The Rbottom is wrong though.  It's measured at 2150, reported through the math at 5393.30, which is 2.5x what it should be.

Didn't take any pictures as it is taking shape now.

#### Rico

#17
##### Apr 13, 2012, 11:11 am
Just as an aside, I replaced Rbottom with a 51 Ohm resistor, and I get this:  SensorValue: 11.00/Vout: 0.05/Rbottom: 322318.18/VoltRatio: 0.01/ResRatio: 0.01

Vout is right.  ResRatios don't mean anything because it relies on Rbottom.

I think we need to focus on Rbottom calculations.

#### robtillaart

#18
##### Apr 13, 2012, 11:23 am
Think there is a flaw in the code as the ratio between 3500 and 5393 is almost exactly the ratio between 2150 and 3500

the current flowing through the system is +> A = (Vin-Vout) / R.top
this current also flows through Rbottom resulting in Vout => A * Rbottom = Vout
or Rbottom = Vout / A;

combining these  ==> Rbottom = Vout / ( (Vin-Vout) / Rtop)  = Vout * Rtop / (Vin-Vout);

==>   float Rbottom = Vout * Rtop / (Vin - Vout);

testing with the values:   1.97 * 3500 / ( 5 - 1.97) = 2275  just 1% above the 2150
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

#### Rico

#19
##### Apr 13, 2012, 12:52 pm
OK, I worked it out and that formula is right.  I just tried:

Rtop = 3280, Rbottom (test) = 2150
Vin = 5V, SensorValue = 357

Rbottom = (1.72 * 3280)/(5 - 1.74) = 1750 Ohms, which is wrong.

OK, I'm not sure I'm covering all aspects.  I'm using 2 multimeters here, neither of which can read Amperage.

#### robtillaart

#20
##### Apr 13, 2012, 04:03 pm

I don't understand it ...
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

#### Rico

#21
##### Apr 13, 2012, 04:29 pm
I will mess around with it, the reporting, and see what I can find.  Anybody else, please chime in here.

#### Docedison

#22
##### Apr 14, 2012, 04:05 am
Your 'bottom ' resistor is 215 ohms mot 2150 ohms... 350 + 215 = 565 ohms 5 / 565 = .0884 A X 215 ohms = 1.90 V 3% low... well within spec I should think.

Doc
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

#### Rico

#23
##### Apr 16, 2012, 06:57 pm
Wow another resistor mis-read.  OK I'll go have a look and report back.  Thanks for noticing that and letting me know.

#### Rico

#24
##### Apr 16, 2012, 08:28 pm
OK it's completed.  Rtop during this was 3300.  I just have to recalibrate the thermistor and get a better trend line.

Thanks for the discussion.  Got through it.   XD

#### robtillaart

#25
##### Apr 16, 2012, 08:33 pm
Up to the next project!
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

#### Rico

#26
##### Apr 16, 2012, 08:38 pm
This is a BBQ thermoprobe, so now I want to send data to my database and create a refreshing page that graphs the progress. And eat more food.

BTW where in Holland are you?

#### robtillaart

#27
##### Apr 16, 2012, 08:40 pm
Brabant, near Helmond
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

#### Docedison

#28
##### Apr 17, 2012, 10:44 pm
Anderson published a table and the math to calculate any temp within the thermistor's range (10K NTC)... to at least 1% accuracy. P H Anderson... I can't remember where I found the table but it is on Anderson's website...
Somewhere,

Doc
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

#### Rico

#29
##### Apr 18, 2012, 12:31 am
Hi Doc.  Thanks for the post.  I found two links with trend lines posted.

I guess through trial and error that I can see if the formula fits?  I have no knowledge what these probes are.  Hence the calibration.

Cheers

Go Up