Skip to content
Daniel Öster edited this page Apr 26, 2024 · 110 revisions

Welcome to the Battery-Emulator wiki!

Where do I get the hardware?

Product Product Link
T-CAN485 AliExpress

Supported inverters list

The following solar inverters have support:

  • Fronius Primo Gen24 Plus ✅
  • Fronius Symo Gen24 Plus ✅
  • Fronius Symo Hybrid 3.0/4.0/5.0-3-S ✅
  • Sungrow SH5.0/6.0/8.0/10RT ✅ (some AU models not supported)
  • Sungrow SH3.0/3.6/4.0/5.0/6.0RS ✅ (some AU models not supported)
  • GoodWe ET/BT & EH/BH & EHB ✅
  • SolaX X1 Hybrid ✅ ⁉️ Not compatible with single CAN board. Needs double CAN to avoid having EV pack on same CAN channel.
  • SolaX X3 Hybrid ✅ ⁉️ Not compatible with single CAN board. Needs double CAN to avoid having EV pack on same CAN channel.
  • Ingeteam STORAGE 1Play TL M (3-6 kW) ✅
  • Deye SUN-(5-20)K-SG01HP3-EU-AM2 ✅
  • Deye SUN-(29.9-50)K-SG01HP3-EU-BM3 ✅ (Tested with BYD-CAN emulation and dual CAN/double Lilygo. May also work with RS485 by emulating BYD-Modbus)
  • FoxESS H1/H3⁉️ Not compatible with single CAN board. Needs double CAN to avoid having EV pack on same CAN channel.
  • Solis RHI-3P(5-10)K-HVES-5G ✅
  • Sofar 5K...20KTL-3PH ✅
  • SMA Sunny Boy Storage 2.5 / 3.7 / 5.0 / 6.0 ⚠️ (Protocol added "SMA H", testers welcome!)
  • Kostal Plenticore ⚠️ (Testers welcome!)
  • SMA Sunny Tripower Smart 5.0-10.0 SE ⚠️ (Protocol added "SMA Tripower", testers welcome!)
  • VIESSMANN Hybrid Inverter 5.0/6.5/8.0/10.0 A-3 ⚠️ (Untested, works with HVS / HVM)
  • KACO Blueplanet hybrid 6.0- 10.0 TL3 ⚠️ (Untested, works with HVS / HVM)
  • GE GEH5.0/8.6/10-1U-10 ⚠️ (Untested, works with HVS / HVM)
  • Canadian Solar CSI-TE & CSI-HE & CSI-BHE Series ⚠️ (Untested, works with HVS / HVM)
  • Huawei Sun2000 ⚠️ (Integration started 08/23)

*When using CAN inverter, remove the terminating resistor from the LilyGo board. See the CAN troubleshooting section for more info

Supported batteries list

The following EV batteries have support:

Supported chargers list (optional)

Emergency charging batteries via a generator, supported via the following standalone chargers:

How do I configure the software for my inverter?

All the changes to the software are done in the USER_SETTINGS.h file, located in the Software folder. At the top of this file, you can select which battery and which inverter protocol should be in use. If you are unsure which protocol you need, check the specific page for the inverter you are using linked here in the Wiki.

Status LED

The board has a built in LED that is used to signal current status. With this feature, it is easy to at a glance catch what info the board is getting. It will show the current colors:

  • Pulses 🟢 if all is well and BMS is active
  • Pulses 🔵 if CAN wires are disconnected, wrong polarity, or incorrect terminating resistor setup. Check wiring!
  • Pulses 🟡 if battery has entered a warning state
  • Solid 🔴 if battery goes into a fault state

CAN wiring troubleshooting

