# Can any op amp be used as a voltage comparator? Confused about IC741, UA741

#### zirconx

Joined Mar 10, 2010
130
I'm trying to turn the analog output from a circuit (the rectified voltage from a current transformer, 0v to 1v or so) into a HIGH/LOW (0v, 3.3v) signal for my raspberry pi. I think this can be done with a voltage comparator. I read an article about doing this with an IC741 voltage comparator. But I can't find that part on ebay, I can only find UA741 op amps. Is that the same thing?

I've built simple circuits, and and am now starting to wrap my head around op amps. Can any op amp be used as a voltage comparator?

Thanks

#### dl324

Joined Mar 30, 2015
12,929
Can any op amp be used as a voltage comparator?
Yes, but they'll be slow. Why don't you just use a comparator?

You'll need bipolar supplies to use a 741 to have the common mode input voltage range include ground.

#### zirconx

Joined Mar 10, 2010
130
Yes, but they'll be slow. Why don't you just use a comparator?...
Can you recommend a part number that I can find inexpensively on ebay?

#### sghioto

Joined Dec 31, 2017
2,373
LM393

#### Papabravo

Joined Feb 24, 2006
16,509
Can you recommend a part number that I can find inexpensively on ebay?
Buying components on eBay is like going out on the street and begging for somebody to just rip you off.

#### Ian0

Joined Aug 7, 2020
2,694
Can any op amp be used as a voltage comparator?
No.
Most of them can, but some op-amps such as NE5534/NE5532 and OP27/OP37 have back-to-back diodes across the inputs. You can only use them as comparators if there is never more than about half a volt between the inputs.

#### bertus

Joined Apr 5, 2008
21,453
Hello,

How many do you need?
The LM311 is a single.
The LM393 is a dual.

Bertus

#### Attachments

• 1.1 MB Views: 2
• 463.6 KB Views: 0
• 263.3 KB Views: 0

#### Ian0

Joined Aug 7, 2020
2,694
The LM393 has the same pinout as a dual op-amp.
The LM339 pinout is different from a quad op-amp. All the outputs are at one end. That makes the pcb a lot easier to track than if you were using a quad op-amp as a comparator.

#### crutschow

Joined Mar 14, 2008
27,461
Most of them can, but some op-amps such as NE5534/NE5532 and OP27/OP37 have back-to-back diodes across the inputs. You can only use them as comparators if there is never more than about half a volt between the inputs.
They are useable if there is enough resistance at the inputs to limit the current through the diodes when the voltage difference exceeds a half volt.

#### dl324

Joined Mar 30, 2015
12,929
Can you recommend a part number that I can find inexpensively on ebay?
LM393 is my go to comparator. I wouldn't recommend buying any semiconductors on ebay or Amazon.

#### bertus

Joined Apr 5, 2008
21,453
Hello,

I wouldn't recommend buying any semiconductors on ebay or Amazon.
Also aliexpress and alibaba are not good for electronic parts.

Bertus

#### Ian0

Joined Aug 7, 2020
2,694
They are useable if there is enough resistance at the inputs to limit the current through the diodes when the voltage difference exceeds a half volt.
True, but if you are using a common reference for several comparators, it can really mess it up! It's like having a comparator with a really low input resistance. Best avoided. It's also a lesson in not thinking that all op-amps work the same!

#### Audioguru again

Joined Oct 21, 2019
3,317
Banggood sells good leather shoes but fake or defective electronic parts.

#### zirconx

Joined Mar 10, 2010
130
In the last 2 days I ordered
10x LMV358P for $5.99 10x LM358 for$0.99
both from Ebay, which is where I get most of my components.

Looks like 1 LM393 from Arrow will cost $6.88. For 10 it's$9.55. On ebay they are $1.97 for 20 of them. I know they are more likely to be "fakes", on ebay. But so far I haven't had an issue. Maybe there is some other site cheaper than Arrow but more quality components than ebay? Last edited: #### prairiemystic Joined Jun 5, 2018 187 A current transformer (CT) outputs an AC voltage. You would first need to rectify that signal, then feed into a comparator. A two-stage circuit. #### Ian0 Joined Aug 7, 2020 2,694 In the last 2 days I ordered 10x LMV358P for$5.99
10x LM358 for $0.99 both from Ebay, which is where I get most of my components. Looks like 1 LM393 from Arrow will cost$6.88. For 10 it's $9.55. On ebay they are$1.97 for 20 of them.

I know they are more likely to be "fakes", on ebay. But so far I haven't had an issue. Maybe there is some other site cheaper than Arrow but more quality components than ebay?

#### neonstrobe

Joined May 15, 2009
165
Also - a current transformer puts out current. It may put out a really high voltage in order to do so. Your rectifier needs to be solidly wired to a load resistor so as to limit the voltage. You are not planning to measure mains current (or higher) are you?
Some CT's have built in resistors. They will limit the output to a rectifier. Preferably you would use one without, as the voltage should overcome the diode forward voltage, but that is the situation to be more careful.