A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

Battery-Emulator

This software enables EV battery packs to be used for stationary storage in combination with solar inverters.
https://github.com/dalathegreat/battery-emulator

Category: Energy Storage
Sub Category: Battery

Keywords from Contributors

transforms observation archiving measur profiles optimize token meshing mock projection

Last synced: about 18 hours ago
JSON representation

Repository metadata

This revolutionary software enables EV battery packs to be easily reused for stationary storage in combination with solar inverters

README.md

Battery-Emulator โšก๐Ÿ”‹

GitHub release (with filter)
GitHub Repo stars
GitHub forks
GitHub actions
Static Badge

This software enables EV battery packs to be used for stationary storage. It achieves this by converting the EV battery CAN data into a brand battery format that solar inverters can understand. This makes it extremely cheap and easy to use large EV batteries in a true plug'n'play fashion!

[!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.

Fronius

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 compatibility list on which are supported.

Finally, you will need a compatible hybrid solar inverter, for example the "Fronius Gen24" or "GoodWe ET"

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 5-12V power source to power the LilyGo and 12V to 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.
Wiring

Here's how to connect the high voltage lines
HighVoltageWiring

For more examples showing wiring, see each battery types own Wiki page. For instance the Nissan LEAF page

How to compile the software ๐Ÿ’ป

Start by watching this quickstart guide

IMAGE ALT TEXT HERE

  1. Download the Arduino IDE: https://www.arduino.cc/en/software
  2. Open the Arduino IDE.
  3. Click File menu -> Preferences -> Additional Development -> Additional Board Manager URLs -> Enter the URL in the input box: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json and click OK.
  4. Click Tools menu -> Board: "...." -> Boards Manager..., install the esp32 package by Espressif Systems (not Arduino ESP32 Boards), then press Close.

NOTE: The ESP32 version depends on which release of Battery-Emulator you are running!

  • โš ๏ธ Make sure to use a 2.x.x version if you are on a release older than 6.0.0 (For instance ESP32 v2.0.11 when using Battery-Emulator v5.4.0)
  • โš ๏ธ Make sure to use a 3.0.x version if you are on a release newer than 6.0.0 (For instance ESP32 v3.0.0 when using Battery-Emulator v6.0.0)
  • โš ๏ธ Make sure to use a 3.1.x version if you are on a release newer than 8.0.0 (For instance ESP32 v3.1.0 when using Battery-Emulator v8.0.0)

bild

  1. The Arduino board should be set to ESP32 Dev Module and Partition Scheme to Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) (under Tools -> Board -> ESP32 Arduino) with the following settings:

ArduinoSettings

  1. Select which battery type you will use, along with other optional settings. This is done in the USER_SETTINGS.h file.
  2. Copy the USER_SECRETS.TEMPLATE.h file to USER_SECRETS.h and update connectivity settings inside this file.
  3. Press Verify and Upload to send the sketch to the board.
    NOTE: In some cases, the LilyGo must be powered through the main power connector instead of USB-C
    when performing the initial firmware upload.
    NOTE: On Mac, the following USB driver may need to be installed: https://github.com/WCHSoftGroup/ch34xser_macos

NOTE: If you see garbled messages on the serial console, change the serial console to match the baud rate to the code, currently 115200.

NOTE: If you see the error Sketch too big then check you set the Partition Scheme above correctly.

This video explains all the above mentioned steps:
https://youtu.be/_mH2AjnAjDk

Linux Development Environment Setup

In addition to the steps above, ESP32 requires a dependency for a Python module, pyserial install using the cli.
python3 -m pip install pyserial

If you're using Ubuntu , use apt to manage the dependencies of arduino:
pyserial install: sudo apt install python3-serial

Arduino AppImage must be set as executable after downloading to run correctly
example: chmod 775 arduino-ide_2.3.3_Linux_64bit.AppImage

Also you might need to install FUSE to run appimages
sudo apt install libfuse2

Dependencies ๐Ÿ“–

This code uses the following excellent libraries:

It is also based on the information found in the following excellent repositories/websites:

