Shop OBEX P1 Docs P2 Docs Learn Events
convert LTC1298 output to temperature — Parallax Forums

convert LTC1298 output to temperature

MikeSMikeS Posts: 131
edited 2004-12-02 19:52 in BASIC Stamp
I have an LM34 connected to a LTC1298 ADC.
Will the formula below work to calculate the temperature?

AD = output of LTC1298
819 = 1/1.22mv (AD resolution)

v1 = AD/819· (hundreds degress)
v2 = (AD//819)*10·(tens degrees)
v3 = (v2/819)·
v4 = (v2//819)*10· (ones degrees)
Anyone know of a different method?

Comments

  • Tracy AllenTracy Allen Posts: 6,658
    edited 2004-12-02 18:46
    The easier way is to use the Stamps' */ or ** operator. As you noted, the LTC1298 with a 5 volt reference gives 1.221 millivolts per bit (5 volts / 4096 steps). The LM24 gives 10 millivolts per degree Fahrenheit, so the conversion from counts to Fahrenheit is 0.1221 degF per bit. On the Stamp, use,

    degF = ADCounts ** 8002

    Why 8002? The fraction 8002/65536 is a close approximation to 0.1221. To find that factor, you are simply solving this equation:

    factor / 65536 = 1221 / 10000

    Internally, when the Stamp sees the ** operator, it multiplies together the two numbers and divides by 65536 (2^16).

    Look at the help on the ** and */ operator, and this URL:
    www.emesystems.com/BS2math1.htm

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • MikeSMikeS Posts: 131
    edited 2004-12-02 19:52
    Thanks Tracy,

    I figured there was an easier way. You explained the ** operator very well and I posted your BS2 math link in my Stamp favorites.

    I Appreciate it!

    Mike
Sign In or Register to comment.