Searching \ for 'changed to [EE]:' in subject line. ()
Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=OT%5D
Search entire site for: 'changed to [EE]:'.

Truncated match.
'changed to [EE]:'
2003\02\07@114510 by

Tempurature sensing is something I have done a lot of.  I am doing ~0.4
degree accuracy tempurature sensing with an LM335H, mostly limited by the
output so no approximations are necessary.  No op amps required either.  And
the device can be calibrated using a 10K pot.

DegreesC = (AD Count/(1023/5)*100) - 273.15 + 2.54 ... simple as that.  The
only fudge constant in here is the 2.54 scaling factor.  The 273.15 is the
conversion from Kelvin to Celsius.  The output in volts = degrees
Kelvin/100.  The 1023/5 is obviously the conversion from AD count back to
volts using 10bit A/D.

The only trouble with this sensor is that it's range is limited to -40C to
100C, so it is not suitable for you.

The Pt100 is reasonably linear to about 450C - so a similar formula should
work for you with appropriate divider and scaling factor.  You can work out
your volts per degrees using the method described by Ren.

{Original Message removed}
Hi,

I'm using the LM235 for automotive oil and water temperature sensing and
it's good to 125C.

But you raise an interesting point.  Should the voltage per bit be
5V/1023 or 5V/1024?  After all,  you can buy a REF198 from analog
devices which has a rating of 4.096V  That divided by 4095 doesn't yield
as nice a number as 4.096/4096 ==> 1mV per bit.  Or in the case of the
10 bit A/D,  4.096/1024 ==> 4mV per bit.

Just curious.

John Dammeyer

Wireless CAN with the CANRF module now available.
http://www.canrf.com
Automation Artisans Inc.
Ph. 1 250 544 4950

> {Original Message removed}
If you think about it, the maximum 10bit number is 1023 not 1024, although
that is a moot point.  It should be 1023/5 or about AD/206.4.

{Original Message removed}
Oops AD/204.6 not AD/206.4  I get a little dislexic after 10 hours PIC
programming !

-----Original Message-----
From: pic microcontroller discussion list
[PICLISTMITVMA.MIT.EDU]On Behalf Of John Dammeyer
Sent: Saturday, 8 February 2003 4:05 am
To: PICLISTMITVMA.MIT.EDU
Subject: Re: changed to [EE]:

Hi,

I'm using the LM235 for automotive oil and water temperature sensing and
it's good to 125C.

But you raise an interesting point.  Should the voltage per bit be
5V/1023 or 5V/1024?  After all,  you can buy a REF198 from analog
devices which has a rating of 4.096V  That divided by 4095 doesn't yield
as nice a number as 4.096/4096 ==> 1mV per bit.  Or in the case of the
10 bit A/D,  4.096/1024 ==> 4mV per bit.

Just curious.

John Dammeyer

Wireless CAN with the CANRF module now available.
http://www.canrf.com
Automation Artisans Inc.
Ph. 1 250 544 4950

