Will this signal destroy my uC pin? - Page 1
Forum section: electronics / general

author: eTobey
author_rank: Super Contributor
timestamp: May 17, 2024, 03:41:11 pm
content: Hi,my signal generator does some not so pleasent pikes when it is turned off.I wonder if my inputs (3.3V) will take immediate damage, or if it takes a few of those pulses (10, 100, 600?).Anyone has some references or knowledge?

author: ebastler
author_rank: Super Contributor
timestamp: May 17, 2024, 03:50:45 pm
content: It might help if you tell us what µC you are using...Also, have you checked the output impedance of that transient voltage pulse? How does it look if you put e.g. a 1 kOhm resistor in parallel?

author: nctnico
author_rank: Super Contributor
timestamp: May 17, 2024, 03:51:58 pm
content: A better approach is to have protection on pins. Even if it is just a prototype board. It saves a lot of trouble and time.

author: tom66
author_rank: Super Contributor
timestamp: May 17, 2024, 04:03:41 pm
content: It may well do so.Likely your signal generator has a 50 ohm output termination. The damage threshold for the ESD diode in the pin may be around 10mA and the clamping voltage will be Vcc+0.6V typically. So you can calculate that the current will be approximately(Vout-Vcc+0.6)/50once over this threshold. Solving for Vout assuming 10mA maximum and assuming Vcc of 3.3V gives you 4.4V as the absolute maximum voltage that can be output from the signal generator, before its internal termination, before damage occurs.Test the signal generator output voltage with no MCU connected on power off and see what voltage it goes to, to determine the maximum open circuit voltage.Note that the pin might withstand higher currents for a brief period of time, but there is no guarantee of this and progressive damage can occur causing the IO structure to failure. In many cases, this will cause a dead short from 3.3V to ground, but in some cases it can just damage that IO pin.Also, note that ADC channels on many microcontrollers will misbehave if just one input is overstressed. I have a PIC32MM board here where that was a problem, we had to change divider resistors to ensure no channel ever went above Vcc as it caused adjacent channels to misbehave.

author: eTobey
author_rank: Super Contributor
timestamp: May 17, 2024, 05:41:06 pm
content: Quote from: ebastler on May 17, 2024, 03:50:45 pmIts a STM32G431 RBT6.With 1k, the max value goes down to 5V.Quote from: nctnico on May 17, 2024, 03:51:58 pmOf course i have those on my prototype, but right now im testing with a nucleo board. I dont think it has any protection.

author: ebastler
author_rank: Super Contributor
timestamp: May 17, 2024, 05:47:33 pm
content: Quote from: eTobey on May 17, 2024, 05:41:06 pmUmm, "goes down to 5V"? Isn't the maximum about 4.25V in the screenshot you shared?

author: eTobey
author_rank: Super Contributor
timestamp: May 17, 2024, 05:54:37 pm
content: Quote from: ebastler on May 17, 2024, 05:47:33 pmYes, that one is outdated:I checked the setup without the resistor, the value was at about 5.7V, but it is not always the same.

author: pcprogrammer
author_rank: Super Contributor
timestamp: May 17, 2024, 06:09:52 pm
content: Also the so called spikes in that screenshot are clearly topped of by some diode action. The question is how much current is flowing at that moment and for how long if it will actually do damage.What is the signal generator you are using, and how is it turned off? Is there a switch to turn of the output, or is it actually turning of the whole signal generator that creates these pulses.Can it be the wiring you are using that introduces inductive properties. So many unknowns here.If it is just for some simple testing on a test board, looking at the duration of the spikes, I don't think it will hurt, but better safe then sorry and disconnect the generator output before turning it off would be my choice. Probably less chance of damage.

author: ebastler
author_rank: Super Contributor
timestamp: May 17, 2024, 06:22:59 pm
content: I know from the other thread that you are testing a Siglent SDG1032X. Looks like you turned off the unit's mains power while the output was still active, I assume? If that is the case, I would strongly advise to turn off the output first, then power down the unit.For what it's worth, my SDG2042X does not output any transient voltages outside of the currently selected signal range -- even when powered off while it is still actively outputting a signal. It might be a better design than its smaller sibling, but this has me wondering: Could it be that some voltage is injected from your device under test? Do you still see that transient if you have only the scope connected to the SDG's output?

