Searching \ for 'changed to [EE]:' in subject line. ()
Make payments with PayPal - it's fast, free and secure! 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.
PICList Thread
'changed to [EE]:'
2003\02\07@114510 by Ian McLean

flavicon
face
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
10bit AD on the PIC.  The good thing about this device is it is linear in
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}

2003\02\07@121014 by John Dammeyer

flavicon
face
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}

2003\02\07@121636 by Ian McLean

flavicon
face
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}

2003\02\07@121824 by Ian McLean

flavicon
face
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
[spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU]On Behalf Of John Dammeyer
Sent: Saturday, 8 February 2003 4:05 am
To: .....PICLISTKILLspamspam@spam@MITVMA.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

2003\02\07@123011 by Spehro Pefhany

picon face
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"
RemoveMEspeffTakeThisOuTspaminterlog.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

2003\02\07@132429 by Ian McLean

flavicon
face
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:
((AD+1)*5)/1024.  Is this correct ?

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}

2003\02\07@135639 by Spehro Pefhany

picon face
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.

Try adding 0.5 LSB to the number read. Eg. if the reading is 1, we expect
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"
spamBeGonespeffspamBeGonespaminterlog.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

2003\02\07@142429 by Wagner Lipnharski

flavicon
face
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

2003\02\07@144316 by Ian McLean

flavicon
face
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}

2003\02\07@145121 by Ray Gallant

flavicon
face
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" <TakeThisOuTianmcleanEraseMEspamspam_OUTOPTUSHOME.COM.AU>
To: <RemoveMEPICLISTspamTakeThisOuTMITVMA.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}

2003\02\07@150622 by Ian McLean

flavicon
face
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}

2003\02\07@152448 by llile

flavicon
face
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 <speffEraseMEspam.....INTERLOG.COM>
Sent by: pic microcontroller discussion list <EraseMEPICLISTspamMITVMA.MIT.EDU>
02/07/2003 11:27 AM
Please respond to pic microcontroller discussion list


       To:     RemoveMEPICLISTEraseMEspamEraseMEMITVMA.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"
RemoveMEspeffspam_OUTspamKILLspaminterlog.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

2003\02\07@153627 by Ray Gallant

flavicon
face
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,
feel free to ask me directly.  Your right about other factors affecting
reading.  Got hit with sensor self-heating coefficient once, yum!  Good
weekend, u-all, {slewrate}

----- Original Message -----
From: "Ian McLean" <RemoveMEianmcleanTakeThisOuTspamspamOPTUSHOME.COM.AU>
To: <EraseMEPICLISTspamspamspamBeGoneMITVMA.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}

2003\02\07@160821 by Peter L. Peres

picon face
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

2003\02\07@163106 by Peter L. Peres

picon face
On Fri, 7 Feb 2003, RemoveMEllileKILLspamspamSALTONUSA.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

2003\02\07@212006 by llile

flavicon
face
*>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

2003\02\07@213901 by Andrew Warren

flavicon
face
llile@saltonusa.com <PICLISTSTOPspamspamspam_OUTmitvma.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?

   The answer to the above is sometimes contrasted with the answer
   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 -- spamBeGoneaiwSTOPspamspamEraseMEcypress.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

2003\02\10@102915 by llile

flavicon
face
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 <KILLspamaiwspamBeGonespamCYPRESS.COM>
Sent by: pic microcontroller discussion list <EraseMEPICLISTspamEraseMEMITVMA.MIT.EDU>
02/07/2003 08:46 PM
Please respond to pic microcontroller discussion list


       To:     @spam@PICLIST@spam@spamspam_OUTMITVMA.MIT.EDU
       cc:
       Subject:        Re: changed to [EE]:


spamBeGonellilespamKILLspamsaltonusa.com <.....PICLISTspam_OUTspammitvma.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?

   The answer to the above is sometimes contrasted with the answer
   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 -- TakeThisOuTaiw.....spamTakeThisOuTcypress.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
TakeThisOuTpiclist-unsubscribe-requestKILLspamspamspammitvma.mit.edu>

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