diy solar

diy solar

DIY Vendor agnostic Smart Shunt & Victron Smart Solar MPPT data logger based on ESP8266

All sounds good and progressing quickly :)

Personally, and this is just my preference and wariness of 'all-things-cloud' - and not intended as a 'design-input' as I'm unlikely to use your code, having already developed similar...

I'd far rather have a system that is totally self-contained, does not rely on Internet connectivity or other businesses computers. Who knows when the Internet goes down, signal lost if it's an RV / cabin / remote deployment. Not to mention any data gathering and monetisation of free cloud-based systems.

I'd also like to think that the frequency of needing to swap ESP devices is less than losing access to 'thingywhatsitcalled.io' or similar.

For my system, I have a spare ESP32 board (pre-loaded with the software) ready for a quick cold-swap in case of failure. The code is written so that data read from non volatile storage will load default values if that data was not found (as may happen with an ESP swap). e.g. like this...

#include <Preferences.h>
Preferences configData;
configData.begin("BMSESP", false);
...
// load stored configuration data from non-volatile storage
AllowOvernightDischarge = configData.getBool("AllowDis", false);
 
Yeah I don't see the point of having anything cloud-based involved when you're already writing code for a local device.
I know home assistant is not everyone's favorite but at least it's local and infinitely programmable if or when you figure out what you're doing with it.
This part is the most difficult for me because I am a very electro mechanical engineer and programming is absolutely a foreign language to me. I just cannot get the hang of it and it makes my brain hurt.
 
Yeah I don't see the point of having anything cloud-based involved when you're already writing code for a local device.
For me, "local" is off-grid and I am hunting every mW that drains my battery on overcasted days.
Every computer required on site -even a Raspberry Pi- is just too much drain.
So everybody has his own reasons...
 
Is your code public?
Much of my code is way too specific to be of general use, but the guts of it - that which would be of interest to others, including the VE.direct interface - uses the code from the thread on here that I shared in post #17, the direct GitHub link is this one...
I have also interfaced to the UART port of my (Overkill) JBD BMS, using this library..
 
Every computer required on site -even a Raspberry Pi- is just too much drain.
I'd assume that an ESP32 would be less, but I thought a Pi Pico or Pi Zero 2 or Orange Pi Zero were in the order of 1W consumption or less. Guess it will depend largely on how much processing is going on?
 
I'd assume that an ESP32 would be less, but I thought a Pi Pico or Pi Zero 2 or Orange Pi Zero were in the order of 1W consumption or less. Guess it will depend largely on how much processing is going on?
Even with the 2W of a Pi Zero 2 you can drain a 12V/100Ah battery in less than a week.
Running things like Home Assistant requires a full blown Linux, you won't put that on a Pi Pico.
An ESP8266 is <150mW.

Edit: by the way: I work also with Raspberry Pis, which run 24h/365days a year.
Exact today I had to replace a worn SD card. When you write permanently to EEPROM you get into trouble.
 
Last edited:
Do both? Local HTML page and push data to the cloud for remote monitoring, but with the code smart enough to not die if the internet or provider is down.

I'd like to not poke holes in my firewall to access my solar data.
 
Do both? Local HTML page and push data to the cloud for remote monitoring, but with the code smart enough to not die if the internet or provider is down.
That is how e.g. Drok-Juntek-on-Steroids work and Victron-VE-on Steroids will work too.
The code runs 100% on the ESP and Internet is only required for monitoring and saving variables that must survive a reboot.
Without internet, you have local control of the ESP over a Telnet command line interface, you have reports to monitor the device too.
 
Last edited:
So I needed some debugging to estimate the internal resistance, but now it seems solid.

What works:
- Framework / Network / Telnet / Telnet Menu / Telnet reporting
- Gathering data from VE-Direct
- Transform serial text into Float variables.
- Compute data not transmitted by Victron:
- Panel power (Estimated when not transmitted)
- Panel current
- Load power
- Gather battery internal resistance from variations of battery voltage/battery current.

What is in the pipeline:
- Coulomb integration
- Battery capacity (one full cycle without load current)
- Battery SOC (need input)

- Dashboards.
Code:
Here a Telnet example:
$ telnet 192.168.188.27
Trying 192.168.188.27...
Connected to victron-telnet.fritz.box.
Escape character is '^]'.

Snooze
V

