rctime problems
jayhawk4
Posts: 6
I'm doing a temperature project that shows the temperature of a room in different temperature scales. I am using the BS2 with the AD592 (non temperature probe one, its just the sensor) and the rctime method used in the applied sensors book. When I put in the code that is given in the book, it says that rctime is equal to zero and remains constant at zero. I have looked through the forums and tried some of the suggestions with these parts and rctime always equals zero. I don't know what I'm doing wrong or if any of the parts are damaged and any suggestions would be much appreciated.
Thank you.
Here is my code:
Kal CON 15300 ' Constant to be determined
rct VAR Word ' A word variable
TK VAR Word ' Kelvin temperature
TC VAR Word ' Degrees Celsius
DO ' Loop forever
LOW 5 ' Discharge the capacitor
RCTIME 5, 0, rct ' Time for the volts to rise to 1.3 V
TK = Kal/rct*10 + (Kal//rct*10/rct) ' Calculate Kelvin
TC = TK - 273 ' and Celsius
DEBUG DEC rct, TAB, DEC TK, ' Show the results
TAB, SDEC TC, CR
PAUSE 50 ' Slows down the program
LOOP ' Back to the beginning of the loop
Thank you.
Here is my code:
Kal CON 15300 ' Constant to be determined
rct VAR Word ' A word variable
TK VAR Word ' Kelvin temperature
TC VAR Word ' Degrees Celsius
DO ' Loop forever
LOW 5 ' Discharge the capacitor
RCTIME 5, 0, rct ' Time for the volts to rise to 1.3 V
TK = Kal/rct*10 + (Kal//rct*10/rct) ' Calculate Kelvin
TC = TK - 273 ' and Celsius
DEBUG DEC rct, TAB, DEC TK, ' Show the results
TAB, SDEC TC, CR
PAUSE 50 ' Slows down the program
LOOP ' Back to the beginning of the loop
Comments
As for putting a pause in I have tried that and it did not work.
Thanks
0 0 -273
I have also changed out everything (including the BS2) except for the AD592. Could the AD592 be the problem?
Thanks
In the Applied Sensors examples they're using a 100Ω (brown-black-brown).
It won't work with a 100kΩ resistor in that position. The capacitor has to discharge through that resistor, and at the same time the resistor also has to pass the current from the sensor.
Otherwise the wiring looks correct. If it doesn't work with 220Ω to pin p5, there must be something else going on. One thing you can try is, take out the AD592 and insert the 100kΩ resistor in its place. Stilll with 220Ω over to pin p5. With R=100k and C=0.22µF, you should see a good rct reading of around 3300 (6600 microseconds).
If you continue to see a reading of rct=0, that means that the RCTIME command is timing out. The input pin p5 is never getting up to the 1.3V threshold. At that point I'd suspect that one of the wires is not making good contact. Wiggle the wires or try different holes in the plugboard.
You have the black wire going from the (+) connection on the AD592 over to Vdd. I'd recommend connecting that to Vin instead of Vdd. That gives the AD592 a little more head room. But I don't think that explains the null results.
Page 184 of "Applied Sensors" has errors though. It re-prints the pin-out from the datasheet faithfully, but it has mistakes in its orthogonal depiction of the device and therefore the wiring.
I have attached my "red-lined" copy.
If anyone has a problem with it, have at.
I think my web page construction diagram is okay: http://emesystems.com/tk_fab.htm