LM358 output ? - Page 1
Forum section: electronics / beginners

author: byoungblood
author_rank: Contributor
timestamp: April 19, 2018, 02:06:59 am
content: I am using an LM358 as a simple differential amplifier to amplify the voltage drop across a current sense resistor for a power supply I'm building. For my testing purposes the V+ is connected to a 13.8v supply I have and the V- is grounded.If I just leave the output floating, I see about 600mV on the output with no load on the circuit with the current sense. If I put a 1k pulldown on the output, I can get that down to about 80mV. Rough math says that will still equate to about 40mA current if I want 3A = 5V output from the differential amp.I'm still feeling my way around op amps, is it normal to have to use pulldown/pullup resistors on their outputs to drive the output to or very close to 0V? Is there any practical limit on how little resistance can be used or is there a better way of handling this?

author: Nerull
author_rank: Frequent Contributor
timestamp: April 19, 2018, 02:11:32 am
content: Opamps cannot reach their supply rails, though some can get pretty close. If you want 0v output you need to supply the opamp with a negative voltage.Testing with an LM358N I've got sitting around, I can get to about 1.5mV with no load and the input grounded, in both a buffer and 2x gain configuration. A split supply improves it to about 0.3mV, which is significantly lower than your numbers, which means your primary problem is input offset voltage.A unity gain differential amp on my bench outputs about 3mV with both inputs grounded. The datasheet specs an input offset voltage of 2-7mV, and I believe that the gain on your differential amp will multiply this.http://www.analog.com/media/en/training-seminars/tutorials/MT-037.pdfGenerally when asking for help with a circuit it is best to give some details about the circuit. How is the opamp connected? What is the gain? Are you testing the 0 current condition or something else?

author: byoungblood
author_rank: Contributor
timestamp: April 19, 2018, 03:22:04 am
content: I am testing in the zero current condition, with a gain of 10 at the moment. I actually need a gain of about 16, but I need to order some 1% 160k resistors. For the sake of brevity, it is connected like U1b in the schematic here:http://www.farcircuits.net/kd1jv%200-14v%202%20a%20ver%202%20power%20supply.pdfIs there any reason not to use 1k and 10k (or in my case, a 16k resistor) in place of R3-R6 in that schematic? 1% of 1k being 10 vs 100 ohms for 10k, or does it really matter in an application such as this? Only downside I can think of is the current drawn across those resistors at higher voltages.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: April 19, 2018, 03:30:02 am
content: Why not offset the input and output, so that you can read zero, and somewhat negative, values? Subtract the difference out later, at whatever's reading it.Tim

author: not1xor1
author_rank: Frequent Contributor
timestamp: April 19, 2018, 04:49:08 am
content: Quote from: byoungblood on April 19, 2018, 03:22:04 amApart the fact that 5 1/4W resistors can dissipate just 1.25W (not 2.25W like stated in the PDF) I seriously doubt that such a circuit may work reliably:- as Nerull suggested you need a negative voltage (you might just use a couple of diodes and capacitors to get it from the transformer)- you cannot just use any P MOSFET as suggested in the PDF because:- most of them are characterized just for switching applications so have no DC safe operating area specifications- you have to modify the compensation network according to the MOSFET- in any case such a circuit is prone to oscillations and is very sensitive to the kind of load, so while may be stable in some instances it will easily oscillate with other kind of loads

author: capt bullshot
author_rank: Super Contributor
timestamp: April 19, 2018, 07:34:20 am
content: ... the LM358 is a lousy (lousy is a technical term) amplifier ... (quote from Bob Pease)In fact, it's probably the only known op amp that works better with a pull-down or pull-up resistor attached. One can use its output to near GND with an pull-down resistor. Your residual voltage (at no input current) is most probably the amplified input offset voltage of the amplifier.Just go for a "better" op-amp, there are rail-to-rail amplifiers and "zero drift" / low offset amplifiers, like e.g. the OPA333 (caution, this one requires a max. 5V supply).

author: byoungblood
author_rank: Contributor
timestamp: April 19, 2018, 12:00:54 pm
content: Quote from: not1xor1 on April 19, 2018, 04:49:08 amAll I used that schematic for was the current limit circuit. I used a (gasp!) LM723 for the voltage regulation with a 2N3055 pass transistor. This is very much a junk box/what I could get inexpensively type build, however the regulation part of the circuit does seem to work quite well over the simple dummy loads I've hooked it up to so far (8 ohm 100w resistors, a few tube filaments in series).

