Skip to main content

Solar Power Management and SoC Prediction System Using Machine Learning

Page 1


International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 12 Issue: 12 | Dec 2025 www.irjet.net p-ISSN: 2395-0072

Solar Power Management and SoC Prediction System Using Machine Learning

1

Dept. of Electronics & Communication,

Abstract - Effective management of energy storage is crucial for off-grid solar systems. Traditional charge controllers depend on fixed voltage thresholds and often cannotpredictcriticalbatterydrainsbeforetheyhappen.This paperintroducesasmartsolarmanagementsystemthatuses aHybridIoTArchitecture,combiningThingSpeakfordataset creationand Blynkfor real-timeuser monitoring.Thesystem is designed on the ESP32 microcontroller and works with INA219, BME280, and BH1750 sensors. A unique Edge AI method is used where a Multiple Linear Regression (MLR) model, trained on historical data collected through ThingSpeak, is deployed directly on the ESP32 to predict the future State of Charge (SoC). This enables the system to manage loads (relays) proactively and inform users through the Blynk app and a local buzzer. Experimental results indicate that the predictive model accurately estimates battery backup time and significantly reduces unexpected power outages compared to traditional methods.

Key Words: IoT, Solar Energy, Machine Learning, SoC Prediction, ESP32, Battery Management, Remote Monitoring, INA219.

1.INTRODUCTION

Solarenergyisquicklybecomingthebestrenewableenergy source for off-grid use. However, the reliability of a solar photovoltaic(PV)systemismainlytiedtoitsenergystorage unit,thebattery.Inruralandoff-gridsettings,batteryhealth oftensuffersbecauseofinconsistentchargingcyclescaused byunpredictableweather,likecloudyskiesorrain.Amajor challengeforthesesystemsistheabsenceofsmartenergy management. Most traditional solar charge controllers available today work in a "reactive" way. They check the battery'sterminalvoltageandonlycutofftheloadwhenthe voltagedropsbelowasetlevel,usually11.5Vor11.7V.This approach often doesn't work well because voltage can change a lot with heavy loads. This can lead to early disconnectionsor,ontheotherhand,deepdischargesthat canseriouslyharmthebattery.Additionally,thesesystems don’tinformusersabouttheactual"backuptime"left,which canleavethemunpreparedforunexpectedpoweroutages. Tofillthesegaps,thispaperintroducesaSmartSolarPower Management System that uses Edge Artificial Intelligence (AI)andaHybridIoTArchitecture.BycombiningtheESP32 microcontroller with a Multiple Linear Regression (MLR) model,theproposedsystemturnsaregularsolarsetupinto asmartdevicethatcanforecastfutureenergyavailability.

Institute of Technology, Karnataka, India

1.1 Motivation

The main reason for this project is the limitations of current "Voltage-Based" monitoring systems. Voltage is a delayed signal of battery capacity. By the time a typical controller notices low voltage, the battery might be significantly drained. Furthermore, standard controllers cannotseeenvironmentalfactors.Theydonotconsiderhow temperatureorsunlightintensityimpactsthechargingrate.

Thereisaclearneedforasystemthatcan:

 Predictpowerfailurebeforeithappens.

 Enable users to remotely monitor and control their energyusage.

 Automatically reduce non-essential loads, like heavysockets,toextendtheruntimeofcritical appliances,likelights.

1.2 Objectives

The main goal of this work is to design a low-cost, predictive energy manager using the ESP32 NodeMCU. Unlikesolutionsthatrelyonthecloud,thissystemusesEdge AI,whichmeansthedecision-makingalgorithmrunslocally onthemicrocontroller.

 Data Driven: We use ThingSpeak to log historical sensordata,includingVoltage,Current,Lux,and Temperature,totrainourpredictionmodel.

 UserCentric:WeusetheBlynkIoTApptoprovide real-timevisualizationandmanualcontrolover householdloads.

 PredictiveLogic:ThesystemestimatestheStateof Charge (SoC) and actively manages the load relays to prevent blackouts and extend battery life.

2. PROPOSED SYSTEM DESIGN

Theproposedsystemisbuiltasastandalone,smartenergy manager that runs on a "Sense-Predict-Act" cycle. Unlike passivedataloggers,thissystemtakesactiontoprotectthe batteryusingreal-timeandpredicteddata.Thestructureis divided into two main areas: the Hardware Layer and the IoT/SoftwareLayer

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 12 Issue: 12 | Dec 2025 www.irjet.net p-ISSN: 2395-0072

2.1 Hardware Architecture

The core processing unit is the ESP32 NodeMCU (38-pin version), powered by a dual-core Xtensa® 32-bit LX6 microprocessor.Thisspecificcontrollerwaschosenforits high clock speed (240 MHz) and built-in Wi-Fi/Bluetooth stack. This allows it to run complex machine learning regressionalgorithmswhilekeepingastableconnectionto theIoTcloud.

The hardware is organized into three functional subsystems:

1) Sensing Block (Data Acquisition) We achieve precise monitoringusingtheI2Ccommunicationprotocol.

a) PowerMonitoring:WeusetwoINA219High-Side DCCurrentsensors:

