Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Verify calculations for an amplifier input output

Status
Not open for further replies.

d123

Advanced Member level 5
Joined
Jun 7, 2015
Messages
2,505
Helped
494
Reputation
992
Reaction score
525
Trophy points
1,393
Location
Spain
Activity points
27,148
Hi.

I'm really bad at sums, it's "depressing" and embarrassing. Could some-one tell me if my calculations are - or at least look - correct, please.

I have a current shunt monitor which has 100V/V gain, it can be supplied from +3 to +18V. In the bread-boarding phase (now), for low currents it provides an acceptably accurate measurement and readout on an ADC.
If it matters, the shunt resistor is 0.02R (+0.12R lead resistance) and an ADC 10K/4K divider - which apparently works give or take a milliamp of accuracy.

Using a multi-meter I see that:

20mv opamp output. On input side of ADC resistor voltage divider, 5mV = 5mA.
33mV opamp output. On input side of ADC resistor voltage divider, 9mV = 9mA.
47mV opamp output. On input side of ADC resistor voltage divider, 13mV = 13mA.

Great, whatever...

So extrapolating based on these results, the opamp output should be: 50mA = 200mV, 500mA = 2000mV, 1000mA = 4000mV, 2000mA = 8000mV

On a +5V rail the opamp can't output the ADC full range, only up to (an optimistic) about 4.9V
I see the V+ supply to the opamp needs to be on an at least 10 i.e. 12V rail to definitely swing up to the needed 8V output (= 2000mV ADC input).

By my calculations, I think on the opamp Vin+ to Vin- side for 5mA load and 20mV output the input is 0.0002mV. 0.0002mV - that's as good as my maths skills get.

so 8000mV output should be, hopefully, if I was able to calculate anything here right:
80mV input max. for 2A shunt sense. This would be well within the opamp's -5/+5V input range.

Is (any of) this right, or is my maths so "special" I should go into "flexible accounting" or statistical analysis, please?
 

The gain is 100. Then if the output is 20mV then the input is 0.2mV which is 0.0002V, not 0.0002mV.

But most opamps (you forgot to say which one you are using) have a maximum input offset voltage of 5mV which will wipe out or multiply your low level inputs unless you use a trimpot to cancel it.
 
  • Like
Reactions: d123

    d123

    Points: 2
    Helpful Answer Positive Rating
Hi! Thanks, so mV or V - it doesn't matter that much does it?! Joke.

Thank you, I'm finding this very confusing and I hope to keep within the devices 5V input range and approx. 12V output range.

The amp is an INA286. Checking the datasheet again, it seems to have very low offset, I have attached a jpg of that part. It says 20 - 70uV offset voltage referred-to-input, so I wouldn't need a trimpot for that, would I?
And do you mean a trimpot on the output side of the opamp?

286 offset info.JPG

- - - Updated - - -

(Sorry to be a clueless nuisance) ...So then, I hope this is correct:

0.0002V/5mA = 0.00004V input per mA.

In that case 0.00004 x 2000mA = 0.08V maximum input for the current range I hope to read (with a lot of "just in case" headroom thrown in).

0.08V input x 100 = 8V opamp output.

If the above theory is sound, and what you said about input offset doesn't apply too much to the INA286, then I should be okay.

If the above calculations are correct - great, if not, please let me know if I'm wrong (and I'll get the abacus out again, and/or I'll have to try with a 741 - they're great aren't they?!).

The little ammeter (besides learning how to make one, and trying to understand how simple ones work) is just to see how much current is drawn by circuits fed by a power supply, and I hope to not even reach 1Amp output as most of the things I do draw at most 350mA, usually 100 - 250mA, but am trying to make use of the ADC full range.

Thanks.
 

The INA286 is not an opamp. It is a special circuit with built-in negative feedback setting its accurate gain and is designed to measure the voltage across a current shunt.

Do not write small numbers with many zeros. 0.0002V is 0.2mV which is 200uA. Then an input offset voltage of 70uA causes a 35% error. 0.00004V is only 40uA so an input offset voltage of 70uA causes a 175% error.
Since the INA286 is not an opamp then it cannot use a trimpot to reduce the offset.
 
  • Like
Reactions: d123

    d123

    Points: 2
    Helpful Answer Positive Rating
My mistake then, it's in the "amplifiers and linear" section of the manufacturer's products, and is described as a "current sensing amplifier" in the datasheet.

