The energy account · Part 1 of 2

The starting battery charger

The camper has a large battery bank. The Iveco has one starting battery, and that battery has been a problem. This charger takes power from the camper bank and charges the truck's starting battery. It sounds simple. It has taken more attempts than any other part of the truck, and it is still being built. This page explains what it must do, how it is built, and what went wrong on the way.

It is the first part of The energy account: how much energy we carry, how the batteries cope, and where the energy comes from.

The job

What the charger must do

The truck and the camper are two separate electrical systems (see How the truck thinks, Part 1). The Iveco works fully without any camper power. The charger is the one controlled path that sends camper power to the truck battery when the truck battery needs it.

The decision to charge is made by the PLCs, as described in How the truck thinks, Part 1. When the starting battery falls below 12.45 V, the Engine Bay PLC asks for a battery boost. The Main Control PLC switches the charger on only when the camper batteries are higher than the truck battery, and at night only when shore power is connected. When the charging current stays below 3 A for 5 minutes, the truck battery is full and the charger is switched off again.

Input

About 14.6 V from the camper bank

The charger only runs when the camper bank is full and being charged, so its input is always about 14.6 V. It only ever has to reduce the voltage, never raise it.

Output

13.8 V, up to 40 A

Most of the time it gives a small top-up current. Into a flat battery it must deliver 30 to 40 A, and keep doing that without overheating.

Never

With the engine running

The charger is never on with the ignition on or the engine running. The PLCs will also not switch it on when the starting battery is below 11.8 V.

Protection

Overload and input limits

Overload protection, and input under-voltage and over-voltage protection. If the camper bank is outside its range, the charger has no supply.

The charger sits about 300 mm from the camper batteries and about 2.5 m from the Iveco battery. The camper side is wired in 50 mm² cable and the truck side in 35 mm² cable.

Accurate voltage regulation is not the goal. The Iveco alternator itself charges the starting battery anywhere between about 12.8 and 14.7 V. The one goal is that the charger keeps working, year after year.

How it is built

Two boards in one box

The charger is split into two circuit boards: a power board that carries the current, and a small control board that decides what the power board does. We drew both boards ourselves in KiCad, down to the placement of every pad, and had five sets made and assembled in China.

The power board

The power transistors are bolted to a 117 × 50 × 22 mm heatsink outside the box. Between each transistor and the heatsink there is an insulating pad and an insulating shoulder washer. These are not optional. A 12 V fan can be fitted to the heatsink, and if it is, the controller switches it.

The control board

An ESP32-S3 Mini board does the control in software. It sits in a socket, so it can be changed in minutes. The board is through-hole, with thick tracks, and is built by hand so that every part can be reached and replaced.

The enclosure

A 3D-printed box. The control board is fixed to the base. The power board is fixed to the lid, with the M6 studs for the battery cables on the outside.

The connection to the PLCs

The on/off command arrives over the network, by Wi-Fi, so there is no relay on the board. The charger's values are available on Modbus like every other controller in the truck.

PHOTO TO COME
Power board and heatsink on the lid
The power board on the lid, with the heatsink outside.
PHOTO TO COME
New control board
The hand-built control board with the ESP32 in its socket.

The same box also carries the electronics of the battery monitor. That is described in Part 2, the battery monitor.

What it taught us

Why it took so many attempts

Six bought converters burned out

For years this job was done by ready-made buck-boost converter modules bought online. About six of them failed. They were potted in aluminium cans and mounted on the camper wall. Some cooked their potting and some exploded, and none of them blew its input or output fuse. Several failed while they were idle: a contactor had switched off their input, but the 80 Ah battery stayed connected to their output, sometimes for days. We believe the battery feeding back into a converter with no input is what killed them. A converter must survive the state it is left in when it is switched off, not only the state it works in.

Do not design with a part you cannot buy

An earlier design of this charger was abandoned because the current-sensing resistors it needed could not be obtained. The design was correct, and useless. Now every part is checked for availability before it goes into a drawing.

The header on the wrong row

The ESP32 module plugs into two rows of pins. On the first control board, the connections were made to the wrong row. The board was in effect upside down, and the module received 5 V on one of its input pins. During commissioning a second module failed as well. A new board revision was not possible, so the existing boards had to be made to work. Check the pin numbering of a module against the drawing, physically, before power is applied for the first time.

Too clever is not reliable

The first control board did too much: wired Ethernet, its own power supplies, relays and analogue control circuits. Each part was reasonable on its own. Together they made a board that was difficult to commission and difficult to trust. We stopped and started again with one rule: the only test of any decision is reliability. The logic goes into the ESP32 programme wherever that is possible. Where a hardware part is still needed, it is the simplest and most robust part available, in a socket so that it can be replaced.

Brass inserts expand plastic

Heat-set brass inserts are pressed into the printed plastic so that screws can be used again and again. Next to the clips that hold the boards, the larger inserts pushed the plastic outwards, and the clips showed stress marks. The next enclosure uses M2 inserts and M2 screws in those places.

A space in a folder name

The ESP32 development tools do not accept a space in the name of the project folder. The build fails, and the error message does not say why. The folder is now called BatteryCharger. A small thing, but it cost time.

Where it stands

Still on the bench

The power board and the heatsink are mounted on the printed lid. The simplified control board is being built by hand now. When it is finished, the charger will be tested on the bench before it goes into the truck.

The series

The energy account