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.
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 compatible hybrid solar inverter, for example the "Fronius Gen24" or "GoodWe ET"
Here's how to wire up the communication between the components.
Here's how to connect the high voltage lines
For more examples showing wiring, see each battery types own Wiki page. For instance the Nissan LEAF page
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.Tools
menu -> Board: "...."
-> Boards Manager...
, install the esp32
package by Espressif Systems
(not Arduino ESP32 Boards
), then press Close
.NOTE: The version depends on which release of Battery-Emulator you are running!
ESP32 Dev Module
(under Tools
-> Board
-> ESP32 Arduino
) with the following settings:
USER_SETTINGS.h
file.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_macosNOTE: If you see garbled messages on the serial console, change the serial console to match the baud rate to the code, currently 115200.
This video explains all the above mentioned steps: https://youtu.be/_mH2AjnAjDk
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
This code uses the following excellent libraries:
It is also based on the information found in the following excellent repositories/websites:
Leave a β If you think this project is useful. Consider hopping onto my Patreon to encourage more open-source projects!