LM393 triggering too soon - Page 1
Forum section: electronics / beginners

author: JoostdK
author_rank: Newbie
timestamp: May 30, 2023, 10:26:33 am
content: Hi all,first post so sorry if I mess something up in the post and since I'm a beginner I'm pretty sure I will batter the terminology. For a battery protection circuit I'm dabbing in voltage comparators and I've got some LM393's. Watched some videos online and recreated some of the circuits. They work fine, except for one thing. I dont really know how to say it, but the 'triggering/activation point/threshold' seems 6% (of the supply voltage) above the ref voltage. To clarify:Supply voltage 10V: ref voltage 5v -> LED starts conducting @ 5.6v => dif 0.6V = 6% of 10VSupply voltage 7.5V: ref voltage 3.5 -> LED starts conducting @ 3.9 => dif +-0.4V = 6% of 7.5VSupply voltage 5V: ref voltage 2.5 -> LED starts conducting @ 2.8v => dif 0.3V = 6% of 5VThis offset also happens at other ref voltages, all give the same 6% offset relative of the supply voltage. I just gave these since they are simple to compare.This is the circuit I use, my understanding is that the values of the pots don't matter.While in theory, this isnt a problem for me as the offset is always the same and I could just set it lower with a potentiometer, I really want to know what is happening here so I can learn. Searched for the answer online, but couldnt find it. Tried 5 different LM393's but all gave the same result. Also tried moving away from the breadboard and soldering the circuit, same result.Thanks in advance,Joost.

author: srb1954
author_rank: Super Contributor
timestamp: May 30, 2023, 12:50:09 pm
content: The circuit as shown would never work as both inputs to the comparator are comparing the same supply rail. Both inputs would simply track up and down at their respective potentiometer ratios and the differential voltage on the comparator inputs would never change sign to cause the comparator to be triggered.For this circuit to work one of the potentiometers would have to connect to a different supply rail.Another way to monitor a single supply rail is to have a voltage reference IC or Zener diode on one of the inputs to hold it constant while the other input varies in proportion to the supply rail.

author: Ian.M
author_rank: Super Contributor
timestamp: May 30, 2023, 01:32:42 pm
content: I *ASS*U*ME* the O.P's circuit is just a test circuit to allow setting one input voltage then slowly sweeping the other.See if its better behaved with decoupling - try 100nF ceramic directly across the LM393 V+ and Gnd pins, and if the leads to the supply are long, 10uF electrolytic across the V+ and Gnd rails.What are you doing with the unused comparator? Both its inputs should be tied to Gnd and its output left open.The problem may be noise pickup - if you are using open frame presets, use an insulating trim-tool! Ground metal pot bodies. Worst case you may need some capacitance to ground at the pot wipers. See if 10nF makes any difference.Also, try with the meter connected from the non-inverting to the inverting input. The offset voltage should be at most a couple of mV, so it should switch pretty close to when the meter goes through zero.

author: JoostdK
author_rank: Newbie
timestamp: May 30, 2023, 02:33:31 pm
content: Hi Ian,you would be correct in that assumption, no asses here. I figured out what was wrong, but I dont know why it is wrong. One tutorial I followed said 'grab a potentiometer, doesnt really matter what value, we are comparing voltages'. So what I did was I just randomly grabbed a 500k pot and a 1k pot. Newby me was thinking, the current doesnt matter, we are indeed comparing the voltage. Well I guess that leads to my strange offset problem.I replaced the 500k pot with another 1k one and now it works as expected.Although there is no more problem, can someone educate me why this did not work?

author: Ian.M
author_rank: Super Contributor
timestamp: May 30, 2023, 02:52:07 pm
content: At 50% wiper position, your 500K pot has a Thevenin equivalent resistance of 250K. I wonder if your multimeter was loading it down? Good DMMs are typically >10Meg input impedance, but cheap ones may be lower. It would only take a 2Meg load to account for the observed 6% error. That's why I suggested connecting the meter between the inputs rather than swapping it from one to the other to measure with respect to ground. If you were using two meters, both permanently connected, ignore the above. In that case the issue with such a high source impedance for one of the inputs, could be noise pickup causing the output to rapidly pulse between high and low when its close to the setpoint given by the other input voltage.

author: DavidAlfa
author_rank: Super Contributor
timestamp: May 30, 2023, 02:59:19 pm
content: If you want a "battery charged" detector, just use a TL431:https://dmohankumar.wordpress.com/2015/03/08/tl-431-shunt-regulator-design-note-11/

author: Zero999
author_rank: Super Contributor
timestamp: May 30, 2023, 10:01:42 pm
content: Do you have an LM358 handy? If so, configure it in unity gain buffer (look it up using a search engine) and connect it between the input and your multimeter. This op-amp's input will have a much higher impedance, than the meter and won't load it down as much.

author: floobydust
author_rank: Super Contributor
timestamp: May 30, 2023, 10:58:50 pm
content: I would guess the multimeter leads are a good antenna and the circuit isn't seeing just DC at the comparator's inputs.Adding a pair of 0.1uF caps to GND, one at each input should make no difference- but it will shunt HF noise if that is a factor here.OP where did you get the IC's from, the chinese specials for comparators are highly suspect.I just got some cheap ones and sure enough they perform poorly.

author: JoostdK
author_rank: Newbie
timestamp: May 31, 2023, 09:18:24 am
content: Quote from: Ian.M on May 30, 2023, 02:52:07 pmI think this was indeed the case. I noticed sometimes the LED would turn on/off (dont remember wich) when I connected the multimeter. Serves me right for buying the cheap tools. Lesson learned!Quote from: DavidAlfa on May 30, 2023, 02:59:19 pmThat looks cool! I think this would be more power efficient than the comparator. So many awesome components....how to know them all?Thanks all for all the kind and fast responses on my first post

author: Kim Christensen
author_rank: Super Contributor
timestamp: June 01, 2023, 04:00:25 pm
content: Quote from: JoostdK on May 31, 2023, 09:18:24 amMeasure a 9V battery with your meter and write that number down.Measure the same 9V battery with a 1M resistor in series with one of the leads. Use jumper clips to keep your fingers off to avoid adding your own resistance to the mix.Then use ohms law to figure out the input impedance of your meter.ie: If the battery measured 9.4V directly, but 8.55V via the 1M resistor, then the meter's input impedance is 10M which is perfectly acceptable.