opamp- nmos constant current sink - Page 1
Forum section: electronics / beginners

author: funtastic r.d.j
author_rank: Newbie
timestamp: April 03, 2024, 11:13:28 am
content: Using the opamp to LM358BA. Giving a supply of 16V . Giving a signal of 0-2.4v on IN+ pin of opamp . Opamp's IN- pin is going maximum up-to 1.35v . So that circuit is sinking 13.5mA max. As soon as I go to 1.4v and above the output of the opamp goes to the positive rail(about 14.7v) and current stays the same i.e 13.5mA . I want my current to go upto 24mA i.e 2.4v on IN- but it stays at 1.35v . This is observed on both opamps tlv9002(opamp vcc-5v) and lm358ba(opamp vcc-16v).Would you know the reason and how it can be solved. Resistor value is 100 ohms. 16v is the supply voltage I am using for sinking the current .The maximum current that can sink is 16/100=160mA right ? So 24mA is not an issue? Mosfet used is 2N7002. Datasheet of mosfethttps://static1.squarespace.com/static/5416a926e4b09de8832655bc/t/64b12b83a18d611117282fe1/1689332614239/2N7002.PDF

author: Terry Bites
author_rank: Super Contributor
timestamp: April 03, 2024, 12:50:45 pm
content: OK, this is not the correct circuit for a current sink. You have made a “source follower” not constant current circuit. The opamp inputs will be at the same voltage in a negative feedback circuit. And so the voltage across the load will be the same as the input voltage. Your circuit is a constant voltage source and not a constant current source.The opamp has to supply Vset+Vgs to keep the MOSFET in its active region. Vgsth for a 2N7002 can be anywhere between 3 and 7v, in the worst case the opamp has to output >=1.4+7 or 8.4V! Good luck with that on a 5V supply! At 16V, the maximum voltage allowed across the load for correct operation could be as bad as Vsupply-8.4, so only 7.6V on a 16V supply. This is the cause of your malfunction I think. See attachment 10If you want to drive a constant current towards ground you need a current source, not a sink. This is a bit trickier because Vset is referenced to the positive rail and the opamp needs to have an input CMV that goes to the positive rail, eg TL072. Opamps with rail to rail inputs are a good choice here. Note that my drawings erroneously show LM324 opamps which will not work in the source configurations. Ignore them, use a RRIO amp or a TL072 or similar instead.In comparison, a bipolar transistor only needs 0.7V to turn on. That wins you back a few volts to play with. The base current is an error term added to the load current though. This may not be an issue for you, how precise to you want it to be? Note that the opamp offset voltage will be added to Vset creating another small error. You can get ~1% accuracy with cheap opamps and bipolar transistors. You can improve matters by using a Darlington transistor arrangement. Again, made with pairs of 3904's and 3906's.There is a trick to set the source circuits. Add another current sink. It’s not too hard to analyse. The input control voltage causes the current sink to draw a current through Rset creating the appropriate Vset referenced to the positive supply.Another trick: There is a solution to the CMV issue and that's use a voltage reference so that that Vset is no longer referenced to the supply rail but a to a voltage below it. The ref must be able to manage the output current. The TL431 can provide 100mA max, so you're fine at 13.5mASee attached circuits that work. Stability components (values not critical for DC applications) are needed for correct function.

author: funtastic r.d.j
author_rank: Newbie
timestamp: April 04, 2024, 01:47:08 pm
content: With 16v as supply why would I get 7.6V? The attachment 10 also shows about 12v. I haven't used a lot of bjt, can you suggest a part number that could be directly replaced because my pcb is ready or I'll have to do a respin. I can also increase my voltage to 24v?I think that would work right?If I give a vref of 1.2v then I get same voltage on -ve pin of opamp.(+-2mv,offset error).I give 1.3v then I get 1.3v but as soon as I go above 1.35v the output goes to positive rail. Below 1.35v the opamp gives a linear output as expected.I used a 300ohm resistor and didn't get any saturation,the opamp works properly for the entire input range. At 50 ohms, after 0.7v the output of opamp goes to positive rail i.e as the resistor value increases the opamp doesn't go into saturation. Is their any calculation by which I can know before hand at what resistor value I'll start getting this error?If I go with bjt then the opamp should also have the output current capability right and then I could use a 5v opamp only with enough output current?The amount of resistance I can put in loop will depend on the supply voltage and not on the vref right?I am making a voltage to 4-20mA converter.

author: MarkT
author_rank: Frequent Contributor
timestamp: April 04, 2024, 06:49:51 pm
content: Double check the resistor values, and the type of MOSFET - did you buy your components from reputable suppliers? If not they may be fakes.