Probably the first thing that the owner thinks about after buying a trolling motor to the boat, or, say, installing an electric bike on a bicycle, is how far you can safely sail / leave without having to go back on the oars or pedals. A similar fate did not bypass me, so when a few years ago I had an electric boat motor, I immediately had the idea to implement the control of the flow of ampere-hours from the battery supplying the motor in a simple but more or less accurate way.
I note immediately that the discussion will focus on the method of controlling the flow of ampere-hours by integrating the instantaneous discharge current over time, and the control methods associated with measuring the EMF or battery voltage under load, along with all their advantages and disadvantages, will be left behind the brackets.
Another point - the idea was implemented several years ago, when it was not yet an easy opportunity to order power condition monitoring devices on ebay (for example, for electric vehicles). Now they exist and can be ordered on ebay or aliexpress, but still quite expensive. At that time I had no choice, so I decided to make the device myself.
')
I decided to measure the instantaneous current according to the classical principle - by the magnitude of the voltage drop across the measuring shunt (piece of supply wire) with a known resistance. Time keeping (integration) and indication was originally intended to be done with microcontroller means, however, the need to fence indicators, buttons, I stopped all this stuff - the game seemed to be not worth the candle.
And then it dawned on me - there is a ready-made device that can greatly simplify the task - the bike computer! Indeed, it is only necessary to convert the current into the pulse frequency (in the range perceived by the cycle computer), as instead of the instantaneous speed (km / h) we get the current consumption current (A), and instead of the distance traveled (km) - just the flow rate in A * h - that is, what we need! The rest of the functions of most bike computers we do not really need, but, for example, travel time can be useful in the boat, and the maximum speed corresponds to the peak current consumption (so, for curiosity). As a result, we connect a fully charged battery to the boat's motor, reset the way for the ride on the cycle computer - and go! We look at the mileage in km - when it starts to approach half of the declared battery capacity - it means it's time to go back.
The ability to use ready-made integration and display tools inspired me so much that I immediately put on a voltage-frequency converter on the then popular ATTiny15. As the measuring shunt acted a piece of wire with a resistance of 1 million. Given the resolution of the built-in tiny ADC (including the plug-in software differential preamplifier), the device was able to measure currents with a resolution of 0.5A in the range of 0-50 Amps, and without any external circuits (except for the 5V power regulator). The device quickly assembled in the turned-up case and the board from the shock sensor of some kind of alarm:

The device conversion factor was programmed as 1Hz / A. In order for the cycling computer to take into account the ampere-hour, like the traveled kilometer, it had to be programmed to such a wheel circumference so that its 3,600 revolutions (i.e., impulses from the transducer) gave a path of 1000 meters. That is, at 278 mm.
A rough calibration of the device was made by changing the point of soldering the measuring lead to the shunt, and the exact calibration was done by changing the calculated wheel circumference in the cycle computer. The idea was tested when riding a boat on the lake, turned out to be fully functional, but over time, electric walks (I'm not a fisherman) with the need to haul the motor and battery, gave way to simple rowing, and the device was abandoned. I remembered about it at the request of a friend who had recently bought a beautiful full-capacity Li-Fe-Po battery to his boat electric motor.