In Electrical Engineering, a Schmitt trigger is a comparator or inverter with hysteresis. It will convert a "dirty" analog signal to a nice clean digital signal.

Details:

A comparator takes any input and digitizes it: for say a 4 V upper rail, any input voltage below 2 V is output as 0 V and any input voltage above 2 V is output as 4V. An inverter inverts the input: any input voltage below 2 V is output as 4 V and any input voltage above 2 V is output as 0 V.

Now, an analog signal (such as a sine wave) will have noise - that is, many small oscillations. With a simple comparator, the output will fluctuate as the input passes the midpoint. Imagine a noisy sine wave as it crosses the 2 V threshold: 1.94 V, 1.97 V, 1.95 V, 1.98 V, 2.01 V, 1.99 V, 2.02 V, etc. The signal is in fact trending upward, but the noise causes glitches in the output.

The Schmitt trigger introduces hysteresis. Instead of having one threshold, there are two: one going up and one going down. Say we set the triggers to 1.5 V and 2.5 V. Then the inverter will not go low on a rising input signal until it reaches 2.5 V, and will not go high until the input signal becomes less than 1.5 V. While the input is in between 1.5 V and 2.5 V, the output is not changed.

Logically, this is implemented as an additional weak inverter in the "other" direction across the main inverter.

    (strong)
      |\      |\
 in --| \o-+--| \o-+--  out
      | /  |  | /  |
      |/   |  |/   |
           |       |
           |   /|  |
           \-o/ |--/
              \ |
               \| (weak)

Here is the CMOS diagram:

                           __________
             _____________/_______   |
           _|     |_     /       _|  |
     /--o||_       _||o-/   /-o||_   |
 in _|      |_____|________|      |__|___ out
     |     _|     |_       |     _|  |
     \---||_       _||--\   \--||_   |
            |_____|______\________|  |
                          \__________|
One of the simplest clocks is made by connecting a Schmitt trigger to a resistor and a capacitor, like so

          |\   
      ----| \o-------- (clock)
      |   | /  |
      |   |/   |
      |        |
      |--\/\/\-|     
      |
     ===
      |    
     _|_    
      -
      
What happens is that the output of the Schmitt trigger (5v) causes the capacitor to begin charging, until the input voltage rises to a certain level, after which the trigger flips (to 0v), and the capacitor discarges until the trigger flips again to 5v, and the cycle repeats. The value of the capacitor, resistor, and the voltage levels that the trigger flips at are all factors in the output clock speed. This simple circuit gives a rough-and-ready clock signal, perfectly good for TTL circuits, and seen a lot in cheap consumer electronics.

There is, however, another factor that affects the clockspeed, which is especially relevent in battery powered appliances - The charging rate of the capacitor depends on the output voltage of the trigger, which in turn depends on the voltage of the power rail. If some component starts drawing a lot of current, the voltage of the power rail will drop, and the clock rate will slow. If the power rail drops too low, gates may start to behave erratically, and the machine may crash... Which is why a Big Mouth Billy Bass with low batteries will sing fine until the fish starts to look at you, and will get slower and sloooooower....

Taaaaaaaaaaake meeeeeeeeeee toooooooo theeeeeeeee riiiiiiiiiiiiiiveeeeeeeeerrrrrrrrrrr <pop!>

Log in or register to write something here or to contact authors.