If you get a 🔵 blue LED on the board (or 🔴 red for BMS missing), you need to check the CAN wiring. Here are some basic tips:

  • Make sure all CAN devices are turned ON
  • Make sure the polarity of High/Low is correct. High goes to High, Low to Low
  • Make sure the terminating resistors are correct. CAN networks should have two 120 Ohm resistors in each end of the network. With everything OFF, you can measure resistance between CAN-H and CAN-L. The result should be 60 Ohm. If it shows 120 Ohm, one resistor is missing at an end. If it shows 40 Ohm, you have too many terminating resistors, and might need to remove the built in resistor on the LilyGo. RemoveThisWhenUsingCANinverter
  • Make sure the cable you are using is a twisted pair cable. This is important for signal quality.
  • Make sure the cable you are using is shielded. One side of the shield should be connected to a pin labelled SHIELD (or PE if no dedicated shield exists). This improves signal quality
  • Try a different powersupply for the board. Powering it via USB from a computer can cause noise on the signal output. Powerbank or phone charger might have cleaner voltage output. If you see CAN_TX_FAILURE occasionally your powersupply might be noisy

What about safety? ⚠️ ℹ️

Reusing old often crashed EV packs always comes with risks. The system performs a few safety functions for safer charging and discharging. Apart from this, the data sent to the Inverter is also processed on the inverter side, and depending on which inverter is used a few additional safety checks are performed there. Here is a list of all safety functionalities that are in the system. Note that almost all safety features rely on communication data, so a physical error (damaged cell casings, ruptured/leaking cells, corrosion etc.) wont be detectable via software. For this you need fuses, and periodic visual inspections. At the end of the day, you are responsible for the system.

Safety features run on inverter side:

  • Battery sends max total voltage allowed for charging. Incase this value is reached, inverter stops charging. (For instance 404V)
  • Battery sends min total voltage allowed for discharging. Incase this value is reached, inverter stops discharge (For instance 300V)
  • Battery sends max cell temperature. Incase this value goes too high, inverter stops charge/discharge (For instance 40*C)
  • Battery sends min cell temperature. Incase this value goes too low, inverter stops charge/discharge (For instance -15*C)
  • Battery sends max allowed charge in Watts. Incase this goes to 0W, no further charging is possible. (This can happen when battery is full)
  • Battery sends max allowed discharge in Watts. Incase this goes to 0W, no further discharge is possible. (This can happen when battery is completely empty)
  • Battery sends state of health %. Incase this value drops too low, the inverter will alert the user that it is time to recycle the battery.
  • Inverter analyzes insulation resistance of the battery connection. Incase a leakage to ground is detected, the system stops.

Safety features run on Battery-Emulator side:

  • If the code enters FAULT state, inverter gets notified, all charging/discharging stops, and contactors are opened (if they are controlled via GPIO pins).
  • If CAN communication is lost between emulator and battery for more than 60s, the code enters FAULT state.
  • Minimum cell voltage is sampled, and if one cell goes too low the code enters FAULT state. (For instance <2900mV)
  • Maximum cell voltage is sampled, and if one cell goes too high the code enters FAULT state. (For instance >4250mV)
  • Battery state of health % is sampled, if it is below 25% the code stops and informs the user that it is time to recycle the battery.
  • BMS fault codes are sampled, if any serious code is set, the code enters FAULT state (For instance LB_Failsafe_Status on Nissan LEAF packs)
  • High voltage wiring is unhooked during operation. This will trigger interlock messages, and the code enters FAULT state
  • Incase of a high voltage leak to battery casing (Protective earth), the code enters FAULT state (For instance LB_Failsafe_Status on Nissan LEAF packs)

Do note that all actual limits are battery/inverter specific, the values here are only used for example purposes. The amount of safeties will vary depending on your choice of battery.

Connectivity

The board has wifi, and supports running a Webserver that you can connect to for real time values, Over The Air updates (OTA), cellmonitoring, changing settings and more.

For those into home automation, the code also supports MQTT

Alternative hardware

There is also an excellent Raspberry Pi integration available here: https://gitlab.com/pelle8/gen24 This version focuses more on power users that want to experiment more than the LilyGo "Set and forget" solution does. Say you want to integrate charging only during certain hours, spotpricing etc., then the Raspberry Pi solution made by Per Carlen is the way to go! You can also use both hardware at the same time, use LilyGo for the control, and use Raspberry for additional statistic-gathering!