EEVblog Electronics Community Forum
Electronics => Beginners => Topic started by: sachleen on December 27, 2013, 12:28:57 am
-
I'm trying to use a 358 as a differential amplifier similar to U12B in Dave's uSupply (http://www.eevblog.com/files/uSupplyBenchRevC.pdf).
Here's my CircuitLab drawing and it seems to do the job in simulation: https://www.circuitlab.com/circuit/97h282/current-sense-amp/ (https://www.circuitlab.com/circuit/97h282/current-sense-amp/)
However, on my breadboard, I'm not seeing any change when I increase the difference between the two voltages. Similar to Dave's schematic, I have a 1 ohm resistor in series with V+ and the rest of my circuit. The blue wire is V+, the red is on the other end of the resistor. All four resistors are measured to be 9.8 K ohm but as long as they're the same it shouldn't matter.
I'm seeing the voltage difference between red and blue wires as I change the load. 50mA load gives me roughly 50mV across the resistor. If I get rid of the 358 and ground the resistor connected to pin 7 (so I have just a voltage divider on each side of the sense resistor) I see a 50mV difference there, too. That difference goes up to 600+ mV as I increase the load up to 600+ mA. So I know all that works fine. Now, when measure the output of the 358 on pin 7, I see 730mV when it should be reporting 50mV. It will increase by maybe 10mV instead of the 1mV/mA I expect.
I've tried swapping out the chip for another one so I know the chip is fine. Can anyone spot something wrong with the circuit?
-
Input Common Mode Range: 0 to (Vcc - 1.5V)
try throwing 3 diodes in front of your 1 ohm current shunt for testing purposes, the supply voltage needs to be higher than the inputs by 1.5V
-
OK I'm seeing some changes now. It's reading 1.7257V when there is 51.9mV across the shunt and 1.7393V when there is 71.4mV across the shunt. 1.622V across the three 1N4001s.
Why do I need this, though? The input voltages are around 6v (12V supply) because of the divider, isn't it?
-
oh bugger, i've been playing around with high gain ones for too long, yes it does divide them down,
that result actually raises some questions, i would advice you to confirm your resistance values
-
That was the last thing I did before asking here. Checked them and labeled the picture in my original post. They're all 9.8X K ohm. I've tried swapping them around since they're not exactly the same values but that didn't make a difference, not that I was expecting any, but I don't know what else to try.
-
I'm seeing the voltage difference between red and blue wires as I change the load. 50mA load gives me roughly 50mV across the resistor. If I get rid of the 358 and ground the resistor connected to pin 7 (so I have just a voltage divider on each side of the sense resistor) I see a 50mV difference there, too.
Shouldn't it be a 25mV difference between the middle of the voltage dividers? A 50mV difference there makes me suspect your ground.
-
Shouldn't it be a 25mV difference between the middle of the voltage dividers? A 50mV difference there makes me suspect your ground.
I thought that was a bit odd, too. If both voltages are divided by two, their difference should be halved as well. I've moved the circuit on to a separate breadboard and just have it hooked up to a dummy load right now. Same result. If you look at the attachment, I paralleled another 10k with R2, making it 5K, and I'm seeing an output of 4.05V and it changes as I increase the voltage across the shunt with the dummy load. So this is doing what I want but offset 4V. My simulation in circuit lab (https://www.circuitlab.com/circuit/nb6vgf/current-sense-amp-2-eevblog/) doesn't show the same result, though.
-
So I think the fact that I'm reading 50mV after the divider has to do with my resistor values not being the same.
Here are my numbers:
Voltage on both sides of shunt: 12.023 V and 11.970 V - difference: 0.053, about what I expect
First voltage divider (divide 12.023 by 2): 5.009 K and 4.997K - ratio: 0.499
Second voltage divider (divide 11.970 by 2): 4.985 K 4.935 K - ratio: 0.497
Voltage measured after divider: 5.997 V and 5.948 V - difference: 0.049, NOT what I expect.
But if you do the math, a slight change in ratio produces a huge change in the output:
(12.023 *.499) - (11.970 *.497) = 0.050387
(12.023 *.499) - (11.970 *.499) = 0.026447
Still doesn't explain why the op amp isn't working right.
-
My first thought was that your output is too close to the negative rail of the opamp. So I checked the datasheet, and it says 20mV, so I thought "that can't be it." But now that I've built it, that's totally it. And now I see the little caveat on the datasheet "RL < 10k". RL is 20k for you, and Vcc is 10V vs the 5V the 20mV is specified for. I have to lower pin 4 by a bit more than half a volt to get it to work.
Here are some voltages from my working breadboard: (- to +)
| D to A | : | 51.30mV |
| C to A | : | 10.00V |
| C to F | : | 45.25mV |
| B to E | : | -1.15mV |
| C to G | : | -1V |
Note that I'm using a 258 and not a 358, but I expect you'd get similar
-
You're looking at the swing characteristic? The minimum output voltage V_OL is 5mV typicall, 20mV max with an input of 5V, right?
But I'm expecting 50mV, which should be within the range. I can't supply a negative voltage to the V- input. Can you explain how RL fits into this? I originally had all 10Ks but now have 5Ks and it doesn't make a difference.
-
RL is the resistive output load, the op amp has a bias current coming out of its output, and with a high impedance or no load at all cannot approach ground
-
I was mistaken about your RL; your only lower potential path to ground is the voltmeter. But I added a 2k resistor from the opamp output to ground, and that didn't fix it like I expected it to. I had to go down to 100 ohms, where I could get down to 19.4mV output.
-
Adding a 100ohm resistor from the output to ground is getting me close. I'm seeing the linear change in output as the voltage across the shunt increases but I have about ~50mV offset. You think that would be because my divider ratios are not exact?
-
yes :)
measure your exact resistances and put those value into your simulation
-
Simulation seems to agree with what I'm seeing now. It's interesting that the simulation didn't show the need for the 100 ohm resistor. I see now that the DC solver doesn't work unless I have the volt meter connected in circuit lab so I guess that should have been a clue.
Thanks guys!
-
I'm trying to use a 358 as a differential amplifier similar to U12B in Dave's uSupply (http://www.eevblog.com/files/uSupplyBenchRevC.pdf).
Here's my CircuitLab drawing and it seems to do the job in simulation: https://www.circuitlab.com/circuit/97h282/current-sense-amp/ (https://www.circuitlab.com/circuit/97h282/current-sense-amp/)
However, on my breadboard, I'm not seeing any change when I increase the difference between the two voltages. Similar to Dave's schematic, I have a 1 ohm resistor in series with V+ and the rest of my circuit. The blue wire is V+, the red is on the other end of the resistor. All four resistors are measured to be 9.8 K ohm but as long as they're the same it shouldn't matter.
I'm seeing the voltage difference between red and blue wires as I change the load. 50mA load gives me roughly 50mV across the resistor. If I get rid of the 358 and ground the resistor connected to pin 7 (so I have just a voltage divider on each side of the sense resistor) I see a 50mV difference there, too. That difference goes up to 600+ mV as I increase the load up to 600+ mA. So I know all that works fine. Now, when measure the output of the 358 on pin 7, I see 730mV when it should be reporting 50mV. It will increase by maybe 10mV instead of the 1mV/mA I expect.
I've tried swapping out the chip for another one so I know the chip is fine. Can anyone spot something wrong with the circuit?
I have the same problem, I attach the schematic and the values expected and real.
I tried with another op-amp (LM6462) and its work good, the problem is that this op-amp work up to 15V and I would like to use VCC=VDD=30V at the end (LM385 is up to 32V).
From the real.png, seems that the op-amp don't work for low difference V+ - V-, my first design have VDD=VCC=19V so I think that the issue is that on the V+ I get a value too near with VDD of the gain, but now there are over 5V, but still not working..
I have the same problem, I attached the schematics and the values expected and real.
I tried with another op-amp (LM6462) and this work as expected, the problem is that this op-amp work up to 15V and I would like to use VCC=VDD=30V at the end (LM385 is up to 32V).
From the real.png, seems that the op-amp don't work for low difference V+ - V-, my first design have VDD=VCC=19V so I think that the issue is that on the V+ I get a value too near with op-amp VDD of the unity gain, but now there are over 5V, but still not working..
-
It's an old post , but the LM358 has a blindspot on inputs and outputs for the top 2v below VCC , that's because the input stage is PNP.
For a highside current sense use a ZXCT1009 or similar. https://www.diodes.com/assets/Datasheets/ZXCT1009.pdf (https://www.diodes.com/assets/Datasheets/ZXCT1009.pdf)
You can use a piece of PCB track as shunt , if accuracy not a problem (e.g. current limit to motor).