using op amp for current limiting

Thread Starter

Bob Steve

Joined Oct 12, 2017
6
hi, so i am trying to make a current limiting lower supply but im having issues with the current limiting portion. what i am using to measure the current is a TLC272/LM358 (I've tried both) op amp differential amplifier across a 1 ohm resistor and it should output a voltage equal to the current flowing. The issue is the output voltage is wayyyy off ex. 20mA running and it outputs 100mV. any ideas why? is it the wrong type of op amp? i have also attached a picture of the circuit.
 

Attachments

Reloadron

Joined Jan 15, 2015
7,889
R1 in your drawing shows a 1 K Ohm resistor on Vcc and to the LM 317 Input. The output of the LM 317 also is tied to ground? I also see Crutschow just commented so nothing else for me to add.

Ron
 

Ylli

Joined Nov 13, 2015
1,092
Crutschow, he's got dividers on the inputs, so the inputs should be OK.

Bob, a circuit like this is going to be very sensitive to resistor matching. Any mismatch will translate to a large offset error. You can try matching all 4 of the 10K resistors by hand or go with 0.1% resistors.

In addition, you are expecting the output of that opamp to be zero with no current flowing. That is not going to happen unless you use at least a couple of volts negative on pin 4.
 

crutschow

Joined Mar 14, 2008
38,507
he's got dividers on the inputs, so the inputs should be OK.
You are right, of course. I didn't look closely enough at the circuit. :oops:

And as you also noted, resistor mismatch could be the problem.
At a Vcc of 10V, a 1% mismatch will give an offset of 10V × .01 = 100mV at the output.

Bob, what's the current sense output voltage with no current?

What you could do is replace one of the 10k resistors with a 9.76kΩ resistor in series with a 500Ω pot.
You then adjust the output for 0V with no current.
 

Thread Starter

Bob Steve

Joined Oct 12, 2017
6
Hey, thanks for the responses they have been very helpful.
At a Vcc of 10V, a 1% mismatch will give an offset of 10V × .01 = 100mV at the output.
despite the error in my schematic the resistor i'm using to measure current is 1 ohm (not 1k) so wouldn't to offset voltage be the voltage drop across the resistor *0.1. so if i was running 1.5A than 1.5 * 0.1 = 0.15mV offset at a max?
Bob, what's the current sense output voltage with no current?
The sense output voltage with no current flowing is 700mV which is wayyy to high.
What you could do is replace one of the 10k resistors with a 9.76kΩ resistor in series with a 500Ω pot.
You then adjust the output for 0V with no current.
even if i add a 10k pot in series with a 10k resistor and try to adjust to voltage drop i can only get it down to 100mV at no current.

- also quick note the video I am building the supply is from here:
he used to TLC272 op amp and seemed to have no problem with 1% 100k resistors.
 

nishkum3

Joined Jun 5, 2017
14
I have configured the port for input...I want to give input as logic1. For that I am connecting that pin to 5v directly..but it's not working.do I need to add any register to make that input.
 

Ylli

Joined Nov 13, 2015
1,092
Bob, try putting -5 volts on pin 4 of your LM358. You really need a negative supply if you expect the output of the op amp to go to zero.
 

Thread Starter

Bob Steve

Joined Oct 12, 2017
6
Bob, try putting -5 volts on pin 4 of your LM358. You really need a negative supply if you expect the output of the op amp to go to zero.
only issue is i only have a single supply dc power supply. so i cant get a negative voltage and any options to convert positive to negative seem to be complex for something that seemed to work in the video i linked.
 

Ylli

Joined Nov 13, 2015
1,092
There are a number of simple chips that can be used to generate a negative voltage from a positive. For example: ww1.microchip.com/downloads/en/DeviceDoc/21469a.pdf.
 

crutschow

Joined Mar 14, 2008
38,507
despite the error in my schematic the resistor i'm using to measure current is 1 ohm (not 1k) so wouldn't to offset voltage be the voltage drop across the resistor *0.1.
No.
The offset error is due to imbalance of the 10kΩ bridge resistors.
It has nothing to due with the sense resistor.
even if i add a 10k pot in series with a 10k resistor and try to adjust to voltage drop i can only get it down to 100mV at no current.
Not surprising.
That's why I had a 9.76kΩ resistor (the value is not arbitrary).
You can't adjust the offset correction in either direction if all the bridge resistors are 10kΩ.
And since the offset can be either polarity, you need to be able to adjust both plus or minus.
With a 1k pot, the series resistor should be about 9.5kΩ.
 

Thread Starter

Bob Steve

Joined Oct 12, 2017
6
That's why I had a 9.76kΩ resistor (the value is not arbitrary).
ok so i tried a 2 4.7k resistors in series to get 9.4k than put a 5k pot in series also but it doesn't matter what way i turn it the value is 300mv+ offset. I feel like im missing something in the video i linked above it worked flawlessly and nothing i do seems to works
 

crutschow

Joined Mar 14, 2008
38,507
put a 5k pot in series also but it doesn't matter what way i turn it the value is 300mv+ offset.
Then something is wrong with your circuit.
Post the exact circuit you have with the pot connection.

All all the resistors 5% types as the 4.7k resistor apparently are?
 

Thread Starter

Bob Steve

Joined Oct 12, 2017
6
ok so update I have tried using some 0.1% resistors and it doesn't seem to change much for the values. i still have the output to be around a gain of 6 which should be only 1. am i missing something obvious cuz nothing i do seems to work
 

Thread Starter

Bob Steve

Joined Oct 12, 2017
6
ok so i figured out the problem. thanks to everyone for the info and help but the issue was a faulty breadboard... i changed it out with a new one and BAM it worked. that is 3 days i will never get back lol
 

GopherT

Joined Nov 23, 2012
8,009
ok so i figured out the problem. thanks to everyone for the info and help but the issue was a faulty breadboard... i changed it out with a new one and BAM it worked. that is 3 days i will never get back lol
You may have spent 3 days learning so you can live 6 extra days.
 
Top