Shop OBEX P1 Docs P2 Docs Learn Events
rctime problems — Parallax Forums

rctime problems

jayhawk4jayhawk4 Posts: 6
edited 2010-11-29 12:30 in Accessories
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

Comments

  • FranklinFranklin Posts: 4,747
    edited 2010-11-21 18:38
    Could you show us how you have it connected and what values you have for the parts?
  • ercoerco Posts: 20,256
    edited 2010-11-21 19:35
    You need at least a PAUSE 1 between LOW 5 and RCTime.
  • jayhawk4jayhawk4 Posts: 6
    edited 2010-11-21 19:56
    Here are some pictures I took. As for values, I'm not sure what you mean, but I am using what the book says to use.

    As for putting a pause in I have tried that and it did not work.

    Thanks
    1600 x 1200 - 212K
    1600 x 1200 - 207K
    1600 x 1200 - 187K
  • jayhawk4jayhawk4 Posts: 6
    edited 2010-11-23 08:51
    I've figured out what you meant by values and here is what I get:

    0 0 -273

    I have also changed out everything (including the BS2) except for the AD592. Could the AD592 be the problem?

    Thanks
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2010-11-23 09:28
    Jayhawk, What is the value of the resistor that connects to pin p5? Not clear from the photo. It should be something around 100 Ω.
  • jayhawk4jayhawk4 Posts: 6
    edited 2010-11-23 10:13
    The resistor is a brown, black, yellow 100Kohm.
  • jayhawk4jayhawk4 Posts: 6
    edited 2010-11-23 10:24
    I have also tried it with a 220 ohm and a 470 ohm resistors without success. Would these also be too high of resistance?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-11-23 10:27
    It looks to me like your AD592 is backwards.

    In the Applied Sensors examples they're using a 100Ω (brown-black-brown).
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2010-11-23 10:56
    It should work okay with the 220Ω or 470Ω resistor.

    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.
  • jayhawk4jayhawk4 Posts: 6
    edited 2010-11-23 11:08
    Putting in a 100 ohm resistor and switching the AD592 around did the trick. Thank you everyone who helped me out.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-11-23 11:10
    When all else fails, check your wiring!
    538 x 496 - 34K
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-11-29 10:27
    I went strictly by the datasheet.

    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.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2010-11-29 12:30
    Thanks for pointing that out PJ. I'll pass it on to the editors.

    I think my web page construction diagram is okay: http://emesystems.com/tk_fab.htm

    tksleeve.gif
Sign In or Register to comment.