This article proposes a novel real-time entropy estimation algorithm based on a Kalman filter combined with a nonlinear observer. The proposed algorithm requires the thermodynamic profile of the battery to be extracted in the laboratory from fresh batteries beforehand, which is piecewise linearly approximated by mean of B-Splines of the first order. Then, a nonlinear observer is used to estimate in real time the open-circuit voltage of the battery. Finally, using the linearized thermodynamic profile as a model and the estimated open-circuit voltage as input, a Kalman filter is designed to determine the entropy of the battery from the measured battery temperature. The proposed algorithm is embedded into a conventional 8 b 16 MHz microcontroller and, under standard constant current, constant-voltage charging conditions, estimates the entropy with less than 0.60 J$\cdot$K$<^>{-1}$ of error for three different types of lithium-ion batteries and less than 3 J$\cdot$K$<^>{-1}$ of error for one type of lithium-polymer batteries, while requiring less than 1 ms of computation time per iteration.