100%
bms-and-offgrid-photovoltaic-management-system Balancer view
Description

Imported from GitHub: kwiecinski/BMS-and-offgrid-photovoltaic-management-system · commit ed01914 · license MIT

Description

Project contains BMS for lead-acid batteries and ESP-based board used to pull information from EASUN offgrid inverter, energy meters and sensors. It show informations od displays and use ESPhome to send it to Home Assistant..

README

Offgrid Photovoltaic Management System

Project contains:

A. Power and mechanical part:

  1. Photovoltaic modules
  2. Concrete base mounting
  3. Metalworking and welding mounting bases and angle bar
  4. Painting mounting base, angle bars and perforated profiles
  5. PV mountings to perforated profiles
  6. Assembly of PV installation
  7. Fully assembled PV installation
  8. Underground Cable Installation and Connection to the Building

B. EASUN inverter - description, installation schematic and wiring

C. Managemenet system part:

  • BMS for lead-acid batteries - equalize battery, protect from large charge/discharge currents, montors battery state (temp, voltage)
  • ESP32 Master module - it communicate with EASUN converter, BMS, Homa Assistant, Energy Meters and sensor. Supervise all system work propertly.
  • Home Assistant integration - integrate ESP Master module with HA for easy and compact managment (local and remote access)
  • Power Tracking module - it is used to regulate heater power accordingly to avaible energy from PV

PV panels connection and DIY Ground Mount structure

1. Photovoltaic modules

The photovoltaic modules I used in my PV installation are Trina Solar TSM-245. These are used panels that I purchased for around $40 each. The installation consists of 8 modules connected in series.

📄 Trina Solar TSM-245 datasheet

The first stage was marking the mounting points for the mouting base structure. The entire construction has eight support points. After digging holes in the ground, they were filled with concrete, and concrete bases with reinforcement were embedded in them. I had plenty of these as production waste from the company where I work. They are typically used for mounting lightning protection masts on flat building roofs.

Inside each base, there is reinforcement and four M16 threads. I modified the bases by drilling holes on the opposite side, and I welded additional reinforcement to the bottom using scrap metal, which helps to improve the structural stability.

Before mounting the structure to the concrete bases, the contact surfaces were coated with a bituminous compound to prevent corrosion.

2. Concrete base mounting

Visible in the photo below is a set of four steel mounting bases of varying heights, with welded pipes and mounting plates. Each element was made with consideration for uneven ground, that is why there are different pipe lengths. Each base has a bottom plate with holes for M16 bolts, intended for anchoring to a concrete base. On the table next to them lies a long steel angle bar, which was welded from several sections. After welding, the elements were ground down. The photo was taken after the mechanical work was completed, during surface preparation for painting. All the steel used for building the PV mouting structure comes from scrap yard.

3. Metalworking and welding mounting bases and angle bar

Longer mounting base are responsible for the solar incidence angle which in this case is 40 degrees

4. Painting mounting base, angle bars and perforated profiles

5. PV Mountings to perforated profiles

6. Assembly of PV installation

7. Fully assembled PV installation

8. Underground Cable Installation and Connection to the Building

To connect the panels, I used AsXSn 4x35 cable and additionally laid an AsXSn 4x25 cable. I found these cables at a scrapyard at a good price, which is why I chose this somewhat unconventional option. Additionally, I installed a gel-filled Ethernet twisted pair cable to allow for potential data transmission if needed.

To connect the AROT 50 (blue) protective pipe with the RL50 pipe (white), I created an adapter using a 3D printer. PETG material was chosen for its weather resistance. The opening in adapter was designed to fit the protective pipe only after heating the adapter. Once cooled, the adapter holds the pipe in place.

EASUN inverter - Description, installation and wiring

📄 EASUN ISolar SMG II 4kW datasheet The EASUN ISolar SMG II 4kW is an off-grid inverter. It does not have the capability to synchronize with the power grid.

Inverter specifications:

  • Input voltage from PV array: 60-500V DC
  • Input current from PV array: 15A
  • Output voltage: 230V/50Hz
  • Battery voltage: 24V
  • Battery current: max 100A

In my case, 12 PV were connected, each with a maximum voltage of 37V, resulting in a maximum voltage of approximately 440V.

The maximum current of the PV array is 8A.
Connected PV array meet the inverter's specifications.

Power Source Priority

OptionDescription
SOLThe inverter uses solar energy to power the loads. If solar energy is insufficient to meet the load demand, the battery only supplements the power. The grid supplies power to the loads only when: Solar energy is unavailable (e.g., at night or during heavy cloud cover). Battery voltage drops to the low-level warning voltage or the threshold set in Program 12.
UFIUtility will provide power to the loads as first priority. Solar and battery energy will provide power to the loads only when utility power is notavailable.
SBUThe inverter uses solar energy to power the loads. If solar energy is insufficient, the battery provides power to the loads.​ The grid supplies power to the loads only when the battery voltage drops to the low-level warning voltage or the threshold set in Program 12.
SUBSolar energy is charged first and then power to the loads. If solar energy is not sufficient to power all connected loads, Utility energy will supply power to the loads at the same time. Attention: I found that there is an idle power (about 150W) that must be drawn from the grid before parallel operation of the grid + solar energy can occur. This means that if the power consumption is up to 150W, it will not be supplied by solar energy but by the grid. If power consumption is over 150W eg. 500W then 350W will we drawn from solar and still 150W will be drawn from grid.

Key Differences between SOL and SBU is battery usage:

SOL Mode: The battery assists only when solar energy is insufficient, and the grid is used if both solar and battery cannot meet the load.

SBU Mode: The battery is used after solar, and the grid is used only when the battery is depleted.​

Management System diagram:

BMS for lead-acid batteries

BMS have several tasks:

  • Battery Balancer equalizes the state of charge of two series connected 12V batteries. If one of battery is overcharged it discharge it using resistor.
  • Bidirectional DC-DC converter - protect battery from too much discharge or charge current
  • Battery monitoring - measurment of temperature of each battery and voltage.

The BMS is controlled by an AVR64DD28 microcontroller. To program it, you need a programmer that supports UPDI. I'm using SerialUPDI (a modified version with high-voltage programming capability and galvanic isolation, which you can find here: SerialUPDI link).

To measure battery voltage and current, I use the INA226 sensor along with the built-in ADC of the microcontroller.

The INA226 measures:

  • The voltage of the entire battery pack, split into BATT_LOW (bottom battery) and BATT_HIGH (top battery)

  • The voltage across a shunt resistor, used to measure the current flowing through the entire pack

Since the INA226 is bidirectional, it allows both charging and discharging current measurements.

The microcontroller’s ADC measures only BATT_LOW voltage. By subtracting the ADC reading from the INA226’s total voltage reading, I can calculate the BATT_HIGH voltage.

Cell balancing is performed using high-power resistors, each connected in parallel with a battery cell. Each resistor is switched by a MOSFET, which is controlled by the MCU using PWM.

PWM is hardware-generated using the TCD timer, which controls two outputs: WOA and WOB, each assigned to a specific MCU pin.

The TCD timer is capable of generating...

ESP32 Master module

Home Assistant integration

Power Tracking module

Comments
Sign in to comment

No comments yet. Be the first to ask about this board.