Comparator

The questions below are due on Monday October 28, 2024; 10:00:00 PM.
 
You are not logged in.

Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.

In this problem, we'll consider looking at a simple 1-bit analog-to-digital converter, which takes in an analog waveform and converts it into a digital value (in this case, 5V if the input signal is below 2.5V, and 0V otherwise):

One naive way to implement this behavior is with a circuit like this, where the op-amp is supplied with +5V and 0V from its power supply:

With this design, however, any noise on v_{IN} will cause v_{OUT} to switch back and forth as v_{IN} crosses 2.5 V, messing up our digital signal!

So we instead use a different circuit that introduces some hysteresis to the comparator using positive feedback to obtain a new input-output relation as follows:

One circuit that implements this functionality is shown here:

Note that v_{OUT} switches to 5V when v_{IN} falls below v_{LOW}, and that it will not switch back to 0V until v_{IN} rises above v_{HIGH}. Similarly, note that v_{OUT} switches to 0V when v_{IN} rises above v_{HIGH}, and that it will not switch back to 5V until v_{IN} falls below v_{LOW}. The separation of v_{HIGH} and v_{LOW} adds a noise immunity margin of v_{HIGH}-v_{LOW} to the switching decision.

In a real circuit, we would use an op-amp-like device specificalyl designed to operate as a comparator (e.g., the MAX941), which behaves as follows:

  • if the input v_+ - v_- < 0 then v_o \approx 0
  • if the input v_+ - v_- > 0 then v_o \approx V_{CC}

A comparator is a very-high-gain amplifier that is designed to switch very quickly between its two power supply values, and remain at one value until it switches to the other. This is unlike the behavior of an op amp. Despite this, the op-amp and the comparator are given the same symbol.

For the rest of the problem, assume we are supplying the comparator with +5V and 0V.

For all questions on this page use R_3 and R_4 for resistors R_3 and R_4, respectively.

Let's first assume the output v_o is 0 V and the determine the voltage on v_+.

v_+ (in Volts) =

Next, assume the output is 5 V and determine the voltage v_+.

v_+ =

So we see that the external circuit is meant to provide a hysteretic voltage at v_+ that is symmetric about 2.5 V. The reason is that 2.5 V is serving as the "virtual ground" in our system.

Finally, we need to pick R_3 and R_4 so that there is the desired amount of hysteresis.

How much hysteresis would there be if R_3=R_4? Enter the difference between the upper switching voltage v_{HIGH} and lower switching voltage v_{LOW} in V: =

Choose R_3 and R_4 subject to the following constraints:

  • 0.4 - 0.5 V of hysteresis, which is the upper switching voltage v_{HIGH} minus the lower switching voltage v_{LOW}
  • resistor values in the range of 1 k\Omega and 100 k\Omega

Enter your values as a Python list in the following order: [R_3, R_4]. Thus, if you chose R_3 = 10k, R_4 = 20k, you would enter [1e4, 2e4].

Enter your circuit parameters here: