Using a voltage reference as input voltage protection

I’m looking to fab some PCBs, and the place I’m looking at offers cheap assembly, as long as you stick to a limited set of components (a few thousand).

One of the things I need is input voltage protection. I want to clamp inputs up to around 12 v down to 3.3 v (the limit of the microcontroller I’m using).

My first thought was a Zener diode, but looking at the datasheets (and also doing some benchtop experimentation), I’m not too happy with them. They need a fairly high current to stay in their constant voltage zone, but limiting the current means a resistor–and I have to pick the resistor based on the worst case. Which means an excessively high current for high voltages. It doesn’t doesn’t seem to work out that well.

I then thought about a linear regulator, like an LM7833. I did some quick experiments with a 7805 I had handy and it actually seems to work well, even with little or no load on the output pin. Datasheets say I need capacitance for stability, though. And it does have a significant voltage drop, though I know LDOs are available.

But then I remembered voltage reference ICs, like the TL431/432. These are 2.5v, but I can work with that (the inputs are digital). They can operate in a couple of different modes. One is just like a Zener: tie the reference and cathode pins together, and connect them to the input with a resistor. The chip then passes enough current to keep the reference at 2.5v. Alternatively (and slightly better, I think), I can tie the cathode directly to the input (it handles up to 37v), and then tie the reference to ground with 470kohm resistor (it just needs 4 uA to operate). I’m not sure what it does at <2.5v input but I don’t care too much (ideally it would just output that voltage, but it’s not a big deal).

Oh, right: I don’t need a great frequency response. This is for sampling really low bandwidth signals. 1 kHz is fine. Though it’s sort of a multipurpose device so I wouldn’t say no to higher bandwidth.

Any ideas? Remember, no uber-fancy ICs, since the fab place isn’t going to stock those among their common parts. They have all the obvious passive components and a decent selection of basic semiconductors (including Zeners, LDOs, and voltage references), but nothing esoteric.

Are you looking for a level shifter or an over voltage protection circuit?

In either case, a zener is the standard method for providing over voltage protection. For level shifting, there are standard circuits using simple MOSFETs.

An opto isolator might be your best bet.

What are the inputs? How much current can they source?
Perhaps you could describe the problem scenario you are trying to guard against?

Also, what is your sensor receptor… is this going directly to a microcontroller input pin?

So if it is 3.3 V logic, is it safe to assume you want the voltage to be knocked down to something between 2 V and 3.3 V?

What is the range of the incoming voltage for a high signal? Is it 3 V to 12 V? 5 V to 12 V? Something else?

Some more specific requirement would help. Current draw? Power source?

My first thought would generally be an LM317. But without some further guidance, hard to say. They have very good characteristics, but might be a bit beefy…

The requirement seems to be for voltage regulation, and less so protection. If you want proper protection a crow bar and fuse is the usual route. But if you won’t be exceeding the input limits or forward current limits on the regulator, you probably don’t actually need protection. There are some very neat modern ICs that can provide a lot of protection in a small package, but they are well into the exotica.

I’m not sure. In the OP he seems to be referring to signal pathways, rather than power supplies?

Hi Doc… maybe you could give us a bit more detail on the use case?

Yeah, does look more that way.
In which case a bit more about the signals to be clamped might be useful. Source impedance, voltage range expected, needing to be protected against, input impedance of the doohicky being built, noise margin and sample rate, nature of signal being processed, especially bandwidth and s/n.

Let’s clarify. You have a 0 to +12V input signal driving a microcontroller which has a max input of 3.3V. You want to protect the input of the microcontroller but not draw high current from the input.

Is this a digital or an analog signal? Are you just changing a 12V logic level to a 3.3V logic level? Or are you driving an A/D converter input on the microcontroller so you need to preserve a linear input from 0 to 3.3V and then clip at 3.3V?

More information on the input signal would be useful. What is its source impedance? If high enough then a simple diode to the +3.3V supply would suffice.

One generally doesn’t put devices which draw significant current in series with inputs.

You either use a passive clamp, like a Zener or TVS, or you actively condition the inputs (add series resistors, a clamp and a buffer).

We need to know more about what these inputs are supposed to do.

Agree.

He also mentioned 1 kHz. I am not sure how quickly a voltage regulator can turn on and off.

My first thought is to buffer the incoming signal with an op amp (non-inverting, G = 1). And then have the op amp drive a resistor and 3 V zener.

Thinking about it some more, assuming a high input impedance at the microcontroller input a resistor in series with the input signal along with a diode to the 3.3V supply that forward biases when the input goes a diode drop above 3.3V should do it. Use a Schottky diode if you want a slightly lower clip level. With a large enough (10k or so to limit current to < 1mA) resistor you could just let the diodes internal to the microcontroller handle the clipping.

