Temp readings and voltage input


Closed Thread
Results 1 to 21 of 21
  1. #1

    Default Temp readings and voltage input

    Hi all,

    i'm my 16F88 temp monitor project i have a LM35 sensor with no vref.
    The input voltage for the workbench was always 5v and everything is working perfectly.

    After moving for the pcb i have found an issue that puzzled me.

    For the PCB aplication i have it connected ( via 7805 ) to a 4.8V NiCd pack. This pack when fully loaded is 5.3V and after some use it drops to +-4.5V.

    This is causing some bad temperature readings when the pack drops bellow 5v.

    The code i used for temperature is like this :

    temp= (in */5000)>>2

    I have no vref because i can live with the 0.5ºC stepping ( 10Bit resolution ) and this code allows me to have an output like XXX,X.

    My question is:

    Is there a better code to be flexible with the input voltage and still have accurate readings ?

    Thanks

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Talking

    The answer is simple ...

    Use a Voltage Ref !!! a TL431 i.e is cheap, TO92 shaped, and easy to trim ...

    OR use a Temp to Digital ( DS18B20 i.e.) or temp to PWM ( SMT 160-30 i.e ) sensor ...

    No miracle to wait for !!!

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Use TL431 with care

    Hi,

    I personally prefer voltage references from the Microchip Analogue familiy. MCP1541 is which I use most. While using TL431 cap values are important and improper design causes noise which would set things up. Find the attachment and open in Microsoft Excel. It is a TL431 calculator. Make sure macros are turned on from your Excel security settings.
    Attached Files Attached Files
    Regards

    Sougata

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Default

    Hi, Sougata

    Thanks for the XLS sheet ...

    TL431 is to consider like a Zener diode ... noise involved !!!

    I always use a solid aluminium 10µF cap ( Alusol C 122 ) or tantalum cap ...

    With a good 4.5 digits multimeter for trimming - and quality components - ... performance is to compare to MAX or AD best voltage refs ...

    Not so bad, for such an oldie !!!

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Thanks Acetronics,sougata,

    The idea for the digital sensor has crossed my mind. Actually i would prefer but i have the problem that the DS18B20 does not reach 150C ( that i what ) and the SMT 160-30 is not available here

    I guess i will have to use the Vref. and have 2,5V there.

    I never used the vref on this chip. Correct me if i'm wrong here:

    In the data sheet it's marked Ra2 and RA3 as Vref- and Vref+.

    I may use only the Vref+ pin and set the ADCON1 REGISTER (ADDRESS 9Fh) like :

    ADCON1=%10100000

    And i have to change the code to:

    temp= (in */2500)>>2

    Is this right ?

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Talking The goal, always look for the goal ....

    Ha,ha,ha ...

    I think VENOM might tell you something !!!

    Now, this would be much easier to use a NTC Thermistor or a KTY 81-1xx NTC sensor.

    Just use a Lookup table with a linear regression between points ... and HOP, in the pocket ( as told the Kangaroo ... )

    ...

    BTW ... choose your "gas" carefully ... lots of degrees to win here !!!

    see :

    http://www.carburant-modelisme.com/

    and

    http://www.meccamo.com/fr/indexFR.htm

    for really serious blenders ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Acetronics,

    you lost me there...

    .

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Wink

    Hi, Ruijc

    Why ( and where ! ) use a 150 °C range sensor on a model ???

    Good question.

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  9. #9


    Did you find this post helpful? Yes | No

    Default

    It's for the engine temp.

    The max 120ºC of the DS18B20 is not enough.

    I need to be able to read safely up to 140ºC.

    I know you will say that the engine cannot reach that temperature unless it's toast, but the real thing is that with 30% nitro they can have peeks of 130ºC/135ºC. Not too good for the engine, it's true, but i need to measure it's peeks to know how the engine is running in mid air

    .

  10. #10
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Default

    ...

    Do not tell me you didn't know that :

    http://www.venom-group.com/print_mot...structions.pdf

    ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  11. #11


    Did you find this post helpful? Yes | No

    Default

    Now i see what you mean.

    I did not knew this.
    Sensor reaches 200ºC ??? wow...and now i undestand why you recomended NTCs.
    But this is a failsafe unit.

    I know this one instead:
    http://www.rcmodels.org/csm/carbsmart.pdf
    I believe it's by far the best idea.

    Apart from these 2...
    My circuit is not like any of these.
    It just stores the values, nothing else.

    .

  12. #12
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Angry

    Ahhhhh,

    CSM !!! I bought one gyro from them ( ICG360 ) Heading "lock" was gently unsteady ( ! )... carefully trimmed parameters for a plane.

    and then ... servo got dead-locked to neutral - and no way to reset the gyro parameters !!!

    No help from CSG nor ( except buy the new 540 model at a fair price ...)

    The sensor ( and its NTC ) is now in my Sensors box !!!

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  13. #13


    Did you find this post helpful? Yes | No

    Default

    Yeah...gyros i only like futaba's my self

    And i have to change the code to:

    temp= (in */2500)>>2

    Is this right ?
    how about the code...will this work ok for 2,5V ref?

    .

  14. #14
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Default

    for 10 bits ...

    use V ref = 4.096v or 2.048 v ... but not 2.5 v

    for 4.096 v you get 1 count for 1 mv
    for 2.048 v you get 2 counts for 1 mv input ...

    so, your formula ... is really awful !!!

    100°C = 1 v ...

    with a 2.5 v ref : 1v /2.5 *1024 counts ... 409.6 > 409

    409*2500/256 / 4 = 998.5 ...

    you will find the good numbers easily !

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  15. #15
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Default

    Errata !!!

    Quote Originally Posted by Acetronics View Post
    for 10 bits ...

    use V ref = 4.096v or 2.048 v ... but not 2.5 v

    for 4.096 v you get 1 count for 4 mv
    for 2.048 v you get 1 count for 2 mv input ...


    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  16. #16


    Did you find this post helpful? Yes | No

    Default

    Thanks Alain

  17. #17
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257


    Did you find this post helpful? Yes | No

    Default

    Hey Ace,

    The Carbsmart uses a 100K thermistor (supposedly a ntsa0wf104fe1b0). I have a spare and was thinking of using it with a pic to do some temp recordings to see how my temps are going.

    I just need some advise on the circuit design. I was going to use a 5V regulator to supply the pic and ref for the thermistor. Also use a 100k resistor as a voltage divider as my analog voltage input to the pic. Is this enough?

    Also, the thermistor has a current rating of 0.14ma @25C. Does that mean max current draw through the ntc over the entire temp range or what?

    See attached circuit.
    Attached Images Attached Images  

  18. #18


    Did you find this post helpful? Yes | No

    Default

    Hi Squibcakes,

    Just a question,

    Does that thermistor has a linear variation with temperature ?

    Where do you get this thermistor ? Any special supplier ?

    Thanks

  19. #19
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ruijc View Post
    Hi Squibcakes,

    Just a question,

    Does that thermistor has a linear variation with temperature ?
    Suprisingly no it's not that linear. I plugged in the values from the data sheet into excel and created a graph of the curve. It's linear on the higher temps (say 90C +). I wired this up on the bench as per the diagram I posted above and it seems to be working. I've seen mention of the LM35 sensor which is linear and has a higher max temp range which I think would be better but finding it hard to source these...

    Quote Originally Posted by ruijc View Post
    Where do you get this thermistor ? Any special supplier ?
    RS sell them pretty cheaply.
    http://australia.rs-online.com/web/s...tsa0wf104fe1b0


    Thanks

  20. #20


    Did you find this post helpful? Yes | No

    Default

    The LM35 is very easy to find. Any local store should have it.

    The problem with non linear thermistors is the math.
    I dont know how to program in a way that the result is always accurate from the "real life".

    The LM35 is linear and accurate and is capable of temps up to 150º. You can easly program and get true results.
    For applications as the one you want ( model engines ) , you will need a sensor that can go over 135º.

    The only problem i see is to get the package of the LM35 fit inside the engine fins.
    You could sandpaper off a bit of the package but you will lose accuracy.

    .

  21. #21
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Wink

    Quote Originally Posted by Squibcakes View Post
    Hey Ace,

    The Carbsmart uses a 100K thermistor (supposedly a ntsa0wf104fe1b0). I have a spare and was thinking of using it with a pic to do some temp recordings to see how my temps are going.

    I just need some advise on the circuit design. I was going to use a 5V regulator to supply the pic and ref for the thermistor. Also use a 100k resistor as a voltage divider as my analog voltage input to the pic. Is this enough?

    Also, the thermistor has a current rating of 0.14ma @25C. Does that mean max current draw through the ntc over the entire temp range or what?

    See attached circuit.

    Hi, Squib

    as always ... it relies on what you want to do !

    your scheme works fine if you just want to switch a relay ( a home thermostat generally works between 17 and 23 °C !!! ) or run an alarm ... NTCs perfectly can be used on limited temp ranges where you use a linear or 2nd order approx.

    now, you also can use a retrive table ( You did it with Excel, it seems ... ) and linearize between points: look at Microchip AN's !!!

    The main problem is NTC's often come with 10 or 20% nominal value tolerance ... so, it's not possible to get something precise without any calibration ( my home thermostat or my car temp indicator offer you to correct the read temp by adding or substracting 0 to 5 degrees ... simplest and easiest way !!! )


    For your thermistor current rating 0.14 ma ^2 x 100 000 = 2 mW ...

    let's suppose it's the maximum current not to disturb the thermistor temp. by self heating !!!



    Now, ... once more, the sensor will be chosen from the temp range and the use you will do with the output ...

    trying to know a model engine head temp @ +/- 1°C is a nonsense ... as you won't be able to place the sensor very close to the combustion chamber ... you just measure "something indicative ... " and the same measurement, with cold ot hot weather do not show ... not negligible ... temp changes at the "critical" point !!!

    Alain
    Last edited by Acetronics2; - 7th July 2008 at 12:38.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. unstable ADCIN readings when using DT ELAPSED.PBP
    By peter_wiersig in forum General
    Replies: 8
    Last Post: - 27th February 2010, 19:16
  2. AD input and 7segment dysplay output
    By ruijc in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th November 2007, 13:45
  3. Good (stable) voltage regulator?
    By achilles03 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th December 2005, 19:39

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts