Use TVS diode to clamp analog voltage - Page 1
Forum section: electronics / beginners

author: Saimoun
author_rank: Frequent Contributor
timestamp: June 04, 2021, 01:53:04 pm
content: HiI have the following circuit (attached).The connector has a TVS and a resistor to protect it from ESD. But now I am also using the TVS to clamp the voltage of the connected piezo sensor (which otherwise could go to about 50Vpp).Measuring with the oscillo gives me the attached result - peak goes all the way up to 4.2V and down to -0.45V. I tried:* removing the 400k pull down resistor (R24): that makes no difference* changing it to 10k: it tames down the soft spikes a lot but hitting the piezo hard enough it can still very easily reach the 4.2VThe MCU's datasheet says the diode to VDD is not implemented, and the "absolute maximum ratings" for input voltage says -0.3V to 4V, clearly I am outside this. The max injected current indicated in the datasheet is -5mA/+0mA (it says " Positive injection is not possible on these I/Os" - I guess because of the missing diode to VDD?).I have been using that circuit for 2 days now and everything works perfectly fine, so my following questions are only for long term usageMy questions:1) Is it ok to use a TVS for a non-ESD signal? Should I use a normal zener in parallel?2) Will the MCU eventually be tired of being outside of the absolute maximum ratings? If so, how could I clamp the voltage precisely between 0V and 3.3V?Thank you!SimonPS: this is kinda the continuation of this topic -https://www.eevblog.com/forum/beginners/analog-signal-50vpp-into-3-3v-mcu/but the issue/question has slightly changed so I made a new one

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 04, 2021, 09:39:59 pm
content: How about increasing R23 and decreasing R24 (or connecting additional in parallel)? If this affects frequency response, put a cap in parallel with R23 to compensate for the MCU pin capacitance.How about schottky clamp diodes e.g. BAT54S?Tim

author: David Hess
author_rank: Super Contributor
timestamp: June 05, 2021, 02:42:16 am
content: Quote from: simonlasnier on June 04, 2021, 01:53:04 pmA TVS is a zener/avalanche diode processed and specified to handle high peak currents. They work fine in place of zener diodes.QuoteYes, momentary excursions at or outside of the absolute maximum ratings will likely cause damage. A more accurate clamp can be made with a pair of forward biased diodes with one diode compensating for the forward voltage drop of the other, and a reference voltage like the positive supply or ground. In low voltage applications, bipolar transistors can be used in place of diodes for even better performance.

author: Saimoun
author_rank: Frequent Contributor
timestamp: June 05, 2021, 09:09:11 am
content: Thanks for your answersIt looks like a schottky to VDD just before the pin (after R23) is the way to go? In a way that replaces the missing internal diode to VDD.And if I am not mistaken it will clamp at 3.3V + 0.3V forward voltage = 3.6V and the IO is called "3.6V tolerant" so that should be fine.And regarding the minus region, I am a bit confused about the datasheet:* One page says absolute minimum is -0.3V* Other page says max -5mA injected currentDoes that mean that both should always be followed? Because in my case I am at -0.45V but way below the -5mA current limit so that surely should be handled without any issues by the internal diode to GND, correct?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 05, 2021, 06:43:29 pm
content: You'll probably find elsewhere that injected current should be 0mA on analog input pins. The schottky will take care of that too.Other than that, what they mean by -0.3V / -5mA is, draw these two lines on the V-I plot for the pin; any current above the -5mA line, or any voltage above the -0.3V line, or the region bounded by -5mA and the diode curve (which, around -5mA, will be ~ -0.7V). It's not obvious that this extra shape is included, but that is of course the only way to reach such currents (at -0.3V, the diode curve will be some uA).So the schottky having a Vf higher than -0.7V means it will take almost all the current, which is fine.Also, everyone's confusing which direction a negative value is, lol.Tim

author: Saimoun
author_rank: Frequent Contributor
timestamp: June 06, 2021, 03:50:12 pm
content: Thanks Tim!Yes all these"above" in the negative ranges are a bit confusing ha haBut I got itI am confused though about which schottky you are speaking about - my idea was only to add one diode to VDD, which will only clip on one side (above 3.6V). But you seem to be speaking about a schottky to GND, which will then clip somewhere higher than -0.7V (probably about -0.3V) - which you are saying is ok.Did I get that right?Thank youSimon

author: Saimoun
author_rank: Frequent Contributor
timestamp: June 06, 2021, 05:39:44 pm
content: So now I added a diode to the +3.3V rail, just after R23 (between R23 and the MCU pin).This was the only I had at home -https://datasheet.lcsc.com/lcsc/1810301824_Tak-Cheong-TC1N4148T26B_C261224.pdfit is not a schottky (I think) so it has about +0.6V of Vf - makes sense as it now clips at 3.9V instead of 4.1V.

