EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: Chris Wilson on November 30, 2016, 11:58:09 am

Title: Hysteresis on an LM393 comparator
Post by: Chris Wilson on November 30, 2016, 11:58:09 am
I have built a little circuit to read the output from a current sense board, details hopefully attached of the device on the board. It outputs 2.5V DC with no current being sensed. If current is drawn the output rises or falls depending on polarity. I want the LM393 comparator to trip over at 3.7V, and it seems to do this, but looking at a meter and a LED on its output pin this is not a sudden change of state around that voltage. I THINK I need to add a feedback resistor, to add hysteresis? Can someone tell me what value to try and confirm it needs to go from output to the + In pin?

Secondly, I want the output to go straight to an inverter based on part of an HEF4069 hex inverter. Will the pull up resistor on the output of the comparator affect the inverter's operation? Is there a better way to get a Low output from the comparator?

I attach the schematic of my circuit, don't laugh too much, `tis my first attempt with Eagle :) "IN" is from the current sense module, "OUT" is to the hex inverter.


Many thanks
Title: Re: Hysteresis on an LM393 comparator
Post by: Zero999 on November 30, 2016, 12:53:12 pm
You need a resistor in series with the non-inverting input, as well as a feedback resistor. The data sheet for the LM393 shows how to add hysteresis, see page 14.
http://www.ti.com/lit/ds/symlink/lm393-n.pdf (http://www.ti.com/lit/ds/symlink/lm393-n.pdf)

Why are you using the HEF4069 as well as the LM393?
Title: Re: Hysteresis on an LM393 comparator
Post by: Chris Wilson on November 30, 2016, 01:03:01 pm
Hi Hero999, I am not sure why I am using both, I suspected there might be a more elegant way of doing things, I need the comparator to eventually cause an output that goes LOW when an over current situation is sensed... Is there a better way of achieving this please? I need the hex inverter to invert two other outputs, so it's "there" anyway.

Thanks for your reply.
Title: Re: Hysteresis on an LM393 comparator
Post by: Brutte on November 30, 2016, 01:50:52 pm
Definitely a positive feedback is needed. Take a look at EEVBlog #941 (https://www.eevblog.com/2016/11/12/eevblog-941-the-amazing-schmitt-trigger/)
Title: Re: Hysteresis on an LM393 comparator
Post by: Chris Wilson on November 30, 2016, 05:09:06 pm
OK, I have found some time to watch that and it is of great help, thank you for the link.

I think if I reverse the reference voltage and the watched voltage on the + and - pins the state of the output will be reversed and do what I need without the inverter? I will test it on the breadboard, I suspect this is why Hero999 asked why I need both? I have much to learn and I am glad I asked here! Thanks again.
Title: Re: Hysteresis on an LM393 comparator
Post by: danadak on November 30, 2016, 11:40:54 pm
Here is a tool to help calculate the needed R's.


http://sim.okawa-denshi.jp/en/compkeisan.htm (http://sim.okawa-denshi.jp/en/compkeisan.htm)


Regards, Dana.