Shop OBEX P1 Docs P2 Docs Learn Events
LM235 help — Parallax Forums

LM235 help

floodhoundfloodhound Posts: 45
edited 2007-05-23 01:54 in General Discussion
Need help reading an lm235 temp sensor; here is what I have so far.
·
  • 5Volts
  • BS2sx
  • ADC0831
  • Temp range 20C to -20C
·
I have tried using the RCTIME as listed on page 352 in the BASIC STAMP MANUAL. Where R is the LM235; I get good resolution but after a few 10 to 20 readings they become corrupted.
·
I then tried using an ADC0831 without an op-amp and I can read some values but it also is not working along the desired temp readings (voltage values).
·
Please help. All advice would be great.

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2007-05-18 16:51
    floodhound -

    A copy of your program (attached) would be a real help in trying to assist you.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • floodhoundfloodhound Posts: 45
    edited 2007-05-18 18:21
    Here is the code i used RCTIME for reading the lm235


    ' {$STAMP BS2sx}
    ' {$PBASIC 2.5}

    idx VAR Byte ' USED IN LOOP
    Raw VAR Word ' ADC RESULTS RAW
    temp VAR Word

    '//////////////////////////////////////////////////////////////
    ' GETS TEMP FROM AN RC CONNECTED TO AN LM235
    ' LOOPS 3 TIMES FOR AND AVERAGE


    GET_TEMP:

    temp = 0
    FOR idx = 0 TO 2
    HIGH AD
    PAUSE 5
    RCTIME AD, 1, Raw
    Temp = temp + raw
    PAUSE 30
    NEXT
    temp = temp / 3 ' average the readings

    RETURN



    This is the code i used to read the AD0831

    ' {$STAMP BS2sx}
    ' {$PBASIC 2.5}

    AdClk PIN 8
    AdCs PIN 7
    AdDta PIN 9
    result VAR Word




    main:
    HIGH 6

    LOW AdCS ' enable ADC0831

    SHIFTIN AdDta, AdClk, MSBPOST, [noparse][[/noparse]result\9] ' read the voltage

    HIGH AdCS ' disconnect ADC0831
    DEBUG HOME, SDEC result
    PAUSE 1000
    GOTO main


    like i mentioned they both have some type of flaws and i cant figure it out.
  • RDL2004RDL2004 Posts: 2,554
    edited 2007-05-19 10:38
    I built a temperature recorder last year that used an LM34 and an ADC0831. I read the LM34's output voltage directly with the ADC0831 then used a BS2 to save the binary value from the ADC to an I2C eeprom and convert that binary value to degrees F and display it on an LCD. Accuracy was only to 1/2 degree F, but that was all I needed.

    I would recommend you check out the Stamps in Class Process Control text, particularly chapter 6, that's where I got most of the LM34/ADC0831 code that I adapted for my project.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Rick
  • RandyRandy Posts: 79
    edited 2007-05-19 16:39
    Floodhound,



    I hope some one has an answer. I have been trying to figure out the same problem for months, make that years. In finished projects you will see my project called 'it's a logger'. I used the LM34cz and have tried the ADC0831, TLC1543 and TLC2543. 8 bits, 10 bits, 12 bits dosen't matter. I get variations of 3 or 4 degrees, sometimes more. I have breadboarded and used profesionally made circuit boards. Added capacitors and resitors in assorted combinations. Added opamps, changed scaling limits, changed power and ground referance. I can really screw it up and make it worse but not better.·I have gone to great pains putting sensors in sealed containers so passing air currents do not cause change (these sensors are very sensitive and react quickly to temperature change). What really confuses me is a volt meter will sit rock steady. Unfortunatly I don't have a 'scope. I did find that by averaging 20+ samples I am down to 1 degree of bounce. Sorry I don't have an answer for you but I will watch your post closely.



    Randy
  • floodhoundfloodhound Posts: 45
    edited 2007-05-21 18:44
    Thanks for the information contained on that link, however I am using an LM235 not an LM34. I am sure there are similarities, but the circuit listed in capture 6 will not work for the LM235 that I am aware of.

    I will keep posting my finding here as to help any others that encountered my same problem.

    Any other advice would be greatly appreciated.

    I am under the impression that the program is not the problem it is my supporting electronic circuit.
  • phil kennyphil kenny Posts: 233
    edited 2007-05-21 19:18
    Randy said...
    Floodhound,



    I hope some one has an answer. I have been trying to figure out the same problem for months, make that years. In finished projects you will see my project called 'it's a logger'. I used the LM34cz and have tried the ADC0831, TLC1543 and TLC2543. 8 bits, 10 bits, 12 bits dosen't matter. I get variations of 3 or 4 degrees, sometimes more. I have breadboarded and used profesionally made circuit boards. Added capacitors and resitors in assorted combinations. Added opamps, changed scaling limits, changed power and ground referance. I can really screw it up and make it worse but not better. I have gone to great pains putting sensors in sealed containers so passing air currents do not cause change (these sensors are very sensitive and react quickly to temperature change). What really confuses me is a volt meter will sit rock steady. Unfortunatly I don't have a 'scope. I did find that by averaging 20+ samples I am down to 1 degree of bounce. Sorry I don't have an answer for you but I will watch your post closely.



    Randy

    The reference voltage of any ADC needs to be rock solid. Any noise on
    that pin will translate into erratic ADC conversions. You can try
    providing a separate, clean reference, say by using a National Semi
    LM 336-5 or equivalent. Since the ADC0831 data sheet lists 2.5
    ma as the maximum +5 v current, try tying its VCC pin to the output
    of the LM 336-5 shunt regulator instead of to the existing 5v regulator.
    Capacitive filtering is still needed for the ADC0831 supply pin.

    phil
  • floodhoundfloodhound Posts: 45
    edited 2007-05-23 01:42
    Thanks a million for the info and the link toward that ref material RDL2004. I am now on the right track to getting great data from my ADS0831 connected directly into the LM235 now if i can find some reading material on communicating to the PC using strings and the like.
  • RDL2004RDL2004 Posts: 2,554
    edited 2007-05-23 01:54
    Here are two easy ways to get data in to a PC:

    StampPlot Pro

    PLX-DAQ

    These may not do exactly what you want, but they may help.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Rick
Sign In or Register to comment.