This project is a datalogger to check the capacity of 18650 batteries by determining if they are in good condition or they must be discarded.
The data that is logged in the sd card is: correct, power, voltage, LM35 temperature and execution time.
In order to not discharge the battery without having conected all the components, there is a button to start the discharge of the batery. Once the button is pressend, the relay closes, the battery starts to discharge and the data is logged eery 5 seconds on the sd card.
When the battery is bellow 2.8V, the relay opens to prevent over discharging the 18650 battery and also appears a new display showing the principal data adquired by the ESP32.
Also, to operate with the oled display, there is a pushbutton with a resistor in pull-down conection. For any questions, do not hesitate to contact me :) Then, all the data can be shown by Matlab to create graphics to compare with other batteries.
Here is the schematic he used. For full code go here.
shuntvoltage = ina219.getShuntVoltage_mV(); busvoltage = ina219.getBusVoltage_V(); current_mA = ina219.getCurrent_mA(); power_mW = ina219.getPower_mW(); loadvoltage = busvoltage + (shuntvoltage / 1000); capacidad = capacidad + (current_mA * 5/3600); Serial.print("Bus Voltaje: "); Serial.print(busvoltage); Serial.println(" V"); //Nos interesa Serial.print("Shunt Voltaje: "); Serial.print(shuntvoltage); Serial.println(" mV"); Serial.print("Carga Voltaje: "); Serial.print(loadvoltage); Serial.println(" V"); Serial.print("Corriente: "); Serial.print(current_mA); Serial.println(" mA"); Serial.print("Potencia: "); Serial.print(power_mW); Serial.println(" mW"); Serial.print("Tiempo en ejecucin: "); Serial.print(timerOn); Serial.println(" s"); Serial.print("Capacidad: "); Serial.print(capacidad); Serial.println(" mA"); Serial.println("");