Input protection tip

I was working with a magneto-resistive float level sensor that has a 0 - 5V output, and it’s powered by 12VDC. Since the ADCs are all 0 - 3.3V, I put a voltage divider with equal resistors to make 0 - 2.5V. When I tested the sensor, and at maximum height it was closer to 6V, so I wanted the extra safety margin and didn’t adjust the resistors to make exactly 5V → 3.3V.

When I redesigned the controller board, I added input protection: A D1213A TVS, which is a combination of a Zener diode and two regular diodes to make a rail-to-rail voltage limiter. I’ve been putting these SOT23 devices on a lot of circuits as they are cheap but provide extra protection. The circuit looks like this:

As it turns out, this was fortuitous because I had a bad ground connection. I hadn’t tested this scenario, but the sensor produces 10V in that case. Even with the voltage divider it was 5V, which could have permanently damaged the ADC.

But with the D1213, there was no damage, the ADC just read the maximum value (4095) which is what tipped me off to something being wrong, since the level should never be that high. (I measured the voltage with a DMM and it really was 3.3V.)

There’s a voltage divider in this circuit so there’s effectively a series resistor to the source. If there was a direct 3.3V input I would have added added a 100Ω series resistor. This is to make sure the 3.3V rail-to-rail wins over the input. Without it, the external voltage could end up increasing the voltage of 3V3 until the Zener fully kicks in.

9 Likes

@rickkas7, does the resistor in the divider or the 100Ω resistor not also provide current limiting so the D1213A’s current shunting limit is not exceeded?

1 Like

Yes, that’s exactly what it does.

2 Likes

@Rickkas7. Am I correct in assuming that for the 3v3 case the voltage divider is removed and replaced by 100ohm resistor between the input and the adc input?

1 Like

Sorry, I did not explain that well. Here’s a better example:

I also have a pressure sensor that outputs 0 - 3.3V, so it does not need a voltage divider going into the ADC. In this case, I added a 100Ω series resistor between the sensor input (green line on the far right) and the TVS and ADC.

2 Likes

Thanks @rickjas7 That was what I assumed but it’s good to have I confirmed. This is a neat and (from my perspective) timely solution to protecting the adc input.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.