Shunt configuration SBMS0 versus SBMS60

21 views
Skip to first unread message

Dave Festing

unread,
Dec 21, 2025, 12:47:48 AM (4 days ago) Dec 21
to electrodacus
Hi Dacian,

I know how the shunts are configured for the SBMS0 as you provide a nice diagram.  For the older SBMS60 I am guessing that it is different, IE a PV shunt plus a Load shunt.  Looking at SBMS60v1.0manual.pdf I don't see the shunts.

I finally realised after using the SBMS0 for about the last 5 years that my logging program should have been updated to reflect that change.  Correct?

Thank you,
Dave 

  

Dacian Todea (electrodacus)

unread,
Dec 21, 2025, 12:50:53 PM (4 days ago) Dec 21
to electrodacus
Dave,

The logging program will see 4 possible currents

PV1 -  For SBMS60 the PV1 shunt is build in so internal and for SBMS0 an external current shunt is needed
PV2 -  For SBMS60 the PV2 shunt is build in so internal the SBMS0 has no PV2 shunt option
Battery - For SBMS60 the battery shunt is build in so internal while for SBMS0 you need an external current shunt.
External Load - For SBMS60 that is an external option can measure just current flow in one direction so just loads could be connected there not chargers.

So SBMS0 has just Battery current shunt (external as opposed to internal on SBMS60) and PV1 (also external vs internal).
I do not think anything would have needed to be changed in a logging program.

Dave Festing

unread,
Dec 21, 2025, 2:38:37 PM (4 days ago) Dec 21
to electrodacus
I think my problem was that from my SBMS60 days that I had incorrectly thought it was a load shunt not a battery shunt.

So, my external logging program has always been incorrect.

Calculating load power from the battery and PV current readings is not a one-liner.

I am still testing this code:

        # need to determine if current is going into or out of the battery
        if PV_current <= 0:
            Load_current = abs(Battery_current) 
        elif PV_current > 0:
            if Battery_current <= 0:
                Load_current = PV_current + abs(Battery_current)
            elif Battery_current > 0:
                Load_current = PV_current - abs(Battery_current)

Dacian Todea (electrodacus)

unread,
Dec 21, 2025, 4:12:56 PM (4 days ago) Dec 21
to electrodacus
SBMS0 has just two shunts one measures battery current and the other PV current.
SBMS60 had 3 build in shunts measuring PV1, PV2 and battery current and an external shunt measuring an external Load (that was unidirectional so can only measure a load).

Yes Load as calculated internally by the SBMS0 is done as the difference between the battery current and PV current.  This only works correctly if your only charge source is PV solar.
Code seems correct 

      # need to determine if current is going into or out of the battery

        if PV_current <= 0:
            Load_current = abs(Battery_current) 
        elif PV_current > 0:     (else should be sufficient here)

            if Battery_current <= 0:
                Load_current = PV_current + abs(Battery_current)
            elif Battery_current > 0:
                Load_current = PV_current - abs(Battery_current)  (you already know that Battery_current is positive no need for abs function).

Gemini has suggested this simpler two lines of code

Load_current = PV_current - Battery_current
Load_current = max(0, Load_current)

I do not write in python but I think this is correct.

Case 1
PV_current = 40A
Battery_current = +30A
Load_current = 40 - 30 = 10A  (correct)

Case 2
PV_current = 40A
Battery_current = -30A
Load_current = 40 - (-30) = +70A  (correct)

Case 3 
PV_current = 40A
Battery_current = +50A
Load_current = 40 - 50 = -10A  I think this Load_current = max(0, Load_current) will not allow negative value so result will be 0A and is so then it is (correct)

Dave Festing

unread,
Dec 21, 2025, 6:34:32 PM (4 days ago) Dec 21
to electrodacus
Correct on your two comments.  I think for:

if Battery_current <= 0:
                Load_current = PV_current + abs(Battery_current)
you can say:
                Load_current = PV_current - a negative Battery_current 

Subtracting a negative number just didn't look right!

Your Case 3 says that it has come up with an incorrect answer. 

Dacian Todea (electrodacus)

unread,
Dec 21, 2025, 6:59:06 PM (4 days ago) Dec 21
to electrodacus
Case 3 will give the correct answer Load_current = 0A that is what the second line of code will do.
So use that two line code as it will provide the correct result in all conditions and is much simpler. 

Dave Festing

unread,
Dec 21, 2025, 7:04:07 PM (4 days ago) Dec 21
to electrodacus
Ah, now I see you can't have a negative load current :)
Reply all
Reply to author
Forward
0 new messages