Shop OBEX P1 Docs P2 Docs Learn Events
Is this temperature setup correct? — Parallax Forums

Is this temperature setup correct?

ArchiverArchiver Posts: 46,084
edited 2001-12-29 08:31 in General Discussion
Maybe someone can confirm that I am doing this properly. I am attempting to make
a temperature probe. I followed Tracy's design using a LM34 and I hooked it up
to a 0831 ADC. I set the Vref to Vdd. Vin is attached to GND.

I am using the following to read the data.

datain var byte
temp var word
low 3
low 4
pulsout 4,10
shiftin 5, 4, msbpost,[noparse][[/noparse]datain\8]
high 3
temp = datain*2
debug dec temp,cr

I am getting what appears to be the proper temperature reading. I guess since I
am fairly new to this I just want to double check that I am doing it properly.
Suggestions are always welcome! Thanks!

Hank

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-12-29 02:09
    Does anyone here knows how to interface the sensor w/ ADC08832?

    --- In basicstamps@y..., "rcvehicles" <rcvehicles@y...> wrote:
    > Maybe someone can confirm that I am doing this properly. I am
    attempting to make a temperature probe. I followed Tracy's design
    using a LM34 and I hooked it up to a 0831 ADC. I set the Vref to Vdd.
    Vin is attached to GND.
    >
    > I am using the following to read the data.
    >
    > datain var byte
    > temp var word
    > low 3
    > low 4
    > pulsout 4,10
    > shiftin 5, 4, msbpost,[noparse][[/noparse]datain\8]
    > high 3
    > temp = datain*2
    > debug dec temp,cr
    >
    > I am getting what appears to be the proper temperature reading. I
    guess since I am fairly new to this I just want to double check that
    I am doing it properly. Suggestions are always welcome! Thanks!
    >
    > Hank
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-29 08:31
    Hank,

    I think the program might need a [noparse][[/noparse]datain\9] instead of [noparse][[/noparse]datain\8]
    (typo?). That is because the ADC0831 clocks out a dummy bit ahead of
    the real 8 data bits. With the reference of 5.0 volts, the
    resolution should be about 20 millivolts (5.0 volts/256 steps =
    0.01953 volts per step). Multiplying the raw count by 2 (as you did)
    gives the temperature in degrees F. Yes.

    If you want to multiply by the more accurate 1.953 instead of by 2.00, use
    temp = datain**62456+datain
    (that with the 5.0 volt reference)

    The resolution with the 8 bit converter is only ~2 degrees F. You
    could use a 2.56 volt or even a 1.28 volt reference on the ADC0831 to
    increase the sensitivity to 1 or 0.5 degree F.

    -- regards,
    Tracy Allen
    electronically monitored ecosystems
    mailto:tracy@e...
    http://www.emesystems.com




    >Maybe someone can confirm that I am doing this properly. I am
    >attempting to make a temperature probe. I followed Tracy's design
    >using a LM34 and I hooked it up to a 0831 ADC. I set the Vref to
    >Vdd. Vin is attached to GND.
    >
    >I am using the following to read the data.
    >
    >datain var byte
    >temp var word
    >low 3
    >low 4
    >pulsout 4,10
    >shiftin 5, 4, msbpost,[noparse][[/noparse]datain\8]
    >high 3
    >temp = datain*2
    >debug dec temp,cr
    >
    >I am getting what appears to be the proper temperature reading. I
    >guess since I am fairly new to this I just want to double check that
    >I am doing it properly. Suggestions are always welcome! Thanks!
    >
    >Hank
Sign In or Register to comment.