Shop OBEX P1 Docs P2 Docs Learn Events
Slightly OT: protecting inputs from negative voltage? — Parallax Forums

Slightly OT: protecting inputs from negative voltage?

ArchiverArchiver Posts: 46,084
edited 2003-11-09 02:04 in General Discussion
Hello!

I'm working on a music synthesizer project that my use a basic
stamp. Some of the I/O lines of the basic stamp are going to be
configured as inputs. Any myriad of voltages may be hooked up to
that input from analog synths.. from -15v to 15v. I have used a
zener clamp circuit to limit the voltage to +5 volts. However, my
electronics skills are, well, not so great.

Q: Should I be concerned about negative voltage appearing on my basic
stamp inputs? And, if so, could someone point me to a simple
schematic of a circuit which will clip out the negative voltages?

Q: If I have some I/O lines that are set as outputs, there's still a
possibility that someone will hook up a positive voltage to that
input. That should do nothing, right? :-) I don't need to worry
about that, do I? My trivial amounts of electronics theory suggests
that hooking a positive to a positive doesn't do anything.

Thanks! Are there any good books that discuss protecting
microcontroller inputs?

- Bret

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-11-09 01:42
    Doesn't seem off-topic to me...


    You can use a simple silicon switching diode to prevent negative voltage
    from getting to the input pin. Connect it so that the end with the stripe is
    connected to the stamp pin and the other end is connected to your signal
    source. Note, however, that this will drop the voltage coming in by about a
    volt.

    As for the output pins...
    There are three states a stamp pin can be at: high (around 5 volts), low
    (around 0 volts), or high-impedance (think of it as not connected to
    anything).
    When a pin is in input mode, it will be at high-impedance - it will not
    drive any voltage. When a pin is in output mode, it will be held either low
    or high. If it is low and you connect a positive voltage to it, you will
    basically have a short circuit (you are effectively connecting your positive
    voltage to ground through the stamp), and soon a dead pin. Even if the
    voltage you connect is around the same as that on the stamp pin, any small
    difference in voltages between the pin and whatever you connect will cause
    current to flow. I suggest you use a current-limiting resistor (250 ohms or
    more) on any pins where this situation may occur.

    --
    Greg Courville (KG6SGY)
    www.gee-enginuity.com
    "Make it idiot-proof and somebody'll make a better idiot"




    Original Message
    From: "c45a6" <clone45@h...>
    To: <basicstamps@yahoogroups.com>
    Sent: Saturday, November 08, 2003 5:18 PM
    Subject: [noparse][[/noparse]basicstamps] Slightly OT: protecting inputs from negative voltage?


    > Hello!
    >
    > I'm working on a music synthesizer project that my use a basic
    > stamp. Some of the I/O lines of the basic stamp are going to be
    > configured as inputs. Any myriad of voltages may be hooked up to
    > that input from analog synths.. from -15v to 15v. I have used a
    > zener clamp circuit to limit the voltage to +5 volts. However, my
    > electronics skills are, well, not so great.
    >
    > Q: Should I be concerned about negative voltage appearing on my basic
    > stamp inputs? And, if so, could someone point me to a simple
    > schematic of a circuit which will clip out the negative voltages?
    >
    > Q: If I have some I/O lines that are set as outputs, there's still a
    > possibility that someone will hook up a positive voltage to that
    > input. That should do nothing, right? :-) I don't need to worry
    > about that, do I? My trivial amounts of electronics theory suggests
    > that hooking a positive to a positive doesn't do anything.
    >
    > Thanks! Are there any good books that discuss protecting
    > microcontroller inputs?
    >
    > - Bret
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-09 02:04
    You are in luck.

    1. If you have a pin configured as an Output,
    and it is holding 0 volts on the Output, and
    another device tries to put +5 on the pin,
    then yes, you have a problem which can burn
    out the Stamp pin. Your assumption that
    hooking up a positive to a positive is OK
    is NOT correct.

    2. If you put a negative voltage on a Stamp
    pin, there are built-in diodes which protect
    the stamp -- as long as you limit the current.

    The solution to both of these problems is
    similar.

    For the 'multiple-output' situation, putting
    a 220 ohm resistor in series with the Output
    pin will protect it from over-current.

    For the 'negative voltage' problem, a
    22 KOhm resistor in series will drop the current
    to the point the internal diode will not be
    harmed. This is done all the time to let
    the Stamp receive RS-232 (-15 Volt) voltages
    without damage.


    --- In basicstamps@yahoogroups.com, "c45a6" <clone45@h...> wrote:
    > Hello!
    >
    > I'm working on a music synthesizer project that my use a basic
    > stamp. Some of the I/O lines of the basic stamp are going to be
    > configured as inputs. Any myriad of voltages may be hooked up to
    > that input from analog synths.. from -15v to 15v. I have used a
    > zener clamp circuit to limit the voltage to +5 volts. However, my
    > electronics skills are, well, not so great.
    >
    > Q: Should I be concerned about negative voltage appearing on my
    basic
    > stamp inputs? And, if so, could someone point me to a simple
    > schematic of a circuit which will clip out the negative voltages?
    >
    > Q: If I have some I/O lines that are set as outputs, there's still
    a
    > possibility that someone will hook up a positive voltage to that
    > input. That should do nothing, right? :-) I don't need to worry
    > about that, do I? My trivial amounts of electronics theory
    suggests
    > that hooking a positive to a positive doesn't do anything.
    >
    > Thanks! Are there any good books that discuss protecting
    > microcontroller inputs?
    >
    > - Bret
Sign In or Register to comment.