Hi All I am controlling the output of a bicolor LED using a dual comparator (393), however when the input voltage hovers around the ref voltage, the LED starts to flicker between colors, and understandably so. Now I was wondering if there is a way to tie down the LED output during the first instance of the crossover between input and ref. Also since the voltage swing can be large sometimes (+/- 1.5v), the only way to restore the original LED output would be to reset the chip. I hope i've made myself clear.
You need to have a little feed back from the output to the (+) input of the comparator. For single supplies, normally a voltage divider is used as the fixed ref at the (+) input to set the threshold point for the (-) input sense. You can place a high value R from the output to this point so that the threshold reference value changes when the output switches.
You can either experiment or do the basic ohms law to calculate the value needed for R verses the hysteresis value of interest, this will stop your flickering.
Have you considered using a Schmitt trigger? This is basically a comparator with a couple of extra resistors to provide positive feedback. This causes the low-to-high threshold to be higher than the low-to-high threshold, which should prevent the problem you describe
If you think this will solve your problem, there are two different configurations (inverting and non-inverting) and a couple of calculators here:
formatting link
formatting link
I suggest that you make only one of your comparators the schmitt trigger and use the output of this to trigger the other, or you could end up with a dead zone where both outputs are in the same state and the LED is off (unless that would be useful?).
You can use a couple logic gates to create a Set-Reset Latch if that is what you want. Use the comparator to drive the Set input of the latch and a switch to drive the Reset input, connect the LED between the Q and Q_bar outputs. Note, the logic gates may not have sufficient output current to drive the LED so you may need to buffer the outputs with two more comparators.
There is more about the SR latch here:
formatting link
--
-----------------------------------------------------------------------
To reply to me directly:
Replace privacy.net with: totalise DOT co DOT uk and replace me with
gareth.harris
There is no reset on an LM393. What you seem to be experiencing is the effect of noise on the input. The classic solution is to use some small positive feedback to give some hysteresis betwen the coulour change points. See app notes.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.