Shop OBEX P1 Docs P2 Docs Learn Events
RCTIME - schemes in Robotics 1.5 and 2.2 are not the same, why and which one to — Parallax Forums

RCTIME - schemes in Robotics 1.5 and 2.2 are not the same, why and which one to

Skywalker49Skywalker49 Posts: 172
edited 2007-06-28 08:04 in Learn with BlocklyProp
The schemes for the set-up of the photoresistor + capacitor in the Robotics 1.5 and 2.2 manuals are different.

In Rob. 1.5 ( figure 4.3)·· the capacitor is connected at one side between the·two resistors and at the other side to Vdd
In Rob. 2.2·( figure 6-10) the capacitor is connected at one side between the two resistors and at the other side to Ground

Looking at the code of the demo programs in Robotics 1.5 and 2.2, it seems that there is not a difference.

How come that there is no difference? Is that because the RC time is not dependant on the voltage but only
on the R and C values. That would make sense.
Next question is then, is there an advantage to use one or the other scheme ?

Ed

Post Edited (Skywalker49) : 6/24/2007 10:06:03 PM GMT

Comments

  • edited 2007-06-26 22:12
    Skywalker49,

    The circuits happen to behave similarly, but they are indeed very different.

    The circuit from the 1.5 manual removes all the charge from the capacitor with the HIGH command and then measures how long it takes for the capacitor to recharge with the variable resistor in the way, slowing down the process. As the capacitor charges, the voltage at the capacitor's lower plate decreases, eventually crossing the BASIC Stamp microcontroller's 1.4 V logic threshold (1 vs. 0).

    The circuit in the 2.2 version is similar to circuits commonly studied in electronics textbooks, and it's also simpler and more straightforward. The code for the 2.2 circuit also uses a HIGH command, but this time, the HIGH signal charges the capacitor. When the I/O pin is done charging the capacitor and its direction is changed to INPUT by the RCTIME command, the capacitor starts discharging through the variable resistor. The decay time is dictated by how much the variable resistor slows the discharge rate. With this circuit, the RCTIME command returns the time it takes the voltage at the capacitor’s upper plate to decay below the BASIC Stamp’s 1.4 V logic threshold. It’s more analogous to a very small battery draining its charge through a resistor. The larger the resistor, the more time it takes for the battery to drain, the smaller the resistor, the less time it takes, and so on…

    Andy

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andy Lindsay

    Education Department
    Parallax, Inc.
  • Skywalker49Skywalker49 Posts: 172
    edited 2007-06-28 08:04
    Andy,

    thank you for the explanation.
    Summarizing:
    Since the code and the results for both cases are the same, it doesn't matter which set-up is used.
    The one with the cap. in parallel with the photoresistor as in Robotics 2.2 is a little bit easier to implement.

    Ed
Sign In or Register to comment.