Hello Everyone!
I am working on Battery Management System (BMS), where I need Open circuit Voltage measurement (OCV) of the battery to be measured in real time. I have sensing circuit based on resistive voltage divider. I am measuring the OCV simply with internal ADC (16 bits) of FRDMK64F. But the problem i am facing is ADC is giving me non-Linear data for corresponding input from sensor output. I have check my sensing circuit voltage input (Regulated input Power supply) and output, its linear. But the ADC Data I am getting is not linear w.r.t sensing circuit output voltage and power supply. I have attached my codes for OCV measurement, Voltages (Power supply, sensing circuit, and FRDMk64F calculated) and ADC data. Also the corresponding plot of Power supply voltage and ADC data w.r.t sensing circuit voltage are attached.
(1)

********************************************************************************************************************
(2)

*******************************************************************************************************************
(3)

**********************************************************************************************************************
(4)
