Shop OBEX P1 Docs P2 Docs Learn Events
Limiting the voltage to a pin — Parallax Forums

Limiting the voltage to a pin

Computer Geek 101Computer Geek 101 Posts: 179
edited 2011-08-15 03:04 in Propeller 1
I know a 2.2k ohm resistor will protect a Prop pin from too much current @ 5vdc, but what is the best practice to prevent damage if the voltage can be 3vdc to 12vdc? The voltage could be 3vdc one time and 12vdc the next on the same pin. Thanks for any suggestions!

Edit: I was thinking a zener diode would work, but would it be the best way?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-07-22 11:22
    It's all Ohm's Law. The protective diode conducts at Vdd+0.6. With a 3.3V supply, that's 3.9V. The diode is rated at 500uA. You need to limit the current to that. For 12V, that's 12V - 3.9V = 8.1V. To limit the current to 500uA or less, you need at least 16.2K. The closest standard value is 18K although you could certainly use 20K or 22K. You could also use a Zener diode rated at 3.6V with a 2.2K resistor between the voltage source and the Zener. The Zener would conduct before the protective diode although you could put a 1K resistor between the Zener and the Prop pin and use a 3.9V or 4.3V Zener.

    With such a wide range of voltages, I'd probably use an optocoupler.
  • Computer Geek 101Computer Geek 101 Posts: 179
    edited 2011-07-22 11:39
    Thanks Mike. I was thinking of using the zener, but I might test out the optocoupler.
  • Dirkimus MaxDirkimus Max Posts: 7
    edited 2011-07-22 22:29
    Apologies if this is poor etiquette, intruding with another question in this thread, but my curiosity..... Mike, the protective diode you mention above, is this a diode internally on the I/O pin?

    Thanks in advance.
    D Max
  • graffixgraffix Posts: 389
    edited 2011-07-22 22:36
    Welcome to the forum, Dirkimus Max !!!
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-07-22 22:53
    ...is this a diode internally on the I/O pin?

    ...

    Dirkimus,

    Welcome to the forums.
    You might want to have a look at the Data Sheet for the Propeller, especially the section on the Absolute Maximum Ratings. It talks a little about the internal protection diode, which is inside the chip on the I/O pins.

    http://www.parallax.com/Portals/0/Downloads/docs/prod/prop/PropellerDatasheet-v1.1.pdf
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2011-07-22 23:00
    Yes the diodes, there are two, are internally built into the chip and between them they protect the voltage going above VDD and below VSS (GND) by more than their forward conductance voltages.

    As said they are only rated to suffer about 500uA each so a limiting resistor has to be used. This could be a problem if you require very fast responses as it would form a RC delay. Optos give isolation from any high voltage nasties, and get around any ground currents but again they are usually slow (ish) on their response.

    There are proper chips for the usuall 5 V to 3.3 V conversions but not for the 3-12 V variations (that I know of).
  • Dirkimus MaxDirkimus Max Posts: 7
    edited 2011-08-12 20:19
    Is there a red-faced emoticon somewhere? Looking back over my old posts, I'm not seeing the response I replied to your generous help! I must have fat-fingered my response somewhere. Apologies! Thanks for this info. I'm attempting to build one of those old-fashioned 60's style light organs, and was asking my question above because I have Forrest Mim's book on active filters, and am building some filters to split audio signals into 3 or so frequency groups, feed them into some I/O pins, and was concerned about damaging the chip (ala a Basic Stamp that is in my drawer with one less I/O (o:). I have a handful of 3.3V zeners, and thought I'd use those to clamp the input, figuring they'd be fast enough for what I'm doing.

    Sorry about my silence. it was inadvertent, and thanks for this info.

    D Max
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2011-08-12 21:58
    Just a quick note about low voltage zeners in that they just aren't very good, Zeners are normal diodes that have been heavily doped to breakdown at a specified voltage but the more doping they go through to bring the voltage down also contributes to increased leakage currents and a "soft knee" in that they start conducting before their breakdown voltage. Just use 100K resistors in the line and forget about zeners altogether as 100K won't affect audio frequencies and should work fine up to 100's of kHz.
  • Dirkimus MaxDirkimus Max Posts: 7
    edited 2011-08-13 07:30
    Thanks for the advice, Peter. Easy solution! I'll do that, and add that to my bag of tricks!
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-08-13 16:29
    Peters solution is spot on. It is a simple and effective way of protecting circuits. This trick has been used for years with CMOS logic. As long as your circuit is fine with such a high input impedance.
  • EmptyBitEmptyBit Posts: 72
    edited 2011-08-14 13:01
    100k sounds simple enough. @12v I trust that there would be 8.1v drop across this resistor? At 3v under the null region?

    I have found other threads and suggestions of a circuit like attached for interfacing 12v to 3.3v.

    The knee on low voltage zeners is very weak to nonexistant. I used a test circuit with a 10k pot in series with the zener to find what resistance would achieve 3v at the node to the 1k which is where the 850 ohm value came from. I have not found any measurable voltage drop on the 1k feeding the prop pin, so I presume this safe for feeding the prop pins without harm.

    Overkill or common practice?

    I question with these discrete components will both protect the pin AND pass a good signal with such a broad (3.3v to12v) input range. Seems like we'd need an IC that works at 3.3v and is 12v tolerant like an opto or level shifter.
    446 x 338 - 10K
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2011-08-14 15:35
    EmptyBit wrote: »
    100k sounds simple enough. @12v I trust that there would be 8.1v drop across this resistor? At 3v under the null region?

    I have found other threads and suggestions of a circuit like attached for interfacing 12v to 3.3v.

    The knee on low voltage zeners is very weak to nonexistant. I used a test circuit with a 10k pot in series with the zener to find what resistance would achieve 3v at the node to the 1k which is where the 850 ohm value came from. I have not found any measurable voltage drop on the 1k feeding the prop pin, so I presume this safe for feeding the prop pins without harm.

    Overkill or common practice?

    I question with these discrete components will both protect the pin AND pass a good signal with such a broad (3.3v to12v) input range. Seems like we'd need an IC that works at 3.3v and is 12v tolerant like an opto or level shifter.

    The internal "diode" is really part of the structure of the substrate and although it has been likened to a zener it is not. In fact there are two diodes and the one that conducts on over-voltage actually forward conducts into Vdd. The threshold is 0.3V above Vdd (not a fixed voltage independent of Vdd) and current should be limited to a few hundred microamps.

    If you used a 1M resistor and fed in 3V to it then you will still have 3V on the CMOS input and if the resistor was rated for mains voltage you could also feed it from the mains and still the CMOS input would handle it as long as the current is within limits. Of course the larger the resistor the longer the time constant when coupled with the parasitic capacitance of the input.

    Don't worry about what you've read in other posts and those "just to be sure" solutions. If you understand the fundamentals and CMOS substrates then you will just know what needs to be done.

    I will save the bulk of this explanation along with diagrams for a design tip of the day post.
  • LeonLeon Posts: 7,620
    edited 2011-08-15 03:04
    Microchip has this useful doc on interfacing between 5V and 3V devices:

    http://ww1.microchip.com/downloads/en/DeviceDoc/chapter%208.pdf
Sign In or Register to comment.