I can't get zener diodes to work as I expect

As I understand it a 3.3v zener diode is supposed to not conduct any current in the reverse direction (like a normal diode). But as soon as a 3.3v or higher voltage is applied to it reversely, it will "open up" and start to conduct in the reverse direction.

But that's not what happens with my circuit:

Here I'm raising the input voltage from 0 volts to 10 volts.

What I expect to measure at the "measurement point" is:
As long as the input voltage is below 3.3v the voltage at the "measurement point" should be 0. But as soon as the input voltage reached 3.3v the zener diode should open and the voltage at the "measurement point" should be equal to the input voltage (minus diode drop maybe?).

But what actually happens is:
This is a small chart of the relationship between the input voltage and the voltage at the "measurement point"
Input Voltage --- Voltage @ Measurement Point
2v --- 0.06v
3v --- 0.5v
3.5v --- 0.9v
4v --- 1.2v
5v --- 2v
6v --- 2.8v
7v --- 3.8v
8v --- 4.7v
9v --- 5.6v
10v --- 6.5v

As you can see the diode doesn't have a specific voltage where it opens up. It almost linearly passes current and nothing specific happens at 3.3v even tho it's a 3.3v zener.
Can someone explain why I'm missing here?

Edit: What I'm trying to achieve is a voltage detector. I want the output to be LOW when the input voltage is below 3.3v and HIGH when the input voltage is above 3.3v

So you have learned that a Zener does not have a sharp "knee" or threshold. :astonished:

Read the article!

Look for a 3.3 V "voltage supervisor".

With an ideal Zener your measurement voltage should be (Input voltage - 3.3 V). IT does not work as you wish.
The "most ideal" Zeners are those with Zener voltage around 6 V. 3V3 is too far from ideal and only slightly better (if better at all) than a blue LED.

Zeners are known to be seriously leaky. Best use of a zener is to limit a voltage level, they're not suitable as detector of a specific voltage or regulator.

Good research by the way, miles above the common "it doesn't work!" post.

Now for your problem: detecting whether a voltage is above or below a certain level. To do this, you have to use a comparator such as the LM339 (and your supply voltage must be higher than 3.3V for it to do its job). One input goes to the signal to measure, the other to a voltage divider set to 3.3V (or if you need high precision some kind of voltage reference, e.g a 3.3V regulator).

