Schmitt trigger design | John Hearfield | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
This article shows how to design a Schmitt trigger using transistors, how to improve the basic design, and why it might sometimes be the best approach. What does it do?A Schmitt trigger is a decision-making circuit. It is used to convert a slowly varying analogue signal voltage into one of two possible binary states, depending on whether the analogue voltage is above or below a preset threshold value. A comparator can do much the same job. Can't I buy an integrated circuit to do this?Yes, CMOS devices are available, but you can't choose the threshold voltage, and they only work with a restricted range of supply voltage. For example, the 74HC14 is intended to run at +5v, with thresholds of typically 2.4v and 1.8v. Or you could use a comparator IC, and define the thresholds by means of additional discrete resistors. If you need to clean up a noisy or distorted digital signal, use an IC. If your requirement demands unusual voltages or a precise threshold, you might have to design a special circuit. The two-transistor Schmitt trigger and how it works
As it does so, T1 begins to starve T2 of base current, so T2 begins to turn off, and so its emitter voltage starts to fall. But this increases T1's base-emitter voltage, so T1 turns on more quickly. The positive feedback snaps the circuit into a state where T1 is on (and by design, saturated) and T2 is off. Vo now sits at close to +V. Finally, suppose Vi starts to fall back towards zero. T1's emitter voltage now is controlled by its own emitter current. When Vi has fallen to about 0.6v above this value (call it VN), T1 will start to turn off. This allows T2 to begin to turn on again, adding its own emitter current to T1's and so nudging the emitter voltage upwards. This compels T1 to turn off more quickly, and once again positive feedback snaps the circuit into its other state, with T1 off and T2 on. Thresholds and currentsI need to emphasize an important design constraint. Suppose Vi is rising slowly from zero, and reaches the threshold at which T1switches on. This threshold (VP) is set by T2's emitter current flowing through RE. As soon as Vi reaches VP, T2 switches off, and the current though RE now comes via T1. VP ≈ I_{2} R_{E}
V_{N} ≈ I_{1} R_{E} Suppose for a moment that this current is larger than that from T2. If it were, T1's emitter voltage would rise abruptly when T1switched on. But T1 would then suddenly discover that its base voltage (Vi) was now smaller than its new emitter voltage, and would instantly switch off. But then its emitter voltage would drop again, and so it would turn on again. In other words, the circuit would oscillate. It follows that the designer must ensure that the current in T1 (I1) is smaller than the current in T2 (I2), or the circuit won't work! And it also follows that the threshold at which T2 switches on again (VN) must be lower than VP. The difference between the two thresholds is known as the circuit's 'hysteresis', by analogy with what happens in a transformer core, I suppose. Design example
Warning. What follows is not for those who insist on precision. Design need not always involve Difficult Sums! The first step is to decide the threshold VP. From the waveform, it probably ought to be around 12 or 13v. Next, choose the current that will flow in T2. A low value saves energy but implies a high value of collector load resistor, which might slow down the switching edges. Choose 3 mA in T2 for now. Then the emitter resistor RE will be [12v / 3mA] = 4k. Use 3.9kΩ. Next, calculate R2 as [(24v - 12v) / 3mA] = 4k. Use 3.9kΩ here too. VP ≈ I_{2} R_{E}
V_{N} ≈ I_{1} R_{E} Finally, choose T1's collector current and hence the lower threshold voltage VN. The noise spikes look troublesome, so it would be sensible to aim for around 9 or 10v - which would give about 4v of hysteresis - which sets I1 at [9v / 3.9kΩ] = 2.3mA. Then R1 is [(24v - 9v) / 2.3mA] = 6.5k. Use 6.2kΩ. R3 limits T1's maximum base current, which could safely be [2.3mA / 30] = 77μA (because the transistor won't have a current gain lower than 30), so R3 is [(24v - 9v) / 77μA] = 194k. Use 180kΩ. (I'm assuming that the circuit is driven from a zero-impedance voltage source. If it's not, then the source impedance can be subtracted from R3.) That leaves RA & RB. RA is there to limit T2's base current when T1 is off, and RB ensures that temperature effects won't matter. The two resistors form a potential divider which must set T2's base at (say) 12.6v with T1 off, and draw a current significantly higher than T2's base current, which can't exceed [3mA / 30] = 100μA. Choose the bleed current through RA & RB to be about 500μA, so that it's much larger than T2's base current. Then if R1 were zero, the sum of RA & RB would be [24v / 0.5mA] = 48kΩ and with the divider mid-point at 12.6v, [RB / (RA+RB)] = [12.6v / 24v] = 0.53, which implies RB = 1.1 RA. This implies that RB is [48k x 1.1/2.1] = 25k and RA is [48k - 25k] = 23k. HoweverR1 isn't zero, it's 6.2kΩ, so the real value of RA is [23k - 6k] = 17k. So, round the values down, since a bit more current won't matter, and choose RA = 15kΩ and RB = 22kΩ. There. Finished. Now to build one and try it. Well, simulate it, anyway. It works as it's supposed to, switching at 12v and 8v. Final circuit for the design example
An alternative approach using three transistors
A simpler alternative
An even simpler alternativeIf you've read this far, you now know how the circuit works, how to design one, and how to tweak it. But you might still be wondering when, if ever, you would choose this approach.
References Circuit consultant's casebook - TK Hemingway (Business Books, 1970) |