{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics
At 04:13 AM 2/8/2003 +1100, you wrote:
>If you think about it, the maximum 10bit number is 1023 not 1024, although
>that is a moot point.  It should be 1023/5 or about AD/206.4.

If you think about it a bit more.. the step size is Vref/2^10 = 5V/1024.

There are 1024 numbers from 0 to 1023 inclusive. Classic fence-post problem.

See, for example, the mid-range reference manual under "transfer function".

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
speffinterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics
You are right, but this is now confusing me.  I think my maths is actually
correct.

Scenario - your VRef is 5V.  You give a 5V input to the AD pin.  Your count
is 3ffh.

OK, now you want to convert back to volts.  (3ffh * 5)/1024 = 4.995 volts.
Err umm.

So what do you do ?  I guess to use 5/1024 I must add 1 to my AD count
first, so the correct formulae for AD to volts would then be:

How can this be ?  A reading of 0V (AD count = 0) would then give
((0+1)*5)/1024 = 0.005v

It seems to be out by 0.005 volts again.  Even if you are right, the
difference is outside the accuracy level of sensor and AD.  (I think I
mentioned it was a moot point).

If you use 5/1023, the counts convert back to volts correctly.

I am right, or am I missing something here ?

{Original Message removed}
At 05:21 AM 2/8/2003 +1100, you wrote:
>You are right, but this is now confusing me.  I think my maths is actually
>correct.
>
>Scenario - your VRef is 5V.  You give a 5V input to the AD pin.  Your count
>is 3ffh.
>
>OK, now you want to convert back to volts.  (3ffh * 5)/1024 = 4.995 volts.
>Err umm.

that the voltage is between 1 and 2  *  5V/1024 (middle is 1.5 bits).
If the reading is 0x3FE, the voltage should be between 1022 and 1023 * 5/1024
(middle 1022.5 * 5/1024 = 4.993). If the reading is 0x3FF, the voltage is
(ideally) greater than 1023 * 5/1024, the transition should take place at
4.995V.

>I am right, or am I missing something here ?

It's a zero issue, not a span issue.  It's no big deal at 1024 because it's
only 0.1% (in most cases) but with 8 bit resolution might cause problems.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
speffinterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics
Ian McLean wrote:
{Quote hidden}

In a 10 bits ADC, there is ONLY 1023 numbers different from zero, so, if
you want to exclude "zero" from your calculation results, you should use
the number 1023 in the calculation.  If the ADC gets a max count of 1023
and 1023 means the ONE (unity) of your span number, where 1 = X / 1023,
then X = 1023. So, if span = 5V, then the resolution would be 5/1023 =
4.887586mV.  This is why we always should choose a span number that creates
an easy math resolution.  Suppose you choose 4mV as resolution, then span
would be 1023 x 0.004 = 4.092V, or if reaching at least 5V is necessary,
then 5mV could be used, resulting in a span of 5.115V.  What is the
problem? none!  If your ADC reference is tied to a submultiple of 5.115V,
then your software math will be much easier.

You can't add 1 to the ADC output to offset it to 1024, since you turn zero
to one, then no zero will be there.

It seems confusing, but if you think about the absolute range of numbers
different than zero, then it turns clear, and zero you want to have in the
range...

Wagner.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics
Ah ah.  This explanation along with Spehro's and the one I just got from
John makes it much clearer to me what is going on here.

I think for sake of simplicity, I should just stick with 5/1023 as my
convertor - the difference is in the order of magnitude 10^-3, so rounding
makes absolutely no difference to the final result, and the maths is much
easier.

Thanks guys.  It is nice to hear explanations from different points of
views.  That is what makes the PICList singularly the most powerful resource
for PIC developers in my opinion, many intelligent people freely and
obligingly offering input on a common subject of interest.  What a great
think-tank this is.  In just 3 days of being subscribed to this list, I have
learnt so much !

At least I don't have to worry about the embarrassing prospect of updating
AD code in projects I have already completed because of the rather linear
approach of my calculations, because the order of magnitude of the error is
beyond the rounding of all results used to date, and my accuracy has not
suffered.

And to think, I was answering someone elses question here - and yet I learnt
something from it as well !

{Original Message removed}
Ian, just curious in regards to some details you mentioned about your
design.
0.4 Deg "C"? across the whole temperature range? What is your
temperature range? Do you use any software filters? Output resolution is?
Do you use floating point math to consider divide function remainders?  Do
you use a thrice standard to verify your design accuracy, and if so, what
kind of reference is it.  Thanks in advance for the feedback, Best Regards,
{slewrate}

----- Original Message -----
From: "Ian McLean" <ianmcleanOPTUSHOME.COM.AU>
To: <PICLISTMITVMA.MIT.EDU>
Sent: Friday, February 07, 2003 3:41 PM
Subject: Re: changed to [EE]:

> Ah ah.  This explanation along with Spehro's and the one I just got from
> John makes it much clearer to me what is going on here.
>
> I think for sake of simplicity, I should just stick with 5/1023 as my
> convertor - the difference is in the order of magnitude 10^-3, so rounding
> makes absolutely no difference to the final result, and the maths is much
> easier.
>
> Thanks guys.  It is nice to hear explanations from different points of
> views.  That is what makes the PICList singularly the most powerful
resource
> for PIC developers in my opinion, many intelligent people freely and
> obligingly offering input on a common subject of interest.  What a great
> think-tank this is.  In just 3 days of being subscribed to this list, I
have
> learnt so much !
>
> At least I don't have to worry about the embarrassing prospect of updating
> AD code in projects I have already completed because of the rather linear
> approach of my calculations, because the order of magnitude of the error
is
> beyond the rounding of all results used to date, and my accuracy has not
> suffered.
>
> And to think, I was answering someone elses question here - and yet I
learnt
> something from it as well !
>
> {Original Message removed}
I will need to review this now, but my results are tracking a digital
thermometer with a stated accuracy of 0.5C extremely accurately throughout
the range.

I suppose I should have said that 0.4 degrees in the resolution of my
results, not necessarily the accuracy.  In reality, that degree of accuracy
is very hard to achieve really, so the stated accuracy on the thermometer is
probably theoretical as well.  In the real world (i.e. not an ideal black
body in a hard vacuum), there are all sorts of things that would effect the
real accuracy - dissipation, component heating, Q, etc, etc.

I am reading ranges of -20 to 40 degrees.
The only software filtering I use is averaging over a number of readings.  I
also use an RC filter in hardware to remove jitter, and a pot for
calibration.
Output resolution is in the order of about 9bits from the maximum range of
10 bits.
I do use floating point maths and consider the divide function remainders,
which I use to round up or down the divisions given.
I am not sure what you mean exactly by a thrice standard, but if it is what
I think it is, then, no, but I would really like a third reference to check
my results.  My current reference standard (i.e. thermometer with "stated"
accuracy) is obviously not ideal.

{Original Message removed}
I take it the "Fence Post Problem" Has something to do with "How many gaps
are between 10 fence posts?"  Exactly what is it?

I think it relates to the mathematical bafflement I experienced at 6 years
old.  Here was my dilemma:

When you are counting seconds, you count the gaps between the second
markers.

When counting Sheep, you count heads.

I could never get it right, and I would always come up with one more or
one less than the teachers did.  This was quite frustrating, because I was
sure they were wrong.

-- Lawrence Lile

Spehro Pefhany <speffINTERLOG.COM>
Sent by: pic microcontroller discussion list <PICLISTMITVMA.MIT.EDU>
02/07/2003 11:27 AM
Please respond to pic microcontroller discussion list

To:     PICLISTMITVMA.MIT.EDU
cc:
Subject:        Re: changed to [EE]:

At 04:13 AM 2/8/2003 +1100, you wrote:
>If you think about it, the maximum 10bit number is 1023 not 1024,
although
>that is a moot point.  It should be 1023/5 or about AD/206.4.

If you think about it a bit more.. the step size is Vref/2^10 = 5V/1024.

There are 1024 numbers from 0 to 1023 inclusive. Classic fence-post
problem.

See, for example, the mid-range reference manual under "transfer
function".

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the
reward"
speffinterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics
Tx, Cool, if your looking for a dirt cheap self-made bench thermal chamber,
I made one from a cooler (peltier cooler driven) which ramps and tracks
about 1 degree.  I use it for sensor transmitter prototype tracking.  I use
4 RTDs for monitoring the chamber's  temperature (humidity is a another
topic).  The PIC base chamber control transmits temperature via PIC's usart
to my PC's spread sheet and so do the unit on test.  I track mostly percent
deviation of slope and print a calibration certificate.  If you want some
ideas to potentially help with calibration concepts or bench alpha test,
reading.  Got hit with sensor self-heating coefficient once, yum!  Good
weekend, u-all, {slewrate}

