Skip to content
Daniel Öster edited this page Feb 5, 2025 · 235 revisions

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.

Welcome to the Battery-Emulator wiki!

Where do I get the hardware needed?

There are many hardware kits that can run the Battery-Emulator software. The cheapest and most common board is the LilyGo T-CAN485. For those that need more reliable hardware, here are some alternatives:

Product Product Link Notes
LilyGo T-CAN485 AliExpress Cheap!
Stark CMR Module Wiki page Professional HW, CE certified, Massive I/O
ESP32 Devkit V1 Wiki page For expert tinkerers
3LB Coming soon Open source triple-CAN

Note

There is no way to purchase a pre-programmed device. This is a hobbyist open source project. You will be responsible for loading the software and setting it up correctly for your components. There is however a support Discord group available.

Supported inverters list

The following solar inverters have support. Remember to double check that the voltage range of your inverter matches the battery you intend to use.

Vendor Product Name phases Supported Notes Battery voltage
Afore Afore AF17K-THA 230V 3 Good option for Norway IT 150–800V
Canadian Solar CSI-TE & CSI-HE & CSI-BHE Series ⚠️ Untested, works with HVS / HVM
Deye SUN-(5-20)K-SG01HP3-EU-AM2 3
Deye SUN-(29.9-50)K-SG01HP3-EU-BM3 3 Both BYD_CAN and PYLON_CAN work
Ferroamp EnergyHub 3 174-432V
FoxESS H1 FoxESS H1 1 Cannot co-exist on EV battery CAN channel. Needs its own CAN channel!
FoxESS H3 FoxESS H3 3 Cannot co-exist on EV battery CAN channel. Needs its own CAN channel!
Fronius Primo Gen24 Plus 1 150-455V
Fronius Symo Gen24 Plus 3 150-455V
Fronius Symo Hybrid 3.0/4.0/5.0-3-S 150-455V
GE GEH5.0/8.6/10-1U-10 1 GEH10 Tested. Made by GoodWe
GoodWe ET hybrid solar 3
GoodWe BT AC battery inverter 3
GoodWe EH hybrid solar 1
GoodWe BH AC battery inverter 1
GoodWe EHB hybrid inverter, South Africa only) 1
Growatt HV N/A ⚠️ Testing ongoing!
Growatt LV N/A ⚠️ Testing ongoing!
Huawei SUN2000 ❌ Requires DC/DC converter, NOT supported
Ingeteam STORAGE 1Play TL M (3-6 kW) 1
KACO Blueplanet hybrid 6.0- 10.0 TL3 3 ⚠️ Untested, works with HVS / HVM
Kostal Plenticore N/A RS485 120-650V
Schneider XW PRO ⚠️ Testing ongoing! 48V
SMA Sunny Boy Storage 2.5 / 3.7 / 5.0 / 6.0
SMA Sunny Island 4.4M / 6.0H / 8.0H ⚠️ Testing ongoing! 48V
SMA Sunny Tripower Smart 5.0-10.0 SE 3 150-600V
Sofar 5K...20KTL-3PH 3
SolaX X1 Hybrid 1 Cannot co-exist on EV battery CAN channel. Needs its own CAN channel! 80-480V
SolaX X3 Hybrid 3 Cannot co-exist on EV battery CAN channel. Needs its own CAN channel!
Solis RHI-3P(5-10)K-HVES-5G 3 ✅ / S6-EH1P10K-H-US-APST
Solis RHI-3P(5-10)K-HVES-5G 3 ✅ / S6-EH3P-(5-10.0K)-H-EU
Sungrow SH5.0/6.0/8.0/10RT 3 Some AU models not supported 150-600V
Sungrow SH3.0/3.6/4.0/5.0/6.0RS 1 Some AU models not supported 80-460V
VIESSMANN Hybrid Inverter 5.0/6.5/8.0/10.0 A-3 ⚠️ Untested, works with HVS / HVM

Supported batteries list

Be sure to checkout the installation guidelines section for how to install your battery. Amount of stars ⭐ signal how mature and stable the integration is.

  • ⭐ Works, but many values estimated or functionality missing. Expect manual tweaking to keep battery operational
  • ⭐⭐ Integration has minor known issues or missing features. Manual interventions sometimes required.
  • ⭐⭐⭐ Very well supported battery. Longterm stability confirmed without user interaction. Many success stories from users.
