Crowd sourced smart EV charging station network using ML

Electric vehicle owners face the problem of having limited charging station options. Individual charging stations near households can act as a viable solution to solve this problem. A forecasting model which can effectively predict the power consumption of a charging station will help charging station owners get a clear view of how much energy to produce. With this intent, this paper proposes an Internet of Things (IoT) based charging station network that acts as a platform to provide charging to electric vehicles and a model based on ARIMA whose learners are fitted to the charging station subsets with optimum parameters to increase the overall performance of sales prediction. The proposed model predicted power consumption for 7 charging stations, with average MAPE, RMSE and R2 values of 12.88%, 5.67, and 0.79 respectively.


Introduction
With the rising adoption of electric vehicles, the automobile industry is undergoing rapid change. This necessitates the construction of a massive infrastructure of electric charging stations. According to a Business Standard research published in 2021, India will require 4,00,000 charging stations by 2026 to accommodate an anticipated 4 million electric vehicles [1]. The installation of an electric charging station is an expensive process, with an average cost of 25,00,000 INR. The majority of the costs are related to obtaining land cover and maintaining a steady supply of electricity. Setting up charging stations in residential areas could be a viable solution for providing cheaper land [2]. Using renewable energy to generate power can result in lower electricity costs [3].
Connecting charging stations to the internet and establishing a smart charging station allows consumers to schedule a charging station through a website or mobile app [4]. While smart charging stations have their advantages in this situation, automating the charging process and estimating the number of consumers on any given day is a hassle [5]. To address these issues, an IoT-based interconnected electric charging station is proposed, consisting of a network of automated charging stations that can be booked online. To effectively manage the charging station's energy source, an algorithm based on the ARIMA model is utilized to estimate daily sales for the charging station [6][7].

Proposed Method
A network of IoT-based charging stations is being established, and these charging stations can be booked through a website. The charging stations are connected to the cloud. A current sensor and a relay module are used in charging stations. On a regular basis, the data acquired from the sensors is uploaded to the cloud.
All the information about the clients who booked charging stations is saved. Customers will be given an authentication token that they can use to gain access to the charging station. The charging process is regulated by the current sensor based on the charging percentage selected by the customer on the website. The relay module is used to turn on and off the charging station's power supply. It is updated in the cloud, after the charging process is completed.
If a customer wants to book a charging station, they should go to the website and choose their location. The website dynamically displays the available charging stations based on the user's location .The charging station can be used by the customer after arriving at the designated charging station location and entering an authentication token provided to the customer after booking confirmation. The charging station list in a location is updated hourly on the website based on its availability, as shown in Fig. 1. The booking information is transferred to the cloud, and the authentication token information is forwarded to the charging stations that have been specified. After that, the authentication token can be used to authorize the customers. The list of available stations is updated on a regular basis by updating the charging station status after each successful order. Charging stations as shown in Fig. 2 are the devices available to a customer in a desired location To obtain insight into product sales at various stores over time, the dataset is exposed to exploratory data analysis (EDA), and several charts are created. After that, the dataset is subjected to feature engineering, which extracts important sub-features from the original features. Feature engineering helps develop a stronger machine learning model by expanding the dimensionality of the dataset. The dataset is divided into training and testing partitions. After the splitting method, time series forecasting is utilized to build the prediction model.

Implementation
A system of six charging stations is implemented where each charging station gets its input from the cloud that stores the order information received from the website. And performs physical action to charge the customer's vehicle to the desired charging percentage. The implementation of the proposed system is explained through the following subsections.

Website
A website is designed as shown in Fig. 3 which acts as a marketplace to book charging stations [8]. The following are the steps involved in developing the user interface web application for the proposed system: Step 1: The website is designed using React JS as the frontend framework and Express JS as the backend framework.
Step 2: Product details are rendered from Firebase based on the vending machine selected by the user.
Step 3: Authentication of the users and extraction of their user history is also done using Firebase.
Step 4: A State container is created using redux for processing order information.
Step 5: Payment interface is created using RazorPay.
Step 6: Verification of users and intimating the user about the package delivery status is done using Twilio.
Step 7: The authentication tokens of the booking are stored in Firebase cloud

Charging Station
The charging stations in the proposed system act as a power vending machine [9]. These charging stations consist of a constant power supply, a current flow sensor and a relay module. As mentioned before, the sensor is used to regulate the amount of charge that is flown out from the charging station. Whenever the charging station gets a booking authentication token from the cloud via ESP8266 module, the relay module allows the current flow till the current sensor notifies the microcontroller that the desired charging is reached. After the completion of the task a message is sent to the cloud regarding the task accomplishment.

Machine Learning
The data set, which was collected from retail shops, includes the date, timestamp, location and meter value [10] [11]. The proposed system's implementation is shown in Fig and described in the following subsections.

Load data
The data set is saved in a CSV file format. For the year 2020, the data set has three columns and 1,50,000 rows. As shown in Table I, the data set includes columns for station id and meter value for the various dates.

Preprocessing and Visualizing dataset
The seasonality of the input dataset is found using time series decomposition. This technique is used to decompose the time series data into trend, seasonality and residual components [12][13].

Trend
The Trend indicates the progression of sales over the year.

Stationarising Dataset
The statistical features of a dataset, such as mean, variance, autocorrelation, and others, are checked for consistency across time to assess its stationarity. Dickey-Fuller test can be used to determine if the series is stationary or not. We see that the p-value is greater than 0.05. To get a stationary series, we need to eliminate the trend and seasonality from the series [14]. Computing the differences between consecutive observations is the first difference that makes the non stationary series stationary. If after taking the first difference also doesn't result in p being less than 0.05 (Non Stationary), differencing is performed again until the sequence becomes stationary.

Parameter Determination
We must first find the best parameters for our forecasting model before proceeding. We'll need ACF and PACF graphs to get those ideal settings [15].

Autocorrelation Function(ACF)
The connection between time series observations and prior time steps, known as lags, may be calculated. The ACF plot shows the autocorrelations which measure the relationship between y(t) and y(t−k)for different values of k. ACF is exponentially decaying or sinusoidal. There is a significant spike at lag p in the PACF, but none beyond lag p.

Partial Autocorrelation Function(PACF)
PACF shows the relationship between y(t) and y(t−k) after removing the effects of lags 1,2,3,…,k−11,2,3,…,k−1. PACF is exponentially decaying or sinusoidal. There is a significant spike at lag q in the ACF, but none beyond lag q.

Results and Discussion
The metrics used to assess the proposed system's accuracy are Mean Absolute Percentage Error (MAPE), Root Mean Square Error (RMSE), and R2 score.
Mean Absolute Percentage Error: It's the root of the mean of squared differences between actual and predicted observations as in (2). The proposed model has an average RMSE value of 63.

∑
(2) -actual value -predicted value n -number of observations R 2 score: For regression models, the R2 score is a measure of goodness-of-fit. R2 is calculated by finding the variation of the difference of sum of squares and total sum as in (3). The proposed model's average R2 score is 0.76, indicating that it is better at fitting the data. The last six months of the dataset are utilized to evaluate the algorithm and forecast power consumption per day for the same time period. Fig. 5 indicates the depiction of power usage from the train, test sets, and predicted power usage.

Conclusion
The issue of a lack of charging stations can be addressed by establishing an integrated decentralized network of charging stations, and a machine learning forecasting algorithm can as sist in predicting energy consumption on a given day.