Best way to protect analog input of ESP32

What is the best way to protect analog input of ESP32?
I found the following schema that is supposed to protect the ESP32's analog inputs.
3.3v_input_protection.

The issue with it is that the voltages at the input and at the ADC (pin) are different (hence, measured values are messed up).
Thank you.

Protect against what? Transients?

yes

Dont the input pins already have internal protection diodes ?

Normally one would use a TVS diode. Capacitance can also do the trick.

You are experiencing transients on the analog inputs to your ESP32 that has been damaging your ESP32's? Post O-scope images of the detected transients so we can see how your circuit needs protecting.

If you have external connectors with high impedance input signals, then adding protection against static shocks is not uncommon. If you want the device to pass EMC testing it's most likely even a necessity.

1 Like

Yup.

Give an example. What is the voltage applied at the input and what is the voltage at the pin?

1 Like

I would make a few modifications to your plan.

  1. add a 0.1µF immediately at the input (far left). Its function is to squelch any RF (being continuous or transients or ESD) coming in on your leads.

  2. Increase the 470 ohm to something like a couple of kilo ohms. Will reduce the current to the schottkys due to any large/long transients of miswiring.

  3. add another couple of kilo ohm resistor (2k - 5k) between the Schottky's and the ADC input. This will limit any current into the ADC protection diodes in the event of a really high transient that pumps a lot of current into the Schottky's. This is optional but adds a bit of extra protection.

  4. add another 0.1µF cap connected directly to the ADC input pin to the ground of the Arduino board. You want the shortest leads possible. This will smooth any noise from going into the ADC and will give you better readings. It is not related to transients or protection.

Hope this helps.

1 Like

Schottky diodes can also add a problem. They have high leakage that increases dramatically with temperature. If you use them, then you can't measure high impedance sources correctly.

Another way is to use common diodes (1N4148, 1N4004), and have the resistor between them and the pin.

Another way is to reduce input voltage (and current) with a voltage divider, and code for a lower Aref voltage.

What you need to do (or not) all depends on the characteristics of the source.
Leo..

Most improbable with only a 470 Ohm series resistor. :roll_eyes:

1 Like

To help understand what might be going on, can you tell us:

  1. What you current input circuit is?
  2. Where (i.e. physically the location of you measurement probes) are you measuring for each?
  3. What you are using as a meter.

So far, I am only using a simulator (iCircuit) as follows:
simulation1

Use a voltage divider.

If you want to measure 6V and a clipper circuit holds the input down to 3.3V is used than measuring the 6V will not happen.

Voltage Divider Calculator (ohmslawcalculator.com)

10V as source voltage,10K for R2, 3.3V for output volts give a resistor value for R2. Use 1% resistors and go through the resistors measure them for closest match and use the actual resistors values in the calculations.

It is not about a want to protect the inputs, it is more about a want to scale the analog input to match the ESP32's input parameters.

Stick with 10K for R2, impedance matching.

I get this feeling too.

You did not post what zeners you are using.

Nobody has mentioned zeners.
I assume OP meant a Schottky diode clamping circuit, but didn't use the correct symbols.
Leo..

This is why you ask for information before running off half-cocked trying to solve a problem.

@OP: so, thank you for answering my question about what you applied vs. what you read. Next question: are you trying to measure that 6V, or is it just an example of the overload you're trying to protect against?

I agree, however simulation the seems to think there are zeners in the circuit. Assuming the simulation knows the proper symbol for what it is simulating.

In either case I don't know many low voltage zeners that would result in a 3.1 volt result.