author: eTobey
author_rank: Super Contributor
timestamp: May 17, 2024, 07:21:21 pm
content: Quote from: ebastler on May 17, 2024, 06:22:59 pmI do not subject my DUT to a device, that i do not trust yet.Its just the scope. Nothing else. And some alligator BNC clips.

author: eTobey
author_rank: Super Contributor
timestamp: May 17, 2024, 07:36:28 pm
content: I just had another test:at 2V high level it also peaks at around 5VBut with 1V high level it peaks at around 1.5VSo i guess i have to create a little checklist for powering down everything. Like going through a checklist when landing a plane.

author: ebastler
author_rank: Super Contributor
timestamp: May 17, 2024, 07:59:35 pm
content: You did not answer the question from pcprogrammer and me yet: How didi you actually "switch off" in those tests?Does the spurious voltage already show up when you just disable the generator's output, via the rubber pushbutton? Or does it only occur when you power down the generator? If it's the latter, does it make a difference whether you have first disabled the output?

author: eTobey
author_rank: Super Contributor
timestamp: May 17, 2024, 08:15:08 pm
content: I turned off the generator itself.I would expect it, to make a difference... gonna try...Edit:I have not found any problematic issues. (0-2V).

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 18, 2024, 12:52:15 am
content: Some pins of this MCU are 5V-tolerant, some aren't. You need to check which are in the datasheet and whether you use one of them here.The rated max voltage on 5V-tolerant pins is 5.5V. The absolute max is a bit confusing, I'm not sure what "FT_c" pins are, you'll need to read the datasheet. If the pin you use is a FT_xxx pin but not a FT_c pin (sic), the absolute max is min(VDD, VDDA)+4, so if you typically have VDD = VDDA = 3.3V, that would be 7.3V. Which gives a significant margin. As long as you use the right pin. Which I don't know.In any case, if the generator is at all able to generate voltages above that, some protection before the input pin is highly recommended. If it's just a dev board, you can add some protection on a small piece of proto board - I suppose you were already using some adapter, you just need to insert protection.

author: NiHaoMike
author_rank: Super Contributor
timestamp: May 18, 2024, 03:51:47 am
content: Add a signal line TVS to clamp the voltage.

author: eTobey
author_rank: Super Contributor
timestamp: May 18, 2024, 05:50:19 am
content: No, protections (TVS) would not work on the high side. It will distort the signals. I could clamp the negative voltages, though. Also, i run on a breadboard, and dont want to solder anything here, or create more stuff already. I was in the hope of getting information on what a pin can withstand.Also it is really stupid, to work on a project and then having to create a "little project" to protect the MCU, because i spent a little more money in the hopes, of not having to to this, like you would have, with cheap products.

