Close

RPM gauge for Charge remaining

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 01:230 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.

Discussions