In the rapidly evolving landscape of renewable energy and electrification, lithium-ion batteries have emerged as a cornerstone technology due to their high energy density, long cycle life, and versatility in applications ranging from portable electronics to electric vehicles and grid-scale energy storage. The safe and efficient operation of these li ion battery systems is paramount, driving the need for advanced monitoring techniques that can provide real-time insights into internal states without compromising performance. Traditional battery management systems (BMS) rely on voltage, current, and temperature measurements for state estimation, but these parameters offer limited visibility into the complex electrochemical processes within a li ion battery. Electrochemical impedance spectroscopy (EIS) has gained prominence as a non-invasive diagnostic tool, capable of revealing intricate details about a li ion battery’s health, state of charge (SOC), state of health (SOH), and internal temperature by analyzing its frequency-dependent impedance. However, conventional EIS measurements using benchtop potentiostats or galvanostats are often offline, costly, bulky, and require the li ion battery to be in a quiescent state, which may alter its internal conditions and limit practical deployment in dynamic operating environments. To address these limitations, I have developed an online impedance measuring device specifically designed for li ion battery applications, enabling rapid, accurate, and continuous impedance acquisition during operation. This device integrates seamlessly with existing BMS platforms, leveraging embedded microcontroller technology and advanced signal processing algorithms to facilitate real-time state estimation and fault预警 for li ion battery systems. In this article, I will elaborate on the design principles, implementation details, and experimental validation of this innovation, emphasizing its potential to enhance the safety and longevity of li ion battery packs across diverse sectors.
The core challenge in online impedance measurement for li ion battery systems lies in injecting a small-signal perturbation without disrupting normal operation and accurately extracting the impedance from the resulting response. Impedance, denoted as $Z$, is a complex quantity that varies with frequency $f$, and it is typically represented in terms of its magnitude $|Z|$ and phase angle $\phi$, or as real and imaginary components $Z = R_e + jX$, where $j = \sqrt{-1}$. For a li ion battery, the impedance spectrum across frequencies from millihertz to kilohertz reflects various physical processes: high-frequency regions correspond to ohmic resistance and inductance effects, mid-frequency arcs relate to charge-transfer kinetics and double-layer capacitance, and low-frequency tails indicate diffusion limitations. The relationship between the injected current $i(t)$ and the resulting voltage response $u(t)$ for a linear system is given by Ohm’s law in the frequency domain: $U(f) = Z(f) I(f)$, where $U(f)$ and $I(f)$ are the Fourier transforms of the time-domain signals. To achieve online measurement, I employ a current-mode excitation approach, where a sinusoidal current signal $i(t) = A \sin(2\pi f t + \phi_0)$ is superimposed on the li ion battery’s operating current. This current signal, with amplitude $A$ typically set to 0.05C of the li ion battery’s capacity to ensure linearity and minimal disturbance, generates a voltage response $u_B(t) = U_B \sin(2\pi f t + \phi_2) + u_d$, where $U_B$ is the amplitude, $\phi_2$ is the phase shift, and $u_d$ is the DC bias from the li ion battery’s open-circuit voltage. By simultaneously measuring the voltage across a precision shunt resistor $R_{cal}$ in series with the li ion battery, which carries the same current $i(t)$, I obtain $u_R(t) = U_R \sin(2\pi f t + \phi_1) + u_d$, with $U_R = A R_{cal}$ and $\phi_1 = \phi_0$. The li ion battery impedance is then computed using a ratio method to eliminate common-mode noise and DC offsets:
$$|Z| = \frac{U_B R_{cal}}{U_R},$$
$$\phi = \phi_2 – \phi_1,$$
$$R_e = |Z| \cos \phi,$$
$$X = |Z| \sin \phi.$$
This fundamental principle underpins the device design, but its practical implementation requires careful attention to signal generation, acquisition, and processing to achieve high accuracy across a broad frequency range from 0.01 Hz to 10 kHz.
The design of the online impedance measuring device for li ion battery systems is centered around an embedded microcontroller platform, chosen for its real-time processing capabilities, low power consumption, and ease of integration into BMS architectures. The device operates in two modes: a frequency-sweep mode for acquiring full EIS spectra and a fixed-frequency mode for continuous monitoring at a selected frequency, such as 70 Hz, which is often sensitive to li ion battery state changes. The hardware architecture comprises several key modules: a direct digital synthesizer (DDS) for programmable sine-wave generation, a voltage-to-current converter based on a Howland current pump to deliver the excitation current, signal conditioning circuits for amplifying and filtering the response voltages, a dual-channel analog-to-digital converter (ADC) for synchronous sampling, and the microcontroller unit (MCU) for control and computation. A block diagram illustrating the signal flow is presented in Table 1, summarizing the functional components and their interconnections.
| Module | Function | Key Components/Specifications |
|---|---|---|
| Microcontroller Unit (MCU) | System control, data processing, communication | STM32F407VET6 (Cortex-M4 core, FPU, DSP instructions) |
| Direct Digital Synthesizer (DDS) | Generate sinusoidal voltage signal | Programmable range: 0–500 kHz, resolution: 0.004 Hz |
| Low-Pass Filter | Remove high-frequency noise from DDS output | 7th-order elliptic filter, cutoff: 100 kHz |
| Operational Amplifier | Amplify DDS signal to desired level | Gain adjustable, bandwidth > 1 MHz |
| Voltage-to-Current Converter | Convert voltage to constant-amplitude sinusoidal current | Howland current pump, output: 0–500 mA |
| Shunt Resistor | Provide known reference for current measurement | Precision resistor, value matched to li ion battery impedance |
| Signal Conditioning | Amplify and remove DC bias from response voltages | Instrumentation amplifier, programmable gain amplifier, 4th-order Butterworth LPF (cutoff: 100 kHz) |
| Analog-to-Digital Converter (ADC) | Synchronously sample voltage signals | Dual-channel 16-bit ADC, sampling rate optimized per frequency band |
| Communication Interface | Data logging and external control | UART/USB to上位机 |
The software algorithm is pivotal for accurate impedance extraction, especially given the constraints of real-time processing. Traditional fast Fourier transform (FFT) methods, while computationally efficient, suffer from spectral leakage and the fence effect when the sampling frequency is not synchronized with the signal frequency, leading to errors in magnitude and phase estimation. To overcome this, I implemented an all-phase FFT (apFFT) algorithm, which considers all possible phase offsets of the sampled data by applying a windowing function and performing a circular shift before the FFT. For a discrete-time signal $x[n]$ of length $N$, the apFFT process involves forming a new sequence $y[n]$ by weighted overlapping of $x[n]$ centered at $n=0$, followed by an FFT. The apFFT output $Y[k]$ at frequency bin $k$ exhibits reduced spectral leakage and maintains phase invariance, meaning the phase of the central sample is preserved. The mathematical formulation for apFFT can be expressed as:
$$y[n] = \sum_{m=-(N-1)}^{N-1} w[m] x[((n-m))_N],$$
$$Y[k] = \sum_{n=0}^{N-1} y[n] e^{-j 2\pi k n / N},$$
where $w[m]$ is a symmetric window function (e.g., Hanning window), and $((\cdot))_N$ denotes modulo-N operation. Compared to standard FFT, apFFT enhances the main lobe-to-side lobe ratio, suppressing leakage, and yields a consistent phase reference. Furthermore, to mitigate the fence effect—where the true frequency falls between FFT bins—I incorporated an interpolation technique on the apFFT results. By applying a quadratic or sinc interpolation to the magnitude and phase spectra around the peak, the frequency resolution is effectively increased, allowing for more precise estimation of $U_B$, $U_R$, $\phi_1$, and $\phi_2$. This combination of apFFT and interpolation ensures that the impedance calculation for the li ion battery remains robust even with limited sampling points and non-coherent sampling, which is common in online scenarios where the li ion battery’s operating conditions may cause minor frequency drifts.
The hardware realization involves meticulous circuit design to maintain signal integrity across the target frequency range. The DDS module, controlled via SPI by the MCU, generates a low-distortion sine wave; its output is filtered to attenuate harmonics above 100 kHz, ensuring a clean excitation signal. The voltage amplifier stage adjusts the signal amplitude to drive the Howland current pump, which I designed to provide a transconductance gain $G = i_{out}/v_{in} = 1/R_{set}$, where $R_{set}$ is a set resistor. The output current $i_{out}$ is given by:
$$i_{out} = \frac{v_{in}}{R_{set}} \quad \text{for ideal components},$$
but in practice, I used precision resistors and low-offset operational amplifiers to minimize errors. The current injects into the series combination of the shunt resistor $R_{cal}$ and the li ion battery under test. The voltage drops across these elements are typically small (less than 10 mV for the li ion battery response to avoid nonlinearities), so the conditioning circuit first removes the DC bias using AC-coupling capacitors and then amplifies the signals with a programmable gain amplifier (PGA) whose gain is set by the MCU based on the measured amplitude to optimize the ADC dynamic range. The PGA output is further filtered by a 4th-order active low-pass Butterworth filter to reduce noise, and then sampled by the dual-channel 16-bit ADC at rates adapted to the excitation frequency: for instance, at 70 Hz, a sampling rate of 1 kS/s per channel is used, capturing multiple cycles for averaging. The MCU orchestrates the timing, triggers the DDS and ADC, processes the sampled data with apFFT and interpolation, computes the li ion battery impedance, and transmits results via UART to a host computer for logging. The entire device is powered by a stable DC supply, and all analog grounds are carefully routed to minimize interference.

