Auto Ranging current meter, are relays fast enough?

Thread Starter

johnny411

Joined Mar 3, 2020
41
hello! this is my first post here, hope i'm doing it right.

this is my first "true" project using precision analog, and thus don't really know the best solution to my problems.

i'm designing a current meter (based on the uCurrent but different). the uCurrent uses a slide switch to change between ranges (uA,mA,nA). A similar project to my own,the current ranger, uses p-channel mosfets. however i don't want either of those solutions. my idea would be to use a pair of relays to control the ranging.

here is a picture of the uCurrent range switch:
u current resistors.PNG

since this device will be optically isolated (thus battery powered) (the microcontroller is usb powered), mosfets would be ideal. however the relays coil legs cross the isolation barrier nicely, so could be powered with usb 5v.

here is my sad excuse for a block diagram:
block.jpg

simply explained, the window comparator has two outputs, so those pass through the optocoupler to the micro. the micro then decides to range up, down, or stay the same. the relay is powered on the USB side, thus no extra battery drain (usb should have enough power)

relay will be this: tx2-5v

my questions are:
-is this a good solution (relays)
-will i have noise issues?
-will the relay ranging be fast enough to not blow the ADC?
 

Thread Starter

johnny411

Joined Mar 3, 2020
41
thank you. that's what i thought might be a problem.

looking at alternative solutions to my problem i have found four:

1) copy the design of the current ranger
front.PNG

2) programmable gain amplifier: LMP8358MT/NOPB

3) create my own programmable gain Amplifier: Website

4) design my own version of what the "current ranger" does using mosfets.

a 5th option i considered was something like a pair of sp3t demuxes, but their internal resistances (lowest at 1 ohm) and current capability made them not viable

any reason that i should choose one solution over the other? any other solutions that i'm not considering? thanks.
 

Thread Starter

johnny411

Joined Mar 3, 2020
41
idk if there is an "edit post" control here, but i cant seem to find one.

EDIT:
i left something important out of the above post- the "programmable gain amplifier" would be used alongside the relays, not as a standalone thing. (the whole point of this is low burden voltages) I.E. during the time that the relays switch the gain amplifier can change the gain to what the ADC's Range Is. to me this seems like a better option than using mosfets, as relays have very low contact resistance (so do mosfets, but those require drivers etc). the software would compensate for this. i am a second year EENG student, so alot of this analog stuff is still new to me. is doing it like this a good idea?
 
Can you give more specifics of what you are trying to do? What range(s) of current are you expecting (minimum and maximum)? What voltages would be acceptable at your ADC?

If the combination of these work out, you may be able to get away if a single value sense resistor and just adjust the gain of your opamp accordingly.
 

djsfantasi

Joined Apr 11, 2010
9,156
If you look at the bottom of your post, you’ll see a set of ellipses. Clicking there, you’ll be presented a menu option to edit the post.
 

Thread Starter

johnny411

Joined Mar 3, 2020
41
ok.

Maximum of 1A (3 ranges, nA, uA, mA)

i could get away with only two resistors instead of three, but not one i don't think

the key design requirement (why even do the project otherwise) is low burden voltages, thus allowing the measurement of very small currents on low voltage micro controllers.

i was thinking about doing it like this, but that might add too much burden voltage.
block diagram switcher.PNG
the programmable gain amplifier i'm using doubles as a ADC driver so it will have the output voltage correct already. (PGA 281).

ltc2400: https://www.analog.com/media/en/technical-documentation/data-sheets/2400fa.pdf

pga281: http://www.ti.com/lit/ds/symlink/pga281.pdf

max4239: https://datasheets.maximintegrated.com/en/ds/MAX4238-MAX4239.pdf

@crutschow i will look into that. thanks.
 

schmitt trigger

Joined Jul 12, 2010
872
Your last circuit should work, with one observation.

The opamp amplifying R19's voltage will see a common mode voltage that it should reject. This means wiring the opamp in a differential configuration, and using high precision resistors to achieve this.

True, the common mode voltage will be low, but depending on the required accuracy, is the rejection ratio that you require.
And thus the precision of the resistor network.

Lastly, goes with saying that you must also employ low Vos opamps.
 

crutschow

Joined Mar 14, 2008
34,285
You might use instrumentation amps instead of opamps.
They require fewer resistors when used as a differential amp, and have higher common-mode voltage rejection.
 

Thread Starter

johnny411

Joined Mar 3, 2020
41
thanks!

Ok so i revised my design down further.

key points:
-relay for the 10k nA range so that the burden voltage is still super low when nA are not needed. relay should be fast enough as a pair of spst analog switches are also in use.
-single ended design
-0.01 ohm resistor for the uA and mA. this is amplified x10, and then feeds into a programmable gain amp to get it to a value the ADC can read.
-micro-controller completely optically isolated
-0.01% or 0.05% resistors used for everything

Here is my attempt at an understandable block diagram. (i forgot to add arrow between optocoupler and micro)
current circuit v3 block.png

here is the horendous simulation schematic:
current circuit v3 schematic.PNG

i guess my question now is whether this is a good way to do this? i'm just an eeng student taking their first analog course so much of this is fairly new to me, especially with classes being online now. anything else i should be taking into account?

@schmitt trigger i am using very low Vos op-amps. also does this design fix the problem of common mode voltage rejection?

@crutschow i will look into that but i like using regular op-amps for this.
 

Thread Starter

johnny411

Joined Mar 3, 2020
41
attached are two pdf's with project simulations, data, and discussions. design 34 should b read before design 38. design 34 refers to analog while design 38 refers to digital/ power delivery.

if anyone wants to they can look at them and point out any errors. thanks.
 

Attachments

MrAl

Joined Jun 17, 2014
11,396
Hello,

Expensive meters use instrumentation grade reed type relays, they have low mass. Sometime even a test current is run through them to measure contact resistance for high accuracy especially for differential measurements.

You would first provide some protection on the ADC input with some sort of clamp circuit. The old way of doing this was to use two diodes in anti parallel where the signal would always be much lower than the forward conduction voltage of the diodes, and along with that some current limiting resistors that serve to keep the current though the diodes low during any anticipated over voltage.
This really is the mantra for any device that might see an over voltage.
There are other ways though. One is to clamp the input to the supply rails, but care has to be taken so that any over input will not over power the supply rail and cause the voltage to either rise or fall.
 
Last edited:
Top