Inverter: SMA Sunny Boy Storage - dalathegreat/Battery-Emulator GitHub Wiki

[!CAUTION] Working with high voltage is dangerous. Always follow local laws and regulations regarding high voltage work. If you are unsure about the rules in your country, consult a licensed electrician for more information.

Compatible SMA inverters

  • Sunny Boy Storage 2.5 (SBS-2.5) :heavy_check_mark:
  • Sunny Boy Storage 3.7 (SBS-3.7) :heavy_check_mark:
  • Sunny Boy Storage 5.0 (SBS-5.0) :heavy_check_mark:
  • Sunny Boy Storage 6.0 (SBS-6.0) :heavy_check_mark:

Word of caution, isolated CAN ⚠️

This inverter does not handle a CAN connected EV battery on the same channel. If the inverter, which likes to see only BYD CAN frames, sees standard automotive CAN frames, the inverter will enter a fault state.

This can be solved in several ways:

Keep in mind that you will also need automated contactor control via GPIO, or a battery that has CAN controllable on/off contactors. This is due to a complicated pairing process when taking the battery in to use, when the inverter will command on/off the battery in order to succeed with pairing.

[!NOTE]
The inverter contains a 120 Ohm terminating resistor on CAN-H/L pins

[!IMPORTANT]
Grounding is extremely important for all inverters. Make sure the battery case is connected to protective earth, and the shield part of the twisted pair CAN is connected to PE also! Failing to do this will result in CAN errors.

Connecting the Enable pin from Inverter to Battery-Emulator

The inverter needs to be able to control the closing of the contactors. This is done via a signal, called the enable line. This Enable line is connected to GPIO 5 on the LilyGo board. Due to the signal being 12V, we need to step it down to 3.3V that the Battery-Emulator uses on its GPIO pins.

This stepdown can be achieved with a resistor divider

image

The 1k resistor isn't technically needed but just in case there's a short it would limit the current into the LilyGo pin

This is how the SBS should be connected to the lily/stark hardware image

Compiling the software for SMA Sunny Boy Storage inverters

Make sure that the settings in the "USER_SETTINGS.h" file are correct. The line:

#define BYD_SMA //Enable this line to emulate a SMA compatible "BYD Battery-Box HVS 10.2KW battery" over CAN bus

Needs to be uncommented for the software to emulate the SMA specific BYD H protocol over CAN. Next step is then to select the battery that you intend to use, for instance if you use LEAF battery, make sure the following line is uncommented:

#define BATTERY_TYPE_LEAF // See NISSAN-LEAF-BATTERY.h for more LEAF battery settings

Also, Contactor control is required to let the Battery-Emulator decide when to turn on/off the battery

#define CONTACTOR_CONTROL //Enable this line to have pins 25,32,33 handle automatic precharge/contactor+/contactor- closing sequence

The inverter needs to allow when to turn on the contactors for the pairing to work. Apart from contactor control needed via GPIO, one of the pins will need to be used as an input, and "Allow contactors to close" signal from the inverter, also called the Enable line. This Enable line is connected to GPIO 5 on the LilyGo board.

After setting this up, flash the board!

Inverter setup

You'll need the installer password (or buy PUK from SMA) for the web interface of the inverter.

Set battery type to "BYD Battery Box HVS"

Connect the Enable line and CAN communication to the Battery-Emulator. When starting the system and pairing, make sure the Inverter checkbox goes :heavy_check_mark: image

Let the pairing run until it completes. In worst case, it can take up to 20minutes for the pairing to complete. Once done, it will look like this:

image

Installation examples

Please feel free to add!