Like this project? ๐Ÿ’–

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


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 7 days ago

Total Commits: 2,091
Total Committers: 51
Avg Commits per committer: 41.0
Development Distribution Score (DDS): 0.387

Commits in past year: 1,347
Committers in past year: 42
Avg Commits per committer in past year: 32.071
Development Distribution Score (DDS) in past year: 0.448

Name Email Commits
Daniel ร–ster d****t@g****m 1281
Cabooman 8****n 101
amarofarinha 1****a 89
lenvm l****m 79
mvgalen m****n@g****m 72
josiahhiggs 7****s 55
rha r****o@o****g 48
wjcloudy 5****y 34
Brett Christensen b****n@r****m 33
Jakob Lรถw j****b@m****e 30
laughingguffly e****m@g****m 27
No-Signal m****t@h****d 25
Steven Maresca s****a@g****m 23
LevinSwe l****m@h****m 21
nmainil 1****l 20
Ole o****d@l****k 18
Christopher Obbard o****c@g****m 15
Bernhard Urban-Forster l****m@g****m 13
rjsc r****t@g****m 13
itpr-gwis2 b****2@i****e 9
pre-commit-ci[bot] 6****] 8
Paul Brand p****d@g****m 8
Jรณzsef Nagy 1****o 7
James Brookes jb@j****m 5
Jamie Jones j****e@j****k 5
mathl79 m****l@g****t 4
JorgenSeemann 8****n 4
Brian McKenna b****n@b****g 3
Bryant Eadon b****n@g****m 3
ilia i****2@m****g 3
and 21 more...

Committer domains:


Issue and Pull Request metadata

Last synced: 2 days ago

Total issues: 429
Total pull requests: 710
Average time to close issues: about 2 months
Average time to close pull requests: 4 days
Total issue authors: 180
Total pull request authors: 42
Average comments per issue: 3.88
Average comments per pull request: 0.79
Merged pull request: 619
Bot issues: 0
Bot pull requests: 1

Past year issues: 345
Past year pull requests: 494
Past year average time to close issues: about 1 month
Past year average time to close pull requests: 4 days
Past year issue authors: 149
Past year pull request authors: 37
Past year average comments per issue: 2.92
Past year average comments per pull request: 0.95
Past year merged pull request: 413
Past year bot issues: 0
Past year bot pull requests: 1

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/dalathegreat/battery-emulator

Top Issue Authors

  • dalathegreat (39)
  • havrla (12)
  • GoSmartEV (10)
  • StarkJohan (9)
  • malcolmputer (9)
  • pazdzierzz (9)
  • DeadmaroZ-TLOTL (6)
  • obbardc (6)
  • dvbhannes (6)
  • EnergibatteriMax (6)
  • Jaywatts (6)
  • pmajor021 (6)
  • lenvm (5)
  • bubble07 (5)
  • jakub8109 (5)

Top Pull Request Authors

  • dalathegreat (400)
  • lenvm (67)
  • amarofarinha (41)
  • mvgalen (28)
  • StarkJohan (21)
  • No-Signal (14)
  • wjcloudy (13)
  • LevinSwe (11)
  • rjsc (10)
  • kukumagi (10)
  • obbardc (10)
  • josiahhiggs (7)
  • M4GNV5 (6)
  • gwk1 (6)
  • matvey83 (6)

Top Issue Labels

  • Feature request (104)
  • bug (93)
  • question (48)
  • Troubleshooting install (42)
  • enhancement (37)
  • help wanted (16)
  • Connectivity (11)
  • hardware (8)
  • crash (8)
  • wontfix (6)
  • Triage (6)
  • invalid (3)
  • good first issue (2)
  • dependencies (2)
  • documentation (1)

Top Pull Request Labels

  • enhancement (6)
  • help wanted (2)
  • hardware (2)
  • bug (2)

Dependencies

.github/workflows/compile-arduino-sketch.yml actions
  • actions/checkout v4 composite
  • arduino/compile-sketches v1 composite

Score: 11.29447090314215