1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Window Comparator Exercise

Discussion in 'Homework Help' started by 307pavlos, Aug 19, 2011.

  1. 307pavlos

    307pavlos Member

    May 11, 2011
    hi, doesnt help. In my opinion i think the 2 comparators must be supplied by +12V and GND. But i'm not so sure about that. That's why i'm asking :)
  2. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Jan 4, 2007
    Ex Yorks' Hants UK
    Most comparators are open collector output [ no internal pull up resistor to +Vs], so an external resistor is required.
    The typical sink current can be in the order of 1mA to 5mA, so with a 5V supply a 4.7K would be OK.
  3. MrAl

    MrAl Well-Known Member Most Helpful Member

    Sep 7, 2008

    [​IMG] Originally Posted by MrAl [​IMG]
    To get the resistor values, we start with the equations similar to yours but we also include the negative supply rail Vss:

    Q1. Why is this +Vss. How did you input it in the equation?

    [​IMG] Originally Posted by MrAl [​IMG]

    Q2. Same here!

    [​IMG] Originally Posted by MrAl [​IMG]
    and remember that Vss is negative.
    To get the resistance values, we first select a rough impedance for the whole resistance string, say 100k. This means R1+R2+R3=100k.

    Q3. Why's that? How can you say D=100k ?

    [​IMG] Originally Posted by MrAl [​IMG]
    Next we solve for R1 from:
    and we get:

    Q4. I rewrote your Vltp equation and i end up here : R1=(Vltp-Vss)*D/(-Vss) , Where Vss=-10 and Vcc=0. Are you sure you didnt make a mistake with the Vss sign of the denominator?

    [​IMG] Originally Posted by MrAl [​IMG]
    Now that we know R1 we can solve for R2 from the other equation:
    and we get:

    Q5. I get R2=[Vss*R1+(Vss-Vutp)*D]/Vss , Where Vcc=0, Vss=-10V

    [​IMG] Originally Posted by MrAl [​IMG]
    Now that we know R2 and R1 we get R3 from knowing D too:
    and that's about it.
    Note that R3 is the resistor that connects to the most positive supply rail Vcc, and R1 is the resistor that connects to the most negative supply rail Vss. You can also do this by taking Vcc=0 (ground) and connect R3 to ground and solving the above with Vcc=0. That means you dont have to use the positive supply rail. Both set points are negative so we can get away with this for this problem.
    Also remember that Vss is negative so it enters the equations as a negative number like -5. So for example if Vcc=5v and Vss=-5v then Vcc-Vss=5-(-5)=10, and this is important.

    Q6. I see! So did I upload the proper diagram? Both Comparators will get -10Volts where GND was and 0Volts where Vcc (+10Volts) was!


    A1. To find the voltage divider voltage with a lower voltage that is not zero, simply subtract it from Vcc before multiplying by the resistor divider equation, then add it back after that.
    Thus we get (Vcc-Vss)*R+Vss
    where R is the resistor divider equation like R1/(R1+R2+R3).

    A2. Same as A1.

    A3. I can say D=100k because that's what i made the entire string resistance R1+R2+R3, and that is the denominator of the two resistor divider equations.

    A4. Your equation is the same as mine. Set your equation for R1 equal to my equation and you will find an identity.

    A5. Your equation for R2 doesnt look correct. Start with D=100k as i suggested and work up an example where you set your two set point voltages to two different negative voltages like -3 and -0.3. Calculate R1 and R2 and R3 using my equations, then solve for the two voltages. Do the same with your equations and solve for the two voltages with your new resistor values. See which set comes out to the proper set point voltages. When i do this with my equations i get the very same set point voltages i was designing for, so i assumed my equations were correct. Try this with your equations. It's always a good idea to try your results in a real example just to see if they come up with the right results.

    A6. It looks like you uploaded the right diagram, but you'll have to watch Vcc for the output of the op amp as was mentioned by Eric and shown in his diagram.

    Just to note, a resistor divider can be solved with Vcc*RL/(RU+RL) where RU is the upper resistor and RL is the lower resistor. If you have a lower voltage Vss that is not zero, you can change this to
    and note that for your three resistor string circuit RL sometimes becomes the sum of two resistors.
    Last edited: Aug 22, 2011

Share This Page