Author Topic: Noninverting comparator (LM397) circuit troubleshooting...  (Read 666 times)

0 Members and 1 Guest are viewing this topic.

Offline davethebossmanTopic starter

  • Newbie
  • Posts: 4
  • Country: ca
Noninverting comparator (LM397) circuit troubleshooting...
« on: January 25, 2024, 07:57:10 pm »
Hi, all;

First time posting, and I'm looking for assistance from some circuit experts. Recent EE graduate, here. Embarrassed that I can't get some simple circuits working! Any help is appreciated...

Goals:
- Make a noninverting comparator circuit. Vcc = ~12V, Vthreshold = ~10V..... these values are to be experimented with, once I get the circuit functioning.
- not terribly committed to my hysteresis value yet, but <500mV would be nice
- Comparator will eventually be used to trigger a 555 Timer (LM397 OUT will be attached to 555 TRIG, and *hopefully* Timer will be triggered on falling edge signal from LM397)

Successes so far:
- Inverting circuit (attached below) is functioning. I just eyeballed the resistors to get things going. Inverting circuit has values of VH = 11.1V, VL = 11.0V, with VCC = 12V.
- ummm other successes..... I haven't melted the LM397 yet?

Failures so far:
- I don't care about the inverting circuit working... I want a noninverting comparator
- noninverting comparator circuit refuses to light up, both by "playing around with values" and by mimicking TI's example circuit (PDF attached below)
- significant attack on pride and confidence |O

Requests:
- Please suggest how my noninverting circuit needs tweaking. As soon as I get it working at all, I should be okay to tweak.
- if LM397 isn't the right fit, then please say so
- Be nice, I'm trying.

Notes:
- yes my LED is facing the right way
- yes I've checked my math (using TI's PDF, it was basically plug-and-play calculations), but please feel free to ask specific questions
- have not used a scope on the circuit yet

Thank you for reading. Hopefully I've provided enough details!

David


 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6221
  • Country: de
Re: Noninverting comparator (LM397) circuit troubleshooting...
« Reply #1 on: January 25, 2024, 10:23:19 pm »
Soo...
"Open collector output stage". Google it. (and relate it to a 100k pullup for the LED)
As for negative feedback for a comparator... not really useful.
And, and, and.
 

Offline MarkT

  • Frequent Contributor
  • **
  • Posts: 393
  • Country: gb
Re: Noninverting comparator (LM397) circuit troubleshooting...
« Reply #2 on: January 26, 2024, 02:11:33 pm »
Your first circuit has pins 1 and 5 shorted together - I don't think you meant that.

Comparator circuits use only positive feedback, and usually only a small amount of it to ensure a crisp snap transistion.  Typically a large value resistor from output to non-inverting input is used for this, although in many situations it can be omitted.

Comparators compare, they don't invert (or non-invert).

And don't be confused by the symbols, comparators are very different from opamps in several important ways.  Using an opamp as a comparator is fraught with pitfalls, trying to use a comparator as an opamp is doomed as comparators are designed to be unstable and saturate the output.
 

Offline davethebossmanTopic starter

  • Newbie
  • Posts: 4
  • Country: ca
Re: Noninverting comparator (LM397) circuit troubleshooting...
« Reply #3 on: January 26, 2024, 04:40:32 pm »
Well, I should update my progress:

- first off, my comparator is now functioning! I pulled out my multimeter and started measuring nodes. I found some interesting results.
- my inverting voltage divider was causing a very low node voltage.... around 1.5V..... I had been hoping for a Vthreshold of 10V
- i noticed the odd behaviour that, when adjusting my Vsig, I would find Vthreshold changing as well. I didn't anticipate this (am I imagining things or was this true??)
- the result was that, when I varied Vsig at the noninverting input, I could never reach the Vsig < VThreshold condition
- upon changing my resistors to much lower values (<100k), I reached my desired Vthreshold
- now, when changing Vsig, I could cross the Vthreshold boundary.....my comparator works!

Remaining things to understand:
- why were my original resistor values (~1M in some cases) giving trouble? The math says they should be fine. And TI's guide suggests that such high values will reduce power loss (not that I care, for my application)
- should I consider a capacitor anywhere, to smooth my Vsig a bit? I'll be using a LM7812 to obtain Vref, so I'm not terribly worried about that part (though maybe it deserves a cap as well?).
- now that this portion of the circuit is functioning, I've attached it to the 555 timer. I'm finding the 555 timer to be triggering randomly, which is clearly not good. Obviously it's receiving some falling edges from the comparator. I must investigate whether hysteresis or trigger input smoothing can be implemented.

Thank you, users, for your suggestions! Will update as the circuit develops. Maybe it'll help someone else.

David
 

Offline davethebossmanTopic starter

  • Newbie
  • Posts: 4
  • Country: ca
Re: Noninverting comparator (LM397) circuit troubleshooting...
« Reply #4 on: January 26, 2024, 04:42:13 pm »
Soo...
"Open collector output stage". Google it. (and relate it to a 100k pullup for the LED)
As for negative feedback for a comparator... not really useful.
And, and, and.

Hi, Benta. Thank you for your reply!

1. Can you give me a hint about what I should've noticed, when Googling? From my reading, it seems that the pullup resistor is necessary due to the open collector topology; this is good for me because I want the Vsig > Vthreshold condition to result in a high output. Please give me some hints what else I should notice.

2. My mistake about the negative feedback. That resistor should indeed be connected to the noninverting input.... kicad had the symbol in the reverse order from I expected. Didn't notice til you pointed it out.

Thanks again.
 

Offline davethebossmanTopic starter

  • Newbie
  • Posts: 4
  • Country: ca
Re: Noninverting comparator (LM397) circuit troubleshooting...
« Reply #5 on: January 26, 2024, 04:46:45 pm »
Your first circuit has pins 1 and 5 shorted together - I don't think you meant that.

Comparator circuits use only positive feedback, and usually only a small amount of it to ensure a crisp snap transistion.  Typically a large value resistor from output to non-inverting input is used for this, although in many situations it can be omitted.

Comparators compare, they don't invert (or non-invert).

And don't be confused by the symbols, comparators are very different from opamps in several important ways.  Using an opamp as a comparator is fraught with pitfalls, trying to use a comparator as an opamp is doomed as comparators are designed to be unstable and saturate the output.

Hi, MarkT;

Thank you for your reply as well. A couple things...

1. Actually I indeed meant to short pins 1 and 5. I was merely "getting the circuit going" and this happened to work... albeit with the reverse output. It's not part of my design, moving forward.

2. I'm a bit confused about your "comparator don't invert" comment. I found that, when reversing the comparator inputs, I either got a normal-high output (for Vsig at noninverting input) or normal-off output (for Vsig at inverting input). Please help me understand better.

3. Thank you for the clarification about opamps vs comparators. I know they're related but not alike. I'll keep this in mind for future. Any further comments on this matter would be appreciated, if you're willing.

Thanks again.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf