Solar Wireless Electric Vehicle Charging
Solar Wireless Electric Vehicle Charging
Abstract
The rapid adoption of electric vehicles has created an urgent need for
intelligent charging solutions that go beyond simple power delivery. Current
charging stations often lack real-time monitoring, accurate billing
mechanisms, and vehicle detection capabilities. This project bridges these
gaps by creating a comprehensive charging management system.
Control Unit:
Sensing Modules:
User Interface:
Power Control:
Power Supply:
5V DC Power Source
Voltage Regulation Circuitry
4. Circuit Connections
1. Ultrasonic Sensor:
o VCC → 5V
o GND → Common Ground
o TRIG → GPIO14
o ECHO → GPIO12
2. LCD Display (I2C):
o SDA → GPIO21
o SCL → GPIO22
o VCC → 5V
o GND → Common Ground
3. Voltage Measurement:
o IN → GPIO27
o VCC → 5V
o GND → Common Ground
o NO → Charging Cable Positive
o COM → Power Source Positive
// Include necessary libraries
#include <Wire.h> // For I2C communication
#include <LiquidCrystal_I2C.h> // For I2C LCD display
#include <WiFi.h> // For WiFi connectivity
#include <WebServer.h> // For web server functionality
#include <HTTPClient.h> // For HTTP requests (not used in this
code)
#include <ArduinoJson.h> // For JSON data handling
// Sensor pins
#define ANALOG_IN_PIN 35 // Analog pin for voltage measurement
#define CURRENT_SENSOR_PIN 32 // Analog pin for current measurement
// Billing variables
unsigned long startTime = 0; // Timestamp when charging starts
(millis())
unsigned long chargingTime = 0; // Total charging duration in
milliseconds
bool isCharging = false; // Flag to track charging state
float costPerKWh = 13.03; // Cost per kilowatt-hour in rupees
int personCount = 0; // Counter for number of charging
sessions
// WiFi credentials
const char* ssid = "BATCH3"; // WiFi network name
const char* password = "123456789@Batch3"; // WiFi password
String response;
serializeJson(jsonDocument, response);
server.send(200, "application/json", response);
}
// Measure distance using ultrasonic sensor
float measureDistance() {
// Send 10us pulse to trigger pin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Display on LCD
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Time: ");
lcd.print(hours);
lcd.print(":");
if (minutes < 10) lcd.print("0"); // Leading zero for minutes
lcd.print(minutes);
lcd.print(":");
if (seconds < 10) lcd.print("0"); // Leading zero for seconds
lcd.print(seconds);
lcd.setCursor(0, 1);
lcd.print("Cost: ");
lcd.print(cost, 2); // Display cost with 2 decimal places
lcd.print(" INR");
// Initialize LCD
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("EV Charging");
delay(2000);
lcd.clear();
// Configure pins
pinMode(trigPin, OUTPUT); // Ultrasonic trigger pin as output
pinMode(echoPin, INPUT); // Ultrasonic echo pin as input
pinMode(relayPin, OUTPUT); // Relay control pin as output
// Connect to WiFi
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
readCurrent();
currentData.current = current_value;
lcd.setCursor(0, 1);
lcd.print("D:");
lcd.print(distance, 1);
lcd.print("CM ");