Continue to Site

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.

  • 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.

Window Comparator Exercise

Status
Not open for further replies.
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 :)
 
Hi,
thanks. +5volts apply on the output (that's because the max output voltage is +5V?) and the 2 comparators right? How do you calculate the R4 and why is it for?

hi,
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.
 
----

**broken link removed** Originally Posted by MrAl **broken link removed**
To get the resistor values, we start with the equations similar to yours but we also include the negative supply rail Vss:
D=R1+R2+R3
Vutp=(Vcc-Vss)*(R2+R1)/D+!Vss!

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

**broken link removed** Originally Posted by MrAl **broken link removed**
Vltp=(Vcc-Vss)*(R1)/D+!Vss!

Q2. Same here!

**broken link removed** Originally Posted by MrAl **broken link removed**
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 ?

**broken link removed** Originally Posted by MrAl **broken link removed**
Next we solve for R1 from:
Vltp=(Vcc-Vss)*(R1)/D+Vss
and we get:
R1=((Vss-Vltp)*D)/(Vss-Vcc)

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?

**broken link removed** Originally Posted by MrAl **broken link removed**
Now that we know R1 we can solve for R2 from the other equation:
Vutp=(Vcc-Vss)*(R2+R1)/D+Vss
and we get:
R2=((Vss-Vcc)*R1+(Vutp-Vss)*D)/(Vcc-Vss)

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

**broken link removed** Originally Posted by MrAl **broken link removed**
Now that we know R2 and R1 we get R3 from knowing D too:
R3=D-R2-R1
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!


Answers:

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
(Vcc-Vss)*RL/(RU+RL)+Vss
and note that for your three resistor string circuit RL sometimes becomes the sum of two resistors.
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top