author: nctnico
author_rank: Super Contributor
timestamp: May 18, 2024, 08:43:36 am
content: Quote from: eTobey on May 18, 2024, 05:50:19 amA TVS diode doesn't distort signals (TVS diodes are used on all inputs / outputs on any piece of quality equipment). A TVS diode is similar to a zener diode but with better surge handling capacity. Also, never clamp signals to power rails using a diode. You don't want to push power from an unknown source into your power supply.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 18, 2024, 01:23:56 pm
content: What is the pin? ADC? For what purpose? What is the source impedance and bandwidth? (50Ω I guess given the generator, but beyond that?) What is your input circuit, or your circuit overall?Quote from: eTobey on May 18, 2024, 05:50:19 amAt least all other STM32s I've looked at, pin characteristics are reasonably well documented in the data section -- give it a look. You will need the IO pin type/class from the pinout section, then cross-reference that with the allowed pin injection currents, voltage ranges, etc. Note that analog inputs (or pins near an analog section) typically stipulate zero injected current, else the analog stuff may read incorrectly -- charge injection into the internal circuitry messes everything up, and maybe it reads wrong by some counts, maybe whole bits in any position (or comparators gain offset, or work slower, or flip state, or the PLL messes up, etc.).Anything that's rated as -0.3 to VCC+0.3V (or 0.5 or 0.6 are sometimes seen on MCUs), can be assumed to have input clamp diodes to the supplies. 5V-tolerant pins may be absolute (-0.3 to 7V, say), or VCC-relative, suggestive of the type of ESD structure used there (i.e. zener to GND, or zener or diode-strapped FET to VCC, etc.).If current injection is allowed, and doesn't mess up any nearby peripherals, it is safe to rely on that as a feature -- but be careful that only that much current is used, including transiently, and respect totals across IO banks or whole chip. Mind also that using clamp diodes typically increases Icc, because they're usually actually BJT structures clamping to VCC/GND with the collector to the opposite side, i.e. the pin current is drawn from both rails, not strictly one (as a true diode would do).Quote from: nctnico on May 18, 2024, 08:43:36 amWell, it certainly does distort some signals. It wouldn't be a TVS otherwise!I guess you meant as signals that are intended, nominal range, as opposed to unexpected noise or surge; but those are signals in the general sense as well, so it pays to specify.Nothing wrong with clamping to supply per se, but one must have a complete list of potential hazards you are protecting against. For example, clamping ESD into a supply of more than a few uF is fine, almost regardless of load current; but clamping, say, a telecom surge, or a cross-wired input, is a different matter.Clamp diode arrays often include a supply TVS as well, which can be biased by the signals themselves (TVS left unconnected), or tied with the supply which also provides clamping to the circuit generally.Clamp diodes are generally acceptable for analog purposes, but the impedance does matter, as well as bandwidth and linearity. Zener/TVS are less preferable as they have a softer knee and higher capacitance. Very small clamp diodes (<1pF Cj) are available for broadband applications (e.g. USB3, HDMI, etc.), which would also do well on high impedance and high bandwidth analog signals.Tim

author: eTobey
author_rank: Super Contributor
timestamp: May 18, 2024, 01:37:03 pm
content: Quote from: nctnico on May 18, 2024, 08:43:36 amI have made some test on a zener i have. See picture.I cant think how a TVS diode would work much better.

author: shapirus
author_rank: Super Contributor
timestamp: May 18, 2024, 01:42:29 pm
content: Quote from: nctnico on May 18, 2024, 08:43:36 amOf course they do. Not only they have non-zero junction capacitance, just like any diode, but this capacitance can actually be very high, which can be critical for fast signals.For example, P6KE series:Input protection is always a trade-off between preservation of the original signal and the level of protection.Clamping input signal to rails is not necessarily a bad idea, as long as measures are taken to prevent the rail voltages from exceeding the allowed thresholds, which can be done in multiple ways from simple zeners to active shunting circuitry.

author: shapirus
author_rank: Super Contributor
timestamp: May 18, 2024, 02:00:30 pm
content: Anyway, this advice is to be followed:Quote from: nctnico on May 17, 2024, 03:51:58 pmNever trust your input signal! Unless, of course, it is generated by a trusted subcircuit inside the device itself -- an external signal generator is not one of them.I'd suggest building a feed-through signal conditioner that can be used for prototyping as a weekend (or a couple weekends) project: input port, output port, small signal fast diodes, like 1n4448, that clamp input (connected in series with a current limiting resisitor) to rails and something to clamp the rails to an acceptable voltage: from a zener in the simplest case to a transistor-based shunt with a potentiometer to adjust the clamping voltage level.Not only it can be practically useful, but it's also a good exercise to learn something new, in this case, input protection techniques.

author: tggzzz
author_rank: Super Contributor
timestamp: May 18, 2024, 02:02:24 pm
content: Quote from: eTobey on May 18, 2024, 01:37:03 pmAre yousurethat's a 4.7V zener? Looks more like a 2.7V zener.I suggest you do a little research about "load lines" and diode I-V curves. That will enable you topredictthe voltage and current through a diode, zener and otherwise. Prediction is always better than measurement, because it requires understanding. Of course measurement should be used toconfirmthe understanding and operation.BTW, capacitors diodes and resistorsall"distort" the signal. The question is whether that distortion affects operation. Is should be possible to choose a zener, TVS, etc so that the signal is not affected. Whether that will also offer protection depends on the details of the circuit inputs, the protection components, and the stimulus.But well done for spotting a possible problem, and then asking a question.

