Shop OBEX P1 Docs P2 Docs Learn Events
BS2 Accuracy — Parallax Forums

BS2 Accuracy

Bsense524Bsense524 Posts: 11
edited 2010-05-02 22:18 in General Discussion
Hi, I am running into trouble with the sensitivity of sensors. I have the LM34 with a converter working on the BS2, however I am having trouble detecting small (& quick) changes in temperature. Perhaps the LM34 is physically limited for what I am trying to do, or maybe it is the software unable to adequately handle the tiny changes in voltage?

I would love to know if this is simply a LM34 limit or a BS2 limit.

Thanks in advance!

Comments

  • Tracy AllenTracy Allen Posts: 6,666
    edited 2010-04-10 19:08
    It is probably a converter limit. What converter are you using? The LM34 outputs 10mV per degree Fahrenheit, so if you have an 8 bit converter with a 5 volt reference the resolution is only 5000mV/256steps = 19.53125 mV, almost 2 degrees Fahrenheit. On the other hand, if you have a 12 bit converter with a 4.096 Volt span, then the resolution is 1 mV = 0.1 degF.

    Speed is a different issue, depending on mounting and limited by the thermal mass of the LM24 package. How "quick" are you talking about?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Bsense524Bsense524 Posts: 11
    edited 2010-04-10 22:26
    Well I am using a ADC0831, which is an 8bit converter I believe. That is interesting about the resolution. Would the BS2 be able to recognize the small resolution? I thought I read on another post that the Basic Stamp had some limitations in that respect.

    For speed, I wanted to see a change in temperature within or less than 1 second. I know there is a time constant of 10 seconds or so in air but since I'm not interested in the accuracy only the change, I thought this approach might work.

    So I am now wondering about the Limitations of the LM34 with the information above, and the Resolution limitations of the BS2.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-04-10 23:02
    In your case, the limiting factor is the ADC0831 which is an 8-bit ADC. As Tracy indicated, you're limited to a resolution of about 20mV which comes out to about 2 degrees F. If you use a 12-bit ADC like an LTC1298 (available from Parallax), you get a resolution of about 1.25mV which comes out to about 1/8 of a degree F. The BS2 can handle that just fine since it does its arithmetic with 16-bit words even though it can store data as 8-bit bytes as well as 16-bit words.

    Do remember that, even though the resolution may be on the order of a mV, your actual accuracy depends on the stability of your power supply and the amount of noise on the power supply and around the ADC and temperature sensor.
  • Bsense524Bsense524 Posts: 11
    edited 2010-04-11 15:19
    Thanks everyone, I'll post the results once I get the 12bitADC running.
  • Ken GraceyKen Gracey Posts: 7,401
    edited 2010-04-11 17:44
    Regarding the ADC0831, I think you can set a bias and span on that device and obtain 8 bits of resolution over a much narrower temperature range. I'm pretty sure there's an example of this in our Process Control book.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ken Gracey
    Parallax Inc.

    Follow me at http://twitter.com/ParallaxKen for some insider news.
  • Bsense524Bsense524 Posts: 11
    edited 2010-04-30 03:14
    Hi Ken, I read about the bias and spanning in the Process Document, but it seems that in order to control Bias I would need the Stamp Plot running. If I wanted a stand a lone system do you think I am still able to detect the smaller changes? Do you think a 12 bit converter would help? I did order a 12 bit converter but I until I am still concerned it is a physical limitation of the sensor.

    Am I missing something from the process pdf that still might help?

    Thanks again in advance.
  • RDL2004RDL2004 Posts: 2,554
    edited 2010-04-30 05:50
    Here is a program for use with an ADC0831 and a LM34 to measure temperature with 0.5 degree resolution by using offset and span.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Rick

    Post Edited (RDL2004) : 4/30/2010 5:55:09 AM GMT
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2010-04-30 06:20
    The LM34 is an analog sensor and as such has "infinite" resolution. With a modicum of care the resolution can be 0.1 degree Fahrenheit. That is close the resolution of a 12 bit converter. An ADC0831 with a Vref=0.64 volts would have good resolution too, about 0.25 degree Fahrenheit.

    Quick response is another thing. The TO92 case does have a thermal time lag that will not keep up well with small quick changes on the order of less than a second. For that you would need a tiny thermistor or a thermocouple. What are you measuring?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Bsense524Bsense524 Posts: 11
    edited 2010-04-30 20:15
    Thanks Rick, I will try it out and reply a response with my findings if I get it working.

    Tracy, I'm measuring small quick changes in temperature. I understand there are other sensors to detect similar changes in surroundings, but I'm currently focusing on temp. Accuracy of the actual temperature is irrelevant, only the delta. Thermistor or thermocouple.. what do you suggest? I found the thermocouple kit on parallax for 35$ But I would like something far cheaper.
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2010-05-01 15:19
    Well, accuracy and delta are connected. If the temperature cycles up and down from 37°C to 38°C at 1 second per cycle, the LM34 will only go up an down about 1/10 of a degree and it will lag behind the actual temperature change. That is due to the thermal time constant of the package. The actual temperature sensor is buried in a block of plastic, and heat takes time to flow in and out. So if you are interested in the delta, you will only be seeing a fraction of it. Does that matter?

    Are you measuring in gas, liquid or solid?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Bsense524Bsense524 Posts: 11
    edited 2010-05-02 22:18
    If I understand, the temp change in the sample is 1 deg, 37-38, but because the sensor is buried inside the plastic holding the the sensor, the detected temp change from 37 - 38 takes time. That is the time constant associated with these parts I think? So, to answer your question, no it doesnt matter that the change detected is only a fraction of the actual change.

    I'm testing in gas, but I'd like to put the sensor in water, but I guess the time constant will increase in liquid? It doesn't need to be lightning fast (though it would be nice), I just want to know where the limit is for an affordable price.
Sign In or Register to comment.