Shop OBEX P1 Docs P2 Docs Learn Events
question about RC Time — Parallax Forums

question about RC Time

Keith HiltonKeith Hilton Posts: 150
edited 2005-11-12 20:07 in BASIC Stamp
tongue.gif·I have an interesting question about the Basic Stamp 2 command, RC Time.· Of course RC time is usually determined with a fixed capacitor value, and the resistance can be fixed or one that changes.· Usually, the RC Time is figured with a fixed voltage.· What if you used the RC Time command with the Basic Stamp 2, with a fixed capacitor value, a fixed resistance value, and a voltage that varied?· Of course the voltage could not drop below a certain point, or it would not register as an input on the basic stamp.· Seems to me this is one way you could feed·a variable analog sensor voltageto a Stamp, and have a ready made command for it-RC Time.· freaked.gif

Post Edited By Moderator (Chris Savage (Parallax)) : 8/30/2005 6:32:06 PM GMT

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2005-08-30 18:13
    Keith,

    Way back when (June 13th, 1996), when there was something called the L.O.S.A (List Of Stamp Applications) I used a method similar to what you describe as a crude way to monitor the Battery voltage.

    Google:
    LOSA Beau Schwabe

    Found this...

    http://www.hth.com/filelibrary/TXTFILES/losa.txt

    ...Look at entry #035

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 8/30/2005 6:12:40 PM GMT
  • Clock LoopClock Loop Posts: 2,069
    edited 2005-11-12 18:20
    I tried entry #035 and noticed it allows over 5 volts to go into your stamp input. Actually it allows almost all of your power supply voltage into it. How would one go about doing this without supplying too much voltage?

    Would a simple voltage divider using a few resistors work? Would that affect the rctime?



    Heres entry #35

    =====================================================================
    Title : Simple Battery Check using the BS2-IC [noparse][[/noparse]# 035]
    =====================================================================
    Date : 960613
    Author: Beau Schwabe
    E-mail: bschwabe@ionet.net
    Stamp model : BS2-IC Module
    Code available: YES
    Filename : N/A
    URL : Se below
    Description :

    External Components:

    .01uF "ZTR" capacitor (Zero Temp Response)
    100K Resistor

    Directions:

    1 - Connect the CAPACITOR and RESISTOR in parallel.
    2 - Connect one side of the RC to Vin
    3 - Select an available pin on the BS2 for the other
    side of the RC.

    Program:

    Battery var byte

    Start:
    low {pin#}
    rctime {pin#},0,Battery
    Debug home,? Battery
    goto Start

    Typical Results:

    85 - Fresh 9 Volt Battery
    220 - Low 9 Volt Battery

    Note:

    Number INCREASES as Battery weakens...

    Attached is a schematic.
    417 x 553 - 65K
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2005-11-12 18:39
    At the time I was basing this on the assumption that 9V through a 100K resistor would limit the amount
    of current into the stamp to 90uA... In other words, not going to hurt the stamp.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Clock LoopClock Loop Posts: 2,069
    edited 2005-11-12 19:11
    I suppose thats why my BS2 still works. heh.

    Thank you. So if this is the case, are their general guidelines to follow when working with more than 5 volts input into the stamp?

    I never knew that ANY voltage into the stamp over 5 volts was ok, no matter what the current.
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2005-11-12 19:56
    As a general rule you don't want to go over 5V. I suppose technically if your voltage is above 5V you
    should use a voltage divider. So something like this might be appropriate.


                      1K           1K
    Vin (0-10V) >----/\/\---o-----/\/\-----> GND
                            |
                            |   100K
                            o---/\/\---o---> Stamp I/O
                            |          |
                            o----||----o
                               .01uF
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-11-12 20:07
    Here is another URL with a similar take on the issue and some calibration equations:

    www.emesys.com/BS2rct.htm#B_voltage

    As Beau said, the 100 microamps is not going to hurt the Stamp. There are diodes internally at the Stamp pins that clamp the voltage there at Vdd+.6 volt and Vss-.6 volt. Those diodes prevent damage to the gate oxides, but too much current through the protection diodes can burn them out, or lead to a latched up condition in the chip. You can look at the PIC or SX chip Electical Characteristics chart and find there that the maximum clamp current is around 20 milliamps. Another spec is the latchup current, 200 mA. It is good enginerring practice to limit the maximum current from power supplies outside of the 0 to 5 volt range to well less than 20 milliamps, by use of a resistor in series with the pin.

    Another issue is, what happens to the current through the resistor when the Stamp goes to sleep? If you want that current to contribute to running the Stamp (via a sneak path), you have to limit it to less than 50 microamps or so, which is the typical current drain of a Stamp in SLEEP.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
Sign In or Register to comment.