(Car) Manufacturer Product Name # kWh Supported Voltage range Notes
BMW BMW i3 (all sizes) 18/22/40 ✅ ( ⭐⭐⭐ ) 270-400V
BMW iX & i4-7 Platform 68 / 80.7 ✅ ( ⭐⭐ ) 270-464V Manual contactor control
BMW PHEV (330e/530e etc) 12/24 ⚠️ Testing ongoing (CAN logs wanted!) 270-400V Manual contactor control
BYD BYD Atto 3 / Yuan Plus 50/60 ✅ ( ⭐⭐ ) 380-440V
Chevrolet Bolt 64 ⚠️ Testing ongoing
Citroen C-Zero 16 ✅ ( ⭐ ) 310-370V
Citroen ë-C4 2020+ (Stellantis eCMP) ? ⚠️ integration started 320-450V
Hyundai E‐GMP platform 58.2/72.6/77.4 ⚠️ (Integration ongoing!) 430-806V SoC not updating, contactors not closing
Hyundai Kona 39/64kWh 39/64 ✅ ( ⭐⭐⭐ ) 230-410V*
Hyundai Kona Hybrid 2 ⚠️ Testing ongoing
Hyundai Santa Fe PHEV 14 ✅ ( ⭐⭐ ) 290-400V
Jaguar I-PACE 90 ⚠️ Testing ongoing
Kia e-Niro 39/64kWh 39/64 ✅ ( ⭐⭐⭐ ) 230-410V*
Kia Niro Hybrid 2/9 ⚠️ Testing ongoing
Kia EV6 ⚠️ Testing ongoing
Land Rover Land Rover ⚠️ Untested base added
Mitsubishi i-Miev 16 ✅ ( ⭐ ) 310-370V
Nissan Ariya 87/63 ⚠️ (CAN logs wanted!)
Nissan LEAF 24/30/40/62 ✅ ( ⭐⭐⭐ ) 300-400V
Nissan e-NV200 24/40 ✅ ( ⭐⭐⭐ ) 300-400V
Opel Ampera-e 64 ⚠️ Testing ongoing
Peugeot Ion 16 ✅ ( ⭐ ) 310-370V
Polestar 2 78 ✅ ( ⭐ ) 290-450V
Renault Kangoo 22/33 ✅ ( ⭐⭐ ) 300-400V
Renault Twizy 6.1 ⚠️ Testing ongoing 48V
Renault Zoe Gen1 22/41 ✅ ( ⭐⭐⭐ ) 300-400V
Renault Zoe Gen2 50 ✅ ( ⭐⭐ ) 300-400V
Tesla Model 3 & Y (all sizes) All ✅ ( ⭐ ) 280-400V
Tesla Model S & X (2020+) All ✅ ( ⭐ ) 310-460V
Volkswagen MEB Platform 48/55/61/82 ✅ ( ⭐ ) 252-450V* Requires extra precharge circuit
Volvo EX30 55/69 ⚠️ (CAN logs wanted!) 300-460V
Volvo XC40 78 ✅ ( ⭐ ) 290-450V

Other batteries

Supported chargers list (optional)

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

Shunts

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.

How do I make changes to CAN configuration?

For advanced setups where you add CAN channels, you will need to change which channel a component is connected to. This is done in the USER_SETTINGS.cpp file.

Example, you want to change which CAN channel the inverter is connected to, since you added an MCP2515 chip. We then change the line .inverter = CAN_NATIVE, into the correct interface, .inverter = CAN_ADDON_MCP2515,

Example 2, you want to change which interface the battery connects to, since it needs CAN-FD add-on. We then change the line .battery = CAN_NATIVE, into the correct interface, .battery = CANFD_NATIVE,

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

This section has been expanded and moved here

Note! CAN networks are vulnerable to lightning strikes. See the dedicated wiki page for this for more info 🌩️

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.

Tip

Be sure to checkout the installation guidelines section for how to install your battery

Caution

At the end of the day, you alone 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)

Important

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.

Tip

You can also add an equipment stop button to the Battery-Emulator, to increase the amount of safety.

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. See the Webserver page for more info on how to use the system

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/batteryemulator 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!

Clone this wiki locally