author: eTobey
author_rank: Super Contributor
timestamp: May 18, 2024, 02:12:29 pm
content: Quote from: shapirus on May 18, 2024, 02:00:30 pmI never thought, that signal generators could be that problemtatic. At leaste those that cost more than 300 bucks.But yes its a bood thing to not trust everything. And this can be said in quite a lot of occasions, not only electronics!I have used some BAT46 to clamp signals to the rail, as inputs can only be max to 0.3V. But i dont really know much about what you said.

author: tggzzz
author_rank: Super Contributor
timestamp: May 18, 2024, 02:18:04 pm
content: Quote from: eTobey on May 18, 2024, 02:12:29 pmI have no opinion about the specific signal generator you are using, but such issues are one of the reason professionals like HP-A-K kit and are prepared to pay more for it.You might like to look at your PSU for similar "infelicities".

author: eTobey
author_rank: Super Contributor
timestamp: May 18, 2024, 02:28:29 pm
content: Quote from: tggzzz on May 18, 2024, 02:02:24 pmIts a 4.7V Zener. But i had this 36k resistor in there.See picture with 100R: The signal is distorted from 4V on, and clamps the voltage to 4.7V

author: shapirus
author_rank: Super Contributor
timestamp: May 18, 2024, 02:32:20 pm
content: Quote from: eTobey on May 18, 2024, 02:12:29 pmThings to keep in mind when using Schottky diodes for input protection are junction capacitance (pretty low in this case) and reverse leakage current, which in this case is going to be on the order of 0.1..3 uA, which may or may not be an issue, depending on the input and source impedances.Quote from: eTobey on May 18, 2024, 02:12:29 pmWell it's a big topic. Take a look at e.g.https://www.digikey.com.au/en/articles/protecting-inputs-in-digital-electronicswhich covers the basics. What they don't cover in this article is that when you clamp input signal to power rails, then the rails must be able to sink whatever extra current the extra voltage of the input signal is able to source, otherwise your rails voltage may rise above acceptable levels. Short spikes (such as ESD or turn-on/turn off transients, like in your case) can be absorbed by capacitors (which you are supposed to have on power rails anyway). For prolonged input overvoltage you need something that will begin sinking current as the voltage of the power rail raises above a certain level, which can be as simple as a single Zener diode (of the beefier ones, if necessary), or more involved, if you need e.g. higher precision.Simulate it. This kind of stuff is easy to simulate with little frustration, as it doesn't require any models beyond basic SPICE primitives, except maybe Schottky diodes, but they can be found easily (unlike some ICs, but that's a different story). It requires a bit of learning, but it's a very rewarding experience. In the long run it will save you a lot of time. Remember, though, that simulation has its limits. But adding explicit elements for parasitic inductance, capacitance etc. can make those limits much wider :).

author: nctnico
author_rank: Super Contributor
timestamp: May 18, 2024, 02:33:21 pm
content: Quote from: shapirus on May 18, 2024, 01:42:29 pmWhich is why there are so many different kinds of TVS diodes. Including those intended for high speed signals like USB (in various forms), PCIe, HDMI, etc. You can find these with capacitances way below 1pf.

author: ebastler
author_rank: Super Contributor
timestamp: May 18, 2024, 02:36:43 pm
content: Quote from: eTobey on May 17, 2024, 08:15:08 pmSo what does that mean? If you toggle the output off (via the dedicated rubber button) before powering down the generator, i.e. if you use the generator as intended, you don't have any problems at all? What does the "0-2V" limitation have to do with it, and where did it suddenly come from?Those troubleshooting discussions with you would be much more productive if you describe in detail what you did and observed, right away, rather than giving little sentence fragments here and there.Also, please be more systematic in the experiments you do and the way you report results -- e.g. the unexplained transition from 4.25V to 5.7V transients earlier in the thread, and now the "2V" limitation which seems to come out of nowhere.

