LM235 help
Need help reading an lm235 temp sensor; here is what I have so far.
·
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.
·
- 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
A copy of your program (attached) would be a real help in trying to assist you.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
' {$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.
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
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
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.
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
StampPlot Pro
PLX-DAQ
These may not do exactly what you want, but they may help.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Rick