author: byoungblood
author_rank: Contributor
timestamp: April 19, 2018, 01:07:13 pm
content: Quote from: capt bullshot on April 19, 2018, 07:34:20 amI just tried a lower value resistor (330 ohm) and it made no difference over the 1k I used as a pulldown. Still wouldn't go below 80mV, so I believe you are correct, it is simply amplifying its own offset voltage.Can you suggest a through hole op amp that may fit the bill? The OPA2333 is $72 for oneBetter yet, if I could get some pointers on how to interpret some of the datasheets to be able to figure it out myself. Max differential voltage between the non/inverting outputs should be about 300mV, but the common mode voltage could be as high as ~30V (assuming 30V max output from my regulator). I guess is what confuses me a bit is that my desired output is a maximum of 5V, but it appears that I need an op amp that requires a supply voltage at least a volt or two higher than the common mode voltage?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: April 19, 2018, 01:44:40 pm
content: Quote from: byoungblood on April 19, 2018, 01:07:13 pmNice find, I guess? There are slightly better out there:https://www.digikey.com/short/jznbj8Not sure why you'd be shopping by top price rather than bottom, though; or mil vs. commercial spec! (Check the temp rating column; also, just look at all the gold on those suckers!)QuoteShould it? Including feedback?Notice the differential amplifier contains two voltage dividers, one referenced to the op-amp output. What does this do to the input voltages? What happens if you set Vout = V((in+) - (in-)) * A, then let A --> infty? (It takes a bit of substitution, but it's just algebra.)QuoteYes, you need a common mode range near the supply, for that circuit. '324 should be fine (you get about 10% below supply, or 3V, and it needs ~2V to behave itself). Note that, because the inputs connect to voltage dividers -- you can simply choose a lower ratio divider, and get a more modest common mode range. Downside: this happens to reduce the diff amp's gain as well. Somewhere inbetween, there'll be a good compromise between output voltage range (i.e., you could have the circuit designed around a measly ~600mV current sense output range), and too little input common mode range.And again, you can simply subtract whatever offset remains, from the other side of the circuit. What is the current sense output read by? Another op-amp. Aha! Let's add ~80mV to its other input, which, actually, they've already went ahead and done that more or less (R16), so all we need to do is adjust its value and we're done.Tim

author: Audioguru
author_rank: Super Contributor
timestamp: April 19, 2018, 03:39:08 pm
content: National Semi invented the LM358 but you might have a bad copy made by somebody else. TI now owns National Semi.Their datasheet spec's Output Voltage Swing Vol (output low) at 5mV typical and 20mV max when there is a 5V supply and a 10k load resistor to ground.

author: byoungblood
author_rank: Contributor
timestamp: April 19, 2018, 09:31:33 pm
content: Quote from: T3sl4co1l on April 19, 2018, 01:44:40 pmGuess I should have said I was looking for a through hole part!QuoteQuoteMy math isn't quite what it used to be (I'm 40...) but lemme see. If we end up with Vout/A=V((in+)-(in-)), Vout divided by infinity is 0, so 0=V((in+)-(in-)). So as Dave mentions in his op amp video, with the feedback, the op amp drives the output (with feedback) to make the inputs equal. Equal inputs means zero differential voltage. Ah ha.QuoteQuoteThanks Tim, I have some 324s sitting around so I'll swap that and give it a try and play around with the voltage dividers and see what ends up working out the best.Thank you for clearing up my data sheet interpretation.Some quick math (ok, I used a voltage divider calculator on my phone) says about 270 ohms should be right with the 6.2K series resistor (using the schematic from the PDF to obtain a 3A limit like I want) to null the offset I see with the 1k pulldown on the LM358. I'll have to see what I end up with the 324 as well.

author: byoungblood
author_rank: Contributor
timestamp: April 19, 2018, 09:32:47 pm
content: Quote from: Audioguru on April 19, 2018, 03:39:08 pmThey're TIs that I sourced from Mouser, so I hope not.

