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.

how to debounce switch at comparator input?

Status
Not open for further replies.

danjel

Member
I have a simple comparator using a tl072 setup to swing output to positive when the input goes above a threshold of about 1V. This comparator is being fed clock signals in the range of 0Hz to 20kHz of various wave shapes (hence the need for comparator to square them).
The comparator output is connected to the CLK in of a flipflop

I also wanted to connect a tact switch that can act as a manual clock pulse. Initially I was going to just connect the tact switch to the positive input of the comparator (same place where the clock input is fed) via a 10k resistor and the other side to positive votlage rail. That way whenever I press the switch it feeds positive voltage to comparator and it triggers.

However, I am wondering if I will need switch debouncing? i.e. are the switch bounces slower than the comparator slew?

If I used a standard debouncing configuration with pullup resitor and a cap to ground the issue is that the logic is reversed so I can't connect to the comparator input.
I could use an inverting schmitt trigger but then I am adding an extra IC and I want to avoid that if possible.

Any tips?
 
Last edited:
Please post a schematic.

The TL72 has issues when the inputs get too near the power supply rails.

The LM393 is a better comparator, unless you need to use one as an op-amp, in which case it might make sense to use an op-amp IC rather than a comparator.
 
Please post a schematic.

The TL72 has issues when the inputs get too near the power supply rails.

The LM393 is a better comparator, unless you need to use one as an op-amp, in which case it might make sense to use an op-amp IC rather than a comparator.


Yeah the LM393 is good but it is an open collector output. I am powering the TL072 with +/-12V and I have the output go to a 100k and then another 100k to 12V. This means that I can get logic 0 when the comparator is in full negative swing (default) and then a logic High when it is in positive. At the inputs of the comparator I have a voltage divider so that the input will never exceed the voltage rails.

Perhaps with an LM393 I would not need the Voltage divider and then could save some components? (I am strapped for space on my pcb). I need 8 comparators on this circuit so I was actually using TL074 not TL072 (my mistake).
 
Why is having an open collector output a problem?

Resistors are very cheap.

You can also buy comparator ICs with push-pull outputs.
 


cool so if I wanted to use this and make sure that only positive voltages are generated (and given this is rail safe). I would just power with single rail?

Also do I need to drop the input voltage at all? In my current configuration the input goes to 10K+100K voltage divider to drop it about 1V (from 12V rails).
Would I still need a current limiting resistor at the input?

Also I probably still need a hysteris resistor/ voltage divider for the negative input? (probably 100k+10K voltage divider for 1V hysteris threshold)
 
So in this schematic I have the old method (using a TL074)

and then I put what I think is correct for the new version using LM339. Since the Lm339 has a pullup if I used the positive input I would get inverse logic right? (i.e. a positive input above hysteris results in the output going low). So if I wanted it to be positive I would just use the negative input?

**broken link removed**
 
I fail to see why you even need the NAND gate on the comparator output. You can set the output logic based on where you set your vref pin on invert or non invert pin.
**broken link removed**
 
I fail to see why you even need the NAND gate on the comparator output. You can set the output logic based on where you set your vref pin on invert or non invert pin.
**broken link removed**

The NAND gate was just an arbitrary example (I just grabbed a random CMOS gate since I am trying to interface to CMOS devices with rising edge triggered inputs)

Also I see from this examples in the link that the output of the comparator is the opposite of what I thought. So with the LM339 I just use the positive input and put my reference voltage to the negative input.
So despite the fact that it is Open collector and you need a pullup the output is b default "on" and conducting to ground so that the output is logic zero.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top