This Flask-based application provides a visual interface for monitoring battery cell data, including State of Health (SoH) and various performance metrics over time. The application uses data stored in a SQLite database, which is populated from CSV files containing battery cell data.
- Display State of Health (SoH) for multiple battery cells using pie charts
- Visualize detailed cell data including voltage, temperature, current, and capacity over time
- Interactive plots using Plotly
- Data stored and retrieved from SQLite database
- Data import from CSV files
app.py: Main Flask application file containing route definitions and data processing logicdatabase.py: Script for setting up the SQLite database and importing data from CSV filesbattery.db: SQLite database storing battery cell datatemplates/: Directory containing HTML templatesindex.html: Home page displaying SoH pie charts5308.htmland5329.html: Individual cell data pages
cell_5308.csv,cell_5329.csv: CSV files containing raw battery cell data
The data used in this application originates from Excel files (5308.xls and 5329.xls). The CSV files (cell_5308.csv and cell_5329.csv) were created by extracting specific columns from these Excel files. Here's the mapping of the data:
- Current Data: Sheet no: 4, Column No: 6
- Voltage Data: Sheet no: 4, Column No: 7
- Capacity Data: Sheet no: 4, Column No: 8
- Temperature Data: Sheet no: 6, Column No: 5
- Time Data: Sheet no: 4, Column No: 11
Code for extracting is mentioned in create_csv_file.ipynmb file
-
Clone this repository:
git clone https://github.com/JoshiSneh/Battery-Cell-Data-Visualization.git -
Install the required packages:
pip install -r requirements.txt
-
Ensure you have the CSV files (
cell_5308.csvandcell_5329.csv) in the project root directory. -
Run the database setup script:
python database.pyThis script will create the
battery.dbSQLite database and import data from the CSV files.
-
After setting up the database, run the Flask application:
python app.py -
Open a web browser and navigate to
http://localhost:8080to view the application.
/: Displays the home page with SoH pie charts for all cells/api/cell_data/<cell_id>: Retrieves and displays detailed data for a specific cell
The battery_data table in the SQLite database has the following structure:
id: INTEGER PRIMARY KEY AUTOINCREMENTcell_id: INTEGERrecord_index: INTEGERcurrent: REALvoltage: REALcapacity: REALtemperature: REALtimestamp: DATETIME
This project relies on the following main libraries:
- Flask
- SQLite3
- Plotly
- Pandas
- Bootstrap for the UI