author: David Hess
author_rank: Super Contributor
timestamp: April 19, 2018, 10:44:07 pm
content: Quote from: byoungblood on April 19, 2018, 01:07:13 pmThe LT1013 is a precision improved replacement for the LM358 which can pull its output all the way to the negative supply and perhaps the least expensive improved replacement since it is second sourced.As shown below, the LM358 has a PNP emitter follower (Q11) to actively pull its output to ground and then a 50uA current sink (Q10) which is limited by the Vce saturation of an NPN transistor. So any significant load can only get to Vbe Q11 + Vce(sat) Q9 or about 0.7 volts and with no load, the output can get down to Vce(sat) of Q10 or about 0.1 volts.QuoteBetter is to provide either negative bias to the current sense amplifier so its output can reach zero without any issues or to offset the current measurement to a level within the output range of the operational amplifier.Better yet in my opinion is to float a single operational amplifier to the positive supply to get rid of the input dividers as shown below. The ancient LM301A was commonly used for this because its input common mode range includes the positive supply. Many old but inexpensive JFET operational amplifiers can also be used this way. The second example below shows an LM301A (1) used for both high side current measurement and to regulate the maximum output current.(1) Marked LM101A which is the premium version of the LM301A.

author: byoungblood
author_rank: Contributor
timestamp: April 21, 2018, 12:36:55 pm
content: Quote from: David Hess on April 19, 2018, 10:44:07 pmI was looking at the diagram of the LM358 right after I posted this thread and figured that the Vbe (at least) was what I was seeing at the output.I replaced my 358 with a 324 and immediately saw a drop in the no-load output voltage, and was able to use a 1k pull down to get it down to about 30mV. I then just offset the minimum value of the inverting input of the comparator as suggested, and viola, it works as expected now.Thanks all for providing me with "think through it" answers. I can say that I've actually learned something.

author: David Hess
author_rank: Super Contributor
timestamp: April 21, 2018, 04:19:46 pm
content: Quote from: byoungblood on April 21, 2018, 12:36:55 pmYou can see the Vbe+Vce saturation of the PNP emitter follower at about 0.6 volts and Vce saturation of the NPN 50 microamp current sink at about 0.1 volts in the graph below.QuoteThe 358 and 324 should be the same thing but there is some variation between manufacturers. Maybe something was wrong with the 358 you were using.Do not forget that the sink current also includes any current drawn out of the feedback network.If you can sink current at the output to a point below ground, then operation down to zero volts and slightly below is possible. Obviously this can be done if you have a negative supply voltage but then the negative supply could be used to power the 324/358. There are two other methods I have used:1. An inexpensive optocoupler like a 4N25 which provides access to the base-emitter junction of the output transistor can produce 100s of microamps at zero volts so makes a great active pull-down. This is much better than the 50 microamp current sink built into the 324/358.2. A single bipolar transistor configured for reverse base-emitter breakdown produces a negative current (and voltage) at its base-collector junction. This is not as efficient as 4N25 optocoupler but it works.Somewhere I have the article Bob Pease mentioned this on paper; I should scan it in:Take any NPN silicon transistor - metal can (2N2222) or plastic (2N3904) or even monolithic (LM114). Ground the base. Connect the emitter through 1k to +12 volts so it will zener. (This may damage or degrade the transistor, so you should throw it away when you are done.) What is the V at the collector? A high-Z DVM will read –0.3 Volts.- Bob Pease

author: Audioguru
author_rank: Super Contributor
timestamp: April 22, 2018, 02:01:13 am
content: An LM324 has exactly the same opamps as an LM358. Your LM358 with an output low voltage higher than the guaranteed spec's is defective.

author: byoungblood
author_rank: Contributor
timestamp: April 26, 2018, 04:35:25 am
content: I'm going to check them with the inputs shorted as before and just make sure it wasn't the breadboard causing the issue. I've gotten caught up with some other projects in the past week including just trying to get the rest of this PSU put together so I can move on to the next project.

author: Kartika
author_rank: Regular Contributor
timestamp: December 12, 2023, 02:17:38 pm
content: Hi Is LM2904 better replacement? *

author: liaifat85
author_rank: Regular Contributor
timestamp: December 12, 2023, 03:49:01 pm
content: The output of an LM358 varies with the reference voltage and configuration of the circuit. You can cross-check with the application circuits of the datasheet to check if the IC is behaving normally:https://www.onsemi.com/download/data-sheet/pdf/lm358-d.pdf