Limiting the voltage to a pin
Computer Geek 101
Posts: 179
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?
Edit: I was thinking a zener diode would work, but would it be the best way?
Comments
With such a wide range of voltages, I'd probably use an optocoupler.
Thanks in advance.
D Max
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
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).
Sorry about my silence. it was inadvertent, and thanks for this info.
D Max
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.
http://ww1.microchip.com/downloads/en/DeviceDoc/chapter%208.pdf