The subject of Coulomb counting has been briefly touched in this forum before, but I would like to inquire about whether it would require anyhing other than firmware changes to achieve the ability for the MCU to keep count of the number of (micro/milli) Coulombs that have passed through the shunt since, and make the value available on the display and on the BT link. And while at it, it would be handy to also have a Maximum_Current (positive and/or negative value).
The Coulomb counter (and maximum current) would be really useful to have to be able to predict battery life of a system with very irregular current consumption, e.g. an IoT device that sleeps for most of the time (10µA), runs for short periods, at regular intervals reading sensors (10mA), and rarely transmits data via WiFi, LoRa etc (100mA). With the auto-ranging feature enabled, the CurrentRanger could sum all ADC readings (current_in_amps * delta_time_in_seconds), and thus keep track of the Coulombs that has been consumed by the device under test, over long periods of time (hours), allowing you to estimate the expected battery life of a system.
I realize that the accuracy of the Coulomb count may be fairly poor, due to current spikes with durations shorter than the ADC reading interval (200mS), but for the purpose of estimating battery life, an accuracy of +/-10% would be plenty accurate.
Unless someone knows of a good reason why Coulomb counting cannot be implemented purely by firmware, I will make an attempt to make an implementation. It would clearly also require changes to the UI, being able to reset the counter, and possibly enabling/disabling the display of the Coulomb counter, and the maximum (positive/negative) current since last reset, alongside the instant current, on the tiny OLED display. But I am sure something can be worked out, using the existing touch pads (long-press, double-click, hold-A-and-click-B, ...). Suggestions are obviously welcome.
My alternative would be to add a separate Coulomb counter to the CurrentRanger (or µCurrent/tinyCurrent) device, but I believe it would be difficult to take advantage of the auto-ranging feature. Alternatively, it could possibly be achieved by reading the BT serial output and interpolating readings, but it would not be as neat, as an integrated feature.
I look forward to hearing ANY feedback on this!
/Morten
PS
For those, who asks "what is a Coulomb"... It is an SI unit equal to A * s (Current in Amperes * time in seconds), or exactly -1/(1.602176634×10−19) electrons (approximately -6.2415090744×1018), which means that a C float variable would actually be able to hold the (approximate) count of the number of electrons that have passed through the shunt of the CurrentRanger, although that would be a very silly thing to do.