Current Monitor

Description:
For the construction kits "Fiets" and "Brandaris" I was curious to find out how fast the accu would charge and discharge. The electronics are simple and based around the QX5252 chip, but is is a 'black box' system.

The core concept is to place a small shunt resistor in series with the battery and measure the voltage drop across it. This voltage drop is sampled once per second over an extended period to monitor the current consumption. Within that second more samples can be taken and averaged to increase accuracy.

To enable this functionality, two additional elements are required. First, a real-time clock (RTC) provides a stable 1 Hz system heartbeat and timestamps each measurement, allowing accurate correlation between time and measured values. Second, data storage is required; for this purpose, a microSD card is used. This also allows the SD card to be removed and inserted into a computer for further analysis, such as generating an XY plot of current versus time.

The system is controlled by an Arduino Nano. Power is supplied by a 18650 battery combined with a boost converter module, although any regulated 5 V supply can be used.

Implementation detail: The shunt resistor is made part of the current monitor which enhances flexibily.

The INA180Ax chips are current sensing amplifiers. Here are some of the part codes (see datasheet for more details):
INA180A1    Gain factor 20       << This chip is used, selection depends on requirement of currents to measure and R1.
INA180A2    Gain factor 50
INA180A3    Gain factor 100

Note: Do not forget to remove resistor U4 from the RTC module if a CR2032 battery is used.


Schematic:



RTC DS3231 Module Micro SD Card Module 18650 Boost 3V3, 5V Supply Module


Software:
The software is stored in folder named 'Datalogger', the sketch is named 'Datalogger.ino'.
It is required to install the RTClib, which can be done via the Library Manager in the Arduino IDE.

DOWNLOAD: Software ZIP file



Hardware:
More information about modules can be found on the internet or in this document:

DOWNLOAD:
Document in PDF format



Result:
To be able to measure the charge and discharge current I used both channels but removed one resistor and connected the second channel reverse, resulting in one channel measuring the charge current and the other channel measuring the discharge current.

Data format (which you can change by changing the software):


 Plot of the data using excel: