First non tutorial pic project thermistor question - Page 1
Forum section: electronics / beginners

author: blewisjr
author_rank: Frequent Contributor
timestamp: March 10, 2013, 12:11:43 pm
content: 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?

author: SeanB
author_rank: Super Contributor
timestamp: March 10, 2013, 01:23:50 pm
content: 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 athttp://www.digikey.com/Web%20Export/Supplier%20Content/api-technologies-1171/pdf/api-ntc-engineering-notes.pdf?redirected=1Updated, looked further at the google results for thermistor curve and foun a better explanation for you.http://www.mstarlabs.com/sensors/thermistor-calibration.html

author: mariush
author_rank: Super Contributor
timestamp: March 10, 2013, 01:50:18 pm
content: 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,40cBasically get several measurements and draw a pretty graph to figure out what the ADC should report for the missing temperature values.

author: blewisjr
author_rank: Frequent Contributor
timestamp: March 10, 2013, 02:23:58 pm
content: Awesome never thought of doing those things. Really helpful thanks a bunch.

author: dimlow
author_rank: Frequent Contributor
timestamp: March 10, 2013, 02:47:40 pm
content: 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 theSteinhart Hartequation 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.

author: blewisjr
author_rank: Frequent Contributor
timestamp: March 10, 2013, 03:21:51 pm
content: 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.

author: Dongulus
author_rank: Regular Contributor
timestamp: March 11, 2013, 10:49:39 am
content: Sounds exactly like one of my first labs in my uC class in college. Horray for making LEDs blink!

author: blewisjr
author_rank: Frequent Contributor
timestamp: March 11, 2013, 11:57:36 am
content: 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.

author: Dongulus
author_rank: Regular Contributor
timestamp: March 11, 2013, 08:12:45 pm
content: 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.

author: blewisjr
author_rank: Frequent Contributor
timestamp: March 15, 2013, 05:00:37 pm
content: 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.