go_away

Author Topic: Combination Voltage and Current Sensor  (Read 2706 times)

0 Members and 1 Guest are viewing this topic.

Offline z.s.tar.gzTopic starter

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Combination Voltage and Current Sensor
« on: January 17, 2010, 01:41:34 PM »
I was originally going to get a combination voltage/current sensor 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?
Save yourself the typing. Just call me Zach.

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: Combination Voltage and Current Sensor
« Reply #1 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.

Offline z.s.tar.gzTopic starter

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: Combination Voltage and Current Sensor - Op Amps?
« Reply #2 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)
Save yourself the typing. Just call me Zach.

Offline TrickyNekro

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,207
  • Helpful? 15
  • 1.6L Peugeot 307 tuner
Re: Combination Voltage and Current Sensor
« Reply #3 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
For whom the interrupts toll...


P.S. I've been inactive for almost a year... Don't give promises but I'll try to complete my tutorials. I'll let you know when..

Cheers!

Offline z.s.tar.gzTopic starter

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: Combination Voltage and Current Sensor
« Reply #4 on: January 17, 2010, 07:35:35 PM »
What do you think about this current sensor IC 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!
Save yourself the typing. Just call me Zach.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 98
Re: Combination Voltage and Current Sensor
« Reply #5 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.


Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Combination Voltage and Current Sensor
« Reply #6 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.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: Combination Voltage and Current Sensor
« Reply #7 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


Making your own involves a current sense IC and a resistor:
http://www.societyofrobots.com/sensors_currentsensor.shtml

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: Combination Voltage and Current Sensor
« Reply #8 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?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: Combination Voltage and Current Sensor
« Reply #9 on: January 17, 2010, 11:47:49 PM »
Yea, but its one of my oldest tutorials:
http://www.societyofrobots.com/schematics_batterymonitor.shtml
(meaning not well written and probably outdated)

Offline z.s.tar.gzTopic starter

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: Combination Voltage and Current Sensor
« Reply #10 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.
Save yourself the typing. Just call me Zach.

Offline z.s.tar.gzTopic starter

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: Combination Voltage and Current Sensor
« Reply #11 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.
Save yourself the typing. Just call me Zach.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 98
Re: Combination Voltage and Current Sensor
« Reply #12 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
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?

Offline z.s.tar.gzTopic starter

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: Combination Voltage and Current Sensor
« Reply #13 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.
Save yourself the typing. Just call me Zach.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 98
Re: Combination Voltage and Current Sensor
« Reply #14 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

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://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.maxim-ic.com/app-notes/index.mvp/id/746/

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Combination Voltage and Current Sensor
« Reply #15 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 should do.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline z.s.tar.gzTopic starter

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: Combination Voltage and Current Sensor
« Reply #16 on: January 19, 2010, 03:12:25 PM »
The lm307 is marked obsolete by digikey, how about this one?

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?
« Last Edit: January 19, 2010, 05:03:34 PM by z.s.tar.gz »
Save yourself the typing. Just call me Zach.

Offline GearMotion

  • Supreme Robot
  • *****
  • Posts: 489
  • Helpful? 24
  • Two decades+ of Embedded Design
Re: Combination Voltage and Current Sensor
« Reply #17 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



« Last Edit: January 19, 2010, 05:49:40 PM by GearMotion »

Offline z.s.tar.gzTopic starter

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: Combination Voltage and Current Sensor
« Reply #18 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.
Save yourself the typing. Just call me Zach.

Offline GearMotion

  • Supreme Robot
  • *****
  • Posts: 489
  • Helpful? 24
  • Two decades+ of Embedded Design
Re: Combination Voltage and Current Sensor
« Reply #19 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.


Offline z.s.tar.gzTopic starter

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: Combination Voltage and Current Sensor
« Reply #20 on: January 20, 2010, 12:29:28 PM »
I guess I'll just make it and fine out then.  ;D
Save yourself the typing. Just call me Zach.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Combination Voltage and Current Sensor
« Reply #21 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(?).

Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline z.s.tar.gzTopic starter

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: Combination Voltage and Current Sensor
« Reply #22 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.
Save yourself the typing. Just call me Zach.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Combination Voltage and Current Sensor
« Reply #23 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 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).
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline z.s.tar.gzTopic starter

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: Combination Voltage and Current Sensor
« Reply #24 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!)
Save yourself the typing. Just call me Zach.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Combination Voltage and Current Sensor
« Reply #25 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:
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline z.s.tar.gzTopic starter

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: Combination Voltage and Current Sensor
« Reply #26 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.
Save yourself the typing. Just call me Zach.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 98
Re: Combination Voltage and Current Sensor
« Reply #27 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.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Combination Voltage and Current Sensor
« Reply #28 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.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline z.s.tar.gzTopic starter

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: Combination Voltage and Current Sensor
« Reply #29 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!
Save yourself the typing. Just call me Zach.

 


Get Your Ad Here