• Stars
    star
    1,011
  • Rank 45,471 (Top 0.9 %)
  • Language
    C++
  • License
    GNU General Publi...
  • Created almost 2 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This software enables EV battery packs to be used for stationary storage in combination with solar inverters.

BYD-Battery-Emulator-For-Gen24 โšก๐Ÿ”‹

This software enables EV battery packs to be used for stationary storage in combination with solar inverters. It achieves this by converting EV battery CAN data into Modbus RTU registers, that emulate a BYD 11kWh HVM battery. This makes it extremely easy to use EV batteries in a true plug'n'play fashion.

alt text

Hardware requirements ๐Ÿ“œ

This code fits on the LilyGo ESP32 T-CAN485 devboard , see https://github.com/Xinyuan-LilyGO/T-CAN485

You will also need a complete EV battery. See the battery compability list on which are supported.

Finally, you will need a hybrid solar inverter that accepts the BYD battery communication standard, for example the Fronius Gen24

Installation basics ๐Ÿช›

  1. Connect one end of the LilyGo RS485 to the Gen24 Modbus
  2. Connect the other end of the LilyGo to the CAN side of the battery
  3. Wire up high voltage cable between the Gen24 and the battery
  4. Add a 12V power source to power the LilyGo and the battery (uninterruptible PSU or 12V lead acid recommended in parallel)
  5. Some batteries need manual pre-charge circuit and positive/negative contactor control. Others are automatic. See the wiki for more info.
  6. Enjoy a big cheap grid connected battery!

Wiring example, LEAF battery ๐Ÿ’ก

Here's how to wire up the communication between the components. alt text

Here's how to connect the high voltage lines alt text

Here's how to wire up battery low voltage wiring alt text

For more examples showing wiring, see the Example#####.jpg pictures in the 'Images' folder https://github.com/dalathegreat/BYD-Battery-Emulator-For-Gen24/tree/main/Images

How to compile the software ๐Ÿ’ป

  1. Download the Arduino IDE: https://www.arduino.cc/en/software
  2. When the Arduino IDE has been started; Click "File" in the upper left corner -> Preferences -> Additional Development >Board Manager URL -> Enter the URL in the input box https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
  3. Go to "Boards Manager", and install the ESP32 package by Espressif Systems
  4. The arduino settings should be set to "ESP32 Dev Module" with the following settings; alt text
  5. Select which battery type you will use, along with other optional settings
  6. Press Verify and Upload to send the sketch to the board.

Dependencies ๐Ÿ“–

This code uses two libraries, ESP32-Arduino-CAN (https://github.com/miwagner/ESP32-Arduino-CAN/) slightly modified for this usecase, and the eModbus library (https://github.com/eModbus/eModbus). Both these are already located in the Software folder for an easy start.

It is also based on the info found in the following excellent repositories:

Like this project? ๐Ÿ’–

Leave a โญ If you think this project is useful. Consider hopping onto my Patreon to encourage more open-source projects!

More Repositories

1

Nissan-LEAF-Battery-Upgrade

Software and guides for upgrading LEAFs to bigger and newer batteries
C
91
star
2

Nissan-LEAF-Inverter-Upgrade

Software for extracting more power from LEAF inverter upgrades. Enables 110kW and 160kW inverters to function with the older LEAF
C
48
star
3

Nissan-LEAF-CCS

Information for how to add CCS to your LEAF, keeping it relevant for many years to come!
C
46
star
4

Nissan-Leaf-Battery-to-OBD2

An opensource solution for connecting OBD2 straight to the Nissan Leaf battery
40
star
5

Nissan-Leaf-ChargeCurrent

Software for adjusting AC charge speed on the Nissan Leaf
C
32
star
6

Nissan-Leaf-BatteryPairing

Commands for pairing batteries
24
star
7

Nissan-env200-Battery-Upgrade

Software for upgrading a 24kWh env200 to 40kWh with a Muxsan CAN-bridge
C
21
star
8

Nissan-Leaf-Bruteforce-Upgrade

Software for correcting instrumentation on a battery "bruteforce" upgraded LEAF
C
20
star
9

LeafEnhancer-UserManual

User manual for the LeafEnhancer software developed by Dala's EV Repair
19
star
10

Arduino-Coil-On-Plug

Source code for converting distributor based Nissan engines to more modern coil on plug ignition
Arduino
16
star
11

Nissan-Leaf-BatterySaver

Code that powers the BatterySaver feature
C
14
star
12

EV-CANlogs

Collection of CAN logs from different electric vehicles
13
star
13

BatteryUpgrade-UserManual

A guide for the BatteryUpgrade software, along with a list of all known defects in the conversion code
11
star
14

Nissan-Leaf-Aeromod-Grille

A 3d printable aeromod for your first gen Nissan Leaf (2011-2017)
6
star
15

Nissan-LEAF-PTC-heater-reverse-engineering

Tips and tricks on repairing the fragile ZE0 LEAF PTC heater
5
star
16

Arduino-Flex-Fuel

Arduino based flex fuel signal converter
Arduino
5
star
17

Nissan-LEAF-Battery-Downgrade

Information on how downgrading the battery on LEAF models work
C++
4
star
18

Arduino-Solar-Offgrid-Monitoring

'Arduino UNO' + 'Ethernet shield' offgrid solar battery monitoring system
Arduino
3
star
19

eGolf-aeromod

Front grille blocker for the Volkswagen eGolf
2
star