i) SensorA(Address0x40):Thissensorisplaced betweentheBatteryandtheLoadtomeasure DischargeCurrentandTerminalVoltage.

ii) SensorB(Address0x44):Thissensorisplaced betweentheSolarPanelandChargeController tomeasureGenerationCurrent.

b) EnvironmentalMonitoring:ABH1750digitallight sensor measures solar irradiance (Lux) to assess "SolarAvailability,"whileaBME280sensortracks ambient temperature, as battery capacity drops significantlyattemperaturesabove45°C.

2) Actuation Block (Load Management) To manage householdappliances,weusea4-ChannelRelayModule (5V, Active Low). The relays are optically isolated to protectthemicrocontrollerfromback-EMF.Theloads fallintotwocategories:

a) CriticalLoads:LightsandFans(ConnectedtoRelays 1&2)

b) Non-EssentialLoads:HeavySocketsandChargers (ConnectedtoRelays3&4),whichwedisconnect firstduringa"LowPower"event.

3) FeedbackBlock:

a) Visual: A 0.96-inch OLED Display (SSD1306) connected via I2C gives on-site technicians realtimediagnosticdata(Voltage,Current,Prediction).

b) Auditory: A Piezo Buzzer produces distinct alarm sounds(e.g.,3rapidbeeps)whentheAIpredictsa criticalbatteryfailurewithinthenext2hours.

2.2 Hybrid IoT Framework

Tobalancedataloggingrequirementswithreal-timeuser control,ahybridarchitecturewasimplemented:

1:BlockDiagramofProposedSystem

 ThingSpeak(CloudLayer):Servesasthedatabase. The system uploads sensor telemetry every 15 seconds. This historical data iscrucial for training theregressionmodel.

 BlynkIoT(EdgeLayer):Servesastheuserinterface. It utilizes Virtual Pins(V1 to V13) to receive realtimealertsandsendcontrolcommands(switching relaysON/OFF)backtotheESP32withlowlatency.

3. METHODOLOGY AND ALGORITHM

Theintelligenceofthissystemcomesfromitsfirmware.This allows the ESP32 to make independent decisions without needingaconstantinternetconnection.Theprocessconsists of three stages: Data Logging, Training, and Edge Deployment.

3.1 Data Acquisition (Training Phase)

Before the system could predict battery life, weneeded to understand how environmental factors affected battery drainage.Wefirstsetupthesystemin"DataLoggingMode." ItuploadedsensordatatoThingSpeakevery15seconds.The datasetincluded:

 SolarGenerationCurrent(Isol)andVoltage.

 BatteryVoltage(Vbat)andDischargeCurrent.

 AmbientTemperature(T)andLightIntensity (Lux).

Thisdatacollectionphaseshowedthatbatteryefficiency dropssignificantlywhenthetemperaturegoesbeyond 40°C.Standardvoltage-basedcontrollersdonotdetectthis pattern.

3.2 Edge AI Implementation (SoC Prediction)

To predict the State of Charge (SoC), we used a Multiple LinearRegression(MLR)model.Thisalgorithmdiffersfrom simplethresholdchecksbecauseitlooksatseveralvariables to predict the battery's future status. The regression

Figure

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 12 Issue: 12 | Dec 2025 www.irjet.net p-ISSN: 2395-0072

equation,basedonourtrainingdataand embeddedinthe ESP32firmwareis:

SoCpred=(ALux)+(BTemp)+(CIsol)+(DVbat)+K

WhereA,B,C,DarethetrainedweightcoefficientsandKis theintercept.TheESP32calculatesthispredictioninrealtime. If the model forecasts that the battery will reach a criticallevel<20%withinthenexthour,Thesystemstarts loadsheddingaheadoftime.

3.3 System Operational Logic

Thecontrolflow,illustratedinFig-2,operatesasfollows:

 Initialization:ThesystemconnectstoWi-Fiand calibratesthesensors.

 Sensing:TheINA219,BME280,andBH1750 sensorscollectreal-timedata.

 Prediction:TheEdgeAImodelcalculatesthe "TimetoEmpty."

 DecisionMaking:

 HealthyState:IfSoCisgreaterthan50%, allRelaysareON.

 WarningState:IfSoCislessthan40%or ahighloadisdetected,theBuzzerbeeps, andanotificationissenttotheBlynk App.

 CriticalState:IfthepredictedSoCisless than20%,Relays3and4(Sockets)are turnedOFFtosavepowerforlighting.

4. RESULTS AND DISCUSSION

Theteamtestedthesystemunderdifferentenvironmental conditionstochecktheperformanceoftheEdgeAImodel and the responsiveness of the IoT interface. The testing focusedonhowwellthesystemcouldpredictlow-battery eventsandsendremotealerts.

4.1 IoT Dashboard and Control

Theuserinterface,createdontheBlynkIoTplatform,actsas themaincontrolcenter.AsshowninFig3,thedashboard offersreal-timevisibilityintothesystem'sparameters:

 Battery Gauge: Displays the live State of Charge (SoC)percentage(0-100%).

 HistoryGraph: Monitorsreal-timecurrentvaluesof acompletedayfromtheINA219sensors.

 StatusIndicators:Textwidgetsupdatedynamically basedontheAI'sdecision(e.g.,displaying"System Healthy"or"Critical:UnplugSockets").

 ButtonWidges:Tocontrolrelayswitchingfromthe Blynkapplicationitself.

