Search for question
Question

ECE 220 Laboratory 4 Volt Meter, Comparators, and Timer Michael W. Marcellin Please follow all rules, procedures and report requirements as described at the beginning of the document entitled ECE 220 Laboratory 1. Always wear your safety glasses when performing your lab experiments. Prelab Part 1 In Lab 2, we built a simple volt meter using a d'Arsonval panel meter. We found that the main problem with this simple meter is that its Thevenin resistance is rather small. Because of this, it tends to load the circuit being measured, changing the value of the voltage to be measured. Here, we consider an improved volt meter that uses a 1 mA d'Arsonval panel meter and an op amp as shown in Figure 1. In this figure, assume power rails of +7 V, and −2 V. a) Calculate the value of R required so that id = 1 mA when v₁ = 5 V. b) For the value of R calculated above, write an expression for iɖ as a function of vi. Observe that your equation in b) results in a linearly increasing needle deflection as a function of v¿, with full (100%) deflection at 5 V. Specifically, the current through the panel meter is of the form id = ẞv₁. That is, the op amp and resistor form a voltage-controlled current source with the panel meter as its load. An important feature of this circuit is that neither the value that you calculated for R, nor your equation for ia depend on the internal resistance of the panel meter. Vie Figure 1. Improved volt meter. In Lab 2, we used your simple meter to measure the voltage at terminals a and b in Figure 2 below. We discovered that your meter performed poorly when RT was not small. Specifically, we saw a large %error for the case of Rh = 4.7 k§. This is because the input (Thevenin) resistance of your meter was not very large compared to 4.7 kQ. Recall that an ideal volt meter has infinite input resistance. The input resistance looking into the input of the improved volt meter of Figure 1 is very large. In class, we would model it as infinity. In reality, it is "only" many Meg-Ohms. This results in the %error of the improved meter being negligible for values of Rh up to at least 1 MQ. We will now verify this via a PSpice simulation. RTh w VTh b a Figure 2. Thevenin equivalent circuit. Start a new project in PSpice and draw the circuit shown below in Figure 3. This figure represents the use of the improved meter of Figure 1 attempting to measure Vɑð in Figure 2. The 155 resistor is used to model the panel meter, although this resistance value is unimportant as noted above. As in Prelab 3, use uA741 for the op amp. We have not used the Vcc labeling trick this time, and have just allowed wires to cross. Note carefully that PSpice includes a red dot (node) where wires connect. There is no such connection where the negative power supply wire crosses the feedback path. Note also, that this time we have included two parameters (variables). Each of them is created using the new property button in the property editor spreadsheet for the part PARAM, as before. You do not need two copies of PARAM. You will just create two different properties (columns) within the same instance of PARAM. Finally, note that the (default) values of the two parameters should be chosen as Vrh = 5 V and RTh 1 MQ. Remember that in PSpice, we use "meg" in place of "M." = {VTh} PARAMETERS: RTH = 1 meg VTH=5 R4 U17 www {RTh} 3 V+ 6 OUT V2 2 4 OSTO UA741 V- R2 www 155 R7 Put your calculated value of R here No connection here www www R6 2k Figure 3. PSpice schematic. Perform a linear sweep of RÃ from 1 kÔ to 1 M in increments of 1 k. Note that và will R5 7k V3 9Vdc (automatically) stay at its default value of 5 V throughout this sweep. Use a current marker, as shown in Figure 3, to measure the current through the panel meter. The resulting graph will show this current, iɖ, as a function of Rh. Ideally, it should be constant at 1 mA, corresponding to 100% needle deflection, since the voltage that the meter is trying to measure is 5 V. In reality, ia will decrease very slightly as Rä increases due to the loading effect. c) What value of Rh (among those tested) yields the maximum error between id and its ideal value of 1 mA? d) For this value of Räh, calculate the %error in iɖ· e) print your graph. Now edit the simulation profile and redo the sweep. This time we will sweep và from 0 to 5 V in increments of 0.1 V. The value of RTh will (automatically) stay at its default value of 1 M throughout the sweep. You may have to add the current marker again after you edit the simulation profile. Ideally, the graph of the current through the panel meter, id, should rise linearly from 0 to 1 mA, corresponding to a linear needle deflection from 0 to 100%. Your graph should (essentially) show this desired behavior. f) print your graph. Prelab Part 2 In class, we discussed an op amp comparator circuit as shown below in Figure 4. For this circuit, whenever V¡ > Vref, V goes to the positive power rail. Else, v goes to the negative power rail. Throughout this part, assume that the power rails are +5 V. Vi νο Vref Figure 4. Comparator circuit. Now consider the circuit of Figure 5. a) Which LED will be turned on when v₂ = 1 V? Which LED will be turned on when vi = -1 V? Vi 200 Ω. 200 Ω LED 1 LED 2 Figure 5. Comparator with LEDS. Now consider the circuit of Figure 6. b) Write an equation for v₁ as a function of the pot setting F. Assume F = 0 corresponds to the slider being all the way up. 5 V+ 01 vi(t) 1 ΚΩ + n(t) 5 VC + Figure 6. Input signal. = To make things more interesting, we add some “noise” to v₁. The resulting “noisy” signal is v¡(t) = v₁ + n(t). Assume that the noise n(t) is a square wave of amplitude vp = 0.1 V (Vpp 0.2 V) and frequency f = 2 Hz. Figure 7 shows a graph of vi(t) for a pot setting F = 0.4. Make sure that you understand this figure. Changing the pot setting F will raise or lower the level of the signal in Figure 7. As another example, when F 0.5, the square wave will be oscillating above and below 0 V, rather than above and below 1 V as shown in Figure 7. = 1.0 V ^vi(t) $0.2 V 0.5 1.0 2.0 (seconds) Figure 7. "Noisy" signal. Consider now connecting v₂ (t) in Figure 6 as the input to the circuit of Figure 5. Like the improved volt meter, the input resistance of the comparator is very high. Thus, we do not need to worry about the loading effect. c) What do you expect the LEDs to do for a pot setting of F = 0.4? How about F = about F = 0.6? 0.5? How In class, we also talked about the Schmitt trigger (comparator with hysteresis) which reduces "chattering" due to noise. A Schmitt trigger circuit is shown below in Figure 8. Again, assume power rails of ±5 V. d) What is the threshold T for the Schmitt trigger as shown? Note that this threshold is larger than Vpp of the noise in the example above. Thus, any chattering in the example should be eliminated by replacing the comparator with the Schmitt trigger. We will verify this in the lab. Vi 20 ΚΩ w 300 ΚΩ w νο Figure 8. Schmitt trigger. Prelab Part 3 In this part, we use an RC circuit together with a comparator to build a simple timer. Figure 9 below shows an RC circuit with a step input of 3 volts at time t = 0. Assume that the initial capacitor voltage is 0 V. In Chapter 7, we will learn the theory for RC circuits. For now, just use the fact that vc(t) = 33e-t/RC V. a) Let C220 µF and calculate the value of R required so that the capacitor voltage passes through 2.5 V at time t 8 seconds. That is, vc (8) = 2.5 V. = 3 V t=0 R + C. VC Figure 9. RC step response. The circuit of Figure 10 below shows the RC circuit from Figure 9 connected so that the/nLab report 4 (rubric) Lab part 2 Comparator circuit: (3.5 points) Draw the noisy signal V,(t) when the DC offset is 1 V, 0 V, and -1 V. What is the output V.(t) when the DC offset is 1 V, 0 V, and -1 V. Explain the behavior of LED 1 and LED 2 you observed in the lab for those different DC offset values. Schmitt trigger: (3.5 points) Explain how the Schmitt trigger helps eliminate chatter? Perhaps use a representative diagram showing how the threshold you computed helps eliminate chatter. Lab part 3 Timer circuit: (3 points) When does the capacitor charge? At what time did the LED turn on? How can you change the time the LED turns on?

Fig: 1