Shop OBEX P1 Docs P2 Docs Learn Events
thermistor and ADC — Parallax Forums

thermistor and ADC

dreed75dreed75 Posts: 11
edited 2005-03-13 22:03 in BASIC Stamp
I am trying to get a thermistor/ADC combo to get a temperature difference of .1 degrees.· I have to use the thermistor as part of the voltage divider and voltage range that is outputted by this divider is 3.1 to 4 vdc.· This doesn't show much deflection in the·ADC because the reference voltage is 5 volts.· The resistance of the thermistor varies from 85 deg (1700 ohms) to 68 deg (2500 ohms).· So no matter what resistor I use as the R1 of the voltage divider, I always get minimun deflection so I can't measure down to the .1 degree.· The ADC I use is an 0831 8 bit serial ADC.· I know if I get one with a higher resolution, it will work better but I was wondering if there was a better way than using a voltage divider, like maybe a transistor or an op-amp so that when the thermistor is at it's lowest resistance I will get close to 5 volts and when it is at it's highest resistance I will get close to 0 volts.· If I can figure that out, I can get down to the .1 degree.· I am not too sure if any will work better but there are smarter people than me out there.

Thanks,
David

Comments

  • dreed75dreed75 Posts: 11
    edited 2005-03-10 06:51
    Yeah, I lowered the reference voltage but maybe I didn't do it right.· I changed it to 2.55 volts so that I would get a .01 volt difference every 1 change on the ADC (ADC is 8-bit so 255 is the highest it goes).· This was more accurate per change but with the voltage divider now set at 2.55 as the max it would allow through (so I don't burn it up) on the low point of the thermistor, the voltage is 1.70 volts and the high point is 2.55.· That is not big enough of a difference to calculate .1 degrees.· Bascially I figured out that I would need to get each ohm difference which would be a range of 800 ohms.· So now I guess my little 8-bit ADC wont work anymore because it only goes up to 255.· I think I need·a 12-bit one.· That way it has 4096 or something and hopefully I can find a free 800 space in it using my voltage divider.· Does this make sense to anyone?· I am not sure it makes sense to me.



    David
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-10 07:08
    sorry deleted the previous post, the is quite possibly a better way of doing it, my advice seemed too vague. Perhaps use the thermistor as the feedback resistor of the opamp, set your input voltage and resistors appropriately.

    If your voltage in is upto 4 volts I dont think using a reference lower than that will help. Your likely going to need a better interface circuitry to get the precision you want rather than a simple voltage divide, how about a bridge?

    PS see my PM.

    Post Edited (Paul Baker) : 3/10/2005 7:11:39 AM GMT
  • dreed75dreed75 Posts: 11
    edited 2005-03-10 07:12
    I don't really know much about op-amps so I don't know what kind of schematic you are referring to with the feedback resistor and the input voltages.· Do you have a schematic of this?· I just threw out the op-amp idea because I have sortof an idea of how it works but no clue on how to hook it up.· Thanks for your help.

    David
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-10 07:18
    Its real late, gotta goto bed, Ill draw it for you during my lunch break tomorrow and post it, meanwhile read this:

    http://civil.colorado.edu/courseware/struct_labs/wheatstone.html·(basic info)

    http://www.efunda.com/designstandards/sensors/methods/wheatstone_bridge.cfm·(detailed info)

    and play with this vitual bridge circuit http://www.dwiarda.com/scientific/Bridge.html
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-03-10 07:54
    Hi David,

    The ADC0831 has differential inputs and a separate reference terminal.

    You reported that the voltage goes from 3.1 to 4 volts with one divider you tried, as span of 0.9 volt. Let's go with that.

    Use a potentiometer to apply 0.9 volt to the reference input, pin 5. The reference input has a fairly low resistance (~3.5 kohms) so you have to use a fairly low resistance potentiometer (5kohms or so) to make the adjustment.

    Now, with a second potentiometer (10 kohms), apply 3.1 volts to the (-) input, pin 3.

    Apply your signal from 3.1 to 4 volts to the (+) input, pin 2.

    Viola' The digital output should now go from 0 to 255 as your input voltage goes from 3.1 to 4 volts.

    It won't be too too accurate with that low a reference voltage, but you will get the resolution you need.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • BorisBoris Posts: 81
    edited 2005-03-10 14:31
    something to think about:

    How precise is that thermistor? If its just a simple cheap kind from Rat Shack, then its not precise enough to give you 0.1C resolution. Of course you can measure the voltage with a 16bit ADC, and get 0.001C precision, but it doesnt mean anything in real life because the thermistor is just not accurate enough to provide that kind of resolution.

    Boris.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-10 14:44
    Tracy: that was along the advice I gave him in the PM to remove the DC component and use a lower ref, but I was so weary by that time, I didnt look up the specs of the ADC he already had on hand, If I had that would have provided a direct path to an answer, thanks. Now I can spend my lunch break doing something else [noparse]:)[/noparse]
  • dreed75dreed75 Posts: 11
    edited 2005-03-10 20:38
    Tracy: According to the specs of the ADC, pin 3 should be grounded.· Is this just really a reference point for the lower end of the range?· If so, that would be perfect.· Thanks for your help.· I'll be experimenting with it.

    Boris: I haven't had much experience with thermistors to know how precise it is compared to others but the range of this thermistor that matters is 1700-2500 ohms which represents a temperature of·85 to·70.4 degrees.· This would get me about 54 ohms per deg (F).· Also, this would be about 5 ohms per .1 deg.

    Thanks for everybody's help.

    David

    Post Edited (dreed75) : 3/13/2005 9:29:13 PM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2005-03-10 21:32
    David said...

    This would get me about 54 ohms per deg (F)

    This assumes that your thermistor is linear.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe - Mask Designer III

    National Semiconductor Corporation
    (Communication Interface Division)
    500 Pinnacle Court, Suite 525
    Mail Stop GA1
    Norcross,GA 30071
  • dreed75dreed75 Posts: 11
    edited 2005-03-10 21:35
    Yes, it is linear.· The TO says that 5 plus or minus 1 ohm is .1 degrees F.
  • dreed75dreed75 Posts: 11
    edited 2005-03-12 00:52
    Well I tried Tracy's idea but it doesn't set the lower ref.· It should work but it still reads just like it used to.· I double-checked and it is getting 3.1 volts at pin 3.· I am just going to get the 12-bit one from Parallax's accessory page cause I think I need better resolution and it also has the lower ref.· Thanks for everybody's help.· I am sure I'll be back soon [noparse]:)[/noparse].

    David
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-12 01:12
    Honestly I dont think the higher rez will not provide you much help if any at all, it sounds as though your just interfacing it wrong. Try to get every last bit of useful information out of what you have before making the determination that you need more precision.
    First off according to tracy's directions pin 3 should be at 3.1V, its the DC bias your subtracting from your signal, the value your concerned about is the digital one the converter produces, your digital value shoud be D= (Vin-Vdc)*Vref/256, where (Vin-Vdc)<Vref. I maybe slightly off on the equation since its from my head.
  • dreed75dreed75 Posts: 11
    edited 2005-03-12 01:24
    I did put the 3.1V at pin 3 but reading her post again, I did not have .9V at pin 5.· I don't think this is a good idea because you shouldn't have a higher input voltage at pin 2 than pin 5.· If the chip is thinking that .9V is the highest, then the output will always read 255 unless it goes below .9V at pin 2.· The reason I decided to go with a higher resolution was because I decided that I would want to know every single ohm that changed.· When we are dealing with millions of dollars worth of equipment it is best to know every detail.· That way there is less margin of error.· I already paid for the new chips coming in and they definitely have a "low" ref so I'll play around with Tracy's idea since I am not too worried about frying it now and I just want to see if it works.· She's pretty smart so there probably won't be any problems.· Thanks.

    David
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-12 02:14
    I think your confusing things abit, pin 2 - pin 3 should be less than pin 5, in Tracy's setup the degree of resolution is 3.5 mV or 3 and 1/8 Ohm. There is an upper·limit on obtainable precision with any sensor due to internal noise, you'll need to consult the spec sheet for the thermistor to determine what that is.

    And I beleive Tracy is a guy, though I've never asked so I could be wrong, Tracy is the masculine (Tracy Byrd, Tracy McGrady) and Tracey is feminine (Tracey Ullman), but there are exceptions (Tracy Chapman).

    Post Edited (Paul Baker) : 3/12/2005 2:20:15 AM GMT
  • dreed75dreed75 Posts: 11
    edited 2005-03-12 04:35
    Yeah I probably am confusing things, after all, I am a noob and you guys are experts.· As far as the accuracy of the thermistor, I can't really get a spec sheet for it because I am not sure what kind it is.· Thanks for your help.

    Tracy: I am sorry if you are a guy and I called you a girl.· I personally know like 3 Tracy's and they are all girls so it was natural for me to picture a girl.

    David

    Post Edited (dreed75) : 3/13/2005 9:28:29 PM GMT
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-03-13 17:36
    Yes, guy am I. No offence taken.

    The LM0831 data sheet has lots of example circuits at the end, and application notes. It always pays off _big time_ to get ahold of the data sheet (just google "LM0831 data sheet") and really look it over. National Semi is notable for having well written and accurate data sheets. There may also be a separate white paper of application notes.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • dreed75dreed75 Posts: 11
    edited 2005-03-13 21:16
    Yeah, I used the datasheets·but I had never scrolled all the way down to the bottom before last night.· They even have the exact thing I was trying to do with a thermistor and it works perfectly. Thanks for your help.· I am posting the schematic for anyone who is reading this that has the same problem as me.
    502 x 307 - 14K
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-03-13 21:41
    The LM336 is a reference diode.
    bugg

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    But I canna change the laws of physics, Captain!
  • dreed75dreed75 Posts: 11
    edited 2005-03-13 21:43
    In the schematic it is a LM335 which is a precision temperature sensor.

    David
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-13 21:57
    Congrats on getting it functional, does the circuit provide you with enough precision?
  • dreed75dreed75 Posts: 11
    edited 2005-03-13 22:03
    Thanks goes to all you guys but it still isn't enough precision.· But that is the limit of the chip not your advice.· I am glad I got the most out of it that I could though.· I can still use this for future products so it is no loss at all.

    David
Sign In or Register to comment.