Continue to Site

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.

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

LM324N problem!

Status
Not open for further replies.

kpsg25690

New Member
Hey all!
Since this is my first post i should introduce myself..
My name Karan and i am an engineering student.

I have been working on a project on a project that requires a comparator.
I am using LM324n as a comparator and the circuit is working correctly.

I am using a +5V supply power to the ic but when the output is high i get around 2.1V on the output pin,which is enough to drive an LED but i want to give this output to a PIC18F4520 which will not identify 2.1V as high.

What do i do?
I have tried using a 12V supply for the IC also without any change.

I've been at it for some time and need some help...
 
It would help us a lot if you would post a schematic of your project, showing what you have connected to what. (Hand-drawn is fine if nothing else).
 
Do you have the LED connected to the output without a resistor? That will probably give you about that voltage.
 
Do you have the LED connected to the output without a resistor? That will probably give you about that voltage.

I agree, if the output of the LM324 is directly driving the LED sans a series resistor with the LED it sounds to me like you are seeing the forward voltage drop across the LED. Place a resistor in series with the LED and measure the voltage at the output pin. Has it increased? Start with about a 100 Ohm resistor.

Ron
 
Thanks for the reply guys!

and yeah i was driving the LED without a resistor,i followed your advice and connected a resistor in series,Now i get 3.6 V with a 2.2K resistor with o/p pin of lm324 as source and 3.7 V with the o/p pin as sink...

Which configuration should i use?

and if i connect the output pin to the PIC18F4520 as input would the uC identify it as logic 1? (i think it should)
 
According to the datasheet, the LM324's output can swing within 1.5 v of VDD. That's why you're only seeing 3.6v out.

According to the PIC datasheet, you need 0.8 x VDD on a schmitt trigger input for it to be considered a logic 1.

0.8 x 5v = 4v so your output will not be high enough.

You need to either use a different device (a rail-to-rail op amp or a comparator) or place something on the output (a transistor) to level shift.
 
That sounds about right. The LM324 is not a rail to rail operational amplifier so the output voltage swing will be 0 volts to VCC -1.5 or in your case 5 - 1.5 = about 3.5 volts.

Large output voltage swing:0VDC to VCC-1.5VDC

Given a choice if you need a LED in there between output and PIC I would let it source and see how that goes. That short of adding a transistor or anything else.

<EDIT> Gobbledok is way ahead of me. :) </EDIT>

Ron
 
Last edited:
I considered using LM339 but i would have to use pull ups.
Could you suggest a rail to rail amplifier IC or a comparator IC that is easily available and meets the requirements?
 
I would have used the LM339 since what you want is a comparator. You are only looking at a few resistors added to the circuit and then you are using a chip designed more for what you are after, that being a comparator. As to single supply rail to rail operational amplifiers you may want to give this a read. For a single comparator there is the LM311, for a dual the LM393 and for a quad the LM339 all of which are very common and inexpensive choices.

Ron
 
I considered using LM339 but i would have to use pull ups.
Could you suggest a rail to rail amplifier IC or a comparator IC that is easily available and meets the requirements?

MC33201 would suit nicely if you only need one op amp.

MC33202 if you need 2.
 
Why not reverse the inputs to the LM324, and wire the LED/resistor between 5V and the LM324 output?
The LM324 can drive it's output within mV of ground when it is sinking current.
 
Status
Not open for further replies.

Latest threads

Back
Top