Close
0%
0%

Ryobi 480e mower LFP battery upgrade with balance

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

Similar projects worth following
335 views
0 followers
Battery change, the easy part
The lead acid batteries in the ride on mower we bought secondhand 3 years ago have now deteriorated past EOL. Whne we first got it, needed 2 charges to mow the about 1 acre home paddock, with dry grass not too long. Mower ran for 30 seconds after charging last time tried. They were LPC12V 75AH I believe. but not marked. Time to upgrade.

Measuring up battery available space, seems 304mm W x 167 deep x 220h is about the max possible battery size. And there are 4 batteries in the mower, its a 48V thing.

I want deep discharge batteries, so LFP to give decent behaviour, weight, price and lifetime.

Kings 12V 100AH seems to fit, just. Its also rated for 4S 2P as far as the internal BMS is concerned. I bought 4 at $239 each. Picked up Sat 8Feb2025 from Heatherbrae at the 4wd centre. Batteries I purchased are rated 14.6V charge. Batteries on the website were rated 15.4vevor 48V 15A charger with RXV plug as Charged all 4 with my ctec multi chemistry 12V 15

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

Read more »

View all 27 components

  • all for now

    john.r.sheahan04/17/2025 at 10:32 0 comments

    I think thats it for this one. I should move on to my haflinger. If anyone wants more detail on something, or I've left something important out of the git repo, then ask.

  • more on the psu

    john.r.sheahan04/15/2025 at 10:10 0 comments

    The psu is just a wifi to serial converter.

    here is a top of board view 

    the esp32 is on the bottom of the board,like this

    I created this board to allow remote wifi access to a Vichy 8145 bench DMM, but it seems to have other uses. The PCB has provision for a power supply switcher, which isn't used  in this specific application. There is a 3v3 to 5V level shifter,  and the esp32 module does wifi to serial and maybe a bit of protocol conversion.  

    Really it just makes this DPM8624 power supply module more accessible. The DPM8624  seems pretty nice for the price. Works nicely in this particular application for me. Just watch out for the on/off switch on the bottom when you mount it this way. Easy to turn off by mistake, and that takes some head scratching when you didn't even notice the switch. 

  • more on the mcc

    john.r.sheahan04/15/2025 at 10:01 0 comments

    The mcc board looks like this, with associated LCD and rotary encoder.

    The PCB has provision for switchign th echarger on and off. That snot used, the charger used can do that.

    Its powered from a 12V plugpack sharing a switched power socket with the charger 60V power supply.  Coming in board lower. There is a 12V to 5V smps in the board centre.

    There is a esp32 module and a microsdcard socket. Remove the lowest pullup (as pictured) on the sdcard module or the esp32 wont boot.

    20char x 4 line lcd with an I2C backpack, and a rotary encoder for a primitive UI. 

    The LCD allows me to see individual battery voltage and balance state, charger voltage and current, charge state and battery temperature

     So all this oard does is to display whats going on. Its not on the mower, rather next to the charger.

  • more on the mco

    john.r.sheahan04/15/2025 at 09:52 0 comments

    The mco runs the charger. It looks like this

    From the top, a 12V to 5v smps module. On the left, supplies from mower run and charger in.

    an esp32.

    on the left, the beeper. Unused ADC on the right. Too hard to remove.

    plug for the SOC gauge on the left. a temperature sensor on the right 

    Enable plug for the VMON optoisolators on the left.

    any smarts for this board is in the software.

  • more on Imon

    john.r.sheahan04/15/2025 at 03:20 0 comments

    This is what an Imon looks like

    Imon is built on a vmon board.  Imon was the result of a mistake, and I needed to complete the project and mow the lawn.

    The mower internals partly looks like this. 4 batteries with a current shunt (just a 4 terminal resistor). There is a 48V to 12V SMPS. Nothing special, The negative input connects to the negative output. A converter to 5V runs the mco logic, with an ADC.  When charging, the voltage across the current shunt is positive to the reference 0V net. Which is fine for the ADC on the mco board.  When mowing, the voltage from the current shunt is negative , ie below ground, to the ADC inputs, Which is NOT fine for the ADC. 

    So I took a VMON board that I had previously discarded, I stupidly blew it up by shorting 12v on the vmon battery terminal to one of the I2C control wires on the temperature regulator, with a spanner tightening the bolt.   This smokes anything connected to I2C. esp32, 2 temp sensors, ADC.  Sigh.

    By powering the repaired vmon, hacking a little, renaming the boioard and giving it a new dose of software. with a couple of new resistors,  wires and hot glue,  and an isolated 12v to 5v power supply module, I could float the logic on the board, and bias the curren tshunt to the mid rail of the imon board .    

  • more on the vmon

    john.r.sheahan04/09/2025 at 23:16 0 comments

    I should introduce the individual boards. This is the Rev1 Vmon.

    That 8mm hole on the left bolts to the battery positive terminal post. With the cable lug immediately under the pcb, and the battery below that as the plated through pad won't support 50A.
    The flying lead to the left goes to the battery negative post.
    The green phoenix plug upper left is an optically coupled board enable, so the mco can turn the vmon on when its actually in use.
    There is a temperature sensor thermally close to the battery positive post
    there is a small SMPS module to convert the input to 5V. It gets enabled.
    bottom left is a 16 bit delta sigma ADC to measure the battery voltage
    In the middle is the ESP32 module, with built in WiFi
    On the right hand end is an array of balancing resistors. Spread out to allow heat dissipation
    There is another temperature sensor to allow the board to switch the resistors on and off if they get overly warm.

    Once built and tested, I sprayed the boards liberally with PCB acrylic for protection. I put painters tape over the battery pad, USBC connector and the phoenix socket first. Then I bolted some 1mm bare FR4 PCB top and bottom for mechanical protection. Before mounting in the mower I added duct tape around the 4 sides. With a hole in the tape for the enable plug and the battery terminal bolt.

    Its the vmon's job to report battery voltage and temperature to the mco when polled. mco will tell vmon when to turn on the balance resistor if and when appropriate. Vmon will modulate the resistor on-ness if the resistors get too hot.

    In this design each individual battery balances its own internal 4 cells. The VMONs permit balancing the 4 individual batteries to each other. 

    Vmon responds to a suite of short serial commands either from the serial debug port or from WiFi to assist debug, do calibration, or change internal NVM constants such as ADC gain and offset, partner board MAC addresses and the like.

    The set of serial reads and write commands for the board are documented in the source SW file for the board. More likely to stay current that way.

    Thats all in the github repo, along with board schematic, both pdf and kicad, gerber and layout files.

  • Changes someone replicating this needs to make

    john.r.sheahan04/09/2025 at 03:42 0 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.    

  • mower charger socket

    john.r.sheahan04/09/2025 at 02:17 0 comments

    To integrate the new stuff into the mower, I needed to get power to the mco and imon boards.  And I needed them to be powered when mowing, and when charging, and otherwise power down.  I have also drawn and added the top level schematic on how the bits fit together into the mower to the github repo.

    The mower has a keyswitch on the control panel. The green wire from the keyswitch was  an easy place to find 48V when mowing. But how about when charging?

    The charger socket has 3 pins. This is what it looks like fromthe back of the mower.

     The bottom 2 pins are battery plus 48V on the lower left, and battery -  on the right. Always directly connected to the battery. Always on.  The top middle pin is used by chargers for thermal sensing and signalling it seems. 

    The back of the socket looks like this. Its upside down. You can see the back of the 2 power pin barrels between the 2 philips screws. The middle top (when right side up) pin is behind that kludgy green wire hex screw head.

    This took a bit of investigating.  The heavy red and black wires go to the battery. The grey wire has a 2 pin plug on it, and connects to a NTC thermistor, about 11K at room temperature, which bolts thermally to a nearby battery terminal post. I suspect the original charger uses the thermistor. The thermistor appears to connect via 2k resistors moulded into the socket to the middle pin and to the ground pin. 

    The sky blue wire seems to connect via a diode to the bat+48V pin , and ends in a 1 pin barrel connector. The other end of the barrel connector appears to run the mower contactor via the keyswitch - at least the mower won't run without it connected. The blue wire didn't buzz out so there is something moulded into the socket, I assume a diode. 

    I found online descriptions of different model chargers, suggesting the charger plug should jumper 48V+ to the middle pin to make charge lights work.  

    I added the green wire shown. Its  a short flying lead from a lug to a anderson powerpole connector. Lug goes over a steel self tapping screw , about 6mm. I made a brass nut which tightens the lug to the screw head. (5.5mm hole)    The screw then gets driven into the barrel  of the middle pin from behing the socket, a couple of turns until it nips up nicely.   And the charger plug gains a wire jumpering the middle pin to the Battery +48V pin.

    Result is the green wire through that powerpole gives me battery +48V when the charger is plugged in. So I can power the electronics when charging or when mowing.  The electronics can then wake up and turn the charger on to charge. And turn the charger off again when charged.   I need to unplug the charger from the mower the next morning. 

  • RPM gauge for Charge remaining

    john.r.sheahan04/09/2025 at 01:23 0 comments

    The Ryobi mower has a round bar led display for voltage on the lead acid batteries. It was never very useful even with lead acid batteries.  I wanted to integrate battery current, calculate battery State Of Charge, and display that as a percentage. Looking around I found 270 degree reading automotive gauges in the standard 52mm size. They were reasonably priced out of China. I found a 10K rpm gauge that both seemed to map prettty well to a 100% display range without having to draw new scales, and the rpm style frequency input seemed like it would be easy to drive. So I ordered one.

        Thats the original gauge sitting on the battery. New one in the panel. Annoyingly the old gauge was 49mm, so I had to bore out the existing panel hole. The panel is about 1.6mm steel so that was work. 

    The aliexpress 10krpm tacho arrived. its got 4 wires. A switch on the back chooses 4/6/8 cylinders. Switch is very vague. 4 wires, red,black/green/yellow. According to the page it came with,  black is battery -, red switched battery +; mostly the electronics I think. Yellow switched battery +; illumination led power, green is coil/points connection.

    Bench testing, with 12v on red+yellow, with 10v cmos level from bench signal generator into green, (50% duty cycle 0/10V sq wave I suspect) at 330 hz I get full scale 10000 rpm which I plan to be 100% charge. Dunno what the switch is set to, looks like the top is missing. I'd assume a 4 cyl 4 stroke to fire 2x per revolution, so 330hz would be 330 * 2 / 4 * 60 = 9900 Meter seems to clamp at 10,000, set to 168 hz and I get 50% (5000rpm). so I think the 'switch' is set to 4cyl. Which I can live with.

    There is a button on the front that changes the scale illumination intensity and color. It draws 102ma with the display on green. Full white is more, about 160mA, I assume its more leds on. Box it came in said 'dragon gauge'. Seems to look and work fine. It has a fairly dim red glow I quite like, but we tend to mow the lawn in daylight. I guess the mower gets charged in a dim location.

    Definitely a stepper motor gauge, powering down leaves the needle pointing at the last reading.

    In the ESP32 code, led color control seems to be the common way to get pwm out of pins. The following fragment works for me.

    in setup()

      pinMode(soc_pps_pin, OUTPUT);
      ledcAttach(soc_pps_pin, freq_soc_50, 8);
      ledcWrite(soc_pps_pin, 128);  // set soc gauge to 50%

    in loop()
      // calculate new SOC frequency. 336Hz is 100%   charge.
      int soc_f =     336.0 * (float)soc /  fbattery_capacity;
      if (soc_f != soc_pps_freq)
    { // only update soc freq generator when freq changes. otherwise meter glitches sometimes
      ledcChangeFrequency(soc_pps_pin, soc_f, 8);
      soc_pps_freq = soc_f;
    }

    On the mco board, I take the 3.3v IO from a pin, wire it to a small nfet gate. Fet drain has a pullup to 12V, and that drives the green  gauge points wire just fine.

  • graphed the second charge cycle

    john.r.sheahan04/06/2025 at 23:52 0 comments

    I grabbed the logfile out of the SDcard after the second charge. This was after a big mow of a heap of wet, long grass. For some reason the mower had been in pieces for a while.

    At the end of the mow SOC was at 42%, which I thought pretty good after all the work the mower did.

    The black curve is voltage of battery 1. All batteries matched everywhere to better than 20mV, so I just plotted one. I should add a temperature plot too as I don't understand the curve kink around the 2-h hour mark.

    SOC must be working OK, as it took 6 hours at 10V to get to the point it started to balance. Aligns well with the 58% the SOC measure thought it had. Seems to imply the battery sales literature was honest too.

    The red curve is current. The charger was in CC mode for about 5 1/2 hours at 10A.

    Then in CV mode where the current fell steadily to ~3A. 

    The power supply got reset to a slightly higher voltage adn a 3A limit, ran in CC for a few minutes then fell steadily to effectively 0A as balancing and topoff happened.

    Green curve is SOC, ramping steadily from 42% to 100%.

    The blue curve shows where balancing happened. Its in error on the falling edge, I lost a few minutes of log around the shutdown.  the slope on the trailing edge was caused by some data loss.  I have a bug in the logging code I need to track down. I'm guessing some sort of race is causing the log buffer to be written twice (often) and (rarely)  a few minutes goes missing. I'm definitely no software engineer! 

    The logfile includes timestamps (well, h:m:s from when mcc was turned on)  and I had to pipe the data through sort and uniq prior to plotting it.  At least its only the log thats currently known part broken.

    Watching the voltage fall on charge completion (just after 6 hours) when the charger was electrically disconnected I found interesting.  Battery 1 was at 28 degrees C after the mow / at start of charge. It went on charge around 4pm.  At start of charge it was around 10C above ambient, and it likely cooled during, and moreso after charge to ambient which would have been in the low teens overnight.  I gather both the temperature and not being charged together cause that voltage drop of around 0.6V.    You can see why integrating current is needed, and just measuring voltage is next to useless to evaluate LFP StateOfCharge.    

View all 11 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates