Measuring Small Voltages

SilentScreamer

Senior Member
Hi,

I need to measure a voltage between 0V and 0.05V (or even less if possible). I have a 12 bit ADC that I plan to use if the final project although I'll use the PICAXE's own 10 bit until I get it working, I could resort to 8bit if it isn't possible to amplify with enough precision. Is it possible to use a Op Amp (or anything else) to multiply the voltage to 0V-5V? If so what terms can I search for to find an example circuit to adapt? I've been searching for the last couple of days with little relevant information found (though its probably my searching :p).

It is not important if it is not multiplied linearly as I plan to do the maths using a PC (via serial) rather than on the PICAXE.

Thanks in advance,
SS
 

Andrew Cowan

Senior Member
Yup - an op amp is the way to go.

You want a gain of 100 with a non-inverting amplifier.

I'll draw you a circuit diagram now. You'll need to fiddle with resistor values.

A
 

Attachments

Last edited:

Andrew Cowan

Senior Member
A 741 would be ideal, and it's low internal gain would give almost a 100 times gain (slightly over) with the circuit I have posted.

The power supply must be (maximum wanted output voltage)+2V.

Gain (not inc internal gain) = (R1+R2)/R2 (in this case gain is roughly 101)

A
 
Last edited:

fernando_g

Senior Member
In addition to what other posters have mentioned, get yourself an opamp with low Vos (Offset voltage) such as the OPA2234, if you want the least error.
 
Last edited:

boriz

Senior Member
Note:

Your signal needs to be fairly low frequency or even DC otherwise you will need two op-amps.

