Shop OBEX P1 Docs P2 Docs Learn Events
RCtime problem (it is a very strange problem!! ) — Parallax Forums

RCtime problem (it is a very strange problem!! )

JoeJoe Posts: 184
edited 2006-12-06 20:47 in BASIC Stamp
Hi,

I am reading some values using the Photoresistor and a 470 Ohm resistor and
a 104 condenser and a red Led. All the hardware is into a black box ( without any kind of external light)
because I add a red Led into the black box.

The problem I have is that the W2 variable started at 18500
and after minutes is 19600 and the number is increasing the value
even now ( it is night ) , the value is now 22500.

( I am sure that any kind of external light is coming into the black box)

All the circuit have been made to keep always the same value
but I don't know why W2 is bigger each time.

It is the second time that I have the same problem.

I changed all the components and I have the same problem !!

The rutine is very simple:

HIGH 7
PAUSE 100
RCTIME 7, 1, W2
DEBUG ? W2



I don't understand the problem !!!

do you know?

Thanks, Joe

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-12-04 23:07
    Joe,
    ·
    ·· Try changing your PAUSE to 1 instead of 100.· Also, I would recommend declaring a variable name rather than trying to use the W2 register directly.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • JoeJoe Posts: 184
    edited 2006-12-05 02:42
    Chris:


    I am using pause 1 instead of 100 and it seems the problem is solved
    (Thanks)

    I will continue monitoring the numbers.

    All the numbers are about 1500 instead of 18500
    but it seems they are moving between 1495 and 1505
    but they are not moving over 1505.

    Do you know what was happened?

    Thanks, Joe
    PS: I am still using the "W2" (word variables yet )
  • FranklinFranklin Posts: 4,747
    edited 2006-12-05 02:47
    It could be the photoresistor is heating slightly and thus changing resistance not related to the light.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-12-05 02:55
    Joe,
    ·
    ·· Well the deviation of the numbers is to be expected…The values you’re posting now are typical…It’s due to tolerance of the components.· As for what was happening before, you had to long of a PAUSE causing the capacitor to charge 100 times longer than what it should be.· Due to component tolerances I could see that being the main part of the problem, although I have never tried to recreate it.· In any event I’m glad you got it working.· Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2006-12-05 17:02
    The resistance should be very high in the dark. The original value of RCTIME at around 20000 implies a time of 0.04 second and with 0.1uF that implies a resistance of around 400 kohms. That is not unreasonable in the dark for a photoresistor. Actually kind of low, as you might also find resistance in the megaohms. I agree with Franklin, that the resistance in the dark might have a pretty strong temperature coefficient.

    The result of changing from PAUSE 100 to PAUSE 1 suprises me. It makes me wonder how you have this wired up. Could you post a schematic?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • metron9metron9 Posts: 1,100
    edited 2006-12-06 18:21
    I was going to say the same thing Tracy Allen said about the pause. Once the .1 cap is charged it should not matter if you hold it for 10 seconds or 1 second or 1ms, full charge is a full charge.

    Remember the capacitor temperature rating also affects the time constant, a z5u rated cap acts almost like a thermistor using capacitance instead of resistance with a +22%, -56% change over temperature.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • AImanAIman Posts: 531
    edited 2006-12-06 20:47
    Quick note - heat and cold make a perfectly good system go haywire. If you have ever lived in the north or the desert you will know what I mean. When a temp drops to say -30 your car does things it won't do a 70. Likewise when you park your car on an asphalt parking lot at 8 am and its 90 out the temp will increase considerably and the car will do strange things as well.

    My point is this - fans in computers try to keep things cool. What you are experiance is excess heat.

    Think of it like a toaster.
Sign In or Register to comment.