Shop OBEX P1 Docs P2 Docs Learn Events
Thermistor — Parallax Forums

Thermistor

wiresalotwiresalot Posts: 40
edited 2011-01-18 11:24 in BASIC Stamp
Hello

I am using RCTIME with a thermistor to calculate temperature.
Is there a way i can skip the rc time code, so it only runs that part of the program every 1000 or so
loops? Running RCTIME every loop is causing the thermistor to heat it self.

Thanks,

wiresalot

Comments

  • $WMc%$WMc% Posts: 1,884
    edited 2011-01-14 18:49
    Yes!
    '
    Post your code and we can help you with the change.
  • ercoerco Posts: 20,256
    edited 2011-01-14 19:01
    Sure, if your temp isn't changing very fast, we won't make you read your thermistor any faster than you want. :) Hard to believe it's heating up; not that much current is running through it. Attach your schematic and code if you want Forum help. Cheers.
  • wiresalotwiresalot Posts: 40
    edited 2011-01-14 19:04
    Cool!

    This is just a test program, im still learning.

    It works, but doesnt mean the code is correct.
    The schematic is the same as in the "Whats a micro controller" book. just replaced the resitor with a thermistor.

    Im just checking room temperature. I know it isnt linear.

    Thanks
    wiresalot
  • bsnutbsnut Posts: 521
    edited 2011-01-15 00:05
    wiresalot,
    I like the screen name that you picked out.

    You can try a A/D Converter TLC548, which takes the analog voltage from the thermistor and converts it into digital equivalent number that is read by the SHIFTIN instruction. The two things A/D Converters provide you is.
    1. 8 bit resolution
    2. 40,000samples per second

    One drawback is it uses 3 I/O pins in stead of one pin like RCTIME does.
  • wiresalotwiresalot Posts: 40
    edited 2011-01-15 07:55
    Thanks,

    I seen that in my searching, dont like the fact that it does use three pins. I dont need alot of resolution just measuring
    air temperature. Did some researching on J thermocouples, (we use them at work). That would be the sweetist solution.

    Thanks for the replies!
    wiresalot
  • $WMc%$WMc% Posts: 1,884
    edited 2011-01-15 18:51
    wiresalot:
    '
    Take a look at the DS2760 T/C reader. It will read type "k","J',and "T" T/Cs
    Its very accurate as well.
    http://www.parallax.com/tabid/768/txtSearch/DS2760/List/0/SortField/4/Default.aspx
  • wiresalotwiresalot Posts: 40
    edited 2011-01-16 07:38
    Yes already bought that, I have a BS2 and it only works on a BS2p Series.

    Maybe its time to upgrade to the next micro controller :)

    Thanks

    wiresalot
  • ercoerco Posts: 20,256
    edited 2011-01-16 18:07
    Unless you're measuring extreme temps, a thermistor may be your best bet for simplicity & accuracy, once you calibrate it. Thermocouples require a lot of attention & calibration to the electrical connections.
  • wiresalotwiresalot Posts: 40
    edited 2011-01-17 16:02
    Thanks erco,

    I did my calibration, with an idustrial thermometer a cal3200.

    I have figuered out my calculation to be : temp-236/27.5=a , 100-a= nbvar

    this works on paper, I cant seem to get the math to work in my programing,

    My code is for the math:

    HIGH 10
    PAUSE 1
    RCTIME 10, 1, temp
    nbvar = (temp - 236 / 27.5) = "a" , 100 - "a"
    DEBUG HOME, "time= ", DEC4 nbvar

    -temp is a Word
    nbvar is a PINK variable

    Thanks

    wiresalot
  • ercoerco Posts: 20,256
    edited 2011-01-17 16:45
    Think you have a syntax error in your line:

    nbvar = (temp - 236 / 27.5) = "a" , 100 - "a"

    What are you trying to do?
  • bsnutbsnut Posts: 521
    edited 2011-01-18 00:24
    I agree with erco, what are you trying to do here?

    You can acquire an R-T (Resistance – Temperature) conversion table from the maker of this thermistor. What this table provides you with the resistance values that to the corresponds to temperature values of the thermistor you using, which should help you with the math that you need to do.
  • wiresalotwiresalot Posts: 40
    edited 2011-01-18 09:10
    Hello, I just need how to do math in the code.

    Take my RCTIME subtract 236, divide that answer by 27.5 = a

    100-a= nbvar
    Thanks

    wiresalot
  • bsnutbsnut Posts: 521
    edited 2011-01-18 11:24
    It's not that hard and here is the basics
    nbvar = 100 - 27.5/236 - result
    
    or you can do this. Because the stamps like working with whole numbers
    nbvar = 100 - 27/236 - result
    
    I would do test program using both, so you can see what is going on. One thing you will see is a negative result in "nbvar". That, why this may work better
    nbvar = 27/236 - result
    
Sign In or Register to comment.