The LM339 has open collector output as do most comparators, so you have to use a pull-up resistor on the output (an external one, or the Arduino's built-in pull-up).

For "slow" signals, an OpAmp can do the job as well. Use that for your experiments if you have an OpAmp but no comparator in your parts bin.

Zeners are imperfect but it's working as expected with most of the voltage dropped across the diode until you get to the Zener voltage and then it stabilizes about 3.3V.

2v - 0.06v = 1.04
3v - 0.5v = 2.5
3.5v - 0.9v = 2.6
4v - 1.2v = 2.8
5v - 2v = 3
6v - 2.8v = 3.2
7v - 3.8v = 3.2
8v - 4.7v= 3.3
9v - 5.6v = 3.4
10v - 6.5v = 3.5

Have you considered the possibility of measurement point to analog input setup (no zener, just voltage divider), and calibrating the criteria in the code, when A0 increases a variable over the value equivalent to your wanted one?

pourduino:
What I'm trying to achieve is a voltage detector. I want the output to be LOW when the input voltage is below 3.3v and HIGH when the input voltage is above 3.3v

But the point is - what is the purpose of this voltage detector? Is it to shut something down when the voltage is too low or is it to go to an Arduino input? How you do it critically depends on the purpose.

Hi,

What I expect to measure at the "measurement point" is:
As long as the input voltage is below 3.3v the voltage at the "measurement point" should be 0. But as soon as the input voltage reached 3.3v the zener diode should open and the voltage at the "measurement point" should be equal to the input voltage (minus diode drop maybe?).

No.
This is what you should and do get.

What I expect to measure at the "measurement point" is:
As long as the input voltage is below 3.3v the voltage at the "measurement point" should be about zero, but there will be leakage through the zener diode.
But as soon as the input voltage reaches 3.3v the zener diode should start to conduct current and the voltage at the "measurement point" should be equal to the input voltage (minus the 3V3 zener voltage).

The zener does not "open up" it begins to conduct current when its Zener Voltage is exceeded, this voltage as explained elsewhere is not a finite point or consistent from one 3V3 zener to the next.
Tom... :slight_smile:

In English "open" means no electrical conduction, which is confusing as this is completely different
from water and taps (despite this being a common analogy to current flow!). When a switch
is "open", there is a gap between the terminals, so no current flows - the terminology comes
from old-fashioned knife switches: Knife switch - Wikipedia

Devices sold as "zeners" are true zeners if low voltage (5V or less typically), and usually avalanche
diodes at higher voltages. Avalanche diodes have much sharper knees in their curves than true
zeners. Around 5V a zener tends to work simultaneously as a zener (tunneling) and avalanche
(breakdown) - these have opposite tempco's, so tend to cancel in 4.7V zeners which have the
best temperature stability.

Some AVR based Arduinos (Uno, Nano etc.) have a built in comparator and voltage reference which may suit your purpose.

If you want to build something with discrete components, you could try something like this which relies on the voltage needed to turn on a silicon BJT transistor (~0.7v). It has a feedback part to make the switch reasonably sharp.
There are also probably many better ways of achieving the same thing.

It is similar to a design here: Wilf Rigter on Schmitt triggers

Something this simple might work. In theory, the transistor would start to conduct when the voltage across the resistor reaches about 0.6V. It probably wouldn't be a very sharp knee, but you would just have to test it. The GPIO would read high when the DC voltage is low, and low when the DC voltage is high.

Zener voltage detector.png

Zener voltage detector.png

ShermanP:
Something this simple might work. In theory, the transistor would start to conduct when the voltage across the resistor reaches about 0.6V. It probably wouldn't be a very sharp knee, but you would just have to test it. The GPIO would read high when the DC voltage is low, and low when the DC voltage is high.

Zener voltage detector.png

That doesn't look too bad, but, as you've pointed out, is inverted. I've had to use a 4.7v zener because my LTspice installation has nothing lower at the moment:

The resistor should be between the input voltage and the cathode and the measurement point should be the cathode.
(see Reply #9)
Note that the configuration matches the above statement.

So with a 4.7V zener, it switches about 0.4V higher than that. And it actually is reasonably sharp. What would the simulation look like if you connected R3 to a separate fixed 5V or 3.3V supply (assuming that's how the processor's pullup resistor would be configured)?

ShermanP:
So with a 4.7V zener, it switches about 0.4V higher than that. And it actually is reasonably sharp. What would the simulation look like if you connected R3 to a separate fixed 5V or 3.3V supply (assuming that's how the processor's pullup resistor would be configured)?

Like this, very similar and again with a 4.7v zener:

raschemmel:
The resistor should be between the input voltage and the cathode and the measurement point should be the cathode.
(see Reply #9)
Note that the configuration matches the above statement.

If you mean on my single-transistor circuit, then I'm not sure. The NPN would still switch based on the drop across the resistor, but the collector current that pulls down the GPIO pullup would have to flow through the zener. I'm not sure whether that makes it better or worse. Perhaps 6v6gt can simulate that and tell us.

I'm saying that if you google zener diode circuit you will get over a million hits, ALL OF THEM with the resistor between the input voltage and the cathode.

"https://www.electronics-tutorials.ws/diode/diode_7.html"

raschemmel:
I'm saying that if you google zener diode circuit you will get over a million hits, ALL OF THEM with the resistor between the input voltage and the cathode.

"https://www.electronics-tutorials.ws/diode/diode_7.html"

That is true and how the characteristics of a zener are most simply demonstrated. But what circuit do you propose (if any) to match the OP's requirement:

. . .
Edit: What I'm trying to achieve is a voltage detector. I want the output to be LOW when the input voltage is below 3.3v and HIGH when the input voltage is above 3.3v

raschemmel:
I’m saying that if you google zener diode circuit you will get over a million hits, ALL OF THEM with the resistor between the input voltage and the cathode.

https://www.electronics-tutorials.ws/diode/diode_7.html

I understand, but for this purpose I don’t see how that configuration helps. I don’t think it would work for my single-transistor circuit since the GPIO would be pulled “down” to the zener voltage, which doesn’t work. And on the OP’s original circuit, if you switch the resistor and the diode, the test point would just equal the input voltage, but would be capped at 3.3v. That doesn’t give him the high/low indicator he wants. But certainly if you want to produce a 3.3V supply or reference voltage, the resistor would be on top.

So 6v6gt, at the risk of wearing out my welcome, could you do one more simulation on my circuit, to see if changing the 1K resistor to 22K or so would (1) bring the switching point closer to the nominal zener voltage, and/or (2) make the knee sharper?