This project aims to analyze On-Board Diagnostics (OBD) data to calculate vehicle fuel efficiency, CO2 emissions, and provide actionable suggestions to improve these metrics. The project includes generating a sample dataset, analyzing the data using the Groq language model, and demonstrating how to read data from an OBD adapter.
-
sample_input.py: This script generates a sample dataset for OBD data, including metrics like speed, RPM, throttle position, fuel level, and more.
-
groq_llama3_analysis.py: This script processes the sample dataset, calculates metrics such as fuel consumed, fuel efficiency, CO2 emissions, and deviation, and sends this data to the Groq language model for analysis and suggestions.
-
obd.py: This script demonstrates how we would read data from an OBD adapter. Note that this is just a demonstration script and cannot be run without access to an actual OBD adapter.
-
Generate Sample Dataset:
- Run
sample_input.pyto generate a sample OBD dataset. This will create a CSV file with synthetic OBD data.
python sample_input.py
- Run
-
Analyze Data:
- Run
groq_llama3_analysis.pyto process the sample dataset and generate analysis output.
python groq_llama3_analysis.py
- Run
-
OBD Data Reading:
obd.pyis provided as a demonstration of how to read data from an OBD adapter. This script cannot be executed without an OBD adapter connected to the vehicle.
python obd.py
- Python 3.x
- pandas
- json
- time
- groq
- dotenv
-
Clone the Repository:
git clone <repository_url> cd <repository_directory>
-
Install Required Packages:
pip install pandas jsonlib-python3 python-dotenv groq
-
Set Up Environment Variables:
- Create a
.envfile in the project directory and add your Groq API key:
GROQ_API_KEY=your_groq_api_key - Create a
Sample output generated by the analysis script will be saved in the output directory. The output includes detailed analysis of fuel efficiency, CO2 emissions, and actionable suggestions for improving vehicle performance.