How We Cracked the Code to Predict Electric Bike Battery Temperature Using AI

Riding an electric bike on a hot day with a passenger? Your battery feels it too. We set out to understand exactly how temperature affects LiFePO4 batteries and built AI models that can predict it with remarkable accuracy.

Published in Materials

How We Cracked the Code to Predict Electric Bike Battery Temperature Using AI
Like

Share this post

Choose a social network to share with, or copy the URL to share elsewhere

This is a representation of how your post may appear on social media. The actual post will vary between social networks

The Problem That Started It All

Electric vehicles are transforming transportation, but there's a hidden challenge most riders never see: battery temperature management. During my years teaching automobile engineering, I noticed a recurring pattern—students and industry professionals alike struggled to predict how batteries would behave under real-world conditions. Unlike controlled laboratory environments, actual roads present countless variables: changing speeds, passenger loads, weather conditions, and charging patterns. Each factor influences battery temperature, which in turn affects everything from range to safety.

The spark for this research came from a conversation with an electric bike rider who complained about reduced range on hot afternoons with a passenger. That simple observation led to a fundamental question: Could we predict battery temperature with enough precision to optimize performance and extend lifespan?

Over view of the article

Why LiFePO4 Batteries?

We chose lithium iron phosphate (LiFePO4) batteries for good reason. These batteries are increasingly popular in electric bikes due to their exceptional thermal stability, long cycle life, and safety profile. Unlike some lithium-ion chemistries prone to thermal runaway, LiFePO4 offers a more forgiving safety margin—but that doesn't mean temperature doesn't matter. Even these robust batteries suffer degraded performance and shortened lifespan when operating outside optimal temperature ranges.

Building Our Experimental Setup

The methodology required precision and real-world relevance. We equipped an electric bike with a FLIR One Pro thermal imaging camera—a professional-grade tool with 0.06°C thermal sensitivity. The battery pack, enclosed in a black carton to minimize external heat exchange, became our test subject. Every surface—front, back, left, right—was monitored continuously.

Our testing protocol was comprehensive. We ran discharge tests at three speeds (30, 40, and 50 kmph) both with passengers (rider: 63 kg, pillion: 60 kg) and without load using a chassis dynamometer. We also compared daytime versus nighttime charging. Temperature readings were captured every three minutes, creating a rich dataset that captured the dynamic thermal behavior of the battery under diverse operating conditions.

The controlled environment was crucial. We maintained ambient temperature at 28.5±0.7°C and relative humidity at 71.9±0.8% throughout all experiments. This consistency allowed us to isolate the specific effects of speed, load, and charging conditions without confounding variables.

What the Thermal Images Revealed

The thermal imaging data told a fascinating story. During discharge tests with passengers, average surface temperatures reached 39.44°C at 30 kmph, 37.59°C at 40 kmph, and 36.35°C at 50 kmph. Without passengers, these temperatures dropped dramatically to 31.35°C, 31.31°C, and 32.02°C respectively. The passenger load effect was undeniable—additional weight demanded more power, generating significantly more heat.

The speed relationship proved counterintuitive. Lower speeds (30 kmph) generated higher temperatures due to less efficient motor operation and reduced cooling airflow. As speed increased to 40 kmph, motor efficiency improved, but airflow still wasn't optimal. At 50 kmph, we found the sweet spot—peak motor efficiency combined with adequate cooling airflow.

Charging behavior revealed another critical insight. Daytime charging averaged 36.40°C with peaks reaching 40.50°C, while nighttime charging stayed cooler at 34.67°C average and 38.90°C maximum. External factors—ambient temperature and solar radiation—clearly influenced thermal behavior. Consistently, the battery's front side showed the highest temperatures, likely due to proximity to the motor and exposure to road heat.

The Machine Learning Competition

With our comprehensive dataset in hand, we turned to artificial intelligence. We tested four machine learning models: Random Forest, Long Short-Term Memory (LSTM) networks, Multi-Layer Perceptron (MLP), and Support Vector Machines (SVM). Each brought unique strengths to the challenge.

Random Forest emerged as the champion. This ensemble learning method achieved an R-squared value of 0.9228 and a remarkably low root mean squared error (RMSE) of 0.9023. What made Random Forest particularly effective was its ability to capture complex, non-linear relationships between multiple variables—speed, time, load conditions, and position on the battery pack.

LSTM performed admirably as well, demonstrating its strength in handling sequential, time-series data. Its ability to remember long-term dependencies made it well-suited for tracking temperature evolution over time. However, LSTM's computational cost was significantly higher—86.48 seconds training time compared to Random Forest's 0.63 seconds.

The MLP and SVM models, while respectable, couldn't match the accuracy of Random Forest and LSTM. MLP's sensitivity to hyperparameters and potential for overfitting limited its performance. SVM, despite its theoretical elegance, struggled with the dataset's complexity.

The Practical Implications

Why does this matter beyond academic circles? Accurate temperature prediction enables intelligent battery management systems that can make real-time decisions. Imagine an electric bike that automatically adjusts charging rates based on ambient temperature, or one that warns riders when battery temperature approaches critical thresholds.

For manufacturers, these insights translate to better thermal management system design. Knowing that the front side consistently runs hottest informs cooling system placement. Understanding the passenger load effect helps calibrate power management algorithms. Recognizing the day-night charging differential enables smart charging schedules that minimize thermal stress.

For the environment, the stakes are even higher. Extending battery lifespan through optimized thermal management means fewer battery replacements, reducing the environmental impact of battery production and disposal. A battery that lasts 20% longer represents substantial savings in materials, energy, and carbon emissions.

Challenges We Overcame

The research wasn't without obstacles. Converting two-dimensional thermal images into meaningful zero-dimensional temperature data required careful calibration. Setting emissivity values correctly (we used 0.95) was critical for accurate measurements. Ensuring consistent test conditions across multiple days of testing demanded meticulous attention to detail.

Data processing presented its own challenges. With temperature readings from four battery sides at three-minute intervals across multiple test conditions, we generated thousands of data points. Cleaning, normalizing, and preparing this data for machine learning required sophisticated preprocessing techniques.

Looking Forward

This research opens numerous avenues for future exploration. How do different battery chemistries respond to similar conditions? Can we integrate ambient temperature predictions to enable proactive thermal management? What about battery aging—how do temperature patterns change as batteries degrade over thousands of cycles?

We're also excited about real-time implementation. The Random Forest model's computational efficiency (0.026 seconds prediction time) makes it ideal for embedded systems. Imagine this model running directly on an electric bike's battery management system, providing instant temperature predictions that inform power delivery and charging decisions.

The Broader Vision

Ultimately, this work contributes to a cleaner transportation future. Electric vehicles represent our best path toward reducing transportation emissions, but only if batteries perform reliably and last their intended lifespan. Every percentage point of efficiency gained, every month of extended battery life, brings us closer to widespread EV adoption.

The intersection of thermal imaging, machine learning, and battery technology represents exactly the kind of interdisciplinary problem-solving our world needs. It's not just about making electric bikes work better—it's about making sustainable transportation accessible, reliable, and efficient for everyone.

Please sign in or register for FREE

If you are a registered user on Research Communities by Springer Nature, please sign in

Follow the Topic

Batteries
Physical Sciences > Materials Science > Materials for Energy and Catalysis > Batteries