How to protect a Teensy 4.1 pin from higher voltages?

jimmie

Well-known member
I have an application where a Teensy 4.1 pin is used as an input. The input is a dry input (no voltage) where the pin is pulled to ground.

Code:
 pinMode(loop1, INPUT_PULLUP);

However, I am concerned that someone would mistakenly apply a voltage to that pin (up to 24V DC) which would probably brick the board.

How can I protect that pin from accidental damage if a high voltage (> 3.3V and < 24V) is applied to it? I understated that a Zener diode may be used but have not found a circuit explaining connections and values.

Thanks in advance.
 
Screenshot 2022-04-25 122147.png

Sorry the photo is a bit out of focus as it's too close. You need one Zener diode of the appropriate voltage (3.3V or maybe 3.6V), and a resistor to limit current from your source. This resistor's value depends on the current rating of the Zener diode. But if you just use a 1K resistor, then the current is limited to (24V-3.3V)/1K ohm, about 20mA, which is good.

I use this one to protect my 5V circuit from similar mishaps of 12V shorted to signal line:

https://www.digikey.com/en/products/detail/onsemi/1N4733A/977210

So DON'T BUY THIS! Download the data sheet and read the table. I think you can get 1N4728A or 1N4729A. You can also add a resistor in line with the teensy pin side if you want, say a 1K. I normally have a 510 ohm.
 
However, I am concerned that someone would mistakenly apply a voltage to that pin (up to 24V DC) which would probably brick the board.

How can I protect that pin from accidental damage if a high voltage (> 3.3V and < 24V) is applied to it? I understated that a Zener diode may be used but have not found a circuit explaining connections and values.

Zeners are not really the answer (they can have pretty soft knees in their response too), the way to do this is with a pair
of Schottky diodes to the rails and a series resistor:

protect_circuit.jpg

The value of resistor needs to be much less than the internal pull-up, perhaps a few kohms. This circuit protects whether the
circuit is powered up or not, and bolsters the internal protection diodes (Schottky diodes turn on around 0.3V and thus divert
any current before the internal diodes see it (they start conducting significantly from 0.5V or so).

You might want to use a zener or TVS diode to prevent the supply lifting though - ie directly between Vcc and ground
as a crow-bar/clamp.
 
Thank you very much @MarkT, I appreciate it.

If VCC can be up to 24VDC, and let's say I use a 3K Ohm resistor, what specific components do I use for the marked parts?

Thanks again.
 

Attachments

  • Mark.jpg
    Mark.jpg
    61.2 KB · Views: 33
Two Schottky diodes and a Teensy (or any CMOS logic chip at all). This is the standard voltage protection - for surface mount people
generally use a dual Schottky in a SOT23 package for this.

You could get away with a zener before the series resistor and skip the Schottky's, but you'd need another resistor to protect the zener
(in other words the internal diodes can be enough with just a resistor to limit current, but only at more modest voltages). 24V is pushing
it really, that can put dozens of mA through the resistor. Often CMOS protection diodes are rated at a few mA at most, sometimes under
1mA. This is why external Schottky's can be so useful, much more current handling.
 
Thank you very much @BriComp.

I am still a bit confused :). Please see the attached circuit using the BAT54S. What does the Teensy Pin connect to?

What happens if the "IN" is connected to GND? Will the Teensy Pin be connected to GND?
 

Attachments

  • Circuit.jpg
    Circuit.jpg
    44.9 KB · Views: 37
Last edited:
I am just not clear where the green wire in the image below goes?
 

Attachments

  • Circuit.jpg
    Circuit.jpg
    40.6 KB · Views: 38
Interesting topic... I am software guy not hardware, although did have a few EE classes back in school, but that was during the ice age....

But looking tat the other diagrams shown, I would guess something like:
screenshot.jpg
 
Not an EE either ...

example: LED's of diff colors take diff voltages to 'turn on'.
> Up to that voltage there is no light and current is blocked by nature of being a diode

In the lower part of that circuit 'IN' will not pass current to 'GND' until the voltage reaches the design level of the device p#2
> once 'IN' exceeds that set voltage the diode will pass current directly to GND, keeping it from the Teensy pin
 
I do not know how this circuit works ...
Do you know what a diode does?
EDIT:
I am only trying to get you level of knowledge.
No good trying to help you if you don't understand.
 
Last edited:
Thank you @KurtE. I thought so too but wouldn't this connection completely bypass the diode?

That's the point - the signal "bypasses" the diodes unless the input voltage strays out of range, in which case one of the diodes
conducts and clamps the voltage.
 
I found this schematic diagram from an AVR microcontroller. It may be easier to understand since the diodes are drawn almost in line. You can imagine the resistor on the right to external input and Teensy pin on left.
Screenshot 2022-04-26 165604.png

So if you have 3.3V/GND on Teensy, and say the diodes have 0.3V of drop when conducting forwards, then your pin is protected between -0.3V and 3.6V. I bet that makes the pin happy.
FYI, I use Zener diodes on these 5V logic AVR processors in addition to their built-in diodes and inline resistors.
 
Great thread!

So I'm curious at the reaction speed of the zenner or schottky diodes in the above diagrams as everyone posted. PO describes a possible 24v overvoltage, but does not say if it is a fast or slow rising change...... PO asks about 'bypassing' the diodes... which leads me to wonder...

Do you need to buffer or absorb this if a sharp edged spike?
 
I am just trying to protect from the possibility of the Teensy being destroyed if a pin accidentally is connected to 24V.

I have ordered the parts and will test it ...
 
Thanks to all. I received the parts.

I tried first with a BAT54S Shottky but I was never able to solder them as they are so tiny!

So I tried with the attached circuit using a Zener diode. Up to 24V, the Teensy pin only got about 2V which means it is protected.

However, my main question is that in my application, I want to detect when the Teensy pin is connected to GND (Teensy getting a dry contact ...). I needed pin protection in case somebody applies a large voltage (> 3.3V) to the Teensy pin.

So while the attached circuit works when a large voltage is applied, it does not work if the input is shorted to GND ....
 

Attachments

  • Zener Diode.jpg
    Zener Diode.jpg
    48.1 KB · Views: 32
Reply #7 shows the input protection circuit.
If BAT54S is vtoo small for you, use discrete schottky diodes.
 
Maybe you didn't have the right Zener diode. Or it could have been broken. Lower voltage Zener diodes can get damaged by static electricity if they are in non-antistatic bags. If you bought a 3.6V Zener, then it should be 3.6V. Also add a serial resistor between teensy pin and the Zener-3K junction.

If you want to try the schottky diode again, have a look at these small breakout boards:

https://www.adafruit.com/product/1230

This one has the SOT23 footprint, hope that's what you got. You only need 3 out of 6 pads. Other places sell these SOT23 breakout boards too. This is much easier than trying to solder wires to pins.
 
Back
Top