• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

lm324 comparitor

Status
Not open for further replies.

neo_star

New Member
I am using a lm324 voltage compatitor for a project of mine.
The output of the comparitor is to be connected to a microcontroller.
So the power supply i gave to it was +5v to 4th pin and ground to 12th pin.
Will the ic work if i give ground to 12th pin instead of -5v.
 

BrownOut

Banned
That depends on how you connect the other pins. I think there's a turtoial on connecting comparators in the turtoral section on this site.
 

marcbarker

New Member
324 opamp CommonModeInputRange is supposed to include ground, it's a single-rail opamp. The output swings right down to 'ground' too, according to datasheet. In practice it's about a volt when sinking 1 mA, plenty low enough for a logic 'L'.

Yeah, just connect it across the microcontroller's supply, and then you'll know the output swing is within the uC's input voltage range.
 
Last edited:

audioguru

Well-Known Member
Most Helpful Member
The LM324 is one of the slowest opamps ever made.
Its negative or ground power supply pin is pin11, not pin12. Pin12 is an input on one opamp.

If you connect pin4 to -5V then the output will go to almost -5V which might blow up your microcontroller.
 

neo_star

New Member
So wat kind of opamp should i use for a fast response. should i use a pull down resistor.
 

marcbarker

New Member
So wat kind of opamp should i use for a fast response. should i use a pull down resistor.
Why do you need "a fast response"? How fast is does your uC software read it?

What's the concern why considering pull down?
 

Hero999

Banned
You don't need an op-amp, you need a comparator.

Doesn't the MCU have a built-in comparator?

If not try the LM393/399 but you'll need a pull-up resistor.
 

neo_star

New Member
i am sorry i did connect to pin 11. but lm324 is not working as a comparitor
 

Hero999

Banned
why wat is special about LM393/399.
They are specifically designed to be used as comparators.

Sorry that should have been LM393/339.

The LM324 is designed to be used as an op-amp and makes a very poor comparator.
 

MikeMl

Well-Known Member
Most Helpful Member
i am sorry i did connect to pin 11. but lm324 is not working as a comparitor
Is it connected like this:

Note the non-ideal behavior. It works with one input at ground, but it is slow and it has some offset. The common-mode range includes ground at the bottom end, but only goes to about +3V when operated on single 5V supply.
 

Attachments

Hero999

Banned
I already asked that, yet he hasn't answered.

I don't see the point in using a separate comparator in a microcontroller circuit.
 

marcbarker

New Member
I am using a lm324 voltage compatitor for a project of mine.
The output of the comparitor is to be connected to a microcontroller.
Wot exactly r u interfacing to your uController (via a 'comparator')? Just interested.
 

neo_star

New Member
i am interfacing using a comparitor and i am using atmel 89C51.
It does not have a comapritor.
 

neo_star

New Member
Is it connected like this:

Note the non-ideal behavior. It works with one input at ground, but it is slow and it has some offset. The common-mode range includes ground at the bottom end, but only goes to about +3V when operated on single 5V supply.
its the same except for the ground to which i connected a reference voltage
 

MikeMl

Well-Known Member
Most Helpful Member
its the same except for the ground to which i connected a reference voltage
What is the reference voltage? What is the supply voltage?
 

neo_star

New Member
What is the reference voltage? What is the supply voltage?
the supply voltage is +5v so practically the output voltage will be +3.8v.
The reference voltage is +1v.
So after 1v i would read as 1 logic and below 1v i would read as 0 logic.
 

marcbarker

New Member
I asked "what's connected to the input of the comparator [that needs comparing], and got the reply:
i am interfacing using a comparitor and i am using atmel 89C51.
It does not have a comapritor.
So are you saying you are interfacing a 'comparitor', via a comparator to your 89C51?

I'm confused now! Normally you connect into the comparator input, a transducer of some kind (what I was asking about). But I've not heard of a comparitor connected to the input of a comparator. What kind of signal does a comparitor provide to the comparator?

Maybe you don't need a comparator at all and you can just send signal to the 89C51's A-to-D converter instead, and do the comparatoring in software?
 
Last edited:
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top