Wow - "do not...", friendly way of saying things, there, I felt the ruler hitting my fingers. Okay, I have difficulty with those things: a few months ago I had to make a capacitor value comparison cheat-sheet to get used to the same value expressed in pF/nF/uF/F in different places, so the same goes for V/I and I write the best I can explain (until somebody kindly corrects me), I'll look for the correct term next time I need to communicate this type of thing, e.g uA, and my apologies.

It's a step up from "I have a circuit, it doesn't work. Tell me how to make it work? (no schematic included)" style questions, I hope.

Your explanation is very helpful for me to understand what those input offset numbers mean in a real situation, thank you - sincerely. Very interesting to comprehend. So long as I don't try to measure values below the input offset voltage it will be accurate enough for a simple hobby device, and I assume that the calculations are correct enough to not have needed an answer.

Thanks for taking the time to explain what the offset voltage actually implies, and the other comments, I appreciate it more than you might expect.
 
Last edited:

Why do you use a current shunt with such a low resistance that the connecting wires form a divide by 4 voltage divider?
Why do you need to measure such a wide range of current from almost nothing to Amps?
 

You're setting me up for looking stupid, aren't you?! I need no help in that department, I open my mouth and show I'm stupid.

Quick meaningless answer: I've never made one before, because it seems to work okay, and: frankly, why not?

As I keep explaining on eda, I've only been trying to put together my circuits for about a year (instead of occasionally buying kits years ago), so no doubt I am making some dreadful design mistakes as these are first time things for me, and in my case involve trying to learn and get to grips with several concepts at once on most circuits. It's not the same as Telco or solar PV jobs I've done where you only do and don't have to really think about the how to do it part first.

Once I realised (the hard way) that momentary pushbuttons do not perform long-lasting timing or toggling miracles but the circuit inside does, I got very interested in learning more about circuits (that's why I have a big fondness for the 555, my first little IC, I was amazed: "You push a button, and this thing stays on for a programmable time thanks to a resistor and a capacitor, and it isn't a mechanical relay!").

The shunt because after reading up a bit on simple shunt ammeters before even starting I concluded that generally it seemed that shunt resistors people use are in the low milliohm region (some-one here said 5 milliohms for a 100/1 divider I was going to use, which they also advised was a bad choice of divider); the 286 by looking at TI's product base, and trying to match a device to my needs and experience by reading a few datasheets of possible candidates...without being unbelievably lazy and instead of trying to find a device myself just asking on a forum "What (fill in the function) device should I get?"

I have tried to get the possible current range, the shunt, the shunt monitor and the ADC to be able to interact as best I can based on my understanding of them and my poor grip on numbers.

(I hope to and should start a basic electrical and electronic course this September, as I want to have less problems making my bad little circuits which belong in the 1970's and sometimes take longer prototyping than they should.)

Also, I would like, while I struggle through my beginner's circuits on a learning meander more than a learning curve, to:
a) understand as much as I am able to what the device or component I am using can do, and to a degree how it does it.
b) to be able to at least design in, if not actually need to make use of, the full range of the ADC I'm using (an old-fashioned unpopular one with microcontroller fans, before you ask).
c) be sensible, as it seems pointless to waste money on components (I have no money tree nor alchemy skills) and only design in the minimum needs necessary (excluding sensible de-rating), as you never know when a low ceiling will need to be raised.
and
d) finish a linear power supply that I have begun to make and frankly to detest a little (but not the measurement devices), and it's related to your question: the power supply transformer can supposedly put out 2A at 15VAC - so I expect that if I try to stick to well under 1A and probably 5 - 12VDC more than the 5 - 15VDC max output voltage I'd originally hoped for, I'll get to see that on a voltage LED display and a current LED display without anything bursting into flames or being fried, or worse me being fried.

If you have suggestions about how I could have designed this primary school project ammeter better - without being too harsh thanks - I'm genuinely interested, as the point is learning, not stagnating, or making utterly rubbish devices.
 

So the very low resistance shunt is used in a linear power supply. I guess it is outside the voltage regulator so its resistance is in series with the load and causes a voltage drop that ruins voltage regulation.
A good power supply circuit has the current sensing shunt inside the voltage regulator negative feedback loop so its voltage drop is cancelled. Then the current shunt resistor can have a reasonable resistance.

