Author Topic: First non tutorial pic project thermistor question  (Read 4332 times)

0 Members and 1 Guest are viewing this topic.

Offline blewisjrTopic starter

  • Frequent Contributor
  • **
  • Posts: 301
First non tutorial pic project thermistor question
« on: March 10, 2013, 12:11:43 pm »
Hello guys I am getting ready to develop my first solo pic uC project to test what I have learned.

I will be documenting it on my new blog when I get it up and running.  So on to my question.

Essentially I am going to have a thermistor hooked into an analog input and use the adc to calculate the voltage passing through it.  If the temperature is below 100 degree F I want to set an les low when the temp goes 100 or above I want to set the led high to light up. 

The issue I am having is how to figure out the temp without the thermistor data sheet.  The component came in a kit and I don't have the model info.  I can figure out the room temp resistance with a multimeter any suggestions?
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16388
  • Country: za
Re: First non tutorial pic project thermistor question
« Reply #1 on: March 10, 2013, 01:23:50 pm »
Simple, take resistance with it in an ice/water mixture ( half cup of water and half cup of crushed ice, left to stand for 5 minutes) and then measure at 25C ( room temp give or take) and again at 100C (vigorously boiling water in a pot or kettle).

more info at

http://www.digikey.com/Web%20Export/Supplier%20Content/api-technologies-1171/pdf/api-ntc-engineering-notes.pdf?redirected=1

Updated, looked further at the google results for thermistor curve and foun a better explanation for you.

http://www.mstarlabs.com/sensors/thermistor-calibration.html



« Last Edit: March 10, 2013, 01:25:38 pm by SeanB »
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5193
  • Country: ro
  • .
Re: First non tutorial pic project thermistor question
« Reply #2 on: March 10, 2013, 01:50:18 pm »
Get a multimeter with temperature reading.
Connect a lcd screen or serial output to your pic to get the ADC values.

Measure at room temperature.
Put it in the fridge with the multimeter to get a value at colder temperature.
Put it under a desk lamp to get it slightly up, to about 30,40c

Basically get several measurements and draw a pretty graph to figure out what the ADC should report for the missing temperature values.
 

Offline blewisjrTopic starter

  • Frequent Contributor
  • **
  • Posts: 301
First non tutorial pic project thermistor question
« Reply #3 on: March 10, 2013, 02:23:58 pm »
Awesome never thought of doing those things.  Really helpful thanks a bunch.
 

Offline dimlow

  • Frequent Contributor
  • **
  • Posts: 301
  • Country: gb
  • Likes to be thought of as
    • Dimlow Ponders
Re: First non tutorial pic project thermistor question
« Reply #4 on: March 10, 2013, 02:47:40 pm »
If its only ever going to be 100 deg, then great, just measure the resistance of the thermistor at 100 deg and use that in a simple voltage divider to the ADC of your pic. But if you are going to be measuring the Temp,or be using the temp for anything else, your going to have to do a lot more work. Thermistors are not linear, and you will have to use the  Steinhart Hart equation in the pic to get the correct temp from the curve. Looking at the  Steinhart Hart it looks complicated, but when you come to use it, its not that bad. You just need 3 points on the curve as reference. These are mostly given on the data sheet, but you can measure the three points. You then pump these into the equation along with your reading from the ADC and you get your temp. The problem doing it this way is that you will need floating point math in the pic, this is slow and can take a lot of space. Another way would be to pre-calculate a table and use that in the pic, then no math is needed, except for maybe interpolation. There are many examples on the net and many different ways of calculating the curve, Google is your friend here.
 

Offline blewisjrTopic starter

  • Frequent Contributor
  • **
  • Posts: 301
First non tutorial pic project thermistor question
« Reply #5 on: March 10, 2013, 03:21:51 pm »
At some point I will want to display the temp but if I do that I would use the tmp36 sensor which is linear.  This is just a flip the switch with a hair dryer programming exercise.
 

Offline Dongulus

  • Regular Contributor
  • *
  • Posts: 232
  • Country: us
Re: First non tutorial pic project thermistor question
« Reply #6 on: March 11, 2013, 10:49:39 am »
Sounds exactly like one of my first labs in my uC class in college. Horray for making LEDs blink!
 

Offline blewisjrTopic starter

  • Frequent Contributor
  • **
  • Posts: 301
First non tutorial pic project thermistor question
« Reply #7 on: March 11, 2013, 11:57:36 am »
That is cool figure it is a good stepping stone because just blinking led is dull plus it opens room for extension with a LCD.
 

Offline Dongulus

  • Regular Contributor
  • *
  • Posts: 232
  • Country: us
Re: First non tutorial pic project thermistor question
« Reply #8 on: March 11, 2013, 08:12:45 pm »
It's always a satisfying experience to figure to other I/O to venture past LEDs. My thermometer project in my college class also included displaying the temperature on an SPI enabled LCD screen. Unfortunately, it was a nightmare for us because our code inexplicably bricked every Atmega32 chip we tried to program. My professor didn't have any idea what was going on and I never learned the source of the problem. My best guess is that someone messed with some settings in the AVRstudio software that messed with the fusebits.
 

Offline blewisjrTopic starter

  • Frequent Contributor
  • **
  • Posts: 301
Re: First non tutorial pic project thermistor question
« Reply #9 on: March 15, 2013, 05:00:37 pm »
Ok so I found more information about my NTC Thermistor.  It is a NTC Thermistor 20kOhm - 1MOhm with a Beta value of 4300.  The issue I have now is figuring out what the Ohm value for room temperature would be 25 deg C since I don't have a temp controlled environment.  Right now in my bedroom I am getting readings at about 47kOhm and my meter says it is about 24 deg C in my room.  How long should I let the thermistor sit out before checking again?

Edit:
Ok I think I figured it out.  At 25 deg C it has about +- 1% accuracy.  My room is about 24 - 25 deg C due to the 1 degree accuracy of my meter.  I am sitting at about 51.3k Ohms  which I assume corresponds to the numbers on the actual thermistor 503.  I would assume then that 51.3k Ohms is going to be about room temperature.
« Last Edit: March 15, 2013, 06:31:48 pm by blewisjr »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf