1 Electronic Instrumentation Experiment 6 -- Digital Switching Part A: Transistor Switches Part B: Comparators and Schmitt Triggers Part C: Digital Switching Part D: Switching a elay
Part A: Transistors Analog Circuits s. Digital Circuits Bipolar Junction Transistors Transistor Characteristics Using Transistors as Switches
Analog Circuits s. Digital Circuits An analog signal is an electric signal whose alue aries continuously oer time. A digital signal can take on only finite alues as the input aries oer time. 3
A binary signal, the most common digital signal, is a signal that can take only one of two discrete alues and is therefore characterized by transitions between two states. In binary arithmetic, the two discrete alues f 1 and f 0 are represented by the numbers 1 and 0, respectiely. 4
In binary oltage waeforms, these alues are represented by two oltage leels. In TTL conention, these alues are nominally 5V and 0V, respectiely. Note that in a binary waeform, knowledge of the transition between one state and another is equialent to knowledge of the state. Thus, digital logic circuits can operate by detecting transitions between oltage leels. The transitions are called edges and can be positie (f 0 to f 1 ) or negatie (f 1 to f 0 ). 1 0 positie edge negatie edges positie edge 5
Bipolar Junction Transistors The bipolar junction transistor (BJT) is the salient inention that led to the electronic age, integrated circuits, and ultimately the entire digital world. The transistor is the principal actie deice in electrical circuits. When inputs are kept relatiely small, the transistor seres as an amplifier. When the transistor is oerdrien, it acts as a switch, a mode most useful in digital electronics. 6
There are two types of BJTs, npn and pnp, and the three layers are called collector (C), base (B), and emitter (E). C All current directions are reersed from the npn-type to the pnp-type. B npn transistor E A BJT consists of three adjacent regions of doped silicon, each of which is connected to an external lead. The base, a ery thin slice of one type, is sandwiched by the complementary pair of the other type, hence the name bipolar. 7
FET, Field Effect Transistors, are another type of transistor. They are the basis of most logic, memory and microprocessor chips. Applying a gate oltage that exceeds the threshold oltage opens up the channel between the source and the drain This is from an excellent collection of jaa applets at SUNY Buffalo http://jas.eng.buffalo.edu/ 8
pnp and npn transistors Note: The npn-type is the more popular; it is faster and costs less. V CE < 0 V BE < 0 V C I C V CE > 0 V BE > 0 V C I C V B I B - pnp BJT -V BE Apply oltage LOW to base to turn ON V E - -V CE I E V = V V V = V V I = I I CE C E BE B E E C B V B I B V E - V BE npn BJT - V CE I E Apply oltage HIGH to base to turn ON 9
Characteristics of Transistors Cutoff egion Not enough oltage at B for the diode to turn on. No current flows from C to E and the oltage at C is V cc. Saturation egion The oltage at B exceeds 0.7 olts, the diode turns on and the maximum amount of current flows from C to E. The oltage drop from C to E in this region is about 0.V but we often assume it is zero in this class. Actie egion As oltage at B increases, the diode begins to turn on and small amounts of current start to flow through into the doped region. A larger current proportional to I B, flows from C to E. As the diode goes from the cutoff region to the saturation region, the oltage from C to E gradually decreases from V cc to 0.V. I C = βi 10 <β< 1000 B 10
Diode Model of the npn BJT The diode is controlled by the oltage at B. When the diode is completely on, the switch is closed. This is the saturation region. When the diode is completely off, the switch is open. This is the cutoff region. When the diode is in between we are in the actie region. 11
npn Common Emitter Characteristics I C = βi B V BE = 0.7 V I α= I I C E α β= C I = B 1 α 0.9 <α< 0.999 10 <β< 1000 V BE < 0.6 V 1
Switch Model of the npn BJT Controls transistor Switch Circuit that is switched emoe the part of the circuit that controls the switch and consider two possible cases: 13
Using the transistor as a switch Bulb off Bulb on 14
Building logic gates with transistors Input Output 0 1 1 0 15
Part B: Comparators and Schmitt Triggers Op-Amp Comparators Model of a Schmitt Trigger 16
Comparators and Schmitt Triggers In this section we will use op-amps to create binary signals. Comparators are the simplest way to create a binary signal with an op-amp. They take adantage of the ery high gain of the chip to force it to saturate either high (V S ) or low (V S- ) creating two (binary) states. Schmitt Triggers are a modified ersion of a comparator which uses a oltage diider to improe the performance of the comparator in the presence of noise. 17
Op-Amp Comparators The prototype of op-amp switching circuits is the op-amp comparator. The circuit does not employ feedback. out ( ) V = A V V 18
Because of the large gain that characterizes openloop performance of the op-amp (A > 10 5 ), any small difference between the input oltages will cause large outputs; the op-amp will go into saturation at either extreme, according the oltage supply alues and the polarity of the oltage difference. One can take adantage of this property to generate switching waeforms. Consider the following. Non-inerting Op-Amp Comparator ( t) ε= V cos ω 19
The comparator is perhaps the simplest form of an analog-to-digital conerter, i.e., a circuit that conerts a continuous waeform to discrete alues. The comparator output consists of only two discrete leels. Input and Output of Non-Inerting Comparator V sat = ± 13.5 olts V = 1 olt 0
It is possible to construct an inerting comparator by connecting the non-inerting terminal to ground and connecting the input to the inerting terminal. Input and Output of Inerting Comparator 1
Comparator with Offset A simple modification of the comparator circuit consists of connecting a fixed reference oltage to one of the input terminals; the effect of the reference oltage is to raise or lower the oltage leel at which the comparator will switch from one extreme to the other.
Below is the waeform of a comparator with a reference oltage of 0.6 V and an input oltage of sin(ωt). Note that the comparator output is no longer a symmetric square wae. 3
Another useful interpretation of the op-amp comparator can be obtained by considering its input-output transfer characteristic. Non-Inerting Zero-eference (no offset) Comparator often called a zero-crossing comparator 4
Shown below is the transfer characteristic for a comparator of the inerting type with a nonzero reference oltage. 5
Comparator esponse to Noisy Inputs Note how the output swings between high and low. 6
Schmitt Trigger Model One ery effectie way of improing the performance of the comparator is by introducing positie feedback. Positie feedback can increase the switching speed of the comparator and proide noise immunity at the same time. The oltage range oer which the signal does not switch is called the hysteresis (In this case, h=d) Can you explain how this works? 7
In effect, the Schmitt trigger proides a noise rejection range equal to ± V sat [ / ( 1 )] within which the comparator cannot switch. Thus if the noise amplitude is contained within this range, the Schmitt trigger will preent multiple triggering. 8
If it is desired to switch about a oltage other than zero, a reference oltage can also be connected to the non-inerting terminal. In this case, d is not equal to d -, and the hysteresis is gien by h=d d - Switching leels for the Schmitt Trigger are: V > V V 1 in sat ref 1 1 positie-going transition V < V V 1 in sat ref 1 1 negatie-going transition 9
30 How to determine switching leels ( ) ( ) ref out ref out ref ref out = = = = 1 1 1 1 1 We are always comparing the input to the oltage at ( ) ( ) ref sat ref ref sat V V ± = ± = 1 1 Example: If ref =1V and V sat =15V or -15V, then 1 14 1 1) (15 1 1 15 V in V V V sat > = = 1 16 1 1) 15 ( 1 1 15 V in V V V sat < = =
Part C: Digital Switching Digital Chips Inerting Digital Chips Simulating Noise Using Inerters to control a transistor 31
Digital Chips Digital Chips generally hae 14 or 16 pins Digital Chips typically hae many gates in a single chip The upper right hand corner must be tied to the source oltage (5V) The lower left hand corner must be grounded. 3
Inerting Digital Chips The Schmitt trigger inerter chip is a digital chip that conerts analog to digital signals. The inerter inerts a digital signal. It operates much like an inerting comparator. The operating range of both chips is 0V to 5V They both output either HIGH or LOW. 33
Simulating Noise V VOFF = 1.5 VAMPL = 1.5 FEQ = 1k VOFF = 0 VAMPL = 0. FEQ = 100k V3 V U1A 1 7404 UA 1 7414 1 V 1k 0 V 1k 0 Two oltage sources together can be used to simulate a signal with noise in PSpice. 0 34
Using Inerters to control a Transistor 5 1k U4A 1 6 Q V 4 7414 1k QN 1k V1 V 0 1k 5 V 0 0 U3A 1 7404 3 1k Q1 QN V 1k 1 Two identical circuits in parallel. One uses a Schmitt trigger inerter and the other an inerter. (If you copy and paste, components cannot hae identical names.) 0 35
Part D: Switching a elay elays elay Switching Circuit 36
elays elays are electromechanical switches elays contain an electromagnet NO: Current on switch is pulled towards inductor NC: Current off switch returns to normal position A relay looks like a black box with 5 connections 37
elay Circuit 30 DC oltage source is used to control a Schmitt trigger. Schmitt trigger switches a transistor. Transistor switches relay. It clicks. Obsere output at indicated points. Then swap in an inerter and listen to the difference. 38