Input => Resistor => Diode anode => diode cathode => 3.3V supply

Microcontroller input where the resistor connects to the diode anode.

Hey all, thanks for the responses. I obviously could have used more detail, but I was cagey since the point of it is to be fairly multipurpose. I build a lot of small doohickeys and always need some small extra bits, so I wanted to put together an extender board with some extra features–one of them being inputs tolerant to a wider voltage range. I’ve done this in the past with simple resistor dividers when I knew the signal voltage, but I’d like something that I don’t have to build custom each time. I want a 3v or 12v input to both register as high on the microcontroller.

The ideal would simply be a GPIO that’s high impedance, high bandwidth, and tolerant up to >=12v. But there’s the parts bin problem at the fab, so I suspect I’ll have to sacrifice some things to get there. That’s ok–usually these inputs are just checking if a thing is on or off. I’m not receiving SPI data at 40 MHz here. I guesstimated 1 kHz at the highest I’ll need, but this is really fuzzy.

Oh, and I’d rather not need a 12v supply. I looked at level converters a bit, but these are getting close to the edge of what’s available, and at least some require a supply voltage at the upper limit. I’ll have 5v from USB and 3.3v regulated from the microcontroller board available.

Let’s see, what other details… I’d prefer to keep the input impedance under ~2.4kohm. That’s not very high, obviously (5mA at 12v). But some of the Zener solutions I looked at need more to stay at the rated voltage. The lower the current the better, of course.

One more thing: I could use a fixed resistor divider and one of the analog inputs. In fact I plan on having that already for actual wider-range analog sampling. But I only have so many pins available on this board so I wanted something else for the digital pins.

And to answer some specific questions as I read through the responses:

Diverse, as noted. It would be nice to keep it under 5 mA. Most external devices can handle that much, at least.

Yes. An ESP32-C3, specifically.

This one. 3v needs to work, so whatever the protection is, it can’t have too much voltage drop.

I do have a few of them in my personal supply for experimentation. Any particular configuration you have in mind?

Digital. But as noted, it might be 12v, or it might be 3v. Basically I want to clamp at ~3v, or anything that registers as a digital high (datasheet says about 2.5v, though I could probably do with less).

Hmm. BTW, the pins are actually tolerant to 3.6v, so even with a bit of diode voltage drop that would be ok. But that might just work.

So if I understand correctly, you have a voltage signal, and:

  1. If the voltage signal is between 3 V and 12 V, convert it to a high logic-level (2 V to 3.3 V for 3.3 V logic).

  2. If the voltage signal is less than X V, convert it to a low logic-level (0 V to 0.8 V for 3.3 V logic).

If that’s correct, what is X? Convert anything less than 2 V to a low logic-level?

I’m not too picky, really. The datasheet says anything below Vdd*0.25 is low, while >Vdd*0.75 is high. Quite a wide range. If it’s somewhere in that ballpark, I’m happy. I doubt I’ll be dealing much with signals <3.3v.

If this is the case, just use a FET as the input buffer.
Have Vgs > 20V, and put a clamp on the input, and pick one with a nice, low threshold voltage, and you get what you want with only two components.

That should work. The only potential issue (no pun intended) is that a clamp will draw current from whatever it is that is producing this voltage, and I’m not sure what the output impedance if this device is.

It would require more parts, and be more complex, but another idea is to feed this voltage into an LM339 comparator. Power the comparator using 5 V. Take the 0 V to 12 V signal and use a voltage divider (with fairly high value resistors) to get it down to 0 V to 4 V, and then feed it to one terminal of the comparator. And then stick a 1 V reference on the other terminal of the comparator. (The 1 V reference can be made from 5 V and a voltage divider.) Add a hysteresis resistor, and a then a voltage divider on the output to get it down to 3.3 V.

If you make the resistor 100k you will have plenty of bandwidth (> 100 kHz) as long as you use a small diode (< 5pF capacitance). That would limit the current through the diode to roughly 100uA, which would be a very small voltage drop - a half volt using a 1N4448. A 10 cent resistor and a 10 cent diode. Minimal power. For 10 cents more use a Schottky and get the drop down to 0.2V if you are still worried.

The fab has an RB751V40 for 2.6 cents. Looks like a good fit.

Anyone have reasons to go for a FET vs. this method? As I’ve mentioned, the sources I care about can sink some current. 5 mA is acceptable. 100 uA is fantastic. I’m often just testing if another thing is on or not. For example, I had some nice LED lamps that I wanted to enable for Home Assistant, but I wanted feedback in case I turned them on at the lamp. So I just measured whether the LEDs had power or not. No problem with a little extra current there. In other cases I’ve sampled status LEDs to figure out if something is on or not.

That works in several of our systems.