what's wrong with this current sense op-amp circuit - Page 1
Forum section: electronics / projects

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: February 04, 2024, 01:13:59 pm
content: HiI have designed the PCB for a high side current measurement, with variable gain, U6 along the Resistor network (R35,R37,R38) and U5 are the main parts to have 1X,10X, 100X gain in different currents that would pass trough R18, or R17+1R18 depending on the U3 switch conditions, at least that's what I hoped for, and in simulation it was working just fine, But now that I have designed and ordered the PCB, it has these gains roughly 1x, 1.1X and 2.16X in practice,Do you have any Ideas?

author: Andy Watson
author_rank: Super Contributor
timestamp: February 04, 2024, 01:55:44 pm
content: What does "current sense" drive ? Also, how are you measuring the gain - with respect to ground, or V-hi ? And what value is VDD that supplies U3?

author: David Hess
author_rank: Super Contributor
timestamp: February 04, 2024, 06:10:41 pm
content: The on-resistance of the 4052 multiplexor in series with the feedback resistor might explain it.There is a different circuit configuration where the switch is moved to be in series with the inverting input making its on-resistance irrelevant.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: February 04, 2024, 06:49:51 pm
content: Note the OP07 can swing neg to pos, but the 4052 can only tolerate 0-12V as you have wired it.The analog switch resistance should affect the lowest range the most, and then only some %, your higher ranges are 'off by miles'.

author: DannyTheGhost
author_rank: Contributor
timestamp: February 04, 2024, 07:16:05 pm
content: What are the logic levels that are driving inputs of multiplexer? These CD4000s multiplexers require that the voltage of logic "1" level on the inputs must be close to VCC, as it is indicated in datasheet.I had such problem in one of my previous designs, and after close inspection of the datasheet and botched level translator to the PCB it was fixed.

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: February 05, 2024, 09:57:31 am
content: QuoteThe 4052 inputs are drive with ULN2803 outputs with 12V as high and 0.6v as zero, and the ULN2803 inputs are driven with a MCU powered @ 3.3V, so the inputs are fine.QuoteI know that, But as it can be seen the shunt resistors are driven with in the 0-5V range, the right side which is consist of Q6,Q7 etc pairs and Q16 Q17 etc pairs are set to 2.5V supply AKA VGND or virtual ground, and the left side is driven with the currentsense output and an external Function gen for now with a sine wave with a 2.5V DC bias, so every thing is held at mid 5V supply, so I think the 4052 supply maybe not an issue.QuoteI think it would mostly affect the 1X range,QuoteI do not get it fully, would you explain more?QuoteThe current sense would drive the negative feedback, you can check it in this post schematic, U3 supply is 12V and GND, also I would measure the gain like this, 1 channel of the scope is connected to the VDAC, and the other channel is connected to the current sense, Also I have inserted an Ampere meter in P2, so I can measure the output current directly, So basically If I change the 4052 switch to different ranges I should expect the output current be lowered 10X or 100X from 1X, But the Ampere meter would only show 1x, 1.1X and 2.16X in practice, for different positions, also the VDAC and current sense outputs seems to regulate to the same value,

author: Terry Bites
author_rank: Super Contributor
timestamp: February 05, 2024, 02:55:19 pm
content: As David Hess suggests,you could put the amplifier gain switch in series with with the inverting input.No feedback network current flows, so no voltage drop and very low gain error.OrIt may be simpler to use fixed gain current sense amplifiers and select an ouput with a mux and a buffer. Dual and Quad current sense amp are cheap. eg A dual INAx180-Q1 are cheaper than an OP-07 4066 combo, it will perform better too.

author: David Hess
author_rank: Super Contributor
timestamp: February 05, 2024, 04:39:51 pm
content: Quote from: ali_asadzadeh on February 05, 2024, 09:57:31 amThere are other configuration but the one shown below is what I found first for an inverting connection. With the switch in series with the operational amplifier input, it only sees the input bias current so its resistance is irrelevant and does not affect the gain.

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: February 06, 2024, 09:20:43 am
content: Thanks for the update, the complete schematic is attached, what I'm trying to achieve is generating 50Hz sin wave from 1mA to 30A with a single 5V source, so the output power dissipation would be minimal, so I should have a current sense network with gains of 1X,10X and 100X that have a 2.5V bias to it, so I can center it @ 2.5V which is 5V middle voltage, hence using the audio codec that has a 2.5V DC bias for generating the sin wave, so I can use a single ATX power supply to power every thing and do it cheaply in terms of price, Power dissipation and circuit complexity.Now with this new information, How do you suggest I change the current sense network?