To validate the performance of the online impedance measuring device for li ion battery applications, I conducted extensive experiments comparing its results with those from a commercial electrochemical workstation, which serves as a reference standard. The test objects included various li ion battery types: lithium iron phosphate (LFP) 18650 cells with capacities of 1000 mAh, 1100 mAh, and 1200 mAh; a ternary lithium (NMC) 18650 cell with 3300 mAh; and a lithium cobalt oxide (LCO) pouch cell with 4490 mAh. All li ion battery samples were preconditioned through five charge-discharge cycles at 1C rate in a temperature-controlled chamber at 25°C to stabilize their electrochemical states, and their consistency was verified via capacity and EIS checks. For static EIS measurements, each li ion battery was brought to specific SOC levels (10%, 30%, 50%, 70%, 90%) and allowed to rest for 3 hours to reach thermal and electrochemical equilibrium. The electrochemical workstation (CHI600E) applied a 5 mV sinusoidal voltage perturbation across the frequency range 0.01 Hz to 10 kHz, logging 6 points per decade. My device applied a sinusoidal current perturbation of amplitude 50 mA for the 1000 mAh LFP li ion battery and proportional amplitudes for others (0.05C), covering the same frequencies. The results, plotted as Nyquist plots (imaginary vs. real impedance), showed excellent agreement in shape and trends between the two methods, though slight discrepancies in magnitude were observed, attributable to differences in excitation signal nature (voltage vs. current) and potential nonlinearities in the li ion battery response at very low or high frequencies. Table 2 summarizes the key impedance parameters extracted at 1 kHz for the LFP li ion battery at 50% SOC, highlighting the comparative accuracy.
| Measurement Method | $|Z|$ at 1 kHz (mΩ) | $\phi$ at 1 kHz (degrees) | $R_e$ (mΩ) | $X$ (mΩ) |
|---|---|---|---|---|
| Electrochemical Workstation | 45.2 | -12.5 | 44.1 | -9.8 |
| Proposed Device | 46.8 | -13.1 | 45.6 | -10.6 |
The dynamic impedance measurement capability was evaluated by monitoring the li ion battery impedance at a fixed frequency of 70 Hz during charge and discharge cycles. The li ion battery was subjected to a 1C constant-current-constant-voltage (CC-CV) charge protocol (1000 mA charge to 3.6 V, then hold at 3.6 V until current drops below 50 mA) and a 1C constant-current discharge to 2.0 V, while my device continuously injected the 70 Hz sinusoidal current and computed impedance every 0.5 seconds. The results, as shown in Figure 1 (note: figure not included per instructions, but described), revealed distinct patterns: during CC charge, the impedance gradually decreased due to rising temperature and increasing SOC, then dipped sharply at the transition to CV charge before rising slowly as polarization effects dominated; during discharge, the impedance remained relatively stable until the end, where a rapid increase followed by fluctuations signaled approaching depletion. This end-of-discharge impedance surge, consistent across all tested li ion battery types, can serve as an early warning indicator for over-discharge in li ion battery management. To quantify the device’s response time, I measured the impedance update rate at 70 Hz to be approximately 2 Hz, sufficient for real-time monitoring in most li ion battery applications.
Further analysis involved characterizing the device’s performance across frequencies. The impedance magnitude and phase measurements for the LFP li ion battery at 50% SOC were compared against the electrochemical workstation data over the full 0.01 Hz to 10 kHz range, and the relative errors were computed. The error in magnitude, $\epsilon_{|Z|} = \frac{|Z|_{device} – |Z|_{ref}}{|Z|_{ref}} \times 100\%$, remained below 5% for frequencies above 1 Hz, but increased to around 10% at 0.01 Hz due to longer measurement times and potential drift in the li ion battery state. The phase error $\epsilon_{\phi}$ was within ±2 degrees for most frequencies, validating the apFFT’s phase accuracy. These errors are acceptable for online diagnostics, as trends rather than absolute values are often critical for li ion battery state estimation. Additionally, I tested the device’s robustness by introducing controlled noise into the excitation path and observing the impedance output; the apFFT algorithm’s inherent noise suppression kept variations within 3%, demonstrating reliability in noisy environments typical of electric vehicle or grid storage systems where li ion battery packs operate.
The mathematical models underlying the li ion battery impedance behavior also inform the device’s design. A common equivalent circuit model for a li ion battery includes a series resistance $R_s$, a parallel combination of charge-transfer resistance $R_{ct}$ and double-layer capacitance $C_{dl}$, and a Warburg impedance $Z_W$ for diffusion. The total impedance $Z_{bat}$ can be expressed as:
$$Z_{bat}(f) = R_s + \frac{R_{ct}}{1 + j 2\pi f R_{ct} C_{dl}} + Z_W(f),$$
where $Z_W(f) = \sigma \omega^{-1/2} (1-j)$ for a semi-infinite diffusion process, with $\sigma$ as the Warburg coefficient and $\omega = 2\pi f$. My device’s ability to measure $Z_{bat}(f)$ across frequencies allows for extracting these parameters through curve-fitting techniques, enabling deeper insights into the li ion battery’s degradation mechanisms. For instance, an increase in $R_s$ over time may indicate electrolyte dry-out, while growth in $R_{ct}$ suggests electrode passivation. By integrating such models into the MCU firmware, the device could potentially estimate SOH online by tracking parameter shifts, though this requires further calibration and machine learning approaches beyond the current scope.
In terms of practical implementation, the device’s power consumption is a key consideration for integration into BMS. The MCU, DDS, and analog circuits draw approximately 150 mA at 3.3 V, which is negligible compared to the li ion battery pack’s overall energy budget. The physical footprint is compact, with a prototype PCB measuring 10 cm × 6 cm, allowing for mounting directly on li ion battery modules. Communication protocols such as CAN bus or daisy-chained UART can be added for networking multiple devices in large li ion battery systems. The cost of components is estimated under $50 per channel, making it economically viable for mass adoption. Future enhancements could include multi-frequency excitation using sum-of-sines signals to accelerate EIS acquisition, or adaptive frequency selection based on the li ion battery’s operating point to optimize diagnostic relevance.
To summarize, the online impedance measuring device I have designed offers a robust solution for real-time monitoring of li ion battery states. Its architecture combines precise analog front-end electronics with sophisticated digital signal processing, centered on the apFFT algorithm to ensure accuracy despite sampling constraints. Experimental validation with diverse li ion battery chemistries and capacities confirms that the device replicates the trends observed in laboratory-grade equipment, while its dynamic measurement capability reveals characteristic impedance signatures that can be leveraged for fault预警, such as over-discharge or thermal runaway precursors. The integration of this technology into BMS will empower safer and more efficient management of li ion battery energy storage systems, extending their lifespan and preventing catastrophic failures. As the demand for reliable li ion battery performance grows across transportation and renewable energy sectors, innovations like this device will play a crucial role in unlocking the full potential of li ion battery technology.
Looking ahead, several avenues for further research emerge. First, the device could be enhanced with temperature compensation algorithms, since li ion battery impedance is highly temperature-dependent; incorporating a thermal sensor and using Arrhenius-based corrections would improve state estimation accuracy. Second, expanding the frequency range down to 0.001 Hz would capture slower diffusion processes, providing earlier detection of li ion battery aging, though this would necessitate longer measurement intervals and advanced signal processing to maintain online capability. Third, integrating artificial intelligence for real-time pattern recognition of impedance spectra could enable predictive maintenance, alerting users to anomalies before they escalate. Lastly, field trials in actual electric vehicles or grid storage installations will be essential to validate the device’s durability and performance under real-world conditions, where li ion battery packs face vibrations, temperature fluctuations, and complex load profiles. By continuing to refine this technology, I aim to contribute to a future where every li ion battery is intelligent, self-monitoring, and inherently safe, thereby accelerating the global transition to sustainable energy systems.
