diy solar

diy solar

DIY Battery via Smart shunt to inverter integration (Solis etc)

Excited to try the new but the first version (no UI) has been rock solid.
 
How do you use slow charging parameters? What are yours?
It seems anything I enter stops charging completely.

What does "divider" mean in this context?View attachment 214555
I’m not running the UI version but have it defined in code at 90% SOC it ‘divided’ to only charge with 20amps. At 95% SOC it sets charging at 5amps. Gives me a good amount of balance time.
 
I’m not running the UI version but have it defined in code at 90% SOC it ‘divided’ to only charge with 20amps. At 95% SOC it sets charging at 5amps. Gives me a good amount of balance time.
It must not be working. In the GUI version

Im charging at 50 amps currently.
if I put in 20 it stops charging
If I put in 2 it stops
if i put in 80 it stops.
If I populate both setpoints with corresponding values, it stops charging

I have tried decimals but it wont save.

No clue over here :!:~

Hmm, Ill try negative numbers
That didnt work either.
:)
 
It must not be working. In the GUI version

Im charging at 50 amps currently.
if I put in 20 it stops charging
If I put in 2 it stops
if i put in 80 it stops.
If I populate both setpoints with corresponding values, it stops charging

I have tried decimals but it wont save.

No clue over here :!:~

Hmm, Ill try negative numbers
That didnt work either.
:)
My battery is 200ah and defined in code that way. I need the look at the code in my config but here is the source from git. If I understand this, > 90% SOC 200ah/10=charge at 20a. If > 95% SOC 200ah/20=charge at 10a.


if (_battCapacity > 0 && _initialBattData){
if(_battSOC > 95)
_chargeCurrentmA = (_battCapacity / 20);
else if(_battSOC > 90)
_chargeCurrentmA = (_battCapacity / 10);
else
_chargeCurrentmA = _maxChargeCurrentmA;
}
 
My battery is 200ah and defined in code that way. I need the look at the code in my config but here is the source from git. If I understand this, > 90% SOC 200ah/10=charge at 20a. If > 95% SOC 200ah/20=charge at 10a.


if (_battCapacity > 0 && _initialBattData){
if(_battSOC > 95)
_chargeCurrentmA = (_battCapacity / 20);
else if(_battSOC > 90)
_chargeCurrentmA = (_battCapacity / 10);
else
_chargeCurrentmA = _maxChargeCurrentmA;
}
Yeah, that makes sense, but it doesnt work in the gui.
Ill try the code maybe this weekend.
 
ok to use the slow charging feature, you MUST set a battery capacity first of all.

Slow Charge SOC 1 has to be lower than 2.

Below is the example of configuration, I slow down charging at 90% and then again at 95%.

The divider number is by the battery capacity when the SOC is at or above the Slow Charge SOC number.

This has been running on my system for over 12 hours solid, am quite confident in it, but do make sure your running the stable or latest master.
Screenshot 2024-05-11 103303.png
 
Last edited:
I've changed the default partitions of the ESP32 devices to make more space for code.

Make sure your using the release v2 or latest master from the repo, if you don't know how to sync and pull down the changes then let me know and i'll post a how to.

If you have any issues, use the erase flash command in platformio menu and then flash firmware and the build filesystem image.

The build filesystem image is the html code, I may put this in the flash and take away the need for the 2 flashes as it was before i started to understand how you can server web files.
 
All stable now, been running for 24 hours without a hiccup. Just make sure you either use the release i've done 2.0.1 or sync your branch to master now.

P.S. also check out the wiki section on github as i've done a few pages to explain things.
 
Last edited:
Any feature that you think would suit the software, drop it in here and i'll see.

Added to the feature list is: Multiple probe temp monitors with control of fans forced cooling the inverter and heaters for the batteries.

Just an idea for your code when you add the temp monitors...

What I did with my code (which, as you know, was originally derived from yours) was to adjust the charge rate so it is not just based on SOC, but also dynamically based on temperature, in line with the datasheet for my EVE LF280K's. As mentioned here.


eve-lf280k-charge-vs-temperature-profile-png.121396