author: shapirus
author_rank: Super Contributor
timestamp: May 18, 2024, 02:38:14 pm
content: Quote from: eTobey on May 18, 2024, 02:28:29 pmIt's quite hard to understand. Yellow is obviously the post-clamping signal. Green must be the raw input? What's the vertical offset and scale? It's really hard to tell that yellow is distorted -- it looks good to me. The two traces must be aligned and have the same vertical scale to draw any conclusions.What are the noisy-looking white traces? Are they relevant at all? If they aren't, they should be removed to avoid confusion.If you want your data to be understood, you need to prepare its visualisation appropriately, otherwise you will have a hard time delivering your point.

author: shapirus
author_rank: Super Contributor
timestamp: May 18, 2024, 02:50:23 pm
content: Quote from: nctnico on May 18, 2024, 02:33:21 pmYes of course.My point was that saying that a TVS diode doesn't distort signal without a further clarification may be misleading. It's important to explain that care must be taken to select parts that: a) have sufficiently low capacitance so as not to cause an unacceptable distortion of the input signal; b) have a sufficient surge capability so as to provide protection against the required level and duration of overvoltage.Depending on the numbers, it may be impossible to find a single TVS diode that meets both requirements. That's when other protection techniques come into play.

author: eTobey
author_rank: Super Contributor
timestamp: May 18, 2024, 02:50:27 pm
content: Quote from: shapirus on May 18, 2024, 02:32:20 pmThat is one good article, i already read twice. But i did not really understand what you were saying, where the energy would go after the diode. In my case with the breadboard, i do not have a proper rail, nor do i want to solder anything on there. And long wires wouldnt be that good either would they (25cm)?Can i clamp the volatage with a shottkey to a zener, that "simulatates" a rail?

author: shapirus
author_rank: Super Contributor
timestamp: May 18, 2024, 02:52:40 pm
content: Quote from: eTobey on May 18, 2024, 02:50:27 pmThe answer is "maybe". Hard to tell without a schematic that shows input, protection, output, and power rails (including ground).

author: eTobey
author_rank: Super Contributor
timestamp: May 18, 2024, 02:58:03 pm
content: Quote from: ebastler on May 18, 2024, 02:36:43 pmIm sorry.I encountered these problems only when turning off the gen, so far. At a squarewave from 0-2V, the level did not go up anywhere near 5V.It was just some more detail, that i wanted to add.

author: ebastler
author_rank: Super Contributor
timestamp: May 18, 2024, 03:11:49 pm
content: Quote from: eTobey on May 18, 2024, 02:58:03 pmBut did you encounter the transients at all when youfirstturn off the output,thenturn off the power to the generator? I am getting a bit desparate that you still have not answered this simple question.If turning off the output first fixes the problem, that would be such an obvious and adequate solution. Before I shut off my car engine, I stop my car and put the gears into idle or step on the clutch pedal. I am not complaining that the car does not handle it well if I shut off the ignition while driving...

author: tggzzz
author_rank: Super Contributor
timestamp: May 18, 2024, 03:26:58 pm
content: Quote from: ebastler on May 18, 2024, 03:11:49 pmPower cuts happen. I had a (VW) car where the engine suddenly cut out while I was going round a busy roundabout. Fortunately it was a manual transmission, so there was only inconvenience until the hall-effect sensor had been replaced. Analogies are always dangerous.But I agree, there is the smell of the XY problem about this thread. The OP might benefit from reading the first three paragraphs athttps://entertaininghacks.wordpress.com/library-2/good-questions-pique-our-interest-and-dont-waste-our-time-2/

author: nctnico
author_rank: Super Contributor
timestamp: May 18, 2024, 03:47:58 pm
content: Quote from: tggzzz on May 18, 2024, 03:26:58 pmIndeed. Test equipment which supply power and/or signals to a DUT should be designed so they don't output spikes / surges when powered down for whatever reason.