A 741 will require a balanced signal and a balanced power supply with three terminals. A ground terminal and PLUS terminal and MINUS terminal. I suggest a single sided op-amp such as an LM358 (http://www.national.com/pf/LM/LM358.html) would be more suitable for this application.

50mV is very small and your signal could easily be swamped with noise. Every effort must be made to reduce the noise injected at the source. Also try to use as low impedance as possible. Remember, the amplifier will also amplify the noise 100 times.

An amplifier such as this is no big deal to an experienced designer, but could be challenging for a beginner. If you need someone here to design it for you, then you will need to supply much more information about the signal source, including how it’s powered, it’s max frequency, it’s impedance, etc.
 

SilentScreamer

Senior Member
The signal is from measuring a the voltage across a shunt resistor (I've been looking at these) to measure the current. It will be DC and should be fairly stable. The maximum current will be 500ma and I can't use a resistor much larger than the 0.1ohm one I have. I've seen hall effect sensors used for current measurement but every example I found was for much larger currents. I think I saw some ICs designed for this but I'd rather learn from this than just put a chip in with its recommended circuit.

I'm happy to spend as much time as needed on designing this and should have access to a scope fairly soon (I hope at least :D).
 

Dippy

Moderator
In addition to the advice given above, your desing will depend on whether you have the shunt in a high side position or low side.
If you don't want to use a proper diff amp arrangement then someone recently proposed a circuit for the project. It was posted within the last day or so, so have a look.
 

lbenson

Senior Member
I am a rank beginner with op amps, so any subtleties would escape me, but you might find a 5-volt rail-to-rail op amp (such as the MCP602, LMC6482, AD822, TVL2472, or TLC2272) easier to work with than the venerable 741, which requires multiple power supplies.
 

Dippy

Moderator
Yes, there may be many more suitable op-amps than the 741 which is basically the 'school student' standard op-amp for beginners lessons.
 

SilentScreamer

Senior Member
In addition to the advice given above, your desing will depend on whether you have the shunt in a high side position or low side.
If you don't want to use a proper diff amp arrangement then someone recently proposed a circuit for the project. It was posted within the last day or so, so have a look.
It can be on either side but I expect the low side would be simpler?

I assume you're referring to the "Useful Chip" thread? If so this has a maximum gain of 10, as I'm going to need a gain of 100 that chip will be unsuitable I think. I've had a look on rapid and seen this chip, but I expect it is a major overkill. I've also seen this chip that looks good, if anyone has the time to quickly check to see if they're appropriate it would be greatly appreciated.

Also I know I'm going to need a lot of decoupling caps to make this work, does anyone have any suggestions as to where? I know the PICAXE (and 12bit ADC) will want one across the power rails, should I also add them to the signal. If so how, from the +V side of the shunt resistor to 0V?

One doubt I do have is the precision of this, if I can measure it to 1mA thats 0.0001V per mA, is this realistically measurable (or rather practical to multiply in the first place as I know the ADC can measure it once it is ~0.01V)?

Sorry I have a lot of questions, thanks for all the help I've already received.
 

jglenn

Senior Member
Dealing with such a small input range will be difficult. It's not so much which
opamp, but the layout and use of a ground plane. The LM741 is obsolete, the
LM324 could do this, a quad that costs .80. I use the LMV321, single supply
SOT23 pak,but have found when working near ground, it is necessary to have
a small negative supply on the opamp instead of ground, even -2V may be enough. Prob true with the LM324 and others. Try and see!

Better opamps are the LM6142 and LM6218. In any case have a 0.1uF from each supply line to ground, short runs, right at the chip. You can filter the
shunt signal with an RC filter if necessary. It is important to use the differential amp config or instrumentation 3 OPAMP circuit for something like this, for the
best results.
 
Last edited:

boriz

Senior Member
Ok. Well at 0.1 ohms, I don’t think noise will be much of a problem. (That really is low impedance!). And at DC, no bandwidth problems, so any op-amp should be able to manage a gain of 100.

The data sheet for the LM358 actually shows a circuit diagram for a DC amp with 100 gain (actually 101) which I have modified and reproduce here:



(Credit to original author)

Measuring 50mV will be no problem, but for very small input voltages, tiny tolerance problems with the internal op-amp components can cause problems and may need to be compensated for. However, for your application, the simplest method would be to switch different value shunt resistors in and out of circuit and keep the op-amp circuit unchanged at 100 gain.

EG:

For full scale 5v output, with 500mA through the shunt, use a 0.1 ohm shunt.
For full scale 5v output, with 5A through the shunt, use a 0.01 ohm shunt.
For full scale 5v output, with 5mA through the shunt, use a 10 ohm shunt.

You could even have automatic range selection using the Picaxe to drive relays to switch the shunts.

EDIT:
Remember, the wiring itself has resistance, so a voltage can develop between ground and the lower end of the shunt depending on how you wire it up. Unlikely to be a problem though for small currents (<1A). Just be aware of this and try to keep the power ground wiring nice and meaty, and keep the wire between the op-amp ground and the op-amp inverting input as short as practical.

In fact, a common alternative to using a shunt is to just measure the voltage drop across the ground wire between the power source and the power load. The ground wire itself becoming the shunt. If you do this, you will need to perform some tests to work out what gain you need.
 
Last edited:

womai

Senior Member
Two things to look out for in any op-amp amplifier stage:

"Normal" (i.e. voltage feedback) op-amps have a so-called gain-bandwidth product (GBP); this is one of the most important numbers in any op-amp specification. E.g. if the GBP is 1 MHz and you wire the circuit for a gain of 100 you can expect approx. 1MHz/100 = 10 kHz of bandwidth. Not a problem in the present case since the signal is DC or very low frequency. In addition, there is the so-called DC gain, i.e. the maximum gain you can get even at DC - the GBP would predict infinite gain, but in reality it is large but finite (e.g. 1 million).

Even when you are not worried about bandwidth it is risky to make the gain too high - unless you are very careful the circuit can easily start to oscillate because of parasitic feedback due to stray capacitance etc. In this case it is better to cascade two stages with gain=10 instead of using a single stage with gain=100.

You can have a look at the input stage of my Picaxe oscilloscope, it has a gain=10 rail-to-rail op-amp (i.e. can swing from close to 0V up to close to 5V with a power supply of 5V) as its second stage (pins IN1+, IN1-, OUT1). Double that (i.e. two stages in series) and your'e done. Since the package has two op-amps that works out to just one chip. The MAX492 op-amp can be used as a pin-compatible replacement for the Microchip MCP6022 or MCP6922 since you don't need much speed.

http://www.pdamusician.com/lcscope/files/lcs1m_schematic_5_of_7.png

Wolfgang
 

Dippy

Moderator
I agree with that, except that I wouldn't worry too much about GBP in what is basically a DC gain circuit.
In fact a low GBP can be of benefit as it intrinsically ignores HF component of signal.
Of course a little thought concerening feedback and some pre/post RC filtering can remove lots too.

Boriz's circuit shows the easiest method where you have the shunt in the ground line. (Though it should be noted that many apps aren't suited to a resistance in the ground line).

For a high sided shunt (usually the best way generally) you will need a diferential configuration for the op-amp or a specific chip.
Thanks SS, yes, that was the thread.

A Note of Caution.
Well, not so much 'caution' but something to keep in mind.
Obv you will be selecting a shunt value to give you a good range.
Ideally 0-X Amps will be transposed to 0-PICAXE Vdd.
Just be aware of the effect that such a shunt can have on the circuit.
Might get a bit warm when cranking with a starter for example or might cause unwanted voltage drops further down the line.

If you look at the purpose-built diff-amp current sensor chips you can adjust the gain with a single resistor in many cases and some are Gain fixed. There are so many I can't list them.
 

kewakl

Senior Member
B. at the time of positing, I didn't thinks that SS had nailed down which op-amp/circuit to use.
for small signals and 100 gain, temperature of the support components could influence the output no matter how stable the amp actually is.
 

jglenn

Senior Member
Temp variations of the opamp can cause the offset voltage to change,
check the specs and use a good part. It is crazy not to use a Kelvin
connection, thus the diff amp. Once you do it this way you will never
go back. Pay attention to single point grounding, and use a ground plane!

http://www.edn.com/article/CA502424.html

The problem with such a small input voltage, is that any noise will be
amplified too.
 

Dippy

Moderator
Possibly this moment in time could be a good time to read up Diff Amp data sheets and the data sheets on ready-made current-sensing diff-amp chips.
Far easier than trying to describe all this sort ofstuff in a pile of paragraphs.

The Data Sheets will even describe Kelvin connections. Sounds tricky doesn't it, but its basically common sense. Don't use Kevin & Perry connections though.
 

womai

Senior Member
I second the need for a Kelvin connection. Since your circuit has considerable current flowing, even the smallest resistance in your return path with produce significant voltage drops. That means different points on your supposed "ground" will be at different voltage levels > 0V. So you need to measure the difference between the voltages at the two ends of your shunt resistor rather than just the voltage on the "hot" end.

This can be done very nicely with a circuit called an "instrumentation amplifier". It will produce a voltage that is proportional to the difference in voltage between its two inputs, irrespective of their absolute value (so V1=0.1V and V2=0.2V will result in the same output as e.g. V1=1V and V2=1.1V). You can build your own instrumentation amplifier out of 3 op-amps, but it is easier and more accurate to just use one integrated on a single chip. Here is a very suitable candidate that is available in DIP package as a free sample:

http://focus.ti.com/docs/prod/folders/print/ina217.html

Wolfgang
 

jglenn

Senior Member
dippy/womai:

you are both correct. One problem is hobbyist techniques, vs real engineering
methods learned the hard way. Small signal processing requires that sloppy
execution be avoided. Those plug in breadboards and stripboards just don't
cut it. A first try with wirewrap, very short leads, may be ok. But you will find
that a proper layout with a ground plane will give 400% better results.

Simple stuff like component selection. Often you need 1% metal film R's for
stability. Some caps can cause trouble, leaky tants, smd caps that vary
wildly with temp (had two hits on that recently in a 5 channel generator LED display unit),
use film caps for critical things. Polyprop are the best, but costly, and big.
Electrolytic caps can surprisingly work at video freqs, but in very old guitar
amps they have dryed out and need replacing. Stacked foil caps are great.

Casual circuit hacking will not approach the Instrumentation Grade level,
like a 4.5 digit DVM or better. If you use sloppy techniques, you will get
sloppy results.

For example, one unit I worked with detected cracks in metal with magnetic
fields. A LED bargraph displayed the signal. Simple, you think. Wrong. For
months they had oscillation problems at certain times, one guy finally
figured it out.

The grounds for the +\- 15V analog supplies was daisy chained with the
LED bargraph modules, taking more than an amp each. When they drew
max current, it introduced an error in the system, causing oscillation.

The fix was to route the grounds for the 5V high current LEDs, and analog
ground SEPARATELY to each power supply return. Then a lead was connected between the supplies, the only place they were tied.

Any other connections between them would comprise a GROUND LOOP.

:eek:
 

moxhamj

New Member
Good points there from jglenn. I'm going to post the following circuit as an 8 bit resolution circuit. I doubt it would go up to 10 and certainly not 12. But give it a shot and see, as it is a good place to start.

We have a 5V regulated supply, and an op amp set up as a differential amp with a reference at 0V. Gain is set with 10k and 1M resistors to be 100. The current sense is 0.1R. The lower end of the current sense might well be connected to ground on a schematic, but I've left it unconnected as what you want is to put that sense resistor away from the circuit (maybe near the battery), and then bring two physical wires from the sense resistor to the op amp circuit. Those are the sensor wires. If you really want to do it properly, use twisted wires (but different colours so you know which is the +ve side of the sense resistor).

The difference amp is here http://en.wikipedia.org/wiki/Operational_amplifier_applications and it is the first figure on that page (scroll down a bit). I think a difference amp will be better than a non inverting amp.

The reference is ground. I'd normally use a reference of 2.5V off another op amp, but ground would work here. The standard op amp circuit uses + and - supply lines, usually a few volts more than the volts you want to amplify. However, there is a risk that you could end up putting -5V into a picaxe pin, or +7V etc. The 3140 can swing rail to rail so this allows you to get away with not using split supplies.

The output should swing 0V to 5V.
 

Attachments

Last edited:

Dippy

Moderator
Lordy, he was just bursting to use it! :)

