LM393 comparator is not flipping - Page 1
Forum section: electronics / beginners

author: czbaterka
author_rank: Contributor
timestamp: March 15, 2025, 11:58:31 am
content: I am trying to make diy L meter.I have 5ms charge signal from Arduino and then I am measuring oscillation frequency, but my LM393 does not seems to be flipping for the oscillation.Does anyone have any idea, why is not triggering? It should be for anything above (-) of the op-amp which is 0V

author: benj38
author_rank: Frequent Contributor
timestamp: March 15, 2025, 12:15:22 pm
content: The thread title says LM396 instead of LM393. I guess this is a mistake.The datasheet's "Absolute Maximum Ratings" clearly state that the input voltage should not go below -0.3V.The "Recommended Operating Conditions" clearly state that the minimum input voltage should be 0V.In short, this comparator in not intended to detect 0V crossings.You should shift the inverting and non-inverting DC voltages up (e.g., to half the supply voltage), and capacitively couple the AC input signal to the comparator.

author: czbaterka
author_rank: Contributor
timestamp: March 15, 2025, 12:27:08 pm
content: Quote from: benj38 on March 15, 2025, 12:15:22 pmYes. Sorry.Quote from: benj38 on March 15, 2025, 12:15:22 pmSo why there is so much examples of this L meter design with same comparator?

author: benj38
author_rank: Frequent Contributor
timestamp: March 15, 2025, 12:38:24 pm
content: Quote from: czbaterka on March 15, 2025, 12:27:08 pmThat is up to you to conjectureDo you believe the Internet examples more than your own measurements? More than the datasheet?

author: PGPG
author_rank: Frequent Contributor
timestamp: March 15, 2025, 12:55:16 pm
content: Quote from: czbaterka on March 15, 2025, 11:58:31 amSupply + input with DC voltage varying from - to + and in the stable condition search for the problem source.In 70s when I was trying to have a way of measuring elements I have done:1. C & frequency meter based on 74121 timer with analog output at 100uA pointer meter.2. Very simple 2 transistor generator (with third as output follower, if remember well) that was able to generate in a very wide frequency range when LC paralel circuit was connected to it.Nowadays point 1 is not rationale to do as frequency can be easily measured with microcontroller.But point 2 can (in my opinion) be better solution to measure L using known C. About 10 years ago I used this generator in our product where we needed to detect L changes. If you ask I can search for this old schematic (the generator was supplied by microcontroller pin (to run only when needed) and read by the second pin).

author: mikerj
author_rank: Super Contributor
timestamp: March 15, 2025, 01:47:15 pm
content: Quote from: czbaterka on March 15, 2025, 12:27:08 pmDo all these examples tie one input to ground and drive the other input negative? You'll need to bias both inputs into the allowable common mode range to make the comparator work as intended, and also provide some hysteresis to prevent noise from toggling the output.

author: ledtester
author_rank: Super Contributor
timestamp: March 15, 2025, 02:14:04 pm
content: I would try the highlighted circuit I have attached below. It comes from the "AADE LC Meter II".You can find a description of how it works here:https://pe2bz.philpem.me.uk/Comm01/-%20TestEquip/-%20Tester-NonActiveDevice/Cl-251-IndCap-MeterKit/lc-meter-project.htm#:~:text=The%20key%20to%20L/C,used%20in%20the%20tank%20circuit.The highlighted part is just a standard comparator oscillator. In fact, you can test it on its own and you should get a square wave output. More details at:https://electronics.stackexchange.com/questions/94505/working-of-a-comparator-based-oscillator-circuitThe LC tank is AC coupled into this oscillator through a 10u cap. Note that the oscillations occur around Vcc/2 which is a much better region for the comparator to operate in rather than close to the negative supply.This circuit will also start the LC tank and sustain it.

author: czbaterka
author_rank: Contributor
timestamp: March 15, 2025, 03:18:00 pm
content: Thanks for responses. I will definitelly try to build something better and with symetric voltage in future, but my issue was misteriously fixed by flipping the diode on the input?! I do not quite understand why, because if the diode is flipped, its purpose is negated and more than that, the current should now flow to the LC, right?

author: ledtester
author_rank: Super Contributor
timestamp: March 15, 2025, 03:59:16 pm
content: What is your 5ms charge signal -- is it +5 for 5ms and then 0V or +5 and then high impedance?

author: czbaterka
author_rank: Contributor
timestamp: March 15, 2025, 07:03:34 pm
content: Quote from: ledtester on March 15, 2025, 03:59:16 pmI would assume +5 for 5ms and then 0V?

author: ledtester
author_rank: Super Contributor
timestamp: March 15, 2025, 08:12:26 pm
content: At 4:00 in this video:DIY transformer, inductor and capacitor in-circuit ring tester -- DiodeGoneWildhttps://youtu.be/E1dopmxph2A?t=4mthere is a schematic for a "ring counter" which excites a transformer coil and counts the resulting oscillations.

author: Zero999
author_rank: Super Contributor
timestamp: March 17, 2025, 09:48:45 pm
content: What about biasing the comparator's inputs to half the supply?

author: PGPG
author_rank: Frequent Contributor
timestamp: March 18, 2025, 12:30:52 am
content: What is the function of 100nF between +in and -in ?

author: Zero999
author_rank: Super Contributor
timestamp: March 18, 2025, 08:57:06 am
content: Quote from: PGPG on March 18, 2025, 12:30:52 amIt's wrong. It should go to 0V.