author: Saimoun
author_rank: Frequent Contributor
timestamp: June 06, 2021, 06:20:50 pm
content: And now with a decent Schottkty diode (just way too big for what I need -https://datasheet.lcsc.com/lcsc/1912111437_Chongqing-Pingwei-Tech-1N5817_C360254.pdf) - clips at 3.5V

author: David Hess
author_rank: Super Contributor
timestamp: June 06, 2021, 07:43:51 pm
content: Quote from: simonlasnier on June 05, 2021, 09:09:11 amSchottky diodes are the best solution *if* their high reverse leakage is acceptable. Circuits like 1 megohm inputs on oscilloscopes and 10 megohm inputs on multimeters cannot tolerate that level of leakage so must use other means of input protection.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 06, 2021, 08:51:45 pm
content: A BAT54S would be the typical solution, as a series dual it does both clampings in one.Tim

author: Saimoun
author_rank: Frequent Contributor
timestamp: June 07, 2021, 08:20:54 am
content: @David Hess: Oh yea I did not consider this... But I think with the 400k pull down resistor that's low enough impedance to avoid any issues?@Tim: Oh yea sorry I forgot to check it before. It's great! I actually have 3 lines I would like to add diodes on, do you know an equivalent Ic maybe that would have 3 times a BAT54S?

author: Saimoun
author_rank: Frequent Contributor
timestamp: June 07, 2021, 09:37:20 am
content: Quote from: David Hess on June 06, 2021, 07:43:51 pmHa ha I can see my circuit does not work anymore with that last huge diode to VDD I put!! (this one:https://datasheet.lcsc.com/lcsc/1912111437_Chongqing-Pingwei-Tech-1N5817_C360254.pdf)The voltage rests at 0.53V instead of 0V (or close), clearly because of the reverse leakage current.Making the math, 0.53V means the voltage is divided between my 400k pull-down resistor and a "pull-up resistor" of about 2Meg (i.e. that's what the diode is equivalent to), which means the reverse leakage is about 1.65uA, which does fit'ish with the graph in the datasheet.I can see that the BAT54S' reverse leakage is much lower (about 0.07uA with 3.3V), so that should fit perfectly(will make the voltage rest at about 0.03V)

author: tszaboo
author_rank: Super Contributor
timestamp: June 07, 2021, 10:35:47 am
content: Just be aware that TVS diodes have parasitic capacitances that can attenuate or filter your input signal.In general, they can be used to clamp voltages. But they are not designed to handle continuous power, especially the "rated" power. Which can be 1500W for a TVS in a package that is only able to dissipate 1W in DC.Piezo sensors also could be quite painful. I've seen them go way beyond their rated voltage, if hit with an object. I mean 1000V coming from them easily.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 07, 2021, 04:58:12 pm
content: BAT54XY is a dual dual, I don't think there's a triple or quad, or TVS array style (PN diodes are preferred for ESD protection as they have lower voltage drop and higher robustness under surge conditions).Leakage is indeed one of the problems with schottky, and discourages their use on analog signals. Note how it increases with temperature. The capacitance is also relatively high, but it seems your signal is slow enough that's no matter. Since your signal is dynamic, leakage may be okay: the DC value will be restored after clipping a few times, and the ADC reading can be highpass filtered to get acceptable zero crossings. Or whatever it is you're doing?Tim

author: Saimoun
author_rank: Frequent Contributor
timestamp: June 07, 2021, 05:31:52 pm
content: @Tim: yes that's all correct.I'll check BAT54XYWhatever I'm doing is very basic: just checking(1) if the signal reaches 0.6V threshold (using the MCU comparator)and (2) if the signal reaches 3.3V (by checking if I get max value 0xFFF in the ADC)The "DC" value is 0V, set by the 400k pull down.@tszaboo: yes correct about the capacitance, but my signal is 300Hz so no problems thereI need to test with a few different piezo (I'm actually using a drum pad / drum trigger - which has a piezo inside), so far even by hitting it super hard I could not go higher than 50Vpp.

author: David Hess
author_rank: Super Contributor
timestamp: June 07, 2021, 06:45:35 pm
content: Quote from: simonlasnier on June 07, 2021, 08:20:54 amIt is the total impedance including the source which matters but 3.3 volts across 400K is 8 microamps so a schottky diode is marginal at best, and would fail at elevated temperatures because of excessive leakage.