There is a 0V to 30V, 3mA to 3A linear power supply project at www.electronics-lab.com that I have been fixing and improving for 9 years. Its current sensing shunt is 0.47 ohms.
 
  • Like
Reactions: d123

    d123

    Points: 2
    Helpful Answer Positive Rating
Hi!

If you mean this circuit, that's a nice looking, well-thought out power supply (like the voltage stop at "off" feature), and the instructions and description are clear:

https://www.electronics-lab.com/projects/power/001/index.html

That's a nice supply, and thanks for explaining about where a shunt should ideally be placed. In my case, it was a surprise to discover that a power supply is far more complex to get right than just shoving together an transformer, a rectifier, a filter, and a linear regulator (and some variable voltage circuit if wanted), and is as delicate and fussy a circuit as any logic circuit. A pushbutton is never just a pushbutton, nor is a power supply!

Small world: some-one who's opinion and experience I value directed me to your/that power supply a few months ago when we were discussing the subject and he was giving me advice.
I'll bear this circuit in mind for another day, I already have the parts to finish the supply I started, so best use them. I don't mind too much a small voltage drop on the output, I'd factored it in to the output voltages, and no doubt I'll discover how bad a supply it is once it's finished.

On a different note, I think to compensate for unavoidable error with the shunt monitor and other factors, I'll try putting a resistor + a trimpot + resistor on both parts of the voltage divider that is between the shunt monitor and the ADC inputs (it looks like the only point of "attack" for offsetting errors post-soldering to an SRPB). Mainly because my voltmeter lost 30mV accuracy on some readings from the breadboard version to the soldered version, which was a shame after making a big effort to get it as accurate as possible over a few days and 4 little fine tuning modifications to the breadboard versions.

"So the very low resistance shunt is used in a linear power supply. I guess it is outside the voltage regulator so its resistance is in series with the load and causes a voltage drop that ruins voltage regulation.
A good power supply circuit has the current sensing shunt inside the voltage regulator negative feedback loop so its voltage drop is cancelled. Then the current shunt resistor can have a reasonable resistance."

I'll keep this very much in mind, thank you.
 

That is the original project that has many parts overloaded. It does not produce 30V at 3A and is unreliable. I fixed and improved it in two or three very long threads in the forum there. One thread has the latest version on the first page.
The "voltage stop at off" uses Q1 to short the output of opamp U2 when the power is turned off because the opamps selected have a problem called "Opamp Phase Inversion" where the output of U2 goes to a voltage as high as it can when its input voltages become too close to its negative supply voltage (the negative supply turns off first because its voltage is low).

For lower current you can use an LM317, LM338 or LM350 adjustable voltage regulator IC to replace most of the circuit but their output voltage cannot easily go less than 1.25V and output transistors must be added to dissipate heat if the current and input voltage are high but the output voltage is low.
 
  • Like
Reactions: d123

    d123

    Points: 2
    Helpful Answer Positive Rating
Hi - I'll look for those other threads, especially the one you highlight, when time permits (not polite words, I have a lot of dreary chores at present, and the time-consuming reading a lot before making mistakes means making slightly smaller mistakes). Thanks for the explanation about the stop at off feature. The sweet joy of working on and improving devices until they are right, that's nice.

I just love all those happily optimistic datasheets that promise 1 Amp output - until you read the "small print" about how that can be achieved. It seems I'll be using, besides the obligatory bypass transistor set-up, a heat sink a quarter the size of my SRPB; and to be facetious about it, pretty much installing an industrial air-conditioning unit and an extractor fan the size of a plane turbine just to use a TO-220 5V regulator dropping 10 to 14V in the lowest output setting (5V) - an unpleasant and costly learning curve experience I hadn't factored in.
I depended on the 78xx TO-220 series too much, and they seem to have quite a few drawbacks if not used solely for fixed low current output (even if most linear regulators seem to be the same without a heat sink and "forced airflow"), so I'm trying a 73801 for another circuit, and might try the 317 one day (but I'm keen to receive some LM723s which went AWOL in the post to try them for the sake of history, even though they're an ancient device I'm curious and they'd fit well into a prehistoric circuit I'd like to make when I get this one finished), so thanks for mentioning other regulators to give a go.