Very pretty. I prefer schematics though. And as JGlenn quite rightly said, for best results this is a job for good PCB layout and sadly not breadboard.

I fully appreciate the hard work, and I don't mean to sound at all rude, but I hope this isn't going to take precedence over schematics for circuit descriptions - its harder to follow.
 

SilentScreamer

Senior Member
Thanks for all the help everyone, I've been reading the posts and learnt loads and I've decided to go with the INA217 as suggested by Womai (mainly because I am finding the datasheet particularlly helpful).

@jglenn - I planned to make a prototype PCB for this rather than breadboarding as I expected problems with such small voltages. Thanks for the advice on which components to use.

@Dr_Acula - I will never get more than 0.5A (fuses blow first) and most of the time it will be around 10mA so the voltage will never exceed 5V I think?

A few questions:

Do the grounds need connecting between the Op Amp and the circuit that I'm going to measure the current for? I think I don't as I have two connections going into the Op Amp, but I could easily be wrong.

I've attached a schematic that I've made from the datasheet and the information from Dr_Acula, does it look okay?

Assuming the schematic is suitable (or correctable at least) how should I power the Op Amp? I plan to connect a 230V transformer to power the project, what voltage would you advise this is to power the Op Amp, I can't seem to find anything advice in it's datasheet (or probably don't know what to look for).

Also I can't seem to find anything on Kelvin connections other than patents, does anyone have any links that will explain it?
 

Attachments

Last edited:

Andrew Cowan

Senior Member
Typical max output = V+ minus 1.8V.

So for a 5V output, it needs to run off at least 6.8V.

However, you may want to use a 6V supply (to ensure the voltage does not go above the PICAXE power supply voltage), and do a bit of scaling within the PICAXE.

A
 

Dippy

Moderator
Basially, Kelvin connections are direct wires to either side of the shunt, ideally connecting right at the ends of the shunt. So, the voltage drop is JUST the shunt resistance and NOT any other track or contact resistance.
This becomes more and more significant with lower value Shunt resistances.

Bottom line: you want Vdrop across shunt ONLY, the tracks/pads resistance must not contribute to the Resistance.
It is simple common sense.

Obv your connections should avoid any other stray circuit effects too.
For AC mains shunt measurements the slight inductance can affect things, but if i were you I'd just get the basics going first.

For general information AN39 from Zetex will give you some bedtime reading.

PS. WHY don't you use proper purpose-built current shunt diff amps e.g. INA169 or a dozen others. They're made for the job. No faffing around.

This is a crude example I was using to test something using SMD resistors, but you can get the idea.
 

Dippy

Moderator
For a bit more info on Kelvin connections, get the Data Sheet on the LTC6102 current sensor from Linear.
Page 12 figure 2 shows an SMD example.
It uses the 4 pad technique.

I have also seen somewhere a suggested land/pad for SMD shunts.
Can't remember where but it was something like this.
My awful picture shows one SMD pad for a shunt.
The grey bits are track. The big black bit is the SMD pad. See how the Kelvin track is taken.
The other SMD pd is a mirror image. This type of pad may be tricky on some CAD packages to create.
Sorry about quality, I did it in a rush, but I hope you get the drift.
(Well, actually I hope you don't get any drift :) )
I think it came from an SMD shunt res manufacturer.

(Edit: Welwyn suggest the 4 pad method for their ULR series shunts. Most of this may be of no interest, but the info is there if you look. Just remember, it ain't rocket science and is basically common sense unless you want to get really complex).
 

Attachments

Last edited:

SilentScreamer

Senior Member
Thanks for the replies, I'll read the AN39 doc either tonight or tomorrow night it seems the perfect source of information.

Kelvin connections now sound incredibly simple. I imagine thicker tracks help as well as that would reduce the resistance further (of course closeness to the amp comes first)?

My main reason for not using a IC designed for current sensing is because I'd like to learn more about the concepts behind it. If this completely fails however I've found (or rather my spreadsheet telling me what's there, finding the actual IC is another matter) two MAX471s in my stack of random ICs so I can fall back on them if needed.

I've also just realised that I will have a relay on the +V line, could I measure the voltage drop across the relay and use the contact resistance as a shunt resistor? I'm just thinking of it as it will probably have greater than 0.1ohm I would have thought, is its resistance likely to be stable enough if I simply measured it beforehand with a multimeter?

Also if anyone has time can they comment on my schematic, even if just to say its useless.
 

BeanieBots

Moderator
Absolutely no chance whatsover of getting any sensible reading by measuring the volt-drop across relay contacts.
It could be orders of maginitude different each time the relay operates.

The volt-drop down the cables going to the realy would be a better choice.
Likely to be much higher impoedance than the contact itself and would only suffer errors due to temperture (assuming you don't include the terminals in the measurement which would add contact resistance and 'difference of metals thermoelectric effects).

Regarding the op-amp circuit suggestions. With gains as high as 100, using two stages (may two X10 stages) can tend to give more stable results.
 

Dippy

Moderator
Shouldn't worry about tick tracks on your Kelvin line as there is b-all current flowing.

What are the inductors for in your schematic?

And using the relay contacts as a shunt R?
Blimey, no way.
Your shunt R should be consistent and stable.
Will relay contacts fit that bill?

Whats a MAX471?
 
Last edited:

SilentScreamer

Senior Member
What are the inductors for in your schematic?
Datasheet said:
Very low source impedance (less than 10&#937;) can cause the INA217 to oscillate. This depends on circuit layout, signal source, and input cable characteristics. An input network consisting of a small inductor and resistor, as shown in Figure 2, can greatly reduce any tendency to oscillate. This is especially useful if a variety of input sources are to be connected to the INA217. Although not shown in other figures, this network can be used as needed with all applications shown.
Therefore I assume it it needed for my application? If I break it down into two stages with 10 ohms at each should I add them again, or should it be fine once amplified once?

EDIT: MAX471 - Its now obsolete (I got LOTS of MAXIM ICs that were being thrown by a local company), the description on the datasheet is "Precision, High-Side Current-Sense Amplifier".
 
Last edited:

BeanieBots

Moderator
Now you've confused me.
Are you using a current shunt plus op-amp(s) or a high side current sense?
The MAX471 has a built in shunt for currents up to 3A.
What currents do you want to measure?

This is getting VERY confusing and mixed up!
10 ohm shunt shown in your diagram ? ! ?
 

SilentScreamer

Senior Member
The MAX471 will not be used unless I am forced to as a result of this not working as intended.

My current schematic has an op-amp with a gain of 100 set as a differential amplifier with 1K resistors for all 4 resistors. It takes measure the voltage drop across a 0.1&#937; (100m&#937;) shunt resistor.
 
Top