Charged all 4 with my ctec multi chemistry 12V 15A charger.

This worked well in the mower, but now I need to be able to charge it. Easily enough that Pam can do it too.

These 12V LFP batteries internally have 4 single cell 3.3V 100AH Lithium Iron Phosphate (LFP) connected in series to make a 12V battery. They have an internal Battery management system, or BMS, which may disconnect the battery on over or under charge, and probably balances the batteries when near full charge. If the balancer is a passive balancer, which means that a resistor is connected across a higher voltage cell to bring it down to match a lower voltage cell.

Similarly a 12V lead acid battery contains 6 2V cells in series. Lead acid batteries have lots of issues, but balancing the cells isn't really one of them. Just overcharge then, they don't really care about overcharge, they just boil. So add more water. Lithium batteries don't like that one bit. Lithium Ion batteries are reported to catch fire. LFP batteries seem to die an early death. Don't want that for my shiny new batteries.

The internal battery BMS will keep all 4 cells within each battery matched, but so far nothing keeps each of the batteries matched. So I need to add something. I'd also like a fuel gauge, and something that beeps when charge gets too low to be extra safe. And something that turns off charging when the batteries are suitably full. I don't need blinding fast charging, as long as an overnight charge gets from empty to full.

Mower completed a full yard mow, with long, wet end-of-summer grass, with 42% remaining of a single charge after the upgrade. So several times better than the original batteries. The mower was down for a month while I upgraded stuff. A lot of growth.

Architecture
I'm thinking a per battery voltage monitor that can do passive balancing is needed. This will be a board that screws onto the top of each battery. I christen that board a VMON.
I want to have a board somewhere in the mower that talks to the 4 VMONs, so that balancing can be matched. I'll call that board am MCO, for Mower COmmunications. The MCO can also
talk to a current shunt, and integrate the measured current to drive a SOC (State of charge) gauge.
talk to the charger, to set voltages and currents, and turn things off when done.
run a beeper.
I'd like a box with a display that allows me to see individual battery voltage, charger voltage, charge current, temperature, SOC so I know this thing is working correctly. I'll call that an MCC, Mower Charge Controller.
The MCC also has an SDcard so I can log whats going on and provide debug for development and maintenance
the MCC doesn't need to be on the mower, it can be beside the mains powered charger.
And because I made a design mistake on the current sensing of the MCO, I added an extra board I call an IMON to interface to the current shunt and relay current readings to the MCO.
a 60V 20A remote programmable power supply, controlled by the
more detailed design decisions to implement this architecture
ESP32 microcontroller was chosen as a cheap board with sufficient speed and memory to make development easy. The onboard wireless peripheral makes communications easy, VMONs, IMON, MCC, MCO don't share a common power supply reference. All boards have their own ESP32.
espnow wifi software to explicit mac addresses was used to avoid needing full WiFi coverage of the home paddock.
Arduino software development framework was used
Kicad used for all schematic and PCB designs. Retired now and its nicer to use than Altium anyway IMHO.
I used cheap aliexpress modules wherever easily available mounted on custom PCBWAY boards for construction. This minimizes the number of tiny components I have to solder. Eyesight doesn't improve with age. This includes 48V to 12V switchers, 12V to 5V switchers, temperature sensors, ADC, ESP32.
If it turns out to be needed to be reliable over time, I may respin VMON as single layer surface mount so I can better coat it with a conformal coating to better potect it from grass and water.

Individual board requirements

vmon spec
vmon_implement
per-12V-battery voltage monitor VMON and passive current balance board at 100-200mA, 1-2W

powered by the battery it is monitoring
optoisolated bussed enable line from mco to power up all VMONS. Mainly this keeps off power low.
WiFi comms to mco works as there is an explicit board power enable.
optionally comms could bussed + optoisolated serial.
13V to 5V switcher from the local battery. Ideally the switcher has an enable pin.
16 bit ADC likely AD1115 module. Want to achieve 5mV balance.
Vmon addressing. MAC address could be sufficient. Also support an address in NVM for serial.
Calibration support. Which I think is a jig or setup that applies an known external voltage, and records both the applied voltage and the board level reading. That turns into a gain and offset cal value in on-board NVM. Within reason, the boards have to match, Absolute error less than 100mV is OK, so my bench multimeter is an adequate standard.
conformal coating as its on top of a battery with grass clippings, rain and occasionally rat piss around. I do live on a farm. AT least its not a lead acid battery so don't have to worry about sulphuric acid fumes.
possible I could supply PCB resource for polled serial bus. Likely a not fitted component set. probably a resistor and optocoupler on tx. opto and pull resistor on rx. maybe another resistor and rely on ic clamp diodes
temp sensor for the battery
temp sensor for the balancer (ie heater) resistors
switch for the balance resistors
espnow software
expect to do voltage and temperature polls and possible balance set for all boards roughly every 2 seconds.
board needs to update internal sensors faster, say 1/4 second, so that a mco poll can be responded to quickly (couple ms).

imon spec
imon_implement
Single current monitor IMON. Here as the current measure implementation on the mco doesn't work in 2 quadrants / negative currents

