Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: z.s.tar.gz on January 17, 2010, 01:41:34 PM

Title: Combination Voltage and Current Sensor
Post by: z.s.tar.gz on January 17, 2010, 01:41:34 PM
I was originally going to get a combination voltage/current sensor (http://www.sparkfun.com/commerce/product_info.php?products_id=9028) from sparkfun on free day (you know how that turned out :P) but now that I have to pay for it I'm wondering if there's another similar device that's cheaper somewhere else.

Or would it be cheaper to buy two separate sensors? If so, what kind would you recommend?
Title: Re: Combination Voltage and Current Sensor
Post by: madsci1016 on January 17, 2010, 04:27:08 PM
I have that sparkfun sensor you linked to, installed on my SAGAR robot. What I didn't realize (and I'm warning you in case you don't either) is the current sensor on that board is meant for really high currents (up tp 90 Amps) on a 3.3V logic scale. So low current (hundreds of mA) the board is not really precise on.

1 amp = .036 V
100 mA = .0036 V

A 10 bit ADC on a 5V VCC MCU only has .004V resolution. So with that sensor board and my Axon, I only register any current once it's over ~120mA, with a ~120mA resolution.
Title: Re: Combination Voltage and Current Sensor - Op Amps?
Post by: z.s.tar.gz on January 17, 2010, 05:03:51 PM
Yep, I'm gonna need something with more resolution at the low end that that.
I've heard (from this forum somewhere) that you can use op amps to monitor voltage and current (two op amps total).
1. How would I do that?
2. How exactly does that work? I though op amps only amplify signals. (I'm probably wrong)
Title: Re: Combination Voltage and Current Sensor
Post by: TrickyNekro on January 17, 2010, 06:29:30 PM
Look you can measure currents yes with op amps, voltage doesn't need an op amp unless you are speaking for very small voltages...
There is a way I did it, on the member pages, through measuring the voltage difference on a resistor but this is not
a very good approach... The best approach is probably that of a galvanometer...
As current passes through a contacting metal it generates a magnetic field...
Changes in magnetic field generate current thus voltage in a closed loop and this is what you can measure...
Of course you need coils and knowledge :-P

It's the Faraday Law and Lenz Law you should get a look at...

Best Regards, Lefteris
Greece
Title: Re: Combination Voltage and Current Sensor
Post by: z.s.tar.gz on January 17, 2010, 07:35:35 PM
What do you think about this current sensor IC (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=620-1238-ND) I found on digikey?
It looks simple enough for even me to understand it.

As far as voltage sensing goes, there seems to be quite a few techniques to doing it. Just got to do more research!
Title: Re: Combination Voltage and Current Sensor
Post by: waltr on January 17, 2010, 08:56:41 PM
Decent device but did you realize these are for 50 or 100Amps full scale giving 40 or 20 mV/A output biased to Vcc/2 for 0A.

Title: Re: Combination Voltage and Current Sensor
Post by: Soeren on January 17, 2010, 09:43:40 PM
Hi,

Perhaps you better define what max. current and resolution you need, then a solution can be found.
Title: Re: Combination Voltage and Current Sensor
Post by: Admin on January 17, 2010, 10:35:56 PM
If you look at the schematic, you'll see that if you change the sense resistor, Rs, that you can change the sensitivity.
http://www.sparkfun.com/datasheets/Sensors/DC%20Voltage%20and%20Current%20Sense%20PCB%20Spec%20Sheet.pdf (http://www.sparkfun.com/datasheets/Sensors/DC%20Voltage%20and%20Current%20Sense%20PCB%20Spec%20Sheet.pdf)


Making your own involves a current sense IC and a resistor:
http://www.societyofrobots.com/sensors_currentsensor.shtml (http://www.societyofrobots.com/sensors_currentsensor.shtml)
Title: Re: Combination Voltage and Current Sensor
Post by: madsci1016 on January 17, 2010, 10:42:32 PM
I thought i remember there was something written up here for current sensing, but my google powers failed me today.

Didn't you also have something for measuring battery voltage using a voltage divider?
Title: Re: Combination Voltage and Current Sensor
Post by: Admin on January 17, 2010, 11:47:49 PM
Yea, but its one of my oldest tutorials:
http://www.societyofrobots.com/schematics_batterymonitor.shtml (http://www.societyofrobots.com/schematics_batterymonitor.shtml)
(meaning not well written and probably outdated)
Title: Re: Combination Voltage and Current Sensor
Post by: z.s.tar.gz on January 18, 2010, 08:25:58 AM
Hi,
Perhaps you better define what max. current and resolution you need, then a solution can be found.

Yep. I need it to be on a scale of 0-2A (1.25A is what I'm shooting for) with a pretty fine resolution so I can monitor my battery charging.
Title: Re: Combination Voltage and Current Sensor
Post by: z.s.tar.gz on January 18, 2010, 06:45:03 PM
@waltr I don't really understand your post now that I read it again. What exactly do you mean?

I was looking into that current sensor IC I linked to earlier some more, and it says it has a resolution of 40mV/A. The one from sparkfun has a resolution of 36.6mV/A.
Title: Re: Combination Voltage and Current Sensor
Post by: waltr on January 18, 2010, 07:08:32 PM
I was referring to the current sensor from DigiKey.
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=620-1238-ND (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=620-1238-ND)
In this post:
Quote
What do you think about this current sensor IC I found on digikey?
It looks simple enough for even me to understand it.

The data sheet for that sensor covers both the 50 Amp and the 100 Amp sensor. The outputs are 40 mV/Amp or 20 mV/Amp depending on which sensor you use. The output is also offset to VCC/2 to allow measuring both sides of an AC waveform. The one you linked to at DigiKey is the 100 Amp sensor with an output of 20 mV/Amp. This means if your circuit is drawing 2 Amps the sensor output will be 40mV plus Vcc/2. So with Vcc at 5.0V the output for a 2Amp current is 2.540V and 2.500V for zero current.

Does that explanation help?
Title: Re: Combination Voltage and Current Sensor
Post by: z.s.tar.gz on January 18, 2010, 07:22:56 PM
So there isn't really any problem though? I thought you were hinting at some problem with using that type of sensor.
Title: Re: Combination Voltage and Current Sensor
Post by: waltr on January 18, 2010, 08:29:40 PM
Only that you would only have 40mV for the full range of the current you wish to measure and that zero current is at Vcc/2 Volts and not at zero Volts. To get any useful precision you would need to amplify and offset the sensor's output.

Here is how I would go about measuring the charge current:
http://focus.ti.com/analog/docs/microsite.tsp?sectionId=560&tabId=2181&micrositeId=7 (http://focus.ti.com/analog/docs/microsite.tsp?sectionId=560&tabId=2181&micrositeId=7)

Replace the 'load' with the battery and charger so that the charge current passes through the sense resistor (Rs).
Figure 3 has two wires missing: connect the op-amp's inverting input to the dot above the 1k resistor and the non-inverting input the the dot above the shunt resistor (Rs). Then set the op-amp gain to come close to the ADC's full scale for the maximum anticipated current. You can trade off op-amp gain for a larger voltage drop across Rs.

Here are some app notes on current sensing:
http://focus.ti.com/analog/docs/microsite.tsp?sectionId=560&tabId=2180&micrositeId=7&familyId=57 (http://focus.ti.com/analog/docs/microsite.tsp?sectionId=560&tabId=2180&micrositeId=7&familyId=57)
http://www.analog.com/library/analogdialogue/archives/42-01/high_side_current_sensing.pdf (http://www.analog.com/library/analogdialogue/archives/42-01/high_side_current_sensing.pdf)
http://www.analog.com/static/imported-files/tutorials/MT-068.pdf (http://www.analog.com/static/imported-files/tutorials/MT-068.pdf)
http://www.maxim-ic.com/app-notes/index.mvp/id/746/ (http://www.maxim-ic.com/app-notes/index.mvp/id/746/)
Title: Re: Combination Voltage and Current Sensor
Post by: Soeren on January 19, 2010, 10:26:27 AM
Hi,

Yep. I need it to be on a scale of 0-2A (1.25A is what I'm shooting for) with a pretty fine resolution so I can monitor my battery charging.
Then this (http://That.Homepage.dk/PDF/Current_Monitor (0-2A).pdf) should do.
Title: Re: Combination Voltage and Current Sensor
Post by: z.s.tar.gz on January 19, 2010, 03:12:25 PM
The lm307 is marked obsolete by digikey, how about this one? (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=497-4083-5-ND)

Is that a pretty good equivalent?

@soeren: I'm guessing that in the schematic:
1. U_IN = VCC
2. +U_OUT = Signal
3. -U_OUT isn't really needed for microcontroller use

And furthermore:
A. The resistors say "10R", "100R", etc next to them. What does that mean?
B. What is Uo and I_Load in the formula in the bottom?
Title: Re: Combination Voltage and Current Sensor
Post by: GearMotion on January 19, 2010, 05:46:32 PM
> A. The resistors say "10R", "100R", etc next to them. What does that mean?

That is a European style occasionally used in the U.S. Replace R with ohm, K with kilo-ohm, M with mega-ohm, and decimal point in the letter position.

10R = 10 ohm
100R = 100 ohm
1R2 = 1.2 ohm
0R1 - 0.1 ohm

10K = 10 k ohm
2K2 = 2.2 k ohm

5M6 = 5.6 mega-ohm



Title: Re: Combination Voltage and Current Sensor
Post by: z.s.tar.gz on January 19, 2010, 06:10:17 PM
I guess that makes a little sense...
I think that Uo is the output voltage for sensing (educated guess here), so I guess I_Load would be the maximum current load you'd want to sense right?

I'm also assuming that because no faults were made with my numerical statements, they are true.
Title: Re: Combination Voltage and Current Sensor
Post by: GearMotion on January 19, 2010, 06:13:23 PM
I guess that makes a little sense...
I think that Uo is the output voltage for sensing (educated guess here), so I guess I_Load would be the maximum current load you'd want to sense right?

I'm also assuming that because no faults were made with my numerical statements, they are true.

It isn't my circuit to say, but you are not going out on a limb assuming that.

Title: Re: Combination Voltage and Current Sensor
Post by: z.s.tar.gz on January 20, 2010, 12:29:28 PM
I guess I'll just make it and fine out then.  ;D
Title: Re: Combination Voltage and Current Sensor
Post by: Soeren on January 21, 2010, 08:40:10 AM
Hi,

Haven't been able to get a post through for some days, but now it seems the board is back in business.

Is that a pretty good equivalent?
Not really.
Please reload the schematic, I have changed it to use another IC and a few other bits.


@soeren: I'm guessing that in the schematic:
1. U_IN = VCC
2. +U_OUT = Signal
3. -U_OUT isn't really needed for microcontroller use

And furthermore:
A. The resistors say "10R", "100R", etc next to them. What does that mean?
B. What is Uo and I_Load in the formula in the bottom?
You have gotten most of that from GearMotion allready, but let me comment about the "why".
V, A, W  and W are the names for the explicit values. The equivalent symbolic names are U, I, R and P (some use E instead of U).

Although you see it a lot, it's a gross mistake to write something like: P = I x V.  Either use symbolic names (especially when the actual measures aren't known) or use the explicit names, never mix (yeah, I probably do that from time to time myself when I'm sleepy, but it ain't pretty).

As for #3 (-U_OUT isn't really needed for microcontroller use): Sometimes you'll see strange names on terminals in schematics from my hand, as Eagle only allow unique names. And the reason for the extra ground terminal (which it is), is that it then allows you easier connection in case you use separate boards (the terminal used fits either regular terminal pins or the screw blocks terminals, but I could change it to 1/10" module pins for the output to the ┬Ácontroller if you like(?).

Title: Re: Combination Voltage and Current Sensor
Post by: z.s.tar.gz on January 22, 2010, 02:25:29 PM
The mosfet you have in your schematic is marked as obsolete by digikey.
I would normally post something I thought was similar and ask about it, but I haven't been very good at that lately.
Title: Re: Combination Voltage and Current Sensor
Post by: Soeren on January 22, 2010, 04:45:06 PM
Hi,

The mosfet you have in your schematic is marked as obsolete by digikey.
You can use the ZVP4105A (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=ZVP4105A-ND) if you mount it "backwards" to orientate the pins correctly (i.e. let the gate pin bend to the other side of what you'd normally do).
Title: Re: Combination Voltage and Current Sensor
Post by: z.s.tar.gz on January 22, 2010, 07:01:54 PM
Sorry, I don't really understand...
Do I physically modify it, or do I just wire it up different than I normally would?

I'm a bit of a noob when it comes to transistors (but that's why I'm learning!)
Title: Re: Combination Voltage and Current Sensor
Post by: Soeren on January 22, 2010, 09:12:29 PM
Hi,

Sorry, I don't really understand...
Do I physically modify it, or do I just wire it up different than I normally would?
Yes, Like this:
(http://That.Homepage.dk/Img/MOSFET_Pins.jpg)
Title: Re: Combination Voltage and Current Sensor
Post by: z.s.tar.gz on January 23, 2010, 07:19:03 AM
What exactly does that accomplish? Couldn't I just wire it up without bending it?
I'll do it anyways, but I don't see why.
Title: Re: Combination Voltage and Current Sensor
Post by: waltr on January 23, 2010, 09:53:48 AM
Look at the direction of the flat on the BSS110 compared to the other transistor. The pin out to the package flat is reversed.  This is what Soeren is talking about and it is so easy to install the new part backwards (been there, done that).

Bending the leads is to get some separation so they are easier to connect to without shorts.
Title: Re: Combination Voltage and Current Sensor
Post by: Soeren on January 23, 2010, 06:26:24 PM
Hi,

Exactly. And you only need to do it if you use the PCB i made (which is made for the orientation of the BSS110). If you build on Vero or similar, you just need to be sure to connect the pins right.
Title: Re: Combination Voltage and Current Sensor
Post by: z.s.tar.gz on January 23, 2010, 06:38:29 PM
Oh ok. I'm doing this on a protoboard, so I guess I don't need to bend it up then.
Thank you very much!