author: temperance
author_rank: Super Contributor
timestamp: May 18, 2024, 04:02:41 pm
content: QuoteFor those wondering what is going on:https://www.eevblog.com/forum/testgear/siglent-sdg1032-as-bad-as-rigol-dg812/msg5505595/#msg5505595Maybe this topic should be closed or removed.

author: eTobey
author_rank: Super Contributor
timestamp: May 18, 2024, 04:43:13 pm
content: Quote from: nctnico on May 18, 2024, 03:47:58 pmI do agree. Moreover, i would say, that there should be safe limits to setup, that would not be exceeded, when misconfiguring it.

author: tggzzz
author_rank: Super Contributor
timestamp: May 18, 2024, 06:10:07 pm
content: Quote from: eTobey on May 18, 2024, 04:43:13 pmYou do set limits: the max voltage and max current.If you want to have a second set of limits, then you will have to define why you won't misconfigure those limits.Then you'll have to work out why a PSU would violate the first set of limits but not the second.

author: eTobey
author_rank: Super Contributor
timestamp: May 19, 2024, 09:55:39 am
content: Made another test with a 50 Ohm termination ( gen -> 50 Ohm term -> probe).It peaks at 6.2V with a set up level of 3.3! And it equals a mean of 4.5V for 240us.Squarewave on high level that is.

author: EPAIII
author_rank: Super Contributor
timestamp: May 19, 2024, 01:03:32 pm
content: Pikes?https://en.wikipedia.org/wiki/Pike_(weapon)Yes, I would think a pike would definitely destroy any micro-processor pin that I know of. In fact, it would probably destroy the entire micro-processor.But so would a sword, a saber, a lance, etc.Sorry, but I have had German friends who made fun of mein Deutsch.Quote from: eTobey on May 17, 2024, 03:41:11 pm

author: ebastler
author_rank: Super Contributor
timestamp: May 19, 2024, 01:25:14 pm
content: Quote from: EPAIII on May 19, 2024, 01:03:32 pmNo no, you got that wrong. What us Germans are really concerned about is the damage wrought to electronc circuits by fish, especially the predatory species.Or maybe it was just a typo for "spike", which could actually happen to a native speaker too. I certainly produce plenty of them in German...

author: madires
author_rank: Super Contributor
timestamp: May 19, 2024, 02:26:18 pm
content: Quote from: nctnico on May 18, 2024, 02:33:21 pmA classic method to hide the relative large capacitance of a TVS is to place it in a diode bridge. Surge protectors for DSL or GigE often use this method (together with GDTs). For low power transients you can get that integrated in a chip, e.g. SRV05-4.

author: eTobey
author_rank: Super Contributor
timestamp: May 19, 2024, 07:41:40 pm
content: I was thinking about a circuit, and this is what i ended up with.Is there a way to get rid of the 3.3V ? Without it, the signal is greatly distorted from just over 2V on.

author: eTobey
author_rank: Super Contributor
timestamp: May 21, 2024, 11:03:18 am
content: I have now put a 10uF capacitor as DUT, and the line is terminated with a 50Ohm resistor.Its not really smoothed out. I guess then it could really do some harm?

author: madires
author_rank: Super Contributor
timestamp: May 21, 2024, 02:04:32 pm
content: Quote from: eTobey on May 19, 2024, 07:41:40 pmTry a Zener rated for a higher voltage or five silicon diodes in series.

author: eTobey
author_rank: Super Contributor
timestamp: May 21, 2024, 08:23:33 pm
content: Quote from: madires on May 21, 2024, 02:04:32 pmBut then i probably exceed the upper limit. They dont have such a sharp knee.Im thinking about putting in a 3.3V regulator without a zener, if there wouldnt be a better way.

author: shapirus
author_rank: Super Contributor
timestamp: May 21, 2024, 09:21:59 pm
content: Quote from: eTobey on May 21, 2024, 08:23:33 pmNot sure how exactly you're going to use it. In series with input signal?I don't know if it's possible to design a precise clamper that won't distort the signal and would not require some supply voltage itself and, if it has to be really precise, some op amp based tricks. Several fast diodes in series connected from signal (after a current limiting resistor) to ground is probably as good as you can get.How precise do you need it to be, anyway? You never answered the questions in post #17, answers to which will define the required precision: is the target input pin digital or analog? What bandwidth or timing tolerance is required?Options can vary from a simple current limiting resistor in series with input signal and letting the input pin protection diodes handle the rest (if they exist there, of course) to some quite elaborate circuits.

