1 00:00:00,000 --> 00:00:05,170 >> In this video, I'd like to talk about using the op-amp as a voltage-controlled switch. 2 00:00:05,170 --> 00:00:08,350 Basically, we put two different voltages Vp and 3 00:00:08,350 --> 00:00:11,965 Vn into the positive and negative terminals of the op-amp. 4 00:00:11,965 --> 00:00:15,970 Remember that there's going to be no current going into either 5 00:00:15,970 --> 00:00:20,425 of these terminals if we assume that this op-amp is ideal. 6 00:00:20,425 --> 00:00:25,990 So, in this case, what happens is V0 comes out as three different possibilities. 7 00:00:25,990 --> 00:00:30,915 We've got a plus Vcc and a minus Vcc, 8 00:00:30,915 --> 00:00:36,240 and then what's going to happen is V0 will equal to zero if V, 9 00:00:36,240 --> 00:00:37,800 let me put an if statement right here. 10 00:00:37,800 --> 00:00:40,035 If Vp is equal to Vn, 11 00:00:40,035 --> 00:00:45,375 it's going to be equal to plus Vcc, if Vp is greater than 12 00:00:45,375 --> 00:00:52,635 Vn and it's going to be minus Vcc, if the Vp is less than Vn. 13 00:00:52,635 --> 00:00:58,325 So, in effect, the two voltages that we put in Vp and Vn are going to control 14 00:00:58,325 --> 00:01:00,920 what our output voltage is and it's basically going to 15 00:01:00,920 --> 00:01:04,430 rail out between the positive and negative Vcc. 16 00:01:04,430 --> 00:01:06,515 Now, how could we use this as a switch? 17 00:01:06,515 --> 00:01:10,400 Remember that no current is coming in from our input circuit right here. 18 00:01:10,400 --> 00:01:14,840 So, this side is completely isolated from our output side. 19 00:01:14,840 --> 00:01:19,730 Here's the input and here's the output and these two sides are isolated. 20 00:01:19,730 --> 00:01:25,235 The current actually comes from our source right here, and it is used for V0. 21 00:01:25,235 --> 00:01:28,430 So, we would be able to switch something on and off drawing the 22 00:01:28,430 --> 00:01:32,615 current from the power supply for the op-amp. 23 00:01:32,615 --> 00:01:39,315 If we wanted to do another possibility such as V0 is equal to zero, if they are equal, 24 00:01:39,315 --> 00:01:44,030 and let's suppose we want it to be some positive voltage if Vp is equal to Vn, 25 00:01:44,030 --> 00:01:49,470 and then maybe we would like it to be off if Vp is less than Vn. 26 00:01:49,470 --> 00:01:52,700 On that case, what you would do is you would hook up your op-amp like 27 00:01:52,700 --> 00:01:56,900 this with the plus and minus terminals and you'd hook it up to Vcc, 28 00:01:56,900 --> 00:01:59,720 and then your negative Vcc would just be ground. 29 00:01:59,720 --> 00:02:01,685 This value, right there. 30 00:02:01,685 --> 00:02:05,940 That's how you'd be able to make the switch function just a little bit differently.