The biggest challenge in the whole energy system is not making power. It is knowing about it. To answer that, we must measure the voltage of each battery and every ampere that goes in or out. Most battery monitors measure the current with a shunt, a small resistor in the main battery cable. We do not allow a shunt in our battery system. This page explains why, and how we measure the current instead.

Not a voltage, but an amount of energy that we can plan with.
At any moment, at camp or on the road, from the truck or from the dashboard.
Very hard charging from the alternator and very hard discharging, for example when the battery systems are joined to start the engine.
How much comes from burning diesel, how much from paid shore power, and how much free from the sun.
Like a bank account, the batteries have income, spending and a balance. The monitor is the bookkeeper. Without it, every one of these questions is answered by a guess.
A shunt works by creating a small voltage drop in the battery cable, and measuring it. That voltage drop is the problem. It sits between the battery and everything else, so every other voltage measurement in the truck sees a slightly different battery. When you try to work out the energy in the battery, those small differences add up to wrong answers.
We use Hall-effect current transducers instead. The battery current flows through a copper bar that passes through the window of the transducer. The transducer measures the magnetic field around the bar and gives a voltage proportional to the current. There is no electrical contact with the bar and no voltage drop in the cable.
No resistor in the battery cable, so no false voltages anywhere else in the truck.
There is one monitor for the camper battery bank and one for the Iveco starting battery. They have very different jobs.
Rated for 400 A. It measures everything that goes in from the alternator, the solar panels and shore power, and everything the camper uses.
The difficult one. The starter motor draws 300 to 400 A on a normal start, and up to 600 A at most. The same sensor must still see the battery's standing current of about 3 A, and 25 to 30 A with the engine running.
Our target is a resolution of about 0.1 A around 20 A. That is enough to see the energy flow, without pretending to a precision that the rest of the system does not have.
The starting battery's voltage gets its own sense wire. The Iveco's engine computer reports a battery voltage, but it measures it inside the computer, at the end of the vehicle wiring. It is not accurate enough for counting energy.
The first idea was a sealed box at each battery, with the transducer, a copper bar and all the electronics inside, and a cable with power and data to the controller. Space at both batteries is tight, and that box kept growing.
The final design is simpler. A 3D-printed base holds the transducer and a short copper bar. The battery cables bolt to the ends of the bar. The transducer is robust, so it does not need a box around it. A small printed housing on the base carries the transducer's four wires (supply, 0 V, output and reference) to a round 4-pin metal connector. A cable runs from there to the electronics. Brass inserts in the plastic take the screws, so the bracket can be opened and closed as often as needed.




TAP TO ENLARGE
The transducer's output is an analogue voltage. The ESP32's own analogue inputs are not good enough to read it, so a separate 16-bit analogue-to-digital converter, an ADS1115, does the measuring. The ESP32 reads it over I²C, a short two-wire data connection.
The converter sits on a small hand-built stripboard with its own voltage regulators. Like every external device in the truck, it does not take its power from the ESP32 board. Only the data lines and 0 V connect to the ESP32.
For the camper battery, this board sits inside the starting battery charger box (Part 1), and the charger's ESP32 reads it. The values then go out on Modbus, like every other measurement in the truck, to the PLCs, the SCADA and the dashboard. Where the electronics for the Iveco battery will sit is not decided yet.
A Hall-effect transducer is not perfectly straight from zero to full scale, and its output moves a little with temperature. The plan is to calibrate each transducer with a current injector across its whole range, and to correct for temperature in software. The truck already knows the engine bay and camper temperatures, so no extra sensors are needed for this.
At first the monitor was designed around what the charger needed. That was the wrong question. The monitor exists to keep the energy account of both batteries, all the time, whether the charger is running or not.
Battery sensors with a CAN bus output are available. We did not want anything of ours that could disturb the Iveco's own CAN bus (How the truck thinks, Part 4 explains why). The monitor has no CAN connection at all.
The sealed box with everything inside it looked tidy. A bracket that holds the bar and the transducer, with the electronics in a box that already exists, is smaller where space is tight and easier to repair.
The camper sensor bracket and the converter board are built. New camper batteries arrive in the coming days, and the monitors will be installed with them. Then comes calibration. The Iveco battery sensor follows.
Until then, the questions at the top of this page are a goal, not a result. When the monitors are working, the energy account will be shown on the SCADA and the dashboard: the balance in each battery, and the share of income from diesel, shore power and sun.
Real battery current will also improve two things in the control system: the battery boost logic (How the truck thinks, Part 1) and the under-voltage protection (Part 3). Both can then be based on measured energy instead of voltage alone.