----- Original Message -----
From: "Ian McLean" <ianmcleanOPTUSHOME.COM.AU>
To: <PICLISTMITVMA.MIT.EDU>
Sent: Friday, February 07, 2003 4:03 PM
Subject: Re: changed to [EE]:

> I will need to review this now, but my results are tracking a digital
> thermometer with a stated accuracy of 0.5C extremely accurately throughout
> the range.
>
> I suppose I should have said that 0.4 degrees in the resolution of my
> results, not necessarily the accuracy.  In reality, that degree of
accuracy
> is very hard to achieve really, so the stated accuracy on the thermometer
is
> probably theoretical as well.  In the real world (i.e. not an ideal black
> body in a hard vacuum), there are all sorts of things that would effect
the
{Quote hidden}

what
> I think it is, then, no, but I would really like a third reference to
check
> my results.  My current reference standard (i.e. thermometer with "stated"
> accuracy) is obviously not ideal.
>
>
>
> {Original Message removed}
On Fri, 7 Feb 2003, John Dammeyer wrote:

*>Hi,
*>
*>I'm using the LM235 for automotive oil and water temperature sensing and
*>it's good to 125C.
*>
*>But you raise an interesting point.  Should the voltage per bit be
*>5V/1023 or 5V/1024?  After all,  you can buy a REF198 from analog
*>devices which has a rating of 4.096V  That divided by 4095 doesn't yield
*>as nice a number as 4.096/4096 ==> 1mV per bit.  Or in the case of the
*>10 bit A/D,  4.096/1024 ==> 4mV per bit.

