Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Thermistor Help


  • Please log in to reply
8 replies to this topic

#1 PawleysPlayr

PawleysPlayr

    Member

  • Members
  • PipPip
  • 11 posts

Posted 01 June 2011 - 08:48 PM

I have a TTC 103 thermistor
The specs:

TTC Series

R25 = 10000 ohms
B25/50 = 4050
Disipation = 4.5mW/degC
Tolerance of R25 = 5-10-15

Can someone show me how to get the A/B/C constants needed for the Steinhart-Hart Thermistor formula from the data sheet?

Or is there a better method using the thermistor?

#2 mpearson

mpearson

    Member

  • Members
  • PipPip
  • 17 posts

Posted 02 June 2011 - 01:23 PM

Hello PawleysPlayr,
I have some experience with thermistors, and know there is a way determine the coefficients, but am unsure of the way as I have not needed to.

This is a series from BC Components that is similar. They publish coefficients and therefore may be an alternative to speed up the process. This is what I have always used, and they work great.

Here is the datasheet

The coefficients for these would be:

A
0.003354016

B
0.0002519107

C
0.000003510939

D
0.0000001105179

I have applied this in the C language, so let me know if you have any other questions.

#3 PawleysPlayr

PawleysPlayr

    Member

  • Members
  • PipPip
  • 11 posts

Posted 03 June 2011 - 11:34 AM

Thanks! I guess you're right. I should pick up a thermister with the temp/R data on the datasheet. I would be interested in taking a look at you c solution. Just to verify what I've done.

#4 mpearson

mpearson

    Member

  • Members
  • PipPip
  • 17 posts

Posted 04 June 2011 - 07:14 PM

Below is how I applied it in C. If you have any questions, let me know!


//ADC_Value Accepted, Farenheit Returned
	double GetFarenheit(int ADC_Value)
	{
		//Define reference voltage
		double Vref = 5;

		//Define thremistor value
		double ThermRefResistance = 10000;
	
		//Convert ADC reading to a voltage
		double Vin = (Vref * ADC_Value) / 1024;
	
		//Convert Voltage to resistance
		double ThermResistance = ThermRefResistance/((Vref/Vin)-1);

		// Steinhart constants for thermistor (Vishay NTCLE203E3103FB0)
		double a = 3.354016 * pow(10, -3);
		double b = 2.56985 * pow(10, -4);
		double c = 2.620131 * pow(10, -6);
		double d = 6.383091 * pow(10, -8);

		//Convert resistance to temperature in degrees C (Steinhart equation)
		double Celcius = 1/(a + b * log(ThermResistance/ThermRefResistance) + c * pow(log(ThermResistance/ThermRefResistance), 2) + d * pow(log(ThermResistance/ThermRefResistance), 3)) - 272.15;
		
		//Convert celcius to farenheit

		return Farenheit = 18 * Celcius + 320;

	}


#5 mzwaterski

mzwaterski

    New Member

  • Members
  • Pip
  • 2 posts

Posted 08 June 2011 - 07:31 PM

Below is how I applied it in C. If you have any questions, let me know!


//ADC_Value Accepted, Farenheit Returned
	double GetFarenheit(int ADC_Value)
	{
		//Define reference voltage
		double Vref = 5;

		//Define thremistor value
		double ThermRefResistance = 10000;
	
		//Convert ADC reading to a voltage
		double Vin = (Vref * ADC_Value) / 1024;
	
		//Convert Voltage to resistance
		double ThermResistance = ThermRefResistance/((Vref/Vin)-1);

		// Steinhart constants for thermistor (Vishay NTCLE203E3103FB0)
		double a = 3.354016 * pow(10, -3);
		double b = 2.56985 * pow(10, -4);
		double c = 2.620131 * pow(10, -6);
		double d = 6.383091 * pow(10, -8);

		//Convert resistance to temperature in degrees C (Steinhart equation)
		double Celcius = 1/(a + b * log(ThermResistance/ThermRefResistance) + c * pow(log(ThermResistance/ThermRefResistance), 2) + d * pow(log(ThermResistance/ThermRefResistance), 3)) - 272.15;
		
		//Convert celcius to farenheit

		return Farenheit = 18 * Celcius + 320;

	}


Is it possible to use this code with the Netduino? When I try and use this, I'm told that the pow() and log() functions do not exist. Is there a package that I need to add to my environment?

#6 Dan Morphis

Dan Morphis

    Advanced Member

  • Members
  • PipPipPip
  • 188 posts

Posted 08 June 2011 - 10:17 PM

Is it possible to use this code with the Netduino? When I try and use this, I'm told that the pow() and log() functions do not exist. Is there a package that I need to add to my environment?


Those are available in the Math library. Math.Pow(), Math.Log()

-dan

#7 mzwaterski

mzwaterski

    New Member

  • Members
  • Pip
  • 2 posts

Posted 09 June 2011 - 07:35 PM

Those are available in the Math library. Math.Pow(), Math.Log()

-dan


Thanks for your response. I tried this, and the Pow() function now works, but the Log() function is not working (e.g., System.Math.Log(ThermResistance / ThermRefResistance) reports that System.Math does not contain a definition for 'Log'). Do I need to somehow get a different Math library or version of something?

Thanks in advance for any help that you can provide.

Mike

#8 Valkyrie-MT

Valkyrie-MT

    Advanced Member

  • Members
  • PipPipPip
  • 315 posts
  • LocationIndiana, USA

Posted 16 June 2011 - 03:56 AM

...reports that System.Math does not contain a definition for 'Log'). Do I need to somehow get a different Math library or version of something?


Yeah, there are lots of little things missing and this is one of them. But, actually, there was some discussion about a Math.Log function previously. Link below. Just make sure you read to the end of the thread because the code does not work, but the fix is described. Sorry, I always meant to go back and post a corrected version of the log function...

http://forums.netdui...ndpost__p__6949

-Valkyrie-MT

#9 David E

David E

    New Member

  • Members
  • Pip
  • 2 posts

Posted 20 October 2011 - 04:43 AM

Hi , I put some posts here a couple of weeks ago (to which i received some replies)

they all seem to have been taken off the site.

Any ideas what happened? I was asking a question to Mike Pearson about the use of the particular Thermistor in the code below....


Below is how I applied it in C. If you have any questions, let me know!


//ADC_Value Accepted, Farenheit Returned
	double GetFarenheit(int ADC_Value)
	{
		//Define reference voltage
		double Vref = 5;

		//Define thremistor value
		double ThermRefResistance = 10000;
	
		//Convert ADC reading to a voltage
		double Vin = (Vref * ADC_Value) / 1024;
	
		//Convert Voltage to resistance
		double ThermResistance = ThermRefResistance/((Vref/Vin)-1);

		// Steinhart constants for thermistor (Vishay NTCLE203E3103FB0)
		double a = 3.354016 * pow(10, -3);
		double b = 2.56985 * pow(10, -4);
		double c = 2.620131 * pow(10, -6);
		double d = 6.383091 * pow(10, -8);

		//Convert resistance to temperature in degrees C (Steinhart equation)
		double Celcius = 1/(a + b * log(ThermResistance/ThermRefResistance) + c * pow(log(ThermResistance/ThermRefResistance), 2) + d * pow(log(ThermResistance/ThermRefResistance), 3)) - 272.15;
		
		//Convert celcius to farenheit

		return Farenheit = 18 * Celcius + 320;

	}






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.