Values Report
BatV:10.50 BatI:1.670 BatW: 17.53 PanV: 11.79 PanW: 17.53, LoadI 0.00, LoadW 0.00, IOhm 0.0025
BatV:10.50 BatI:1.690 BatW: 17.75 PanV: 11.47 PanW: 17.75, LoadI 0.00, LoadW 0.00, IOhm 0.0025
BatV:10.50 BatI:1.700 BatW: 17.85 PanV: 11.48 PanW: 17.85, LoadI 0.00, LoadW 0.00, IOhm 0.0025
BatV:10.50 BatI:1.700 BatW: 17.85 PanV: 11.48 PanW: 17.85, LoadI 0.00, LoadW 0.00, IOhm 0.0025
BatV:10.50 BatI:1.690 BatW: 17.75 PanV: 11.48 PanW: 17.75, LoadI 0.00, LoadW 0.00, IOhm 0.0025
BatV:10.50 BatI:1.690 BatW: 17.75 PanV: 11.48 PanW: 17.75, LoadI 0.00, LoadW 0.00, IOhm 0.0025
BatV:10.50 BatI:1.700 BatW: 17.85 PanV: 11.49 PanW: 17.85, LoadI 0.00, LoadW 0.00, IOhm 0.0025
BatV:10.50 BatI:1.670 BatW: 17.53 PanV: 11.79 PanW: 17.53, LoadI 0.00, LoadW 0.00, IOhm 0.0025
BatV:10.50 BatI:1.690 BatW: 17.75 PanV: 11.48 PanW: 17.75, LoadI 0.00, LoadW 0.00, IOhm 0.0025
BatV:10.50 BatI:1.670 BatW: 17.53 PanV: 11.77 PanW: 17.53, LoadI 0.00, LoadW 0.00, IOhm 0.0025
BatV:10.50 BatI:1.700 BatW: 17.85 PanV: 11.48 PanW: 17.85, LoadI 0.00, LoadW 0.00, IOhm 0.0025
BatV:10.50 BatI:1.670 BatW: 17.53 PanV: 11.79 PanW: 17.53, LoadI 0.00, LoadW 0.00, IOhm 0.0025
BatV:10.50 BatI:1.690 BatW: 17.75 PanV: 11.48 PanW: 17.75, LoadI 0.00, LoadW 0.00, IOhm 0.0025
BatV:10.50 BatI:1.670 BatW: 17.53 PanV: 11.79 PanW: 17.53, LoadI 0.00, LoadW 0.00, IOhm 0.0025
BatV:10.50 BatI:1.680 BatW: 17.64 PanV: 11.48 PanW: 17.64, LoadI 0.00, LoadW 0.00, IOhm 0.0025
BatV:10.50 BatI:1.670 BatW: 17.53 PanV: 11.79 PanW: 17.53, LoadI 0.00, LoadW 0.00, IOhm 0.0025
 

Snooze

After dinner I will update the code to Github.

The I will have to make a greater pause: visiting my old mother and later my children grand'children.
 
What’s the mating connector for connecting to the VE port? I’m going to need to order some.
 
What’s the mating connector for connecting to the VE port? I’m going to need to order some.
You may use "Grove" cables and cut away 0,5 mm from the two bottom flanges
But you can also -for the time being- use a female jumper strip, you only need one wire to the second pin from the left, when you feed the ESP from the battery over a 5V buck converter. Gnd comes from the battery.
 
Last edited:
What’s the mating connector for connecting to the VE port? I’m going to need to order some.
For the smart-shunt it's JST PH - assume same for other VE ports. See...

and
 
You may use "Grove" cables and cut away 0,5 mm from the two bottom flanges
But you can also -for the time being- use a female jumper strip, you only need one wire to the second pin from the left, when you feed the ESP from the battery over a 5V buck converter. Gnd comes from the battery.
Thanks, I have some Grove cables on hand. Looking forward to doing this. I have a Wyze camera looking at my Epever MT50 displays so I can monitor charge current from them remotely (only in real time) but no way to look at my Smart Shunt or 150/45 SCC remotely.
 
Thanks, I have some Grove cables on hand. Looking forward to doing this. I have a Wyze camera looking at my Epever MT50 displays so I can monitor charge current from them remotely (only in real time) but no way to look at my Smart Shunt or 150/45 SCC remotely.
What is your configuration?: Is the EpeverMT 50 and the Victron 150/45 + the Victron smart shunt on the same battery?
 
What is your configuration?: Is the EpeverMT 50 and the Victron 150/45 + the Victron smart shunt on the same battery?
2 Epever 4215bn, each with an MT50 display, and a Victron 150/45 SmartSolar MPPT. So 3 solar controllers, all attached in parallel to a 24V ~480AH battery pack.
 
Back
Top