## Schmitt trigger, logic and feedback mini-tutorial

Expand Messages
• Hello all, I hope you don t mind me cluttering up the list with a long post but here is a mini-tutorial on the Schmitt trigger and includes soem stuff on logic
Message 1 of 2 , Mar 11, 2001
Hello all,

I hope you don't mind me cluttering up the list with a long post but here is
a mini-tutorial on the Schmitt trigger and includes soem stuff on logic
levels and feedback too. It started out with a look at the Richard Piotters
Schmitt.gif schematic (http://richfiles.calc.org/Circuits.html). That
circuit is simple but non-inverting, has no input diodes and has relatively
low input impedance so it can't be easily used as a substitute for a
74C14/74HC14 Schmitt trigger inverter for beam type applications.

So I modified it as shown in SchmittInverter.gif which more closely
simulating a 74C/HC14 Schmitt trigger including inversion, reasonably high
input resistance (4Mohm) and the all important input protection diodes. Then
I decided to write a little description of operation and before you know it
turned into a tutorial. The Schmitt trigger is a nice example of positive
feedback so trying to describe that concept took another few paragraphs.

"Why?" you may ask. Fourteen components may seem like a lot to simulate 1/6
of one 74HC14 but this discrete circuit shows you what is really going on
inside that little black IC we so often take for granted.

The Schmitt Trigger is used in Beam for Nv and Nu neurons but is more
generally used to clean up analog voltages and convert them into nice
sanitary binary logic levels. If you are in a hurry you can skip straight
ahead to the section on the Schmitt Trigger but if you like some background

DIGITAL

Digital signals are generally considered to be one of two logic states
called by various names: On/Off, High,Low, One/Zero, 1/0 and Vcc/Gnd
These are called logic signals because they are unambiquious "either/or"
values.

In the real world, the voltage levels that represent logic states are not
precisely Vcc and Gnd. When these fuzzy real voltage levels are applied to
digital inverter inputs, they are compared to an internal voltage threshold
and the difference between the applied input voltage and the threshold is
amplified (multiplied) by a factor of about -100. These real voltage levels
representing 1 and 0 must be in a range of values, sufficiently above and
below the actual switching threshold so that their fuzzyness (noise) they
always generate logic 1 or 0 levels at the output of the circuit.

In 74HCxx logic logic "1" signal level are defined as greater than 2/3Vcc
and a logic "0" signal must be less than 1/3Vcc. The range of voltage levels
between 1/Vcc and 2/3Vcc is considered to be in the "forbidden" zone since
signals in that range cannot be guaranteed to be 1 or 0. When a voltage near
the switching threshold in the middle of the "forbidden" zone is applied to
a digital input, the digital output can and does generate a burst of pulses
which can play havoc in the precise digital world of counters and registers.

In the real world, we also have to consider that when a 1 changes to a 0 and
vice versa, the change is not instantaneous and while the logic voltage
level slews from 1 to 0, it traverses through the "forbidden" zone. But
since digital logic cannot react instantaneously to change either, there is
a specification given for the minimum rate of change (switching time) which
is guaranteed not to generate more than a single transition in response to
the logic level change.

So out unambiguous digital logic ignores glitches as long as the time of
change is sufficiently short duration (<500ns). In short, a digital circuit
responds to and generates one of two digital voltage levels, nominally 1 and
0. These levels must be above and below the "forbidden" zone and any changes
in logic levels must be sufficiently rapid to meet the minimum specified
switching times. Perhaps now is a good time to mention that in the world of
Beam circuits these rules are generally ignored.

ANALOG

Analog signals are to digital signals what black and white is to the full
spectrum of colors. Analog signal levels can be any value and each value is
significant. In the real world there is a limit to the minimum and maximum
values that can be distinguished by the input of an analog circuit and the
values that can be generated at the output of an analog circuit. Usually
these signals fall in the range between the circuit power supply voltages.
The main thing to remember is that sensors such as such as LDRs, PDs,
thermistors and time sensitive circuits, such as RC networks (Nv/Nu), all
generate analog voltages including those that are in the digital "forbidden"
zone.

In order to interface the analog and digital worlds we must use special
circuit designs to avoid generating unpredictable chaos results. This is
done by using POSITIVE FEEDBACK.

FEEDBACK

One of the most important concepts in electronics is FEEDBACK. Once you
understand this basic principle which applies to all dynamical systems, you
will experience a quantum jump in knowledge. If I may be so bold to suggest
this idea: in the universe, chaos and feedback rule in a delicate balance
that gives rise to all phenomena.

Feedback, as the name implies, occurs when the output or result modifies a
process or interaction. In electronic circuits this occurs when all or a
part of the output signal(s) is added or subtracted from the input
signal(s). Feedback therefore has two distinct forms: Positive and Negative.
To keep things simple and on familiar ground, we will just discuss in
general how Beam circuits use feedback and in detail how positive feedback
is used in Schmitt trigger circuits.

ELECTRO-MECHANICAL FEEDBACK

The essence of Beam is the "autonomous" interaction between the electronic
and mechanical assembly called the robot and it's environment as seen
through it's sensors. The sensors provide input signals which modify the
action of the robot and, in turn, that action modifies the signals received
by the sensors. Well that is a fine example of electro-mechanical feedback!

In a phototropic robot like a photopopper, the circuit that controls the
motors sends more current pulses to the side that receives less light. This
causes that side to turn towards the light source until both light sensors
are balanced. Then both sides receive equal current pulses as the robot
"waggles" towards the light.

In the Herbie line follower, the motion is continuous rather than pulsed and
the robot follows a broad white line agains a dark background. Each motor
receives current in proportion to the imbalance (also called error or
difference signal) of light on the two sensors that each point to the left
and right edge of the white line. For example, as the bot moves to the left
the line the left sensors points to the darker background and the right
sensor receives the full reflection off the white line creating an imbalance
signal that increases the current to the right motor and moves Herbie back
on track.

Phototropism is an example of NEGATIVE FEEDBACK because the system as a
whole moves towards the "balanced sensors signals" condition. This is a very
important distinction from the "maximum sensors signals" condition.
Photophobic behaviour is and example of POSITIVE FEEDBACK that steers the
system as a whole towards "unbalanced sensor signals" rather than the
"minimum sensor signals" condition. However don't let these subtle
distinctions get in the way of the main idea that the action of the system
influences the sensors which influences action of the system and so on -
that is the feedback loop we so often mention in the discussion of beam
circuits.

ELECTRONIC FEEDBACK

If you got the idea of mechanical feedback, then electronic feedback should
be easy. In Beam type applications which use digital inverters for quasi
analog applications , the feedback balance point is the input voltage level
(threshold) at which the output switches over. For 74HCxx inverters like the
74HC240 that level is 1/2Vcc, right smack in the middle of the "forbidden"
zone. We mentioned earlier that negative feedback subtracts from the input
signal and steers the circuit output towards the balance point. Positive
feedback adds to the input signal and steers the circuit output away from
the balance point.

NEGATIVE FEEDBACK

Negative feedback subtracts from the input signal because it is inverted
before it appears at the output and any inverted output signal will subtract
from the input signal.

A good example of negative feedback would be a 74HC240 inverter with a
resistor connected from input to output. If you measure the output of that
circuit with a voltmeter you will know precisely what the threshold voltage
of the inverter is. For a 74HC240 at Vcc=5V the output will be very close to
2.5V. As mentioned before digital logic is not designed to operate with
input voltages from the forbidden zone and if you measure the Vcc current
you will know why it draws 50mA or more current. In addition, if you turn on
a radio near the circuit, the high frequency oscillation radiated from the
circuit should be quite overpowering compared to local radio stations.

In general, negative feedback is undesirable in digital circuits but it can
be harnessed and put to good use as will be discussed later.

POSITIVE FEEDBACK

Positive feedback adds to the input signal and steers the output away from
the balance point, out of the forbidden zone and towards the Vcc or Gnd
levels of ideal logic signals. This is why positive feedback is generally
useful in Beam circuits and can in fact be used to counteract the effects of
negative feedback.

There are many examples of external positive feedback in Beam bicores,
monocores, SE triggers and latches. But the 74HC14 of microcore fame, is an
example of internal positive feedback because the feedback occurs inside the
chip. As a black box, all we know about the 74HC14 is that it has two
thresholds and that regardsless of the input signal, the output signals
always have nice clean single transistions, are always at Vcc or Gnd and
never at some in between value (unless we forget to add a resitor in series
with the LED indicators). This internal positive feedback is what makes the
74HC14 microcore work and why, without positive feedback, a 74HC240
microcore always degenerates into saturation.

SCHMITT TRIGGERS

The Schmitt trigger is a special circuit which acts like a switch that
changes state at two different thresholds. These are called the upper and
lower threshold or the positive and negative going threhold. The difference
in these two threshold levels is called the hysteresis voltage.

These two thresholds (balance points) makes the 74HC14 Schmitt trigger
different from an ordinary 74HC240 inverter with a single threshold at
1/2Vcc.

Each of the six inverters in a 74C14 Schmitt trigger uses 12 mosfets, so by
comparison the discrete version of the Schmitt trigger using 3 transistors
and 11 other components is about as complex.

Ideal amplifiers called opamps can also be used to make even simpler looking
Schmitt triggers but that would kind of defeat the purpose of the exercise
showing just what goes on "under the hood" of a Schmitt trigger.

The Schmitt.gif reproduces the basic Schmitt trigger circuit of Richard
Piotter. It consist of two inverters (NPN and PNP) which give a double
inversion to the input signal. The output of the second stage is fed back
and summed with the input signal and a resistor to ground. Think of those
resistors as forming a voltage divider which determines the input voltage
required to cross the 0.6V threshold of the NPN base emitter junction to
turn the transistor on of off. With the values given the positive going
threshold is 1.95V and the negative going threshold is 1.34V asuming a Vcc
of 5V. The output signal at the PNP collector is non-inverting with respect
to the input signal.

The Schmitt-Inverter.gif shows how the basic circuit is modified to give the
symmetrical 1/3-2/3Vcc thresholds equal to the 74C/HC14 Schmitt trigger.
This is done by setting NPN emitter voltage to 1/2Vcc-0.6V which makes the
on/off switching threshold at the input NPN base exactly 1/2Vcc. The 1M
input and 3M feedback resistors form a voltage divider that sets the values
of the positive going input threshold to 2/3Vcc and the negative going input
threshold is 1/3Vcc.

The positive feedback signal at one end of the 3M feedback resistor is
altenately Vcc or Gnd depending on the state of the non-inverted output
signal at the collector of the PNP transistor. The other end of the 3M
feedback resistor is at the base of the input NPN which is at 1/2Vcc during
switching. The voltage at the input of the 1M resistor is therefore
1/3*1/2Vcc=1/6Vcc above and below 1/2Vcc which at Vcc=5V is 3.33V and 1.66V
respectively. This ignores the effect of the <0.1uA that sinks into the base
of the NPN at switching.

The inverting NPN output stage provides isolation and input protection
diodes were added to simulate the 74C/HC14 inverting Schmitt trigger so that
this circuit can now be used in the same kind of applications as that device
but at Vcc up to 24V or higher depending on the transistors. The NPN output
drive to positive is limited by the 4.7K resistor but it could be replaced
with a smaller resistor or even a pager motor. The resistor in the PNP
collector was chosen for low power but can be replaced with 4.7K to increase
base drive for the NPN output transistor.

The input diodes are not needed for protection since the 1M resistor takes
care of that but may be needed to clamp an input coupling capacitor (ie Nv)
to the negative and pasitive rails. This is called DC restoration since it
removes the residual charge from the capacitor so it has no memory of any
previous switching operation which might otherwise affect the timing of a
subsequent switching operation.

While this circuit is not an economical substitute for the 74HC14, it gives
a good insight into the design of trigger circuits in general.

BTW Who was that Schmitt person anyway, back in the good old days of the
early electronics explorers when basic circuits were still named after their
inventors?

Enjoy

wilf
• ... their ... Instructor Zoology & Physics, University of Minnesota, Minneapolis, 39-41, assoc. prof. 41-49, Prof. 49-98 One of our famous members was Dr. Otto
Message 2 of 2 , Mar 11, 2001
>
>
> BTW Who was that Schmitt person anyway, back in the good old days of the
> early electronics explorers when basic circuits were still named after
their
> inventors?
>
> Enjoy
>
> wilf
>
>

Instructor Zoology & Physics, University of Minnesota, Minneapolis, 39-41,
assoc. prof. 41-49, Prof. 49-98

One of our famous members was Dr. Otto Schmitt, inventor of the Schmitt
trigger. He was a professor at the University of Minnesota till his death in
1998. To this day we miss his stories of his days as a child startling his
mother with his Tesla Coil and his many other tails of his adventures
through life.

The U of Minn was my Alma Matta....

See:

http://www.ee.umn.edu/users/schmitt/index.html

Looks like my office.

From Steve
Not all heroes wear tights and a cape.

dberger@...
----- Original Message -----
From: "Wilf Rigter" <Wilf.Rigter@...>
To: <beam@yahoogroups.com>
Sent: Sunday, March 11, 2001 3:09 AM
Subject: [beam] Schmitt trigger, logic and feedback mini-tutorial

>
>
>
>
> To unsubscribe from this group, send an email to:
> beam-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
Your message has been successfully submitted and would be delivered to recipients shortly.