Accurate state-of-charge (SOC) detection was still a challenging task to complete due to complex battery dynamics and constantly changing external conditions. The formula for SOC was difficult to determine since external parameters including voltage, current, temperature, and battery arrangement were complex. Also the methods for estimating SOC that were already in use were not always appropriate for the same car operating in various road and climatic conditions. In all situations, the conventional methodologies did not deliver an accurate estimation performance. Here, a unique optimization-based Extreme Learning Machine (ELM) was created to accurately determine a battery's SOC and enhance the operation and safety of battery systems. A lithium ion battery was first created, and data on its current, voltage, SOC, capacity, duration, and discharge rate were gathered to produce a real-time dataset at several temperatures, including 00,250 and 450. The dataset underwent additional pre-processing to standardize the values and enhance the accuracy of the data. To determine the precise state of the battery, these pre-data were loaded into the ELM model. However, the performance of ELM was significantly influenced by the length of training and the number of neurons in a hidden layer. An advanced Honey Badger Optimization Algorithm (HBA) was used to choose the appropriate hidden neurons and increase the estimation accuracy in order to overcome this problem. The proposed SOC estimation model provides 97% accuracy in the FUDS drive cycle and 99% accuracy in the US06 drive cycle. The proposed model provides a well performance for estimating SOC in lithium-ion battery at various temperature, also the proposed model was fit for real time implementation.