comparator woes - Page 1
Forum section: electronics / projects

author: vixo
author_rank: Regular Contributor
timestamp: March 15, 2017, 10:53:06 am
content: i've been making a little music gadget recently, which works pretty well apart from an important comparator circuit, or actually two comparator circuits.I'm finding that whatever I seem to do, I get a little bit of 'chatter' in the transition, which, as I'm feeding an interrupt on a microcontroller, triggers that interrupt twice. I didn't notice it at first as it's *so* slight and I have to zoom right in to see it, but sure enough it's there, on both comparator circuits to a greater or lesser degree.I also really would like not to have to use this pull-up arrangement, which, if you want to get a really fast transition, is power hungry and really I want this to be as low power consumption as possible. lastly, in the second comparator circuit, i have used a er.. slightly dodgy way of mixing two signals in with each other - the idea is you get a pulse when an incoming wave is either below (for example) 5v or above 5v. because I'm using the coupling cap, the output takes a longer time to charge and I kill my upward transition (which I realise i could re-arrange so the resistor is on the emitter) but this coupling also seems to affect the level of 'chatter' I get.As you can see I have used hysteresis and filtered the inputs but the chatter remains. What can I do to stop it? Is there a simpler way I can achieve the same goal? I wouldn't have thought this would be such a pain to get right...

author: MagicSmoker
author_rank: Super Contributor
timestamp: March 15, 2017, 11:42:54 am
content: If your comparators are chattering then you need (more) hysteresis. With a 1k input and 100k positive feedback resistor you have a hysteresis band of about 1% of the output swing, and something like 5-10% would be more appropriate here. So, reduce the feedback resistance and/or increase the input resistance then see if things behave better.

author: Ian.M
author_rank: Super Contributor
timestamp: March 15, 2017, 12:12:26 pm
content: Add 1K isolation resistors between the filter caps C11, C12 and each comparator's +in, with the hysterisis resisors direct to +in.

author: snarkysparky
author_rank: Frequent Contributor
timestamp: March 15, 2017, 12:18:11 pm
content: What is the source impedance driving the circuit. It needs to be low for the hysteresis to work correctly.

author: amspire
author_rank: Super Contributor
timestamp: March 15, 2017, 01:10:11 pm
content: MagicSmoker's idea about adding more hysteresis - more hysteresis will give you more overdrive on the input and a faster transition.339's can suffer from oscillation on the inputs which is cured by adding 100 ohms to 1K series resistance to the inputs. This tends to happen when an input is directly connected to a low impedance - such as a capacitor. If you notice a comparator that seems to be switching when it shouldn't, try adding resistors in series with the inputs. When this problem happens, they seem to switch the output even when the voltages in the inputs are wrong.You can get newer, low power comparitors with active pullup that gives better speed as well. The LM339 is over 40 years old.There is the LVM339 family from TI and the Micrel/Microchip MIC6270 IttyBitty comparitor.

author: StillTrying
author_rank: Super Contributor
timestamp: March 15, 2017, 10:01:28 pm
content: amspireLM319