Close

Changes someone replicating this needs to make

A project log for Ryobi 480e mower LFP battery upgrade with balance

Add a lfp battery balancer to a ryobi lead acid battery upgrade

johnrsheahanjohn.r.sheahan 04/09/2025 at 03:420 Comments

ESP-NOW

The different boards in this project talk to each other using the Espressif espnow protocol. This seems to be  a reduced UDP style protocol that uses the MAC address of the target device to identify its target.

Thats good for the application as dhcp servers and discovery and wifi repeaters and the like are all unneeded, but does mean that each node must know the MAC address of the other processors it communicates with in advance.

I used the Espressif preferences.h library to allow each node to keep the various MAC addresses it needs to know about in NV memory. Each node identifies its own MAC address out its debug serial port at boot time, to help me identify each board. I default the addresses in the NVM structure with the specific MAC addresses of my boards.

Anyone copying this should probably change the source code addresses, and definitely has to change the NV memory addresses, which can be done using the basic debug monitor accessed serially on each boards debug port.     

VMON Cal

Also, each of the 4 VMONs ADCs need to be calibrated to match. Want to get balancing to better than 10mV, which is better than 0.1% accuracy.  This isn't going to come from cheap ADC references and resistors.  We don't really need absolute accuracy, rather the 4 VMONs just have to match to a few mV.  So grab your best voltmeter, apply measured 12 or 14V to each of the VMONs in turn, and adjust the VMON gain calibration constant (in NV memory via the debug port)  so that the VMON reported value exactly matches you reference meter.

I made a jig powering all 4 VMONs through balanced wire lengths and trimmed all 4 to match the reference meter.   

I wrote a script to do that automatically, and test the other vmon  features, but it was pretty hokey. The script is in the repo, but it was not pleasant. If I have to do it again I'll improve the script.    

Discussions