WIBNI: Smart State Of Charge Meter

While you are thinking so deeply about state of charge indication, I would like to put a bug in your ear for a “smart” state of charge indicator.

WIBNI: Smart State Of Charge Meter

Imagine an I2C device with two barrel connectors …


  • I2C communication
  • 5.5x2.1mm Barrel plug input
  • 5.5x2.1mm Barrel plug output
  • Instantaneous Voltage Sensor
  • Average Voltage Sensor (n readings over approx. 1 second, does not need accurate timer)
  • Instantaneous Current Sensor
  • Average Current Sensor (n readings over approx. 1 second)
  • Either multiple single color LEDs (blue, green, yellow, red)
    or a single multi-color programmable LED

Software API:

  • averageV: reports the average voltage. Filters out load variance induced voltage fluctuations,
    (or peak-deltaV charging variations)

  • averageC: reports the average current flow. Filters rapidly changing load (or charging pulses/dips)

  • fastV: reports instantaneous voltage

  • fastC: reports instantaneous current

  • ledV(n,v) or ledV(color,v): light LEDn or set LED color when average voltage is above “v”
    4_Blue=“Recently full”,
    3_Green=“Still Lots o’juice”,
    2_Yellow=“OK, but”,
    1_Red=“Danger Zone”

  • dV: reports the rate of change of the averageV (slope) over a longer period (non-hardware feature)
    (sufficient to detect charging vs discharging)

  • startDcycle: returns datetime of peak average voltage when dV negative (non-hardware feature)

  • currentDcycle: returns current duration of discharge cycle (non-hardware feature)

  • start/stop a systemctl smartmeter.service. (non-hardware feature)

  • A future software update could enable the service to incorporate “learning” the voltage reading versus time remaining versus current load from a run-history saved to disk by the smartmeter.service


(And while I’m dreaming … if it incorporated a battery backed up RTC with a settable “wake-up” alarm connected to a relay that switched the output we could back the robot onto a charger dock, set a “wake-up” time when the battery should be full, perform an orderly shutdown, followed by a removal of power to the robot with the knowledge it will awake fully rested, and ready for another go at “life”.)

Background: I tried using an ACS710 current sensor, and a resistor-divider voltage sensor on my prior Raspberry Pi / MCP3208 10bit A2D equiped RugWarrior robot. The A2D readings from both the current sensor and the voltage sensor had surprisingly large variances placing a significant burden on the processor to create the averages.


Have you looked at Sparkfun’s voltage and current monitoring circuits?

They’re i2c circuits and may be just what you need.



What you ask for is doable, and I could do it, but this is not the task of one night, or even a week’s worth of nights.

It would be a major project, and I have promised myself not to undertake more projects until my current batch are finished.

Look at SparkFun or Adafruit, they might have something that will do what you need.

You can also search Digikey or Mouser, they might have something.

If that fails, you can take something like a teensy, (which programs like an Arduino), and prototype sensors around it.

Aside from doing additional research, which I have neither time nor energy for, I do not know what else to tell you. This will be your mission, if you choose to accept it.

I will be glad to give you whatever advice I can but the lion’s share of the work would have to be yours.


Sorry if it sounded like I was suggesting otherwise.

Interestingly, with the appropriate software, the GoPiGo3 could have a “Smart State Of Charge LED and API” with no additional hardware or wires. I am pretty sure ROSbot Dave will sport this feature (with audible warnings too) at some future point.


No problemo.

Though I have to admit it sounded like a
"This would be totally WIZARD if it existed. (You think you can build one?)

Maybe later I might revisit this as it IS a good idea, but not right now.

If I remember correctly, SparkFun had a current monitor that might have done voltage too, and was i2c.

If I happen to see it again, I’ll post it.

1 Like