// otherwise, adjust charge rate depending on batt min temp and SOC
else if (_battTemp < 1)
{
// no charge if temp < 1 degree
chkCatChange(1);
CAN_SetChargeCurrent(0, "Battery temp < 1 degree");
//writeCriticalErrorLogStr("Warning: Charging stopped as battery temp < 1 degree");
}
else if (_battTemp <= 10)
{
if (_battSOC > 90)
{
// no charge over 90% if < 10 degrees
chkCatChange(2);
CAN_SetChargeCurrent(0, "Battery temp <= 10 degree AND battery SOC > 90%");
}
else if (_battSOC >= 70)
{
// if SOC between 70 and 90%; charge at range of 3.5A to 35A = 0.0125C to 0.125C from 1 degree to 10 degrees
// which is less than recommended allowance up to 0.2C at 10 degrees
chkCatChange(3);
CAN_SetChargeCurrent((_maxChargeCurrentmA / 20) * _battTemp, "Battery temp <= 10 degree AND battery SOC between 70% and 90%");
}
else
{
// if SOC < 70%; charge at range of 7A to 70A = 0.025C to 0.25C from 1 degree to 10 degrees
// which is less than recommended allowance up to 0.4C at 10 degrees
chkCatChange(4);
CAN_SetChargeCurrent((_maxChargeCurrentmA / 10) * _battTemp, "Battery temp < 10 degree AND battery SOC < 70%");
}
}
else
{
// battery temp within normal range (i.e. > 10 degrees)


Caveat: Hopefully that code works as designed. But as I also have battery heaters triggered by my code, the lowest temp they have reached is about 17C when it was -5C outside, so it's never been run in anger ;)

I also allow the Solis to "trickle charge" the battery pack up to a pre-defined but configurable max individual cell voltage (3.45V in my case) once the SOC is reported (from the BMS in my case, but from the Smartshunt in yours) as being 100%. This, I found, avoids any drift of the reported SOC the the actual SOC, makes sure a full charge is achieve and gives more balancing time. So what my code does is when it see 100% SOC reported, but cell voltage is below 3.4V, it sends the Solis a 99% SOC CANBus value and a charge rate of just 4A (=batt capacity with a slow charge divider of 70).
 
eve-lf280k-charge-vs-temperature-profile-png.121396



I also allow the Solis to "trickle charge" the battery pack up to a pre-defined but configurable max individual cell voltage (3.45V in my case) once the SOC is reported (from the BMS in my case, but from the Smartshunt in yours) as being 100%. This, I found, avoids any drift of the reported SOC the the actual SOC, makes sure a full charge is achieve and gives more balancing time. So what my code does is when it see 100% SOC reported, but cell voltage is below 3.4V, it sends the Solis a 99% SOC CANBus value and a charge rate of just 4A (=batt capacity with a slow charge divider of 70).
This is a reason for the adding of the Temp probes, but the battery temp would only be a feed for the MaxCurrent, the actual current would vary and reduce as battery voltage rises or falls.

Just to note the Solis has a minimum cut off, so if you go under i think 4a it just stops.

Also, Solis seems to have a restart of charging min of 96%, so if you hit 100 and then change to 99 it may ignore to charge again.
 
This is a reason for the adding of the Temp probes, but the battery temp would only be a feed for the MaxCurrent, the actual current would vary and reduce as battery voltage rises or falls.
(y) yes, I use SOC, temp and voltage as inputs to the charge current.

Just to note the Solis has a minimum cut off, so if you go under i think 4a it just stops.
LOL... yes... been there, done that... 2A doesn't work!

Also, Solis seems to have a restart of charging min of 96%, so if you hit 100 and then change to 99 it may ignore to charge again.
Interesting... maybe that is firmware-related though :unsure:. Our Solis has been switching between 99% and 100% SOC every 30 mins or so, all afternoon.
 
Interesting... maybe that is firmware-related though :unsure:. Our Solis has been switching between 99% and 100% SOC every 30 mins or so, all afternoon.
I think it's following the Pylontech spec, with Pylontech protocol, it says the inverter shouldn't restart charging until under 97%.
 
So, is V2 ready for primetime, I honestly have not had time to look further into it. I would love to try it out on my EG4 6000xp in the next few weeks.
 
So, is V2 ready for primetime, I honestly have not had time to look further into it. I would love to try it out on my EG4 6000xp in the next few weeks.
Am running it "as production", but obviously I also change mine to test new features, so it's currently running master with some changes to the LCD display code - it did have display support in it originally but for the M5 stack devices.

The master branch and tagged release are currently in a working state and my plan is to do tagged releases with firmware files to download and then just flash using the built in ota updater than having to compile the code and upload yourself, that was why i went with using the flash storage for configuration.

If you keep the original source on your pc and then flash the new, if it doesn't work then you can always go back.

Very minor bugs at moment, like the mqtt param setting doesn't do anything and the loop times are hardcoded, i'll sort them once i've got the LCD working the way I want it.

The LCD support should lead to a system that can be pre-made and sold for people who want an off the shelf solution.

Any issues should be logged on the github page so i can go through it, sometimes lose them in a thread of comments so please do use that to log anything.
 
Last edited:
Start up screen, as everything connects it changes to OK, once all OK it changes to Run Time screen.

1000010686.jpg

Run time screen, couple of bugs in it, the battery current part puts 2 AA's in certain scenarios and the top corner is meant to be a flashing heart beat. Random V at the bottom, not sure where that comes from!

Need to implement a enable/disable feature for lcd support as if you don't have it connected it hangs the start up for a while waiting for the lcd response.

1000010685.jpg
We're getting there tho!
 
Few random things...

1) Now I can't spot your threads easily from your smiling face, with the new avatar :(

