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.
 
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.
 
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:
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.
 
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.
 
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

  • LM342Comp.png
    45.2 KB · Views: 166
I already asked that, yet he hasn't answered.

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

its the same except for the ground to which i connected a reference voltage
 
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.
 
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.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…