HI Guy's,
This is really awesome work.
Can I please please encourage you to use git hub, at the moment the links slothorpe has put up are not accessible.
I just used this guide to setup the two repositories I have shared in this post. I used git before, I found this guide just seemed to "click" for me.
https://www.atlassian.com/git/tutorials/setting-up-a-repository
I've forked a number of repositories for the "Smart BMS" interface. It looks like much of it is the same constructs as you are using for the read/write on the Sabvton controllers. The code "bres55" has written is the most "modular" format for building a universal interface that could be used for both controllers and BMS's.
I have designed a board / hat for the MegaPro with 4 opto isolated serial interfaces that uses low quiescent drain regulators to interface to 3 BMS. The board is powered separately from the main packs and this combined with the low drain regulators will ensure the packs don't over-discharge.
I just made a repo here for the boards eagle files.
https://github.com/flashtel/Mega_Opto
View attachment 3
After I found this thread I've added a 4th for my Sabvaton to use with the code you have created.. In addition I have include interface port for the wiegand based protocol to connect to an RFID reader.
View attachment 2
This is my modified version of the "bress55" code, I've changed the "MySerial" definition to a reference that can be switched in the software routine between the various opto coupled serial interfaces.
https://github.com/flashtel/Smart-BMS-arduino-Reader/commit/7fd29a2101cc1a516ed5a2d96e6c925851cc4816
My initial intention was to have an 125khz RFID ring, that would be used to "Arm" the bike after checking each of the 3 Battery Packs for charge state and bringing them online. If I can incorporate the code you have developed, I can extend that to "Arming" into a specific controller configuration.
ie 2 RFID key's one for "Offroad / Monster" mode and another for "OnRoad /Legal Compliant Mode".
In the Mega_Opto library I've added an I2C interface for a 0802 LCD with 3 buttons. I don't like having "large" displays on the bike. It is as small and discrete as I could make it.
I have ordered 5 boards and I have Pick n Place machine here it, takes me literally 5 minutes to make additional boards once I have the setup, all the components are low cost.
If you want one PM me.
This is what I am going to power the "Managment Board / Mega_Opto" with.
Thanks Paul