2) Flashy new graphic, but for LiFePO4 shouldn't it be like this ;)

Capture.PNG

Random V at the bottom, not sure where that comes from!

3) I found those LCD screen do a funny wrap-around if you inadvertently write more than 20 chars on one line. So, I'm guessing here, but I suspect the "V" is the V from the end of the SOC / BV line (line 2) when the SOC goes to 100% and the final V gets pushed into character 21 position.

4) And finally, just an idea... I found it useful on my 20 x 4 LCD screen to be able to show more info (like IP address that you have on the flash screen) and, when you get round to it, temperatures etc. So I hooked up a button press that allows the LCD to be cycled around different screens.
 
Few random things...

1) Now I can't spot your threads easily from your smiling face, with the new avatar :(
But now you don't have to look at my face! it's an improvement.....
2) Flashy new graphic, but for LiFePO4 shouldn't it be like this ;)

View attachment 215942
Well, probably right but i went with what the AI generated, am happy to receive your contribution......
3) I found those LCD screen do a funny wrap-around if you inadvertently write more than 20 chars on one line. So, I'm guessing here, but I suspect the "V" is the V from the end of the SOC / BV line (line 2) when the SOC goes to 100% and the final V gets pushed into character 21 position.
Yeah it's from the second line, wraps to 4th, it's bizarre in that jumps, the SOC hasn't been at 100% and nothing would have pushed it either, but am going to change it anyway, just toying with the layout.
4) And finally, just an idea... I found it useful on my 20 x 4 LCD screen to be able to show more info (like IP address that you have on the flash screen) and, when you get round to it, temperatures etc. So I hooked up a button press that allows the LCD to be cycled around different screens.
If something goes down it changes to the start up screen to show the problem, but you don't need the IP address really, I implemented MDNS, so you just go to hostname.local and the webpage appears, can send you the code if you want, it's easy.
 
Last edited:
@SeaGal Just ordered a Raspberry Pi 5 to do my own emoncms logging, stopped doing it some years ago but decided to do it again, Home Assistant isn't really working well to be a logger with the amount of data am generating.
 
@SeaGal Just ordered a Raspberry Pi 5 to do my own emoncms logging, stopped doing it some years ago but decided to do it again, Home Assistant isn't really working well to be a logger with the amount of data am generating.
(y) love my Pi 5 which I picked up late last year. Am using it for some processing of Acrel power meter data and also for extracting RS485 COM data from my Solises (or should that be Soles?); that's based on @peufeu's Grugbus code - worth checking that out if you want to get data to and from your Solis :)

I also use emoncms for logging, though that is using the inbuilt Pi that came with the emonPi energy monitor.
 

diy solar

diy solar
Back
Top