with WiFi comms
13V to 5V ISOLATED switcher from the 12v line on mco.
16 bit ADC likely AD1115 module . Only using ~14 bits as I have a 75mv shunt into a 250mV ADC range.
calibration support. Which I think is a jig or setup that applies an external current, and records.
conformal coating as its in a mower.
possible I could supply PCB resource for serial bus. Likely a not fitted component set. probably a resistor and optocoupler on tx. opto and pull resistor on rx. maybe another resistor and rely on ic clamp diodes
espnow software
updates mco every second or so with current. Not polled as I seem to have reached the espnow peer count limit.

MCO charge controller in the mower
mcomms

Gets current from IMON now as the ADC implementation didn't work - the currrent shunt can produce both positive and negative input voltages depending on whether its charging or discharging
enable and poll the vmons
conversing to the enhanced charger, to program appropriate charge voltages and currents. And turn off when done.
drive a SOC gauge as part of the mower. Ordered a 0 - 10000 RPM 52mm gauge
unfortunately the gauge on the mower turned out to be 49mm diameter so I had to bore out the panel.
drive a beeper for lower charge limit to tell the user to stop mowing.
logic to power itself, imon and enable the vmons. Some sort of logical combination of mower turned on OR charger connected.
knows whether the charger or mower is running. Possibly the sign of current? or just which 48V source is in use?
non volatile storage for StateOfCharge. Probably not NVM as it will update often when charging or mowing.
espnow wifi comms to the mcc, psu, imon and vmons.

MCC external charger controller with display and log
mcharger_if

espnow to the mower
LCD screen for humans
knob or buttons for a minimal UI. logfile control, etc.
powered from charger, so need a 48v to 5v stage. At least 60V rated I guess.
240V to 12V supply also would do.
Optional able to switch off the supply (from 240V/5A or 48V/15a ?)
so does that mean its not run from 48V? 240V switching and a 5v USB wall wart?
if the power supply can do that, not essential on MCC. perhaps a build option.
Edit
psu power supply controller
psu I found a 60V 24A remote controllable module on Aliexpress at a fair price. It comes with 5V TTL level serial interface as well as an optional custom remote control panel. While the protocol the remote panel uses is not documented, the serial protocol IS documented! good stuff! And the protocol is pretty simple.

So I need a little board to turn espnow wifi comms to 9600 baud 5v level serial. Sounds like an esp32 with a 5v level shifter.

espnow <> 9600 baud serial for the DPM8624
vichyctl (an earlier serial multimeter WiFi interface I made) with parser changes to suit the \r\n 9600 baudness of the DPM8624.
an optional timeout, used to turn off the power supply output enable if there are no polls for a while. This manages an initial spark when plugging the charger in.

What I want it to do, at least the first cut
charging
connect the charger, which could be powered on
the mco, the imon and the vmons power up
the mco programs the psu for initial bulk charge, currently 55.2V and 10A
this should produce an initial Constant Current (CC) behaviour tapering to a CV regime as the voltage approaches the set voltage
the batteries inthe mower start to charge
mco increments SOC using its current monitor. SOC is measured in milliamp seconds, scaled on readout by the published battery capacity. Signed current in mA is measured about every 2 seconds, multiplied by the update period, and accumulated as SOC.
when the charge current reduces to just under 3A, swith the power supply to its topoff balance mode. Currently thats 56V 3A. Enable balancing behaviour in thes region
vmons watch the individual cell voltages. If A battery is higher in voltage than the lowest voltage battery, turn on its balancer.
mco polls vmons
if any individual battery is too high voltage, charging is stopped
as long as all 4 batteries get to a suitable voltage, balance them up.
reduce the charge current to something close to the balance current,
balance down by turning on the shunt on the higher voltage batteries
repeat till all match in voltage and all 4 shunts off
terminate charge when current falls below 300mA.
set SOC to 100%
mco continually updates (every 2 secs) mcc so the user can see whats happening on the display.
Mowing
when mower keyswitch is turned on
the mco board, imon and the vmons power up
mco board starts to decrement SOC using measured current.
soc is always displayed on the SOC gauge on the mower
SOC cannot go negative. if it does, clamp to 0 and adjust the scaling constnt a bit
if SOC gets too low, below 10%, start to beep.
vmons watch the individual cell voltages. balance shunt is off.
mco board polls vmons
if any individual battery gets too low in voltage, start to beep.
maybe adjust stored battery capacity if SOC and low voltage limits don't match over time.

boxes
I have mounted 1mm fr4 on top and bottom of vmons. Will add duct tape to sides.. Each vmon was liberally coated with acrylic PCB laquer.

I folded up a metal box base which goes behind the batteries for the mco and the imon. Its got a PVC lid I heat formed from some old PVC drain pipe to protect the boards and let the WiFi out of the box.

Power Supply. DPM8624 is screwed to a board. So is the 1200w 60V psu. And psu in a small plastic box. And a bigger plastic box for mcc with a clear acrylic lid. I will rotate the DPM 90 degrees too so I can see both from the front.

charge connector
looking from the back, 3 pin triangular connector.

Bottom right is black / batt negative.
bottom left is red batt 48V
top middle is signalling of some sort. There is a 11K NTC thermistor bolted via
what I assume is a thermal, non-electrical lug to the nearest battery post - +24V in our case. That connects to a 2 pin cable. The socket appears to have 2k0 from back of the pins to bottom right / Batt neg and other pin 2k to middle top signalling. Its a 11K NTC thermistor