Shop OBEX P1 Docs P2 Docs Learn Events
Thermistor and the calculas? — Parallax Forums

Thermistor and the calculas?

grasshoppergrasshopper Posts: 438
edited 2008-06-21 21:20 in Propeller 1
I am using a thermistor and my mind has lost its focus.

As of now I can read the sensor and it changes with a change in temperature. I am using a Steinhart Hart equation but my concern is this.

1. If my Voltage divider is as follows in picture 1 then my total current is 125.0uA. Vin is 5volts
zpic10.jpg


2. if my voltage divider is as in picture 2 then my total current is 69.4uA. Vin is 5volts
zpic20.jpg


My problem is that in order for me to correctly read the thermistor I must know the current. In order to know the current I must know the Resistance. But how can i know the resistance if i can get the current. My voltage is the same but my mind is lost. I was going to implement some sort of derivative but i am at a loss.

zpic30.jpg
3. I wont know the resistance because i cant calculate the voltage in efforts to get the current.



My prop code

pub Calc_Volts | amps

  amps := 0.00026497
  microVolts := 0.000076295
  
  Volts := MAT.FMul(mat.ffloat(Board_temp), microvolts)
  Resistance := Mat.Fdiv(Volts,amps)
  Steinhart_Hart
    
pub Steinhart_Hart   | ScrapBit1 

    '1/K = [noparse][[/noparse]A + B log ( r ) ] + [noparse][[/noparse]C log ( R ) ^3]
  
     
     ScrapBit := G.Log10(resistance)
     Scrapbit1 := G.Fmul (scrapbit , StHeart_B)
     ScrapBit1 := G.Fadd (Scrapbit1, StHeart_A)
     
     ScrapBit2 := G.Fmul(ScrapBit, ScrapBit)
     ScrapBit2 := G.Fmul(ScrapBit2, ScrapBit)'cube
     ScrapBit3 := G.Fmul(ScrapBit2, StHeart_C)'mul to C
     
     ScrapBit3 := G.Fadd(scrapBit1,ScrapBit3)

     Kelvin := G.Fdiv ((G.FFloat(one)),scrapBit3)
     Celsius  := G.Fsub(Kelvin, Con_Celsius)
     G.stop


Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-21 17:58
    Measure the voltage across the thermistor (call it Vt). The voltage across the 10K resistor depends on the voltage across the thermistor and the supply voltage (Vdd) which I hope is fixed and known. The same current flows through the 10K resistor and the thermistor (I = V / R = (Vdd - Vt) / 10K). The thermistor value is R = V / I = Vt / ((Vdd - Vt) / 10K).
  • Tracy AllenTracy Allen Posts: 6,660
    edited 2008-06-21 18:54
    Algebra, not calculus (lucky you!)

                   10k                Rt
    +5 ------/\/\/\-----o-----/\/\/\----gnd
                             Vt
    



    Vt = 5000 * Rt/(Rt+10000) voltage divider equation, Vt is measured across Rt

    keep it in ohms and millivolts for integer scaling,

    solve for Rt

    Rt = 10000 * Vt / (5000 - Vt)

    For example, if you see Vt = 2501 milivolts, then R = 10008 ohms.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com

    Post Edited (Tracy Allen) : 6/21/2008 7:02:21 PM GMT
  • grasshoppergrasshopper Posts: 438
    edited 2008-06-21 21:03
    I guess what i am trying to say is that how can I find Total Current when R2 resistance will vary depending on temperature. I can do the voltage divider concept, but since R2 is never know then I am at a loss. I think that the current will change depending on R2s resistance that also changes.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-21 21:11
    Please reread my previous note. As long as you know the supply voltage, you don't need to know the actual current.
  • grasshoppergrasshopper Posts: 438
    edited 2008-06-21 21:20
    damn !

    Sorry i see what you mean now. Took a cold beer and now i understand.

    R = V / I = Vt / ((Vdd - Vt) / 10K)

    Perfect way to put it.

    I got to slow down at times. Thanks again fellas
Sign In or Register to comment.