I have the Schmitt trigger circuit below that I read the output as 1.6V for the logic High. I wonder how can I increase the output voltage of the comparator below without changing the threshold of the Schmitt trigger?
Increasing output voltage of a schmitt trigger op amp
operational-amplifierschmitt-triggervoltage-regulator
Related Solutions
To create a Schmitt-trigger you have to supply positive feedback, from the opamp's output to the non-inverting input. Usually this input will be the threshold voltage, and it will take one of two values (that's the hysteresis) depending on the opamp's output.
In your case you have the signal on the non-inverting input. You can also make it work this way, but I would suggest you switch both inputs, and also swap R1 and PTC still have the same behaviour: a higher PTC resistance will decrease the inverting input, and when it reaches the threshold the fan will be switched on. So let's do that, and add an R5 from output to the R2/R3 node.
You mention the hysteresis in °C, but we need the voltages. Let's do a theoretical calculation with a \$V_H\$ and \$V_L\$ as thresholds, and assume a rail-to-rail output opamp. Then we have two situations: the high and the low threshold, and three variables: R2, R3 and the added R5. So we can choose one of the resistors, let's fix R2.
Now, applying KCL (Kirchhoff's Current Law) for the R2/R3/R5 node:
\$ \dfrac{12 V - V_L}{R3} + \dfrac{0 V - V_L}{R5} = \dfrac{V_L}{R2} \$
and
\$ \dfrac{12 V - V_H}{R3} + \dfrac{12 V - V_H}{R5} = \dfrac{V_H}{R2} \$
This is a set of linear equations in two variables: R3 and R5, which is easy to solve if you can fill in actual voltages for \$V_H\$ and \$V_L\$ and a freely chosen R2.
Let's for the sake of argument suppose that at 38 °C you have 6 V on the inverting input, and at 42 °C you'll have 5 V. Let's pick a 10 k\$\Omega\$ value for R2. Then the above equations become
\$ \begin{cases} \dfrac{12 V - 5 V}{R3} + \dfrac{0 V - 5 V}{R5} = \dfrac{5 V}{10 k\Omega} \\ \\ \\ \dfrac{12 V - 6 V}{R3} + \dfrac{12 V - 6 V}{R5} = \dfrac{6 V}{10 k\Omega} \end{cases} \$
or
\$ \begin{cases} \dfrac{7 V}{R3} - \dfrac{5 V}{R5} = \dfrac{5 V}{10 k\Omega} \\ \\ \\ \dfrac{6 V}{R3} + \dfrac{6 V}{R5} = \dfrac{6 V}{10 k\Omega} \end{cases} \$
then after some replacing and shuffling we find
\$ \begin{cases} R3 = 12 k\Omega \\ R5 = 60 k\Omega \end{cases} \$
I already said it's less common, but you can also use the current schematic, and the calculations are similar. Again, add an R5 feedback resistor between output and non-inverting input. Now the reference input is fixed by the ratio R2/R3, and the hysteresis will shift your measured voltage up and down, which — at least for me — needs some getting used to.
Let's suppose we fix the reference voltage at 6 V by making R2 and R3 equal. Again we calculate the currents at the node PTC/R1/R5, where PTC\$_L\$ and PTC\$_H\$ are the PTC values at 38 °C and 42 °C resp., and R1 and R5 are our unknowns. Then
\$ \begin{cases} \dfrac{6 V}{PTC_H} = \dfrac{12 V - 6 V}{R1} + \dfrac{0 V - 6 V}{R5} \\ \\ \\ \dfrac{6 V}{PTC_L} = \dfrac{12 V - 6 V}{R1} + \dfrac{12 V - 6 V}{R5} \end{cases} \$
Again, solve for R1 and R5.
Note that the LMC6772 chip you are using is not an opamp; it's a comparator that has an open-drain output. Since it can't actively drive its output high, the Schmitt trigger circuit won't work as designed.
The datasheet says, "Refer to the LMC6762 datasheet for a push-pull output stage version of this device."
However, look at how you have the optocoupler wired up: the anode of the LED goes to the output of the comparator, and the cathode goes to ground. This means that when the comparator output is "high", the LED is driven by the current coming through your resistor network, and when it is "low", the diode is shorted out. This also means that the "high" voltage at the output of the comparator is the forward voltage of the LED. (According to the datasheet, this is at most 1.8V)
Do NOT switch to the push-pull version of the chip unless you also add a current-limiting resistor in series with the LED.
Note also that the website you used to calculate your resistor values is assuming that the opamp in question has bipolar supplies, and that the output swings to -Vcc when the output is "low". Your opamp is being powered by a singled-ended supply, which makes the lower threshold 7.56V when the output is low.
So, the actual threshold voltages of your circuit are 7.92V when the output is at 1.8V and 7.56V when the output is at 0V.
The general equation for the the voltage at the junction of three resistors, each fed by a voltage source is:
$$V_{junction} = \frac{\frac{V_A}{R_A}+\frac{V_B}{R_B}+\frac{V_C}{R_C}}{\frac{1}{R_A}+\frac{1}{R_B}+\frac{1}{R_C}}$$
In your circuit, one of the three resistors is always connected to ground, so you can ignore that term in the numerator. If we plug in the voltages and resistors you used:
$$V_{junction} = \frac{\frac{12 V}{150 \Omega}+\frac{1.8 V}{470 \Omega}}{\frac{1}{150 \Omega}+\frac{1}{470 \Omega}+\frac{1}{560 \Omega}} = 7.92339 V$$
$$V_{junction} = \frac{\frac{12 V}{150 \Omega}+\frac{0 V}{470 \Omega}}{\frac{1}{150 \Omega}+\frac{1}{470 \Omega}+\frac{1}{560 \Omega}} = 7.56141 V$$
But you're right, these thresholds should work fine in your application, and they don't explain the problems you're seeing. I can only surmise that you're seeing some secondary effects arising from the fact that you're trying to operate a "micropower" comparator at some fairly high voltage and current levels.
Related Topic
- Schmitt Trigger Inverter
- Electronic – Discrete Schmitt Trigger: make output logic level at 0V, not 3V
- Schmitt trigger design to control lead acid battery charger
- Electronic – How to implement programmable Schmitt trigger
- Electronic – How to determine low and high threshold levels of a Schmitt Trigger for a known input
- Electrical – Schmitt trigger in button debouncer
- Electrical – Schmitt trigger with 741 op-amp not behaving as in simulation
Best Answer
This might not be exactly right, but because the comparator has an open-drain output, you have to think of it as being something resembling the device surrounded by the dashed box:
simulate this circuit – Schematic created using CircuitLab
When M1 is off (high output), the voltage at OUT is determined by the R1/R2 voltage divider. An open drain output does not drive a high voltage. Instead, it shuts off to a high impedance state, and the high voltage is created by a pull-up resistor (either supplied by you, or perhaps one that is provided in internally ("weak pullup" type feature)).
If you look at the hysteresis example in the datasheet, it works differently. The output is bootstrapped from the input. If we draw it with our explicit open drain model, it looks like this:
simulate this circuit
So here, if OA1 cuts off the output transistor, then OUT is at the same voltage as IN. It is pulled up to IN by the two resistors. And of course if the transistor is fully on, then OUT is pulled to ground.