The penny dropped an hour ago - I see your point... If my power supply were hundreds of volts, up to 800mV difference wouldn't matter, but a 5, 9, or 12V regulated supply that could lose anything up to a hypothetical 800mV, even if in practice it would probably only be about +-200mV, is not a regulated supply at all... Dohhhh! Let's see how I do or don't find a way to get round that "trivial issue".

Thanks for all your helpful advice, it's much appreciated.
 

pretty much installing an industrial air-conditioning unit and an extractor fan the size of a plane turbine just to use a TO-220 5V regulator dropping 10 to 14V in the lowest output setting (5V)
That's where using SMPS (Switched Mode Power Supplies) come into the picture so you can drop from 20V input down to a 5V output without using a commercial 150 ton AC unit to cool your regulator. If you need one take a look at this one. I'm sure it is capable of cooling your TO-220. ;-)
 

Nice link. That's a good one - very funny. Thanks! It looks a bit like the heat sink from that angle...

SMPS sounds great but with a lot of problems to implement it correctly (and safely) - unless you buy a ready-made one, which would defeat the purpose of making something; from things I read, it's far more efficient but at the cost of having to compensate for output switching noise with additional circuitry, besides a couple of other important issues, and maybe only a wise choice to make for people who really do know what they are doing - I wouldn't be so foolish/over-confident about my current ability (a BJT or MOSFET and basically the 220V mains being chopped doesn't sound like a good combination to experiment with).
Thanks for the tip - I'll get onto Johnson and order right away, or perhaps just use the TO-220 to heat the house in winter.
 

(a BJT or MOSFET and basically the 220V mains being chopped doesn't sound like a good combination to experiment with).
Some examples of experiments with SMPS gone wrong. (it's a joke)
 

When considering any current shunt, a few considerations for value.

1. Choose a power level <1% of supply rating or 1W whichever is smaller for most cases
2. Choose a min voltage drop greater than possible/desired resolution error.
3. Choose a max voltage drop of 100mV or 1% whichever is smaller for most applications.
4. Consider a voltage rating at least 2x peak voltage expected across component. 500V for R is common but transients can be 1~6kV.
5. Provide adequate clearance to low voltage for 3kV line transients. ~2mm air/kV
6. Use differential measurements if reference ground is noisy from impulse currents.
7. Condition signal from input and load transients using, twisted pair, shield, suitable ferrite CM choke and/or suitable cap.

All of these can improve results.
 
  • Like
Reactions: d123

    d123

    Points: 2
    Helpful Answer Positive Rating
Nice pictures, those are things to always bear in mind when fiddling with circuits...! I have a good strategy with anything that I made, I ask some-one else to plug it in or turn on the switch if I'm unsure of how unsafe it is... (joke, but maybe not a bad idea)

I was just having a good read of the power supply description, that's a nice device to have been able to put together, simple but quite complicated in the interaction of the components, I take my hat off to you; and anything with a good detailed description is very helpful for a lot of reasons, and preferable to stand-alone schematics which sometimes can be hard to understand what the circuit is doing for beginners. And safe procedure advice is always welcome and wise.
It's also answered a doubt I had about using 1N5408 diodes instead of 1N4007 for attempt #2 power supply, as to whether they would be OTT or not.

The fast off you designed in is nice, if I understood that well the NPN base is held low while the supply is on and then the base gets pulled high at power off. I tried to make a resistor/PMOS bleeder (on the first dodgy version of a power supply) that was inactive during on time and supposed to drain the filter caps at power off, but I'm sure it is defectively implemented and one suspect reason my "abandoned for safety reasons supply" didn't work well (I noticed something not right when a cheap DMM measuring the rail voltage shot up from 27VDC to 80V for no apparent reason, which a better DMM didn't show), besides a soft start section that may have been the cause, or a too low 1100uF filter.
After that I tested the theory I'd read of trying an AC reading on the DC rail, and as it was fluctuating wildly high and low up to almost mains voltage at times, and the general advice was that anything over AC millivolts on DC may be blown filter caps or blown bridge components or not enough filter capacitance - not sure if that trouble-shooting method is good practice, but in a sense: who cares, I'd rather start again and omit the unnecessary parts like the soft start and to begin with add sufficient capacitance. Don't want to look like one of those cartoons!
 

Thank you very much for these guidelines. Your list has helped enormously to see where the circuit is fine and where it needs improvement. Thanks for your help.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top