This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TLV7011: Comparator for equal values

Part Number: TLV7011
Other Parts Discussed in Thread: TLV6700, TLV7022, TLV3201

I am currently using the TLV7011 as a voltage comparator. I am using it to clean up a digital signal that is distorted; when the slope of the line is positive (VRef > Vin), the comparator goes HIGH.  When the slope of the line is negative (VREF < Vin), the comparator goes LOW.  This all works great.

The problem is when VRef = Vin (flat line), the comparator goes LOW.

I need a second comparator to handle the case where Vref = Vin.  Is there a comparator on the market that goes High when Vref=Vin and Low when Vref does not equal Vin (or vise versa)?

Any comparator I have researched treats equal values of VRef and Vin as Low and doesn't differentiate between them.  Thanks for the help.

  • Dustin

    You can use a window comparator to create a narrow band where the output is low or high (your choice) and the output is the inversion of that when the input is above the window or below the window.  The window size is mostly determined by the accuracy of the comparator and the reference.  You can create a window comparator using an external reference and a dual channel open drain comparator.  Open drain is needed so the outputs of the comparators can be connected together.  We also have integrated window comparators that combine a reference and a dual comparator in one package.  Devices such as the TLV6700 could be used if that is preferred.  Dual channel of the TLV7011 would be the TLV7022.

    Chuck

  • Thanks for the reply. I maybe didn't explain the real problem good enough and this picture should make it more clear.  The yellow signal is actually a digital signal that is distorted.  The blue signal is my attempt to correct the distortion using the TLV7011.  I basically measure the slope of the line; if the slope is positive, the TLV7011 is HIGH.  If the slope is negative or flat, the output is LOW.  It works most of the time but where it busts is when the yellow signal is HIGH for a long time and ends up flat, then the TLV7011 calls it LOW which is wrong.  I need a way to differentiate between flat and not flat (when Vref = Vin, High, when Vref <> Vin, Low).  I don't think a window comparator will work because my distorted input signal is all over the place (second image), some of the HIGHS are lower than some of the LOWS and for that reason I can't have a fixed reference voltage to correct the signal.  Hopefully that all makes sense.   

  • Dustin

    Thanks.  I am more clear on what you are trying to achieve now.  I will need to think about this and see if I can come up with a solution.

    Can you share what your present circuit looks like?

    Chuck

  • Hi Chuck, no problem. I will draw and post the circuit later today. I actually think your window comparator idea might work so I will also take my best shot at including that in my circuit diagram and we can go from there. Thanks for the help.

  • In the meantime I drafted this for you.  It seems to work but would need some tweaking of the RC filtering at the input dependent on the slope detection rate you want to detect.  I switched to the TLV3201 to eliminate the hysteresis and lower the offset depending on how sensitive you want this to be.

    Go ahead and play with this TINA file, hopefully this will work for you.

    Chuck

     Slope_Detect_TLV3201.TSC

  • Hi Chuck,

    Here is my circuit as it stands right now:

    Sorry it took me awhile to respond. I've never used this Tina program before and had to learn it before I built the circuit.  The simulator doesn't seem to work for me but that's okay because I know it functioning as its supposed to.  

    The value of the capacitor I am using is 0.047 uf and resistor 47 ohms.  I found these values to work best just by trial and error. 

    Thanks alot for posting your circuit diagram. I noticed its very similar to what I have designed already except you suggest the TLV3201 instead. It appears to work as its supposed to in the simulator; HIGH for positive slope, LOW for negative slope, HIGH for flat line.  Wondering why the TLV7011 is acting different seeing as its almost an identical comparator?  I am definitely going to order these parts and try your circuit out to see if it works.  It will be a week or so before I get it together but will respond with how it turns out.  Thanks for your time very much appreciate it.

  • I will investigate further on Monday and let you know what I discover.

    Chuck

  • Dustin

    The TLV7011 model didn't give me the desired results either.  As you mentioned previously, the output transitions incorrectly when the input waveform slope goes to zero.  I was thinking the larger amount of integrated hysteresis would help but it may be something else that is causing the problem.  Your thought of trying both implementations on a bread board is the best idea.  I believe the devices are pin compatible if you order the same package options.

    Chuck

  • Dustin

    I thought it about it a little more.  I just confirmed that the problem is the TLV7011 model. It is not modeling hysteresis properly and that is why my simulation was not working as the TLV3201 was.  I will need to get the model corrected.  At this point I do not see any issue with you using the TLV7011 for this circuit.  Another way to make sure you don't have any issue is to add a positive feedback resistor that will create additional external hysteresis.  This will make sure that your circuit does not change states when the input slope becomes 0.

    Chuck

  • I will give the positive feedback resistor a shot, never even thought about that. Any idea what value I should try? I can experiment with it and let you know, thanks!
  • Attached is my simulation file but I still want to fix the TLV7011 model to be sure.

    We may find that the internal hysteresis is enough.Slope_Detect_TLV7011.TSC

  • Dustin Have you had a chance to try any of these options out? At some point it may make sense to take this support offline because it is a longer term project. I will leave this post open for a while longer just in case you have any additional questions. Chuck
  • Hi Chuck, I tried adding a positive feedback resistor and it did not work for some reason.  I will keep experimenting with it and mark this as resolved for now so its not lingering. Appreciate all your help.

  • Hey Chuck, I ended up figuring it out. I just had to add R2 (10K) to the inverting input (-). The reason it was outputting LOW was because the two values it was comparing were equal during long periods on HIGH.  The resistor from the inverting input to ground lowers the inverting signal just enough that there is a difference which causes the comparator to read HIGH. This is the final circuit: