# Flip a Schmitt-Trigger when current flows through a Zener diode

I am trying to design a circuit using an intermitent power source (a bicycle hub generator), which is rectified and filtered, and regulated at 6,8V.

Now I want to "detect" when the power source is ON or OFF. I made an experimental circuit (below) to validate the idea that if I put a pull-down at NODE1, when VCC rises above 6.8V, current flows through the zener, the mosfet is activated, and the LED shines.

simulate this circuit – Schematic created using CircuitLab

This seemed to work as expected, but there was some ripple, and the on/off transition was not as sharp as I need. So I thought about using a Schmitt trigger, since I have some ICs around (namely a CD4093BCN). I tried replacing the MOSFET with a double-inverter configuration using two of the IC gates, and the triggering works when I probe the trigger input with a direct wire from Vcc or Ground, but not when I connect the input to NODE1.

simulate this circuit

While measuring V at NODE1, I found out it does not rise enough to trigger (does not go above 2/3 of VCC).

My questions are:

1. What am I doing wrong?
2. How could I properly activate the Schmitt trigger when the Zener is "on"?
3. Would I be better served with an OpAmp Schmitt trigger instead of a Logic-Gate one?
• Could you provide a schematic of the schmitt trigger variant as well? – po.pe Jun 21 '18 at 11:20
• @Humpawumpa I added the schematic. The trig buffer means the IC properly connected to power rails. I made a mistake and the trigger output is "sinking" the led instead of "sourcing" it, but the overall intention is preserved: the "on-off" state of the led should be associated with the "off-on" state of the VCC voltage. – heltonbiker Jun 21 '18 at 11:29

The Schmitt trigger ICs have rather poorly defined thresholds that are percentages of the supply voltage, not absolute voltages. This is clearly spelled out in the datasheet. If you derive the supply from the input voltage you have to take that into account. If the input voltage is Vcc - 6.8V then for that to be 2/3 Vcc then the input voltage should be 3*6.8 = 20.4V, which will destroy the chip.

You can try something like this, which uses half of an inexpensive dual op-amp as a comparator. The thresholds are around 6.8V for 'on' and 6.3V for 'off' with the values shown. Change R4 to alter the hysteresis.

simulate this circuit – Schematic created using CircuitLab

• Thanks for your answer! Do you think a CA741CE is a good OpAmp for this? I have one around. Also, do I assume correctly that altering the proportion beetween R6 and R5 I could tune the values of the input voltage thresholds? – heltonbiker Jun 21 '18 at 12:25
• A 741 will not work. R5/R6 will let you vary the threshold without changing the zener, within a range. – Spehro Pefhany Jun 21 '18 at 12:36
• Thanks again! Pardon my lack of knowledge, but could you please tell me why the 741 doesn't work? Is there a way to know if any other OpAmp would work or not, or are there a set of characteristics that would guide me to choose a fitting OpAmp for this application? – heltonbiker Jun 21 '18 at 13:11
• The 741 needs more supply voltage and the input common mode range does not include ground. The LM358 is likely the cheapest op-amp in the world (maybe a penny or two in volume) and is suited for this application, especially the wide supply range. It's the dual version of the quad LM324 that Bimpelrekkie used. – Spehro Pefhany Jun 21 '18 at 13:44
• Yes, you can use an LM393, it will work about as well in the above circuit, but put a 10K in parallel with the LED to keep the hysteresis about the same. – Spehro Pefhany Jun 21 '18 at 14:53

The first circuit can be made with a bit more "steep" respose by using an NPN instead of an NMOS:

simulate this circuit – Schematic created using CircuitLab

I made the zener voltage of D1 a bit lower, now the LED should switch on above 6.2 V + 0.7 V = 6.9 V.

Regarding the circuit with the Schmitt trigger, note that the levels of the Schmitt trigger are relative to the supply voltage so it is chasing a moving target (the trigger level moves up as the supply goes up).

If you could the Schmitt trigger's input to ground then that stays constant as the trigger level changes with the supply. This might work, what zener value you need I do not know, I would experiment a little. To make the LED light up when the supply (and trigger level) is larger than a certain value, 2 NAND gates in series are needed. If you reference the LED from ground then one NAND gate will do of course:

simulate this circuit

Am opamp based solution could look like this:

simulate this circuit

R7 is optional it adds a bit of hysteresis like in the Schmitt triggers. Make R7 smaller to increase the distance between the trigger levels. Remove R7 to have no hysteresis at all.

• Thanks for your answer! I noticed you exchange the position between the Zener and its series resistor. My initial configuration assumed there would only be "voltage" in NODE1 when the Zener was conducting (that is, when VCC went up the Zener voltage). I did'nt understand your inversion. It seems to me that NODE1 (the Schmitt trigger input) would be always following VCC, even when below Zener voltage, and the Zener diode role in this circuit is not clear to me. Could you elaborate on that? It would be very useful to me, thanks! – heltonbiker Jun 21 '18 at 12:16
• Also, along the "Zener + BJT" solution model, I found this, any thought about it? electronics.stackexchange.com/a/272424/5814 – heltonbiker Jun 21 '18 at 12:18
• In my 2nd circuit the zener makes a reference voltage, let's assume it is 3 V. Also assume that trigger levels are 1/3 and 2/3 of supply. So at supply = 3 V, NODE1 = 3V so above 2/3 of supply so a "1", then NAND1's output will be "0" and NAND2's will be "1", the LED is off. To make the LED switch on, we need a "0" at the input of NAND1. To get that "0" the voltage needs to be at 1/3 of the supply voltage. The reference voltage is 3 V then the supply needs to be 9 V (1/3 * 9 V = 3 V). Above 9 V the input of NAND1 will be less than 1/3 of supply and the LED will switch on. – Bimpelrekkie Jun 21 '18 at 12:57
• The circuit presented in electronics.stackexchange.com/questions/272408/… doesn't work, it needs serious modifications, I would just forget about that circuit. It is not what you need. – Bimpelrekkie Jun 21 '18 at 13:00