Press "Enter" to skip to content

Measuring SOC with Arduino Nano

Vasja Markič 0

We programed (GitHub Link) Arduino Nano and a 0.96″ display to show the State of Charge (SOC) of a Li-Ion battery cell. The method uses a shunt resistor where with analog inputs Arduino measures the voltage drop. Knowing the value of the shunt – 0.56 Ohms – the Micro controller calculates the current. The program loop uses a timer which is recorded and multiplied to reveal the actual battery capacity (while charging or discharging).

Further we added two potentiometers for selecting low/high battery voltage treshold, a button for set the voltage treshold and one for erasing all data from the Nano eeprom. The whole device includes two relays to bridge the battery cell to the load or to the charger, depending on the actual (measured) voltage on the + pole of the cell.

With the wire.h protocol/library in Arduino the device can sends SOC data to another Arduino controler, using analog pins A4 and A5. In that way we can show the SOC graphic in the Nextion display in the I/O device.

From scratch to…

… assemble and finally the working result.