Shop OBEX P1 Docs P2 Docs Learn Events
the A B C in the steinhart equation — Parallax Forums

the A B C in the steinhart equation

grasshoppergrasshopper Posts: 438
edited 2008-06-24 01:51 in Propeller 1
I am using the Stein heart equation for my thermistor and I cant seem to solve or find information regarding the A B and C values.

The equation is - 1/k = A + B log(R) + C log(R)³ where k is kelvin and (R) is the resistance measured off of the thermistor (thanks mike green for the heads up on my other post.) Any ways I cant get A,B,C off the data sheet rocky.digikey.com/weblib/Thermometrics/Web%20Data/RL0503%20Series.pdf I am sure the data is on the data sheet but it will need to be calculated, so how do i go about this?

I will post the propeller code as soon as I find A,B,C for others to use perhaps it may be helpful.

Thanks

Comments

  • LeonLeon Posts: 7,620
    edited 2008-06-23 18:01
    Why not measure the resistance over your temperature range, plot a graph and use that?

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • grasshoppergrasshopper Posts: 438
    edited 2008-06-23 18:12
    Leon,

    Truthfully I thought about going about it as you mention, but I really need to:

    A. Learn how to do this
    B. measure and convert to temperatures with a great degree of precision a graph wont get me as close as I need
    C. I work with scientist and they wont allow shortcuts, they are a rare breed.
  • LeonLeon Posts: 7,620
    edited 2008-06-23 18:59
    You'll have to plot the graph and calculate the constants from that, unless you can find a thermistor with them specified. I don't see why a graph shouldn't be accurate enough, individual thermistors of the same type will have much larger variations than any inaccuracies you will get from a graph.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle

    Post Edited (Leon) : 6/23/2008 7:06:10 PM GMT
  • parskoparsko Posts: 501
    edited 2008-06-23 19:13
    Grasshopper,

    From what I gather on the datasheet, the info Leon suggest you gather already exists. You're going to need to do a bit of work to derive it, but I think it's there. On the left, you have a temperature, then you have it's accuracy, then a ration with respect to it's resistance at 25degC. Graph the sucker up in your local spreadsheet, then derive some sort of curve from that. You will likely get an LN out of that, in the form of: T=a+b*LN(R), which will get you as accurate as you're gonna get with a thermister. I've done the same with a GM water temp sensor, and I've tested it to be accurate to around 1degC, or around 2degF. Any more level of accuracy and you're likely going to have to go the thermocouple route (k-type?). But, my understanding is that these thermisters are pretty good.

    Didn't you ask this before (not asked in any negative manner)?
    http://forums.parallax.com/showthread.php?p=716439

    Are you just now getting back to the project?

    -Luke
  • grasshoppergrasshopper Posts: 438
    edited 2008-06-23 19:30
    parsko:

    Thanks for the information. True I did ask a similar question before, but it was a broad question. The other post I mentioned some A,B,C values. These values were given for a different temp sensor and I did not have to calculate them, more or less I was asking about the "meat of programming the equation" it self. [noparse]:)[/noparse] **Please note also that no offense is taken I appreciate any response and look forward to more sorry if this seems to be a reposting it was not my intentions.

    Leon:

    I did plot this in Excel but I am not sure how to extrapolate the equation from the plot. Among the other reasons I listed why I can not use a graph at the moment is that the accuracy will be in the order of +/- .02. This can be achieved using a thermistor in conjunction with the Stein heart equation. Also if I use an equation I can use different thermistors that have more or less accuracy.
  • parskoparsko Posts: 501
    edited 2008-06-23 19:39
    Grass,

    What range are you looking at?

    My guess is that, over a large range, and accuracy of 0.02 is not going to be easy, especially without a wicked accurate ADC.

    You're right, I don't think excel is able to give you a Steinhart equation, but over a small range, you can use the "a+b*LN(R)" and get VERY accurate results.

    Otherwise, you can create a Steinhart equation, and iteratively find the values by overlapping the created Steinhart result on your existing results. It's a long process, but if you're sitting in front of the TV, it may be less tedious.

    And, I agree with Lean, the differences between specific thermistors of the same part number are going to vary too much for the datasheet values to apply, IMHO. I think you're best off creating known conditions, and making your own curver (meaning; digital meat thermometer, DVM, toaster oven, maybe a second thermometer). That's how I did mine...

    -Parsko
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2008-06-23 19:55
    From wikipedia's entry:

    Where Steinhart–Hart coefficients are not available, but three accurate measures of resistance are made at precise temperatures, then the coefficients may be derived by solving three simultaneous equations.

    So you will have three equations, each have a different T and R but all have the same A,B and C.

    I think this can do it if you enter the three calibration points:

    www.capgo.com/Resources/Temperature/Thermistor/ThermistorCalc.html

    Hope that helps

    Graham
  • grasshoppergrasshopper Posts: 438
    edited 2008-06-23 20:44
    parsko,

    I am using a 16 bit a/d currently with a voltage ref of 2-5 volts so that makes it around .000045777 volts per bit

    Graham,

    Thanks so much, nice link and it worked. I am so thankful.

    Tonight ill post the code for any who needs it.
  • grasshoppergrasshopper Posts: 438
    edited 2008-06-24 01:51
    Halla looo yaa

    Spelling on that dont look right, but thanks to every that helped me get this working

    here is the code to calculate a temperature off of a resistance using the Steinhart equation

    
    {{ 
      Steinhart_Hart Calculation Version 1.0 June 23, 2008
      Michael A.
      Use to get the temperature off of a thermisitor
      R is the Resistance that is measured
      A,B,C are values that you can get here 
      http://www.capgo.com/Resources/Temperature/Thermistor/ThermistorCalc.html
    
      The formula used is
      
      K = 1 /[noparse][[/noparse]A + B log[noparse][[/noparse]R]+ C log[noparse][[/noparse]R]³]
          
    }}
    
    CON
    
      one           = 1.0
        
    OBJ
    
      G : "Float32"
    
    Pub Calc_StHart (A,B,C,Resistance) : kelvin | B_x_Rlog , C_x_Rlog , Rcubed, Rlog,  Addit
          
      G.start                                               ' Start math32
    
      Rlog := G.log(Resistance)                             ' Take the log of the Resistance
      B_x_Rlog := G.FMul(B,Rlog)                            ' Multiply B to log of R
                                                               
      RCubed := G.FMul(Rlog,Rlog)                           ' Cube the log of R by R * R * R 
      RCubed := G.FMul(Rlog,RCubed)                         ' Finish the Cube
         
      C_x_Rlog := G.FMul(RCubed,C)                          ' Multiply C to log the cubed log R
    
      Addit := G.Fadd(C_x_Rlog,B_x_Rlog)                        
      Addit := G.Fadd(Addit, A)                             ' Add all A,B,C together
      Kelvin := G.Fdiv(one,addit)                           ' Kelvin = 1/ all added
    
      G.stop
    
    
    
Sign In or Register to comment.