Best Practices for MCU Input Protection Circuits

Thread Starter

Saeedk9574

Joined Jan 1, 2024
35
Hi everyone,

I have some questions about MCU input protection. Although this topic has been discussed many times in this forum and others, I find myself baffled by the differing answers. Thank you in advance for your insights!

In my project, I will be using both digital input (for a motion detector) and ADC input (for temperature and photocell sensors). First, I would like to know if the protection circuits for digital input and ADC input are different.

Secondly, which of these circuits is recommended, or is there another circuit you would suggest for protecting both digital and ADC inputs?

Thanks again for your help!

1729333428426.png1729333448959.png
 

MrChips

Joined Oct 2, 2009
34,628
Input protection requirements will depend on the application and the severity of the operating environment.

If your environment is severe heavy industrial with extensive cable lengths, then neither circuits shown above is appropriate. Use opto-couplers instead of direct signalling.

Analog signalling requires a different solution.
 

Thread Starter

Saeedk9574

Joined Jan 1, 2024
35
Input protection requirements will depend on the application and the severity of the operating environment.

If your environment is severe heavy industrial with extensive cable lengths, then neither circuits shown above is appropriate. Use opto-couplers instead of direct signalling.

Analog signalling requires a different solution.
The inputs will be used for sensors like motion detector, temperature sensors. Cable length would be 30m at most. Accordingly, which protection circuit is suggested?
 

ronsimpson

Joined Oct 7, 2019
4,647
Top schematic. The power of the overvoltage is clamped by a Diode and Zener. The 10 and 1k resistors limit the current. This is good for TTL but not good for analog if the signal voltage is near 4V. Low voltage Zeners will leak current. The knee is soft.
1729344727101.png
Bottom schematic. The Zener problem goes away. You can have the input signal in the 0 to 5V range without problems. But now if the power in the overvoltage is too much it will lift the +5V supply. It the wire is connected to +12V it will lift the 5V supply. In this example you will have about 0.5A flowing into the +5V.
1729344956957.png
 

Thread Starter

Saeedk9574

Joined Jan 1, 2024
35
Top schematic. The power of the overvoltage is clamped by a Diode and Zener. The 10 and 1k resistors limit the current. This is good for TTL but not good for analog if the signal voltage is near 4V. Low voltage Zeners will leak current. The knee is soft.
View attachment 333950
Bottom schematic. The Zener problem goes away. You can have the input signal in the 0 to 5V range without problems. But now if the power in the overvoltage is too much it will lift the +5V supply. It the wire is connected to +12V it will lift the 5V supply. In this example you will have about 0.5A flowing into the +5V.
View attachment 333952
Thanks for your answer, so I can use both circuits for digital input. if I am not mistaken the bottom one with Schottky diodes is more suitable for TTL. But what is the appropriate protection circuit for the ADC input?
 

ronsimpson

Joined Oct 7, 2019
4,647
Optocoupler usually have isolated power and isolated grounds.
ADC inputs should not have the Zener. Use the two diodes type. You will not be using a pull up or a pull down resistor.

Remove the pull up resistor. If you have problems increase the 1k and maybe the 0.01uF in the green square.
In the layout make these grounds strong and the +5V connections strong. Add a bypass capacitor to the IC!
1729428326097.png
 

Thread Starter

Saeedk9574

Joined Jan 1, 2024
35
Optocoupler usually have isolated power and isolated grounds.
ADC inputs should not have the Zener. Use the two diodes type. You will not be using a pull up or a pull down resistor.

Remove the pull up resistor. If you have problems increase the 1k and maybe the 0.01uF in the green square.
In the layout make these grounds strong and the +5V connections strong. Add a bypass capacitor to the IC!
View attachment 333996
I got that Zener is not suitable in ADC. Some people also suggest to use TVS. If TVS is better compared to Schottky, which part number of TVS do you recommend?
 
Top