# How to build a Schmitt trigger using transistors?

I understand that Schmitt trigger is a comparator circuit with hystersis and that it is used to convert signals from analog to digital and to remove noise from a signal using positive feed back. However how it actually works is confusing and to further understand it I decided to build one myself.

I decided to make a circuit with a power source of $V_{cc} = 8.5V$ that switchs on an LED when the input voltage $V_{in}$ exceeds the high threshold of $V_{HT} = 7.5V$ and switchs it back off when it goes below the low threshold of $V_{LT} = 3V$, I used a potentiometer as a voltage divider to control the input voltage. I used the following schematics:

simulate this circuit – Schematic created using CircuitLab

To determin the resistor values I set the quiesent current to $I_E = 1 mA$ when Q1 is off and Q2 is on, therefore: $$R_E = \frac{V_{HT}}{I_E} = \frac{7.5}{1 \times 10^{-3}} = 7.5 k\Omega$$ $$R_{C2} = \frac{V_{CC} - V_{HT}}{I_E} = \frac{8.5 - 7.5}{10^{-3}} = 1 k\Omega$$ When Q1 switches on and Q2 switches off, the emitter current changes and therefore: $$I_E = \dfrac{V_{LT}}{R_E} = \dfrac{3}{7.5 \times 10^3} = 0.4 mA$$ $$R_{C1} = \frac{V_{CC} - V_{LT}}{I_E} = \frac{ 8.5 - 3}{0.4 \times 10^{-3}} = 13.75 k\Omega$$ Now I wans't sure how to calculate R1, R2 so I assumed that $V_{B2}$ is equal to the high threshold and using the voltage divider between $R_{C1} + R1$ and $R2$: $$V_{HT} = \dfrac{R2}{R_{C1} + R1 + R2} \quad V_{CC}$$ I chose R1 to be equal to $1 k\Omega$ so: $$R1 = 1k\Omega \Rightarrow R2 = 15k\Omega$$

However when I tested the circuit it didn't work at all and the LED was constantly on regardless of the input voltage. Why is it not working as it should be?

• This circuit is simple enough that you could try simulating it to learn more about its behaviour. – PlasmaHH Jan 26 '17 at 9:32
• @PlasmaHH I tried to simulate it with ltspice but I'm not that good with it yet. – razzak Jan 26 '17 at 9:37
• Perfect opportunity to learn I would say. You could increase RC2 to say 100k and add like 3.3k to gnd to the base of q4 and then compare the difference in the simulation – PlasmaHH Jan 26 '17 at 9:45
• I think the main problem with this circuit is that the voltage at the collector of Q3 can never get low enough to swicth off Q4. Therefore your LED stays on all the time. I agree with PlasmaHH that this is the perfect opportunity to learn how to use a simulator. – Bimpelrekkie Jan 26 '17 at 9:51

The schmitt trigger part (Q1 and Q3) actually works. What doesn't work is your output stage. Check the possible voltages at Q3 collector:

• When Q3 is off, it is obviously close to the supply voltage. Therefore, there will be current through R3 and Q4 will conduct.
• When Q3 conducts, the current through RC2 will go through RE and, although it will be a bit closer to ground, the voltage across RE still makes it much closer to the supply than ground. Q4 actually still conducts. The current path is: RC2 -> (R3 || RE).

To quickly fix this, you can use a PNP at the output, instead of a NPN. You'll also have to increase RC2 because with 1k, you're still too close to the supply voltage (which then changes the thresholds, yes, but anyway...). Also, you can remove R3 since RE is already here to limit current through Q4 base.

Here is the new schematic:

simulate this circuit – Schematic created using CircuitLab

With this new circuit, simulation show the thresholds are 3V and 4.5V (I'm way too lazy to confirm this by formulas). Here is the LTspice (which I find waaaay more productive than circuitlabs) asc file pastebin.

However when I tested the circuit it didn't work at all and the LED was constantly on regardless of the input voltage. Why is it not working as it should be?

I'm not going to analyse the whole circuit but just point to the problem of turning the LED off.

To turn the LED off requires that Q4 is turned off. This means that the collector of Q3 has to fall to a level of about 0.5 volts or lower. To get 0.5 volts means that the grounding impedance looking into Q3's collector has to be substantially lower than RC2 (1 kohm). However, no matter how hard you try, Q3's collector will present a grounding impedance no less than RE (7.5 kohm).