author: eTobey
author_rank: Super Contributor
timestamp: May 22, 2024, 05:10:29 am
content: Quote from: shapirus on May 21, 2024, 09:21:59 pmI put it in place of the zener. See above the picture with the circuit.I have not answered, because i have no numbers yet. At least i want it not look so bad on the scope. It looks horrible with that zener alone.

author: madires
author_rank: Super Contributor
timestamp: May 22, 2024, 12:10:31 pm
content: Anyway, the 1 kOhm series resistor limits the current also for the microcontroller's clamping diodes. So the Zener diode can be for a higher voltage. Alternatively you could use a level shifter as a protective buffer in case of a digital signal.

author: shapirus
author_rank: Super Contributor
timestamp: May 22, 2024, 02:29:03 pm
content: Quote from: eTobey on May 22, 2024, 05:10:29 amOkay, as a starting point, will this be good enough?Input: a 100 kHz triangle wave coming from a sig gen with 50 Ohms output impedance.Traces: yellow is input signal before clamper, cyan is after it passes the clamper.Math: yellow - cyan.Probing: 10x oscilloscope probes, alligator clamp ground leads.Assembly: solderless breadboard.Peak voltage measurements are shown in the side window on the right.1. 20 Vpp 0 V DC bias input:2. 10 Vpp 0 V DC bias input:3. 3.3 Vpp, +1.65 V DC bias input (so the signal is contained within the positive and negative clamping thresholds):Schematic:This is an illustration of the idea that I mentioned earlier, that is, to use fast diodes to clamp the input signal to power rails created specifically for such clamping.The rails must be capable of sinking (positive) and sourcing (negative) enough current. The former is limited by DZ1, the latter is limited by R1 (decreasing R1 increases the negative clamping capability).The voltage levels of such rails is chosen as Vr = Vc - Vf for the positive rail and Vr = Vc + Vf for the negative rail, where Vc is the desired clamping level and Vf is the forward voltage drop of the clamping diode(s).In my example clamping starts at just about 3.3V and reaches almost 3.6V at +10V input, which is a bit too high: it's better to set the voltage of the positive clamping rail a bit lower.Dependence of Vf on the current that's flowing through the diode determines how far from flat the clamped signal voltage will be. The higher the current, the higher the Vf. In other words, there is a certain voltage range in which the input signal is already distorted, but not yet fully clamped, and that is seen on the oscillograms as the output trace being non-flat where the input signal exceeds the clamping thresholds.D1 and DZ1 are used in my example as a primitive way to set the clamping rail voltages. This is not power-efficient: a less wasteful way, where it is important, would be to use linear regulators or voltage follower op amps. Besides, as DZ1 starts to sink more clamped current, the voltage drop across it increases, thus further spoiling the flatness characteristic of the positive clamper. A beefy cap across the zener will help with that if the overload condition isn't lasting long.Of course, this simulates pretty well, save for the effects of parasitic inductance and capacitance, which manifest themselves in hardware as phase shift and degradation of high frequency content between input and output.

author: eTobey
author_rank: Super Contributor
timestamp: May 22, 2024, 05:45:11 pm
content: Quote from: shapirus on May 22, 2024, 02:29:03 pmYes it looks good, but thats with a rail, and i was wondering if it could be achieved without a rail.I have something like this in my mind, what do you think about that? (see picture)

author: shapirus
author_rank: Super Contributor
timestamp: May 22, 2024, 07:02:40 pm
content: Quote from: eTobey on May 22, 2024, 05:45:11 pmNo it won't be clamping efficiently enough and it will distort your signal.I strongly suggest that you learn how to run simulations (e.g. kicad+ngspice). It will remove a lot of guesswork and let you try various ideas.