Chris23
10-05-2008, 01:53 AM
Hello everyone,
I am trying to built a temperature data logging system using 6-8 AD592 temperature probes for my final project at university. I have bought a BS2, the probes and a MAX1270 A/D converter. But i can't yet put them work together ! The first logic step for me is to read correctly the temperature from only one AD592 from channel 0 of MAX1270. For that reason, i used the operating circuit for MAX1270 from its datasheet at page 1.
As regards the adaptation circuit from AD592 TO MAX1270 I found something here...
www.emesystems.com/OL2heat.htm (http://www.emesystems.com/OL2heat.htm). I used the first circuit at paragraph 2) and the suggested equations for the conversion of MAX1270 readings to degrees Celcius....
ADch=5
gosub ADread0 ' get count, 1 count=1.25 millivolts=0.25 Kelvin
degC=result*25-27300
debug dec degC/100,".",dec2 degC," degrees Celsius"
So i came out first with this code...
' {$STAMP BS2}
' {$PBASIC 2.5}
AdcDOUT CON 10
SSTRB CON 2 ---------->i am not exactly sure what this is and if it is of any use
AdcDIN CON 9
AdcCS CON 8
clockpin CON 7
controlbyte CON %10000000
result VAR Word
result = 0
degC VAR Word
DO
GOSUB Read_ADC
GOSUB Display
PAUSE 100
LOOP
Read_ADC :
LOW AdcCS
SHIFTOUT AdcDIN , clockpin, MSBFIRST, [controlbyte]
SHIFTIN AdcDOUT, clockpin, MSBPOST , [result\12]
HIGH AdcCS
RETURN
Display:
degC=(result*25)-27300
DEBUG DEC degC/100,".",DEC2 degC,"degrees Celcious"
DEBUG CR
RETURN
The results were something like this....
74.64degrees Celcious
79.64degrees Celcious
78.14degrees Celcious
79.64degrees Celcious
69.14degrees Celcious
86.14degrees Celcious
76.14degrees Celcious
65.14degrees Celcious
65.64degrees Celcious
81.64degrees Celcious
80.14degrees Celcious
75.14degrees Celcious
78.14degrees Celcious
77.14degrees Celcious
83.64degrees Celcious
83.14degrees Celcious
73.64degrees Celcious
78.64degrees Celcious
I thought first that there were calibration problems, but i don't think so. I tried to warm up the temperature sensor with my hand but there was no respone, the temperature was not rising.
Secondly, i used some alternative codes just for reading max1270 without bothering for temperature conversions....and i found ADC.bs2 from this link....
http://forums.parallax.com/showthread.php?p=601139
I used only channel0 and i got these results from the debug terminal for ADC.bs2 code..
Ain1.... 0.000
Ain2.... 0.000
Ain3.... 0.000
Ain4.... 0.000
Ain5.... 0.000
Ain6.... 0.000
Ain7.... 0.000
Ain8.... 4.998 (mV)
What am i doing wrong??? Please any suggestion could be very helpfull...
Thank you in advance,
Christofer
I am trying to built a temperature data logging system using 6-8 AD592 temperature probes for my final project at university. I have bought a BS2, the probes and a MAX1270 A/D converter. But i can't yet put them work together ! The first logic step for me is to read correctly the temperature from only one AD592 from channel 0 of MAX1270. For that reason, i used the operating circuit for MAX1270 from its datasheet at page 1.
As regards the adaptation circuit from AD592 TO MAX1270 I found something here...
www.emesystems.com/OL2heat.htm (http://www.emesystems.com/OL2heat.htm). I used the first circuit at paragraph 2) and the suggested equations for the conversion of MAX1270 readings to degrees Celcius....
ADch=5
gosub ADread0 ' get count, 1 count=1.25 millivolts=0.25 Kelvin
degC=result*25-27300
debug dec degC/100,".",dec2 degC," degrees Celsius"
So i came out first with this code...
' {$STAMP BS2}
' {$PBASIC 2.5}
AdcDOUT CON 10
SSTRB CON 2 ---------->i am not exactly sure what this is and if it is of any use
AdcDIN CON 9
AdcCS CON 8
clockpin CON 7
controlbyte CON %10000000
result VAR Word
result = 0
degC VAR Word
DO
GOSUB Read_ADC
GOSUB Display
PAUSE 100
LOOP
Read_ADC :
LOW AdcCS
SHIFTOUT AdcDIN , clockpin, MSBFIRST, [controlbyte]
SHIFTIN AdcDOUT, clockpin, MSBPOST , [result\12]
HIGH AdcCS
RETURN
Display:
degC=(result*25)-27300
DEBUG DEC degC/100,".",DEC2 degC,"degrees Celcious"
DEBUG CR
RETURN
The results were something like this....
74.64degrees Celcious
79.64degrees Celcious
78.14degrees Celcious
79.64degrees Celcious
69.14degrees Celcious
86.14degrees Celcious
76.14degrees Celcious
65.14degrees Celcious
65.64degrees Celcious
81.64degrees Celcious
80.14degrees Celcious
75.14degrees Celcious
78.14degrees Celcious
77.14degrees Celcious
83.64degrees Celcious
83.14degrees Celcious
73.64degrees Celcious
78.64degrees Celcious
I thought first that there were calibration problems, but i don't think so. I tried to warm up the temperature sensor with my hand but there was no respone, the temperature was not rising.
Secondly, i used some alternative codes just for reading max1270 without bothering for temperature conversions....and i found ADC.bs2 from this link....
http://forums.parallax.com/showthread.php?p=601139
I used only channel0 and i got these results from the debug terminal for ADC.bs2 code..
Ain1.... 0.000
Ain2.... 0.000
Ain3.... 0.000
Ain4.... 0.000
Ain5.... 0.000
Ain6.... 0.000
Ain7.... 0.000
Ain8.... 4.998 (mV)
What am i doing wrong??? Please any suggestion could be very helpfull...
Thank you in advance,
Christofer