4.2 Performance Analysis

During the testing phase, the system underwent a forced discharge scenario. When the battery voltage dropped to 11.8V,thefollowingautomatedactionswereobserved:

 Latency:Thedatatransmissiontothecloudshowed aminimallatencyof1-2seconds.

 Alerts: The system correctly triggered a push notification to the mobile device ("Low Battery Warning").

 Actuation:The"AISuggestion" widgetupdatedto display"UnplugSockets,"andtherelaycontrolling the non-essential load was automatically disengaged,confirmingthesuccessfulexecutionof thesafetylogic.

Figure 2:FlowDiagramofSystem
Figure 3: Blynk application

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 12 Issue: 12 | Dec 2025 www.irjet.net p-ISSN: 2395-0072

3. CONCLUSIONS

This paper describes the design and implementation of a SmartSolarPowerManagementSystemthatusestheESP32 microcontrollerandEdgeAI.Bymovingfromatraditional voltage-basedcutofftoapredictivedata-drivenmodel,the system effectively tackles the frequent problem of unexpectedblackoutsinoff-gridsetups.

Thekeyachievementsofthisworkinclude:

1. IntelligentControl:TheembeddedMultipleLinear Regression (MLR) model allows the system to foreseecriticalbatterydrain1-2hoursinadvance.

2. Hybrid IoT Architecture: The integration of ThingSpeak for data analysis and Blynk for realtimeuserinteractioncreatesa robustmonitoring ecosystem.

3. BatteryProtection:Byautomaticallysheddingnonessentialloads(sockets)whilekeepingcriticalloads (lights) on, the system extends the functional runtimeofthebatteryduringcloudydays.

Future enhancements will focus on implementing Deep Learning(LSTM)algorithms tointegrateweatherforecast APIs,allowingthesystemtoadjustenergybudgetsbasedon tomorrow’spredictedsunlight.

ACKNOWLEDGEMENT

Wewouldliketoexpressourdeepsenseofgratitudetoour project guide, Prof. Lohit Dalal, Assistant Professor, Department of Electronics & Communication, for their valuableguidance,continuousencouragement,andtechnical supportthroughoutthecourseofthiswork.

Wealsoextendoursincerethanksto Dr.SridharIyer,Head of the Department, and Dr. B.R.Patagundi, Principal of S.G.BalekundriInstituteofTechnology,forprovidingthe necessary infrastructure and laboratory facilities to completethisprojectsuccessfully.

Finally,wewouldliketothankourparentsandfriendsfor their moral support and constructive criticism which motivatedustoworkharder.

REFERENCES

[1]S.A.Sarkar,A.D.Nimbalkar,andA.S.Patil,"Design of SolarPanelMonitoringSystemUsingESP32&IoT,"in2024 IEEEInternationalConferenceonSmartPowerControland RenewableEnergy(ICSPCRE),2024,pp.1–6.

[2]G.A.Bhatane,V.J.Gond,S.V.Chaudhari,andP.William, "Real TimePerformanceMonitoringofSolarPV Panel IoT SystemforEnergyOptimization,"in20244thInternational

Conference on Innovative Practices in Technology and Management(ICIPTM),Noida,India,2024,pp.1–6.

[3]S.Hossain,M.E.H.Sajib,andM.N.Hasan,"Designand Implementation of an IoT Based Solar Power Monitoring System," in 2023 IEEE World AI IoT Congress (AIIoT), Seattle,WA,USA,2023,pp.0211–0216.

[4]V.B.Gaikar,R.G.Deshmukh,andT.R.Kumar,"IoTbased solar energy monitoring system," Materials Today: Proceedings,vol.80,pp.3535–3540,2023.

[5] Texas Instruments, "INA219 Zero-Drift, Bidirectional Current/Power Monitor with I2C Interface," SBOS448G Datasheet,Aug.2008,revisedDec.2015.

[6]EspressifSystems,"ESP32SeriesDatasheet,"Version4.3, EspressifSystems,Shanghai,China,2023

BIOGRAPHIES

Ansh Shinde

Final year B.E. student in ECE at S.G.B.I.T college. His interests include VLSI and Embedded Systems. He led the firmware developmentforthisproject.

Neeraj Maggavi

Final year B.E. student in ECE at S.G.B.I.Tcollege.Hespecializesin Power Electronics and Circuit Design.Hemanagedthehardware assemblyandsensorcalibration.

Akshay Siddannavar

Final year B.E. student in ECE at S.G.B.I.T college. He is enthusiasticaboutAIandMachine Learning.Hedevelopedthebattery prediction algorithms for the system.

Siddarood Naragund

Final yearB.E. student in ECEat His focus is on Cloud Computing and Wireless Networks. He designedtheBlynkIoTdashboard andserverconnections.

Turn static files into dynamic content formats.

Create a flipbook