Maker Pro
Maker Pro

Op amp LM339 help

I’m trying to use an LM339 as a voltage comparator to translate a 0-2.5 volt DC level into 0-5 volt logic level. With a 1.6 volt reference on the negative input and 2.5 volts on the positive input, the output will only go to 2.5 volts even with a 1k pull-up to 5 volts on the output. What am I doing wrong?
 

Attachments

  • 37611E1D-3985-4C30-BD5C-E425767BE1DA.jpeg
    37611E1D-3985-4C30-BD5C-E425767BE1DA.jpeg
    140.7 KB · Views: 167
What load do you have on the output?
Thanks for the reply! Just the pull up resistor and I’ve tried 330 ohms up to 100k. What’s strange is that on the bench test the output goes to 5 volts with a separate 0-2.5 volt dc signal but when connected to the unit I’m trying to interface with and using its internal 5 volt supply and the 0 to 2.5 volt dc signal out, the op amp will only go to 0 or 2.5 volts. I’ve tried that same signal connected to a CMOS gate and get the same results (which didn’t surprise me).
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
That's your pull-up, what is the load?

Or are you getting these results without a load?
 
That's your pull-up, what is the load?

Or are you getting these results without a load?
Hi Steve, at this time there is no load on the comparator other than the pull up resistor. If working the way I expected, the output would feed a CMOS gate CD 4082, four input AND. I have tried connecting it but the voltage is still 2.5 volts and the output of the gate is also limited to 2.5 volts.
 
"The output goes to 5 volts with a separate 0-2.5 volt dc signal" but the output does not go high enough "when connected to the unit I’m trying to interface with".
Then whatever drives its input with 0V to 2.5V is probably modulating its voltage on and off so that the average voltage at the comparator output is half the supply voltage. Maybe the input signal is 0V, 2.5V, 0V, 2.5V over and over?
 
Yes the power supply is a solid 5 volts. I monitor it continually during my tests. There are no shorts on the bread board and in fact the LM339 works flawlessly on the bench. A 2.5 volt level applied to the + input with 1.6 volts applied to the - input produces 5 volts out. It’s only when the same set up is connected to the system I’m trying to interface with that the problem occurs. The system has an on board 5volts and remains there when testing with the LM339. The 0 to 2.5 volt being connected and monitored from the system is also constant either at 0 volts or 2.5 volts depending upon the user selection. However the output of the LM 339 never exceeds this 2.5 volt level with only a pull up resistor connected to 5 volts. This chip is open collector so some load is needed.
 
Did you measure each side of the 1K resistor and get 5V on one side and 2.5V on the other side? This seems improbable since the LM339 would have to be half on, which it is designed not to do.

Bob
 
Aren't you measuring the +2.5V output with a slow voltmeter? Try looking at it with an oscilloscope to see the high frequency squarewave switching from 0V to 5V over and over.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Does the external 2.5V source share a common ground with your LM339 circuit?

Oh, and PICTURES.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
And your pull-up is a pull-up, it's not a load. When I asked about a load I was asking about anything else connected to the output (and typically ground referenced)
 
If all you want to do is convert a 2.5V pulse of level into a 5V pulse or level. 2 transistors and a few resistors will do the job.
See pictures attached.
 

Attachments

  • level shifter.pdf
    10 KB · Views: 34
  • level shifter sch.pdf
    8.7 KB · Views: 46
Top