File size: 2,568 Bytes
d5eb75b
 
 
 
 
 
 
 
 
 
 
 
2fd1e61
d5eb75b
2fd1e61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47b8c5a
d5eb75b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
---
title: Range Safe Mode Prototype
emoji: 😻
colorFrom: red
colorTo: green
sdk: gradio
sdk_version: 5.49.1
app_file: app.py
pinned: false
license: mit
short_description: Range safety calculator simulating realistic EV behaviour
---
# Range Safe Mode Prototype

## Overview
Range Safe Mode is an early functional prototype developed for **Project 2** in  
*Design and Deployment of AI/ML Systems*.  
The prototype helps EV drivers quickly determine whether they have enough battery  
to safely complete a trip using a simple **Safe / Marginal / Unsafe** indicator.

This prototype is designed to test user understanding of multi factor energy  
prediction not to provide exact real world accuracy.

---

## What the Prototype Does
The system estimates trip energy using:

- Distance (km)
- Elevation gain (m)
- Average speed (km/h)
- Temperature (°C)

Then compares the required energy against:

- Available battery (kWh)
- Reserve buffer (kWh)

The output includes:

- **SAFE TO PROCEED**  
- **MARGINALLY SAFE**  
- **CHARGING REQUIRED**

A short explanation and a confidence bar are also provided.

---

## Why the Margin Threshold is 5 kWh
A **5 kWh safety margin** was chosen for the prototype because:

- Most EVs consume **0.15–0.22 kWh per km**, so 5 kWh = ~25–30 km buffer.  
- It accounts for unexpected factors: sudden speed changes, weather shifts, detours.  
- Many OEMs recommend keeping a 5-10% buffer for battery health and uncertainty.  
- It prevents a route from being labeled “safe” when the margin is razor thin.

This number is not meant to be exact, it is a **reasonable, user-friendly buffer**  
for a prototype that communicates the idea of confidence vs. risk.

---

## How to Use
1. Enter the battery and trip parameters.  
2. Click **Submit**.  
3. Read the safety classification and explanation.  
4. Adjust inputs to test different scenarios.

---

## Limitations
This prototype does **not** include:

- Real map routing
- Live elevation APIs
- Weather or traffic data
- Battery aging / degradation
- Regenerative braking
- Real EV calibration

Energy estimates are **simulation-based** and meant for conceptual testing only.

---

## Tech Stack
- Python  
- Gradio UI  
- Lightweight simulated EV energy model

---

## Future Extensions
- Integrate elevation API (OpenElevation)  
- Add visual "range bubble" map overlay  
- Recommend fallback chargers  
- Combine with team features (queue prediction, congestion forecasting)

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference