Register to reply

Help designing a thermistor circuit

by rusty009
Tags: circuit, designing, thermistor
Share this thread:
rusty009
#1
Jan30-09, 07:05 PM
P: 70
I want to design a thermistor circuit to be sampled by a microcontroller using an 8 bit ADC, with a voltage reference of 2.55V, I know the following

T (C) R(ohms)
25 2815
40 1200

I am going to use a potential divider then use a linear approximation to measure the temperature. I have two problems, firstly I don't know how to calculate the resistance needed for the potential divider, and secondly how do I calculate from the linear approximation, should I make a line between the two points given ? Thanks in advance !
Phys.Org News Partner Engineering news on Phys.org
Researchers use 3D printers to create custom medical implants
For secure software: X-rays instead of passport control
Razor-sharp TV pictures
berkeman
#2
Jan30-09, 07:38 PM
Mentor
berkeman's Avatar
P: 40,948
Quote Quote by rusty009 View Post
I want to design a thermistor circuit to be sampled by a microcontroller using an 8 bit ADC, with a voltage reference of 2.55V, I know the following

T (C) R(ohms)
25 2815
40 1200

I am going to use a potential divider then use a linear approximation to measure the temperature. I have two problems, firstly I don't know how to calculate the resistance needed for the potential divider, and secondly how do I calculate from the linear approximation, should I make a line between the two points given ? Thanks in advance !
I'm impressed by this entry at wikipedia.org:

http://en.wikipedia.org/wiki/Thermistor

Looks like a linear approximation won't be very accurate for you. Probably best to make a calibration look-up table, based on those equations, and on some measurements by you. Do they have a calibration curve in the datasheet for your thremistor?
rusty009
#3
Jan30-09, 07:49 PM
P: 70
Hey, I looked at that entry in wikipedia but the linear approximation did not seem to work for me, I have done,

gradient k=(2815-1200)/(25-40)=107.67

but k*25 does not equal 2815, am I making a stupid mistake here? I need to use a linear approximation, how would I go about calculating the resistance value for the potential divider ?

berkeman
#4
Jan30-09, 07:56 PM
Mentor
berkeman's Avatar
P: 40,948
Help designing a thermistor circuit

Quote Quote by rusty009 View Post
Hey, I looked at that entry in wikipedia but the linear approximation did not seem to work for me, I have done,

gradient k=(2815-1200)/(25-40)=107.67

but k*25 does not equal 2815, am I making a stupid mistake here? I need to use a linear approximation, how would I go about calculating the resistance value for the potential divider ?
Well, first you would plot the resistance versus temperature graph -- are you only intersted in temps between 25C and 40C? What is the temperature range you want to cover? Also, what is the *tolerance* of the thermistor over the temperature range you want? If it is +/-10% from unit to unit, you will need to include that in your design (so the reading does not top out or bottom out due to manufacturing variations in the thermistors).

The job of your circuit will be to translate something about the thermistor resistance in that target resistance range, into the voltages 0-2.55V. You will most likely use an opamp to do this, probably running between +/-5V or +/-12V with appropriate output clamping. You could also maybe use a more expensive single-supply CMOS opamp, running just between 0V and 5V.

Is the thermistor resistance dependent on the current you pass through it, or is it just dependent on temperature. If there is a "best" current, make that current with an opamp, and buffer the voltage across the thermistor with another opamp. Then process that buffered voltage with an offset subtractor and a scaling stage, to get you to what you want into your ADC.

If there is a wide tolerance on the thermistors, you can consider doing a calibration step as part of bringing up the circuit, either in the analog circuitry ouside, or in the uC after the ADC.

Show us what you come up with.
rusty009
#5
Jan30-09, 08:05 PM
P: 70
Hey, thanks for the reply. I am only interested in temperatures between 25 and 40 degrees. Is there a way to do it without an op-amp as I only have a microcontroller with an 8 bit ADC. I have just plotted the linear approximation in matlab, I have uploaded the file.

edit: the thermistor is only dependent of the temperature.
Attached Thumbnails
line.jpg  
berkeman
#6
Jan30-09, 08:12 PM
Mentor
berkeman's Avatar
P: 40,948
What do you mean you only have an ADC? Does it already include the sample-and-hold circuit that feeds into most ADCs? Or is it on the uC itself?

To do the offset, you will need to have a negative supply available. Do you have that?

If you don't need full 8-bit resolution, you can just bias it with a resistor that gives you 2.55V when the thermistor is max resistance, and do the offset in your uC.

I have to bail for tonight. Hopefully somebody else can pick this up with you if you still have questions.
rusty009
#7
Jan30-09, 08:22 PM
P: 70
The ADC includes a sample-and-hold circuit and I do have a negative supply available.

If you don't need full 8-bit resolution, you can just bias it with a resistor that gives you 2.55V when the thermistor is max resistance, and do the offset in your uC.
I don't understand what you mean by this...
skeptic2
#8
Jan31-09, 07:48 AM
P: 1,810
Do you have the part number of the thermistor?
rusty009
#9
Jan31-09, 08:57 AM
P: 70
no, all the info I was given is listed above.
Grinch
#10
Jan31-09, 10:02 AM
P: 13
For a my old design I've to retrieve the temperature from a NTC thermistor using a PIC microcontroller.
I've solved it by sampling the NTC characteristics in several point (10 interval from 0 to 150 C) and after that I've calculated the linear approximation coefficient for every interval.
To obtain the measured temperature then I've just to measure the thermistor voltage and then find the right sub-interval, after that by using the linear interpolation formula (with the right coefficient) I'm was able to retrieve the estimated temperature. Overall error was less than 1%.

Hope it help

Regards
Grinch
rusty009
#11
Jan31-09, 10:18 AM
P: 70
Grinch,
thanks a lot, your response has helped me. I have the linear coefficient for my desired interval, but how did you calculate the resistance to be connected to the thermistor ? Also, how did you calculate the error in the estimation? Thanks.
skeptic2
#12
Jan31-09, 07:13 PM
P: 1,810
rusty009

I couldn't find any data sheet even close to the values you posted and only 2 points cannot define a curve so this solution is purely a guess. As Berkeman said, thermistors are not very linear and your linear approximation will not be very accurate. I did quick attempt at a simple network to linearize it a little.

To the +5V supply connect the thermistor and a 5.1 k resistor in parallel. To the other side of the thermistor and 5.1 k resistor connect a 430 ohm resistor to ground. Connect the input of the A/D converter to the junction between the two resistors and the thermistor. Program the microcomputer to divide the A/D output (0 to 255) by 3.825 to get temperature.
Redbelly98
#13
Jan31-09, 10:11 PM
Mentor
Redbelly98's Avatar
P: 12,069
Thermistors follow an exponential curve fairly closely. You can use the 40C (T=313K) data to find To in this equation:

[tex]
\ \ \ R =2815\Omega \cdot e^{T_o \cdot (\frac{1}{T}-\frac{1}{298K})}
[/itex]

(T is absolute temperature here)

Or, equivalently, you could do a linear interpolation of ln(R) vs. 1/Tabsolute
Phrak
#14
Jan31-09, 11:13 PM
P: 4,512
I had a similar design task a couple years ago: 8 bit AtoD, thermistor input measuring water temperature. There was insufficient resolution over the required temperature range at one end.

I'm getting a little flustered, becaue I though I recalled using a bridge with a thermistor in one leg... In anycase, I was able to restore sufficient linearity, that the accuracy out of the ADC was obtained.
Phrak
#15
Jan31-09, 11:34 PM
P: 4,512
A simple voltage divider may be enough to restore required linearity and resolution as both this

[tex]V = V_{bias} \frac{R_{therm}}{R + R_{therm}}[/tex]
and this
[tex]V = V_{bias} \frac{R}{R + R_{therm}}[/tex]

are themselves nonlinear in [itex]R_{therm}[/itex] .
rusty009
#16
Feb1-09, 08:35 AM
P: 70
Quote Quote by skeptic2 View Post
rusty009

I couldn't find any data sheet even close to the values you posted and only 2 points cannot define a curve so this solution is purely a guess. As Berkeman said, thermistors are not very linear and your linear approximation will not be very accurate. I did quick attempt at a simple network to linearize it a little.

To the +5V supply connect the thermistor and a 5.1 k resistor in parallel. To the other side of the thermistor and 5.1 k resistor connect a 430 ohm resistor to ground. Connect the input of the A/D converter to the junction between the two resistors and the thermistor. Program the microcomputer to divide the A/D output (0 to 255) by 3.825 to get temperature.
Thanks A LOT for this, but where does the number 3.825 come from ?
Phrak
#17
Feb1-09, 03:59 PM
P: 4,512
rusty, you never did say how much temperature error is allowed in your output.
rusty009
#18
Feb1-09, 05:15 PM
P: 70
I have been asked to calculate the error after I have built it. How would I go about calculating this ?


Register to reply

Related Discussions
Designing a sequential circuit Engineering, Comp Sci, & Technology Homework 0
Need help designing a circuit for my car... Electrical Engineering 7
Designing a circuit from a transfer function [linear control] Engineering, Comp Sci, & Technology Homework 2
Designing a circuit Engineering, Comp Sci, & Technology Homework 4
Designing a switching circuit Electrical Engineering 7