Electronic – How to build a Schmitt trigger using transistors

schmitt-triggertransistors

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:

schematic

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?

Best Answer

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:

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.