Why divide by 4095 ? Divide by 4096. There are 4096 steps between 0 and
4095.

Peter

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics
On Fri, 7 Feb 2003, llileSALTONUSA.COM wrote:

*>When you are counting seconds, you count the gaps between the second
*>markers.
*>
*>When counting Sheep, you count heads.
*>
*>I could never get it right, and I would always come up with one more or
*>one less than the teachers did.  This was quite frustrating, because I was
*>sure they were wrong.

You are not the only one ... there is an easy fix: Real things start at 1
and abstract ones start at 0 ;-) What I did not understand was why maths
calls these real numbers natural ;-) ;-)

Peter

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics
*>When you are counting seconds, you count the gaps between the second
*>markers.
*>
*>When counting Sheep, you count heads.
*>
*>I could never get it right, and I would always come up with one more or
*>one less than the teachers did.  This was quite frustrating, because I
was
*>sure they were wrong.

>You are not the only one ... there is an easy fix: Real things start at 1
and abstract ones start at 0 ;-) What I did not understand was why maths
calls these real numbers natural ;-) ;-)

>Peter

Which reminds me:  There are only three types of people in the world.
Those who can count, and those who cannot.

Still my question remains - what exactly is the "fence-post problem"?

--Lawrence

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics
llile@saltonusa.com <PICLISTmitvma.mit.edu> wrote:

> what exactly is the "fence-post problem"?

It's nothing at all tricky, Lawrence, although some people seem
unable to acquire an intuitive sense for it.  It's just this:

You have a fence 100 meters long, with a post every meter.
How many posts do you have?

to this:

You have a fence enclosing an area whose perimeter is 100
meters, and there's a post every meter.  How many posts do
you have?

-Andy

=== Andrew Warren -- aiwcypress.com
=== Principal Design Engineer
=== Cypress Semiconductor Corporation
===
=== Opinions expressed above do not
=== necessarily represent those of
=== Cypress Semiconductor Corporation

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics
That's kinda what I thought.  I finally found some references to the
problem in computer-science  texts, namely, "Write a do-loop that prints
the following:"

1,2,3,4,5,6,7,8,9,10

but not

1,2,3,4,5,6,7,8,9,10,

It is easy to write a loop that will print the second sequence, but
slightly trickier to print the first esp. for a beginner.  And oh how many
times have I run into this problem?  I can think of a dozen,  Just didn't
have a name for it before.

-- Lawrence Lile

Andrew Warren <aiwCYPRESS.COM>
Sent by: pic microcontroller discussion list <PICLISTMITVMA.MIT.EDU>
02/07/2003 08:46 PM
Please respond to pic microcontroller discussion list

To:     PICLISTMITVMA.MIT.EDU
cc:
Subject:        Re: changed to [EE]:

llilesaltonusa.com <PICLISTmitvma.mit.edu> wrote:

> what exactly is the "fence-post problem"?

It's nothing at all tricky, Lawrence, although some people seem
unable to acquire an intuitive sense for it.  It's just this:

You have a fence 100 meters long, with a post every meter.
How many posts do you have?

to this:

You have a fence enclosing an area whose perimeter is 100
meters, and there's a post every meter.  How many posts do
you have?

-Andy

=== Andrew Warren -- aiwcypress.com
=== Principal Design Engineer
=== Cypress Semiconductor Corporation
===
=== Opinions expressed above do not
=== necessarily represent those of
=== Cypress Semiconductor Corporation

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestmitvma.mit.edu>

More... (looser matching)
- Last day of these posts
- In 2003 , 2004 only
- Today
- New search...