Shop OBEX P1 Docs P2 Docs Learn Events
Smoking an input pin on a BS2? — Parallax Forums

Smoking an input pin on a BS2?

SCFalconrySCFalconry Posts: 5
edited 2008-02-15 22:50 in BASIC Stamp
What is an input pin on a BS2 looking for?· Is it looking purely for 1-10mA of 5Vdc?·· What would happen if the pin was provided 12Vdc at only 2mA?· Would it smoke?

The reason I ask... is I·have a few Omron photoelectric switches that operate with 10-30Vdc.· The signal from·the Omron P.E. Switch is·also 10-30Vdc depending on the voltage·the switch is powered with.·· I plan to run the P.E.Switches with 12Vdc so the signal from the switch would likewise be 12 Volt DC.· I can·add about 6K·resistance to limit the current to 2mA from the P.E.Switch.... but am afraid the 12 volts is going to pop a pn junction inside the BS2.

I know it would be safe to·use the P.E.Switch's output to bias a NPN transistor to switch a 5 volt source to feed to the STAMP's input pin.... but was wondering what would happen if the BS2 was fed 12V at very low amperage.

Thanks for any assistance you can lend,

Marty - K4MLW
(and yeah.... this is my first microcontroller.... was it obvious?) <hahaha>

Post Edited (SCFalconry) : 2/10/2008 2:25:34 AM GMT

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-10 05:07
    Most microcontroller I/O pins including the Stamp I/O pins have protective diodes that become forward biased when the voltage at the I/O pin is more than about 0.7V higher than the microcontroller's power supply voltage (or more than 0.7V below ground). As long as the current is limited, you should be ok. For example, the Parallax Basic Manual discusses using 10K resistors on input pins used for RS232 levels which can go to +12V or -12V. This limits the current to less than 1mA. You should be fine with the same thing for your sensors.
  • SCFalconrySCFalconry Posts: 5
    edited 2008-02-10 15:01
    Mike thank you very much.... I remember reading that in some of the parallax documentation but was unaware that RS232 operated at 12 volts. This begs the question.... what is the highest voltage that can be reliably applied to an input pin? Or... I guess the real question now is " what is the reverse breakdown voltage of these protection diodes?"

    Does anyone have experience applying 24Vdc to a STAMP's Input pin? To limit the current to 1mA ....we could use 24000 ohms.
    The reason I ask....I occasionally have access to discarded 24Vdc devices from my employer.

    Marty
  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-10 15:57
    The safest thing to do would be to use a 5V (actually 5.1V) Zener diode between the I/O pin and ground in addition to the current limiting resistor. Look up "Wiki Zener" on the Internet if you're not familiar with these. They'll limit the voltage on the I/O pin to 5V and you won't have to worry about it. The resistor is what absorbs the excess voltage.

    The protection diodes don't use their "reverse breakdown voltage". They're connected to conduct in a forward direction in overvoltage or undervoltage conditions. Download the PIC16F57 datasheet or the SX48 datasheet from Parallax and look at the diagram of the I/O port structure and you'll see them.

    As long as you limit the current going into the chip, you should be ok. With static discharges, the problem you run into is the resistances and inductances of the chip's internal wiring are enough to get destructive voltages between adjacent points in the chip because of the very high voltages and sharp pulses involved.

    In a way, you're not really applying 24Vdc to the Stamp's input pin. The protection diode is clamping the input voltage to 5.7V and the resistor is absorbing the remaining 18.3V.
  • SCFalconrySCFalconry Posts: 5
    edited 2008-02-10 16:48
    Mike,

    Thanks again!· I'm off to look for the·datasheets now.

    BTW... during my searches of past post in this forum... I've seen that JPG of you quite a bit.·
    Thanks for all those other questions·that·you've answered for me as well.

    Marty - K4MLW
  • Dave-WDave-W Posts: 94
    edited 2008-02-15 22:50
    Marty,

    I would put a 8 volt 1/4 watt zener in series with the stamp input pin along with a 220 ohm current limit resistor to protect the pin, just in case it becomes an output.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    D. A. Wreski
Sign In or Register to comment.