The EV Charging Scheduler is a predictive web application with 3D visualization that helps electric vehicle (EV) users find nearest charging stations, predict their vehicle's range, and optimize charging schedules based on grid load and energy prices.
With the rapid adoption of electric vehicles, users face several challenges:
- Range Anxiety: Uncertainty about how far their vehicle can travel
- Charging Station Congestion: Long wait times at popular stations
- Inefficient Charging: Charging during peak grid load times
- Lack of Real-time Information: Limited visibility into station availability
Our application addresses these challenges through:
- AI-Powered Predictions: ML models for demand and range prediction
- 3D Visualization: Interactive 3D map with animated vehicles
- Smart Scheduling: Optimal charging time recommendations
- Real-time Grid Data: Grid load and pricing information
Based on the project requirements:
-
Design and implement a smart charging scheduler for EVs using AI
- Machine learning models for demand prediction
- Intelligent scheduling algorithms
-
Optimize EV charging based on real-time data such as energy prices and grid load
- Real-time grid load monitoring
- Time-of-use pricing integration
- Optimal time slot recommendations
-
Reduce congestion and enhance user experience
- Demand prediction to avoid crowded stations
- Wait time estimation
- Alternative station suggestions
-
Promote sustainable energy utilization and efficient mobility solutions
- Renewable energy percentage tracking
- Off-peak charging incentives
- Grid-friendly charging behavior
-
Integrate modern computational technologies (AI, Cloud, 3D Visualization) for real-world applications
- FastAPI backend
- React + Three.js frontend
- Cloud deployment (Vercel + Render)
┌─────────────────┐ ┌─────────────────┐
│ Frontend │◄───────►│ Backend API │
│ (React + │ HTTP │ (FastAPI) │
│ Three.js) │ REST │ │
└─────────────────┘ └────────┬────────┘
│
┌──────▼────────┐
│ ML Models │
│ (Scikit- │
│ learn) │
└───────────────┘
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | React 19 | UI framework |
| Three.js + React Three Fiber | 3D visualization | |
| Bootstrap 5 | Styling | |
| Chart.js | Data visualization | |
| Axios | HTTP client | |
| Backend | Python 3.9+ | Programming language |
| FastAPI | Web framework | |
| Uvicorn | ASGI server | |
| ML/AI | Scikit-learn | Machine learning |
| Pandas, NumPy | Data manipulation | |
| Joblib | Model persistence | |
| Deployment | Vercel | Frontend hosting |
| Render | Backend hosting |
- Real-time station visualization with 3D markers
- Animated EV models moving through the terrain
- Interactive controls: Pan, zoom, rotate
- Station information on hover/click
- Grid terrain for spatial context
- Input parameters:
- Vehicle model selection
- Current battery level
- Battery capacity
- Driving conditions (normal/highway/city)
- Output:
- Predicted range in kilometers
- Efficiency (km/kWh)
- Confidence metrics
- Location-based search with radius selection
- Station details:
- Available chargers
- Charger types (Type 2, CCS, CHAdeMO)
- Pricing per kWh
- Amenities (Parking, WiFi, Cafe, etc.)
- Distance calculation using Haversine formula
- Current grid status:
- Load percentage
- Price multiplier
- Renewable energy percentage
- 6-hour load forecast with interactive charts
- Charging recommendations (Good time to charge / Consider waiting)
- Educational content about grid load levels
- Optimal time slot recommendations
- Cost savings estimation
- Grid load-based suggestions
- 24-hour forecast
station_id, name, latitude, longitude, total_chargers,
charger_types, power_kw, price_per_kwh, amenitiestimestamp, day_of_week, hour_of_day, is_weekend,
is_peak_hour, station_id, energy_demanded_kwh,
charging_duration_minutes, wait_time_minutestimestamp, hour_of_day, day_of_week, month,
grid_load_percentage, frequency_hz, voltage_kv,
renewable_percentage, temperature_celsiusdate, time_slot, price_per_kwh, demand_charge,
total_cost_per_kwh, time_of_use_categorymodel, battery_capacity_kwh, range_km,
efficiency_km_per_kwhGet all charging stations
Response:
{
"count": 3,
"stations": [...]
}Find nearest stations
Parameters:
latitude(float): User's latitudelongitude(float): User's longituderadius_km(float, optional): Search radius in km
Response:
{
"count": 2,
"search_radius_km": 10.0,
"location": {"latitude": 19.076, "longitude": 72.8777},
"stations": [...]
}Predict vehicle range
Request Body:
{
"battery_level": 80,
"battery_capacity": 60,
"vehicle_model": "Tesla Model 3",
"driving_conditions": "normal"
}Response:
{
"vehicle_model": "Tesla Model 3",
"battery_level": 80,
"battery_capacity": 60,
"driving_conditions": "normal",
"predicted_range_km": 312.5,
"efficiency_km_per_kwh": 6.5,
"timestamp": "2025-03-14T10:30:00"
}Predict station demand
Request Body:
{
"location": {"latitude": 19.076, "longitude": 72.8777},
"radius": 10
}Get optimal charging schedule
Request Body:
{
"location": {"latitude": 19.076, "longitude": 72.8777},
"required_charge": 50,
"preferred_time": "2025-03-14T18:00:00"
}Get current grid load status
Response:
{
"current_load_percentage": 65.5,
"status": "medium",
"price_multiplier": 1.0,
"recommended_charging": true,
"timestamp": "2025-03-14T10:30:00",
"region": "Mumbai",
"renewable_percentage": 22.5,
"forecast_next_6h": [...]
}- Algorithm: Gradient Boosting Regressor
- Features: day_of_week, hour_of_day, is_weekend, is_peak_hour
- Target: energy_demanded_kwh
- Performance: R² Score ~0.85
- Algorithm: Random Forest Regressor
- Features: battery_level, battery_capacity, driving_condition_*
- Target: predicted_range_km
- Performance: R² Score ~0.98
- Algorithm: Gradient Boosting Regressor
- Features: hour_of_day, day_of_week, month, temperature_celsius
- Target: grid_load_percentage
- Performance: R² Score ~0.90
- Node.js 18+ and npm
- Python 3.9+
- Git
cd backend
# Create virtual environment
python -m venv venv
# Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Generate synthetic datasets
python generate_data.py
# Train ML models
python train_models.py
# Start the server
uvicorn main:app --reloadBackend will be available at: http://localhost:8000
cd frontend
# Install dependencies
npm install
# Create .env file
cp .env.example .env
# Start development server
npm run devFrontend will be available at: http://localhost:5173
- Push code to GitHub
- Connect repository to Vercel
- Configure build settings:
- Framework Preset: Vite
- Build Command:
npm run build - Output Directory:
dist
- Set environment variable:
VITE_API_URL
- Push code to GitHub
- Create new Web Service on Render
- Configure:
- Root Directory:
backend - Build Command:
pip install -r requirements.txt - Start Command:
uvicorn main:app --host 0.0.0.0 --port $PORT
- Root Directory:
- Set environment variables as needed
Use the automatic API documentation at: http://localhost:8000/docs
cd frontend
npm run testev-charging-scheduler/
├── backend/
│ ├── main.py # FastAPI application
│ ├── generate_data.py # Data generation script
│ ├── train_models.py # ML model training
│ ├── requirements.txt # Python dependencies
│ ├── api/
│ │ ├── __init__.py
│ │ └── routes.py # API endpoints
│ ├── models/
│ │ └── __init__.py
│ └── utils/
│ └── __init__.py
├── frontend/
│ ├── src/
│ │ ├── App.jsx # Main app component
│ │ ├── main.jsx # Entry point
│ │ ├── index.css # Global styles
│ │ ├── App.css # App styles
│ │ ├── api/
│ │ │ └── apiService.js # API client
│ │ ├── components/
│ │ │ ├── Navbar.jsx
│ │ │ ├── HeroSection.jsx
│ │ │ ├── StationList.jsx
│ │ │ ├── RangePredictor.jsx
│ │ │ └── GridDashboard.jsx
│ │ └── scenes/
│ │ └── Map3DScene.jsx # 3D map component
│ ├── public/
│ ├── index.html
│ ├── package.json
│ └── .env
├── data/ # Synthetic datasets
├── ml_models/ # Trained ML models
├── docs/ # Documentation
├── README.md
└── .gitignore
-
Real-time Data Integration
- Connect to actual grid APIs
- Live station availability updates
-
User Authentication
- User accounts and profiles
- Charging history tracking
- Favorite stations
-
Advanced ML Models
- LSTM for time-series forecasting
- Reinforcement learning for scheduling
- User behavior prediction
-
Mobile Application
- React Native app
- Push notifications
- GPS integration
-
Payment Integration
- In-app charging payments
- Subscription plans
- Loyalty rewards
Project Team:
- [Your Name] - Full Stack Development
Guided by:
- [Guide Name] - Project Guide
Institution:
- [College/University Name]
- [Department Name]
MIT License - See LICENSE for details.
- FastAPI Documentation: https://fastapi.tiangolo.com/
- React Three Fiber: https://docs.pmnd.rs/react-three-fiber/
- Scikit-learn: https://scikit-learn.org/
- Chart.js: https://www.chartjs.org/
Last Updated: March 14, 2025