Math! analogue or digital temperature sensor ?
Archiver
Posts: 46,084
--- In basicstamps@yahoogroups.com, "Kristoffer M. Hain" <haink@k...>
wrote:
> First off, thanks for everyone's reply on my DIG problem...got that
working
> well. Now, what I'm trying to do is rather complex (for me!)
>
> I need my bs2p to crunch this:
>
> TEMP = ((2.294 + (255 - ADCVAL) * (1.5) / 255) - 2.294) / (0.01 /
1.8) - 40
>
> TEMP is going to be an output temperature, and it can be an integer
value,
> I'm not worried about 78.2 or something silly like that. 78 is
> fine. ADCVAL is a number from 0-255, coming from an ADC0831.
Is there
> a better way to do this? I'm using an LM335AZ Precision temp
sender with
> the ADC...which are both fairly common chips, and I have all the
code to
> SHIFTIN from the chip....just need to convert the 0-255 to a
useable
> temperature. I know the above formula will do what I want, because
I have
> that line in a VB program I wrote a while back that uses both of
those
> chips....
>
> Thanks!!
> Kris Hain
My first question is that if precision is not important, why use
analogue ?
LM70, 3 wire SPI serial will offer better resolution with more
simplicity.
Dave
Dave
wrote:
> First off, thanks for everyone's reply on my DIG problem...got that
working
> well. Now, what I'm trying to do is rather complex (for me!)
>
> I need my bs2p to crunch this:
>
> TEMP = ((2.294 + (255 - ADCVAL) * (1.5) / 255) - 2.294) / (0.01 /
1.8) - 40
>
> TEMP is going to be an output temperature, and it can be an integer
value,
> I'm not worried about 78.2 or something silly like that. 78 is
> fine. ADCVAL is a number from 0-255, coming from an ADC0831.
Is there
> a better way to do this? I'm using an LM335AZ Precision temp
sender with
> the ADC...which are both fairly common chips, and I have all the
code to
> SHIFTIN from the chip....just need to convert the 0-255 to a
useable
> temperature. I know the above formula will do what I want, because
I have
> that line in a VB program I wrote a while back that uses both of
those
> chips....
>
> Thanks!!
> Kris Hain
My first question is that if precision is not important, why use
analogue ?
LM70, 3 wire SPI serial will offer better resolution with more
simplicity.
Dave
Dave
Comments
for standardization across the board on any projects I use that require
temperature. I know it's kinda overkill.....
>--- In basicstamps@yahoogroups.com, "Kristoffer M. Hain" <haink@k...>
>wrote:
> > First off, thanks for everyone's reply on my DIG problem...got that
>working
> > well. Now, what I'm trying to do is rather complex (for me!)
> >
> > I need my bs2p to crunch this:
> >
> > TEMP = ((2.294 + (255 - ADCVAL) * (1.5) / 255) - 2.294) / (0.01 /
>1.8) - 40
> >
> > TEMP is going to be an output temperature, and it can be an integer
>value,
> > I'm not worried about 78.2 or something silly like that. 78 is
> > fine. ADCVAL is a number from 0-255, coming from an ADC0831.
>Is there
> > a better way to do this? I'm using an LM335AZ Precision temp
>sender with
> > the ADC...which are both fairly common chips, and I have all the
>code to
> > SHIFTIN from the chip....just need to convert the 0-255 to a
>useable
> > temperature. I know the above formula will do what I want, because
>I have
> > that line in a VB program I wrote a while back that uses both of
>those
> > chips....
> >
> > Thanks!!
> > Kris Hain
>
>
>
>
>My first question is that if precision is not important, why use
>analogue ?
>
>LM70, 3 wire SPI serial will offer better resolution with more
>simplicity.
>
>Dave
>
>Dave
>
>
>
>To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
>from the same email address that you subscribed. Text in the Subject and
>Body of the message will be ignored.
>
>Yahoo! Groups Links
>
>
>
>