Is this temperature setup correct?
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
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
--- 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
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