# general current flow in given circuit

#### ak52

Joined Oct 15, 2014
225
Heys guys,
I have a doubt in this circuit and need some help figuring it out.
Consider this following rough circuit:

The current source are solar panels which are charging the battery.
The voltage drop across the 0.01E shunt will give me the current value.
Here's my question
"What current does the shunt measure?"
I mean to say ,
Is it the current at which the battery is charging ?
(If this is the case,then the current consumed by the battery should gradually decrease as the battery reaches full charge.So i can predict the battery is fully charged when this current reaches 0.)
OR
Is this the amount of current the panels are forcefully pumping into the battery(solar current)?
(If this is the case,then the current flowing into the battery increases during the day and decreases at night)

Bear in mind that there also is an inverter(in this case we can consider the inverter as a load),so how would the current measures by the shunt vary with respect to the load.

Arun

#### Jony130

Joined Feb 17, 2009
5,445
This shunt voltage show a charging current when voltage across shunt is positive with respect to solar ground. But also show a discharge current when shunt voltage is negative.

#### ak52

Joined Oct 15, 2014
225
Hello Jony,
This puts me in a spot of bother as i will have no way of measuring the two currents individually, Two two currents being :
1. current going in to the battery,or the current at which the battery is charged.
2.current given by the battery to the load,or the current consumed by the load,when battery is discharging.

Any suggestions as to how i can measure the two currents?I am open to adding shunts if required in multiple places.
Please note that i cannot disconnect the load at any given time.

Thanks for you help,
Arun

#### MrAl

Joined Jun 17, 2014
10,052
Hi,

If you measure the voltage across the already present shunt you'll see if the battery is charging or supplying current to the load. If the voltage is positive it is charging, and if negative it is supplying current to the load.

If we call the solar current Is and the inverter current Iinv and the battery current Ib, the expression is:
Ib=Is-Iinv

So when the solar current Is goes low the current to the battery goes negative which would tell you it is supplying current to the load which is the inverter.

What you wont know is how much current is being supplied by the solar array unless you know the inverter current too, but you may not need to know that anyway.

#### MikeML

Joined Oct 2, 2009
5,444
That is not how I would place the shunt, but lets discuss your circuit first. LTSpice uses the Conventional (not electron) Current Convention.
Node Voltages are plotted with respect to the ground node. If we look at your circuit, and put the ground symbol at the negative input to the converter (which is the way most engineers would do it), then the voltage across the shunt is negative and is proportional to the solar panel current while the sun shines. Connected this way, the voltage across the shunt is zero when the sun is not shining.

Now lets look at the more conventional way of doing this: By slightly rearranging the circuit, we have a way of using the shunt to measure both the charging current, and the discharging current. The converter load is 2A. The peak solar panel current is 10A, so the current available to charge the battery is 8A. Note that the shunt shows -20mV =(-2A*10m) when the sun is not shining, and 80mV = (10-2)*10m when it is...

#### ak52

Joined Oct 15, 2014
225
Hello Mike,
The second circuit which you have simulated is exactly how i have implemented in my design,The solar ground and the inverter(Load) ground are the same.Though it did not occur to me the negative voltage it the discharging current of the battery.Thanks for reminding me that

#### ErnieM

Joined Apr 24, 2011
8,355
Several thoughts here. First it is ill advisable and in fact against common electrical codes to break the ground connection for any reason, including adding a current shunt. Thus all measurements should be done in the non grounded lead, here the positive. There are multiple ICs available to translate a shunt resistor's voltage to a ground reference (along with adding some gain) so this should not be an inconvenience.

Once you put ground back together it should be simple to see two shunts can do the job: one measuring current into the storage device, and another measuring current out of that device.

#### Attachments

• 23.3 KB Views: 125

#### MikeML

Joined Oct 2, 2009
5,444
...First it is ill advisable and in fact against common electrical codes to break the ground connection for any reason, including adding a current shunt...
For DC? Please cite a reference?

#### ErnieM

Joined Apr 24, 2011
8,355
The National Electrical Code (NEC), or NFPA 70, written by the National Fire Protection Association has specified such since about 1985 or so.

This document is accepted in total by most municipalities and is commonly referred to as "the code."

I'm guessing about the year it was added. I'm not guessing it is in there.

#### MikeML

Joined Oct 2, 2009
5,444
The National Electrical Code (NEC), or NFPA 70, written by the National Fire Protection Association has specified such since about 1985 or so.

This document is accepted in total by most municipalities and is commonly referred to as "the code."

I'm guessing about the year it was added. I'm not guessing it is in there.
I have the NEC code downloaded on another computer. I have read parts of it as I wired my house while building it. I cannot remember any reference to DC wiring for solar panels in it...

#### ErnieM

Joined Apr 24, 2011
8,355
Try reading the section on bonding once again. You will see ANY system running more then 48V needs be grounded. Nothing about AC or DC is mentioned.

Systems under 48V need not be bonded but must have both conductors fused and switched. Typically this is such a hassle one will just go ahead and bond them anyway.

This also means the black wire on a DC solar system is a HOT wire and never ground. Ground is either green or bare. And yep, the red wire is also a hot wire though one that may or may not be live at any moment.

#### ak52

Joined Oct 15, 2014
225
Several thoughts here. First it is ill advisable and in fact against common electrical codes to break the ground connection for any reason, including adding a current shunt. Thus all measurements should be done in the non grounded lead, here the positive. There are multiple ICs available to translate a shunt resistor's voltage to a ground reference (along with adding some gain) so this should not be an inconvenience.

Once you put ground back together it should be simple to see two shunts can do the job: one measuring current into the storage device, and another measuring current out of that device.

THe "SHUNT 1" in your circuit is a high side shunt.This is basically a high side vs a low side shunt.Both have their advantages and disadvantages.

Low side shunts are easy to implement, you can measure the voltage using a simple low cost single ended opamp.,of course adding any resistance in the ground path will add noises to the measured voltage.
High side shunts require differential opamps at the very least or even instrumentation amplifiers to measure the differential voltage which can be costly at times. But it virtually eliminates the ground noises if there are any.

Low side shunts cannot sense a short between load connection and ground.
Similarly high side shunt cannot sense a short between supply voltage and ground.

Further ,in case of high side shunt,if the drop across the shunt is very low ,the common mode voltage error can be a serious issue.
Low side shunts virtually eliminate common mode voltage error.

#### ErnieM

Joined Apr 24, 2011
8,355
ak52: Shunt 1 and 2 are both high side shunts. Google "hi side current monitor". These are a series of dedicated amplifier chips ready made to transition high side shunt resistor of low value to a "ground referenced" voltage while amplifying the signal. As you connect and define the "ground" or zero volt reference they are quite immune to wiring resistance errors.
It is the preferred way to go. Hey, either way you need an amplifier there, might as well do it the safest way that also respects legal code requirements.

#### MikeML

Joined Oct 2, 2009
5,444
ErnieM:

You haven't convinced me that:

A: that either the positive wire or negative wire from a 50V solar panel needs to have a direct copper wire connection to a ground rod. I do believe that it would be good practice to bond the metallic frame of said solar array to earth ground for lightning protection.

B: that even if A was a requirement, you cant put a 1mΩ or 10mΩ shunt in-series with the wire going to the ground rod.

C. that even if A was a requirement, that the combined resistance to earth ground of the bonding path wouldn't naturally be much higher than 1mΩ or even 10mΩ.