scieee AI-readable full text Open interactive document viewer

Smart Automatic Power Source Switching and Monitoring System Using Arduino

Omojoyegbe, Michael O; Oluwole, Ayodele. S; Akinsanmi, Olaitan; Famoriji, Oluwole John

Abstract

This paper presents the design and implementation of a smart automatic power source switching and monitoring system based on Arduino technology. The system intelligently prioritizes and selects among grid, generator, and inverter sources, while also integrating photovoltaic (PV) input for efficient battery charging. To enhance operational safety, the design incorporates overvoltage and undervoltage protection mechanisms that safeguard connected equipment under abnormal conditions. A 20×4 Liquid Crystal Display (LCD) provides real-time monitoring of the active source, AC voltage, frequency, PV power, and battery status. The deployed methods for this study to develop an algorithm for detecting and optimizing changes in power supply and demands using Arduino microcontroller and Proteus for the entire system expected performance demonstration purposes in real life. Experimental validation confirms the system’s capability to perform reliable automatic switching, efficient fault detection and recovery, and effective renewable energy integration. The proposed system is cost-effective, scalable, and suitable for both residential and industrial applications in regions with unstable power supply.

Full text

 Corresponding author: Oluwole John Famoriji Copyright © 2025 Author(s) retain the copyright of this article. This article is published under the terms of the Creative Commons Attribution License 4.0. Smart Automatic Power Source Switching and Monitoring System Using Arduino Michael O. Omojoyegbe 1, 2, Ayodele. S. Oluwole 1, Olaitan Akinsanmi 1 and Oluwole John Famoriji 2, * 1 Department of Electrical and Electronics Engineering, Federal University Oye Ekiti, Ekiti State, Nigeria. 2 Department of Electrical and Information Engineering, Achievers University, Owo, Ondo State Nigeria. World Journal of Advanced Research and Reviews, 2025, 28(01), 363-378 Publication history: Received on 27 August 2025; revised on 01 October 2025; accepted on 04 October 2025 Article DOI: https://doi.org/10.30574/wjarr.2025.28.1.3422 Abstract This paper presents the design and implementation of a smart automatic power source switching and monitoring system based on Arduino technology. The system intelligently prioritizes and selects among grid, generator, and inverter sources, while also integrating photovoltaic (PV) input for efficient battery charging. To enhance operational safety, the design incorporates overvoltage and undervoltage protection mechanisms that safeguard connected equipment under abnormal conditions. A 20×4 Liquid Crystal Display (LCD) provides real-time monitoring of the active source, AC voltage, frequency, PV power, and battery status. The deployed methods for this study to develop an algorithm for detecting and optimizing changes in power supply and demands using Arduino microcontroller and Proteus for the entire system expected performance demonstration purposes in real life. Experimental validation confirms the system’s capability to perform reliable automatic switching, efficient fault detection and recovery, and effective renewable energy integration. The proposed system is cost-effective, scalable, and suitable for both residential and industrial applications in regions with unstable power supply. Keywords: Arduino; Automatic transfer switch (ATS); Inverter; Photovoltaic system; Battery monitoring; Power protection 1. Introduction Unreliable electricity supply is a major challenge in developing regions, often requiring multiple energy sources such as grid, generator, and inverter systems. Traditional Automatic Transfer Switches (ATS) primarily switch between grid and generator but lack renewable energy integration and intelligent monitoring. To address these limitations, this work proposes an Arduino-based smart automatic power source switching and monitoring system. The system prioritizes grid supply, selects inverter power when battery voltage is sufficient, and uses a generator as backup. It integrates solar PV monitoring for charging decisions and displays system status in real time. The global energy landscape is undergoing a significant transformation, driven by the need for sustainable, efficient, and reliable energy management. The increasing electricity demand, coupled with the integration of renewable energy sources, has led to the development of smart grids. Smart grids are advanced electrical grids that use Internet of Things (IoT) technologies, artificial intelligence, and other innovative solutions to manage energy distribution and consumption efficiently. However, the existing grid infrastructure faces several challenges, such as energy losses due to inefficiencies, power outages impact reliability and economy and cybersecurity as a result of increased in use of IoT devices. To this end, integrating Iot technologies in smart grids provides a solution to these challenges. Iot enables real-time monitoring and control of grid operations. The development of a smart grid monitoring and control system using Iot is crucial for achieving these benefits. This system will enable utilities and grid operators to monitor and control grid operations in real-time, optimize energy distribution and consumption, and improve overall grid efficiency and reliability. The distribution of digital power is increasing greatly day by day. The existing power grids are converted into smart grids to meet the growing power requirements. Information is accumulated from sensors, smart meters and several other devices for the World Journal of Advanced Research and Reviews, 2025, 28(01), 363-378 364 sake of analysis and understanding. To implement IoT in smart grids, mobility support, location awareness, distributed coordination, and latency sensitivity are to be considered. Smart Grid systems in combination with Internet of ThingsAided Smart Grid: Technologies, Architectures, Applications, Prototypes and Future Research Directions as described by Saleem et al (2019) and Famoriji et. al. (2020) IoT allows smart monitoring and control of smart grid by (Ozgen et al., and Wang et al., 2018). In electronics connected via the internet, smart plugs, home gateways and smart meters, t h e application of IoT facilitates proficient resource management. The consumers can obtain information regarding the consumption of energy and price on a realtime basis, thereby moderating the energy consumption. The producer can forecast energy requirements and moderate distribution. The paper experiments with distributing workload between edge and cloud in a Smart Grid application: looking at how many sensor readings/measurements per second can be processed when using edge nodes vs central cloud. Hence, the system is beneficial to both ends as presented by Carvalho et al., 2017, and Tamara-Tarime et. al. (2024). Millions of users interact with smart grids and their information flow. It is important to focus on the scalability of this system. Cloud computing serves as an optimal solution for this purpose. Several architectures, such as event processing for load forecasting, lambda, kappa and cyclic architectures are designed and implemented for processing the data generated by these systems. In IoT-based Smart Grid architectures, the components communicate with each other through the internet. Resource constraints and scarcity of spectrum are major issues in the wireless nodes of these systems (Ozger et al., 2018). Pan Wang et al (2018), proposes a fog-based architecture and a programming model for IoT applications in smart grids and Emphasizes location-aware, latency-sensitive monitoring and an intelligent control in the smart grid. A programing model and fog-based architecture that serves the requirements of smart grid also presented by their research paper demonstrated the operation of a smart electric automobile prototype for evaluation. their findings were able to contribute to the body of knowledge in the field of smart grids and IoT, providing insights for utilities, grid operators, and policymakers to develop and implement efficient and reliable smart grid systems. Electricity grids serve as the backbone of modern society, facilitating the generation, transmission, and distribution of electrical power to homes, businesses, and industries. However, traditional electricity grids are facing numerous challenges that hinder their ability to meet the evolving needs of the 21st century. Conventional grids are overloaded by a daily increase in demand, and the conventional solution techniques are increasing the complexity of the existing network (Kakran et al., 2018, and Makanju et. al. (2024a). The primary challenges of traditional electricity grids include limited visibility and control, low efficiency and reliability, vulnerability to disruptions, limited integration of renewable energy, and inadequate data and analytics. These issues underscore the need for more advanced and resilient grid systems, the smart grid. Smart grid is an intelligent network which enhance collection of various electrical information from the electrical network using intelligent sensors and fast communication systems (IoT) in balancing demand and supply (Kakran et al., 2018) With the advent of smart grid, stated that renewable energy resources can be safely integrated into the grid to supplement the power supply with power from customers’ distributed generation and storage which was also described by Tuballa et al., 2016 and Makanju et. al. (2024b). Traditional grids often lack realtime visibility into the status and performance of grid assets, making it difficult to detect and respond to faults, outages, and fluctuations in demand. Without adequate monitoring and control capabilities, grid operators are unable to optimize grid operations or implement proactive maintenance strategies. They are characterized by inefficiencies in energy generation, transmission, and distribution, leading to power losses, voltage fluctuations, and reliability issues. These inefficiencies not only waste valuable energy resources but also contribute to increased operating costs and reduced grid reliability. In addition, traditional grids are vulnerable to disruptions caused by natural disasters, equipment failures, and cyberattacks. These disruptions can lead to widespread power outages, economic losses, and threats to public safety, highlighting the need for more resilient and robust grid infrastructure. With the growing adoption of renewable energy sources such as solar and wind power, traditional grids face challenges in integrating intermittent and decentralized generation sources into the grid. The lack of visibility, control, and flexibility in traditional grids makes it difficult to accommodate the variability and unpredictability of renewable energy resources. They often rely on manual processes and outdated technologies for data collection, analysis, and decision-making. This lack of automation and data-driven insights hinders grid operators' ability to optimize grid operations, plan for future infrastructure investments, and meet regulatory requirements. Real-life limitations of traditional power grid systems can be observed in the electric power sector of Nigeria as a country. Nigeria's electric power sector has an operating capacity of 3,800 MW and an available capacity of approximately 9,000 MW. Over the years, the Nigerian government has made efforts to address its power generation, distribution, transmission, distribution, monitoring, metering and management challenges throughout its electric power value chain, but little significant improvement has so far been achieved. Historically, the Nigeria Power System was established in 1898 by European entities, primarily serving the European residential area. Subsequent developments included the formation of the Nigeria Electricity Corporation (NEC) in 1951 and the Niger Dams Authority in 1962, both aimed at promoting hydroelectric power. The merger of the independent National Electric Power Authority (NEPA) and NEC led to the creation of the Authority for Niger Dams, and eventually, NEPA was transformed into Nigeria's Power Holding Company (PHCN) (Ajay and Ibe-Enwo, 2019). World Journal of Advanced Research and Reviews, 2025, 28(01), 363-378 365 2. System Design 2.1. The System Block Diagram The system block diagram represents an Automatic Power Source Switching and Monitoring Unit that intelligently manages electricity supply from multiple sources. It continuously monitors the availability and condition of the mains grid, generator, and inverter powered by a solar-charged battery. Based on predefined logic, the control unit automatically selects the most suitable source while ensuring protection against overvoltage and undervoltage conditions. Real-time information such as active source, voltage levels, frequency, and battery status is displayed on an LCD screen, while LED indicators provide quick visual feedback. This design ensures uninterrupted power delivery, optimizes solar energy usage, and enhances system safety and reliability. Figure 1 System Block Diagram 2.1.1. Input Section (Sensors & Switches) • Mains Pin (2) → Detects grid availability. • Generator Pin (3) → Detects generator status. • Inverter Pin (4) → Detects inverter availability. • Overvoltage Pin (9) → Senses high-voltage faults. • Undervoltage Pin (10) → Senses low-voltage faults. 2.1.2. Analog Inputs: • A0 → Reads solar panel voltage. • A2 → Reads battery voltage. Function: These inputs serve as decision-making signals for selecting the power source and activating protection mechanisms. 2.1.3. Microcontroller (Arduino Core) • Reads inputs continuously. • Applies priority-based source selection: o Grid (if available and safe). o Inverter (if battery is healthy). o Generator (if other sources are unavailable). • Executes protection logic: If over/undervoltage detected → disconnect all loads and display fault. • Manages automatic recovery when fault clears. • Calculates PV power, current, and battery status. World Journal of Advanced Research and Reviews, 2025, 28(01), 363-378 366 Function: Acts as the brain — processes sensor data, runs switching logic, and updates display. 2.1.4. Output Section LEDs: • Mains LED (Pin 5) • Generator LED (Pin 6) • Inverter LED (Pin 7) • Load LED (Pin 8) → Shows load is powered LCD (20x4 I2C): • Displays current active source. • Shows AC voltage, frequency. • Displays battery status or PV data alternately. • Shows protection messages (Overvoltage/Undervoltage). Function: Provides visual feedback of system status to the user. 2.1.5. Power Sources • Grid (Mains Supply) • Generator • Inverter (battery-powered) • Solar Panel (for charging & supplying inverter) Function: These are the actual supply options. The microcontroller chooses one based on availability and health. 2.1.6. Protection System • Overvoltage Detection • Undervoltage Detection • Automatic cut-off to prevent damage. • Auto-recovery when voltage returns to safe range. Function: Ensures electrical safety and prevents equipment damage. 2.1.7. Control Logic • Source Priority: Grid → Inverter → Generator • Battery Voltage Conditions: o 56V → allow inverter operation. o <42V → stop inverter to prevent deep discharge. • PV Charging Logic: o If PV voltage ≥ 60V → calculate charging current & power. o Show “Charging” or “Fully Charged” status. Function: Implements intelligent, condition-based switching. World Journal of Advanced Research and Reviews, 2025, 28(01), 363-378 367 2.1.8. The System Flow Chart Figure 2 The System Flow Chart Start & Initialization • The microcontroller powers up. • LCD is initialized and cleared. • Input pins (mains, generator, inverter, overvoltage, undervoltage) are set. • Output pins (LEDs for mains, generator, inverter, load) are set LOW. • Initial power source is selected based on availability and battery level. Voltage Fault Detection • Check overvoltage and undervoltage inputs. • If a fault is detected: o All sources are disconnected. o Display fault type ("Overvoltage!" or "Undervoltage!"). o Wait until fault is cleared. Source Status Reading • Read the status of mains, generator, and inverter inputs. • Read solar voltage and battery voltage via analog pins. PV (Solar) Cutoff Logic • If solar voltage ≥ 60V: o Calculate simulated current and PV power. World Journal of Advanced Research and Reviews, 2025, 28(01), 363-378 368 • Else: o PV output is zero. Source Switching Logic • If mains available → Activate GRID. • If mains lost while on GRID → Check inverter (with battery ≥ 56V) or generator. • If generator lost → Check mains or inverter (battery ≥ 42V). • If inverter lost or battery too low → Check mains or generator. • Auto-switch between inverter and generator based on battery level. Display Updates • Every second, toggle display between: o Battery Status (low, charging, in use, idle) o PV Status (voltage, current, power). • If a source is active → Show AC voltage and frequency. Recovery Check • If no active source, check again for mains, inverter, or generator. • Select best available option automatically. Loop Back • Delay briefly (100ms) and repeat from step 2. • This flow ensures continuous power supply by automatically selecting the best available • source while protecting the system from faults. 2.2. The System Simulated Circuit Diagram Figure 3 Proteus Simulation Circuit Diagrams World Journal of Advanced Research and Reviews, 2025, 28(01), 363-378 369 2.2.1. Core of the Circuit: The Arduino board is the heart of the system. It: • Receives signals from voltage sensors and switch inputs. • Controls LED indicators. • Sends real-time data to an I2C LCD display. • Makes switching decisions for the power sources. 2.2.2. Input Section (Sensors & Control Pins): These are connected to Arduino digital and analog pins Table 1 Digital Inputs Pin Signal Purpose D2 Mains Pin Detects grid (mains) availability D3 Generator Pin Detects generator ON/OFF D4 Inverter Pin Detects inverter availability D9 Overvoltage Pin Receives overvoltage trip signal D10 Undervoltage Pin Receives undervoltage trip signal Table 2 Analog inputs Pin Signal Purpose A0 Solar Voltage Reads PV panel voltage (via voltage divider) A2 Battery Voltage Reads battery voltage (via voltage divider) Connection Method: • Sensors like voltage dividers or optocouplers feed these pins. • Over/Undervoltage signals could come from a comparator circuit. 2.2.3. Output Section (Indicators & Display) LED Indicators Table 3 LED indicator Pin LED Meaning D5 Mains LED Grid source active D6 Generator LED Generator active D7 Inverter LED Inverter active D8 Load LED Load is powered Connection Method: LEDs connected through resistors (220–330 Ω) to ground. 2.2.4. LCD Display (20x4 I2C) Connected via I2C lines • SDA → Arduino A4 (on UNO) • SCL → Arduino A5 (on UNO) Shows • Active power source World Journal of Advanced Research and Reviews, 2025, 28(01), 363-378 370 • AC voltage & frequency • Battery/PV status • Protection messages 2.2.5. Power Sources • Grid (Mains) — possibly detected via relay or optocoupler. • Generator — signal pin detects when it’s running. • Inverter — works when battery voltage is sufficient. • Solar Panel — charges the battery and powers inverter. 2.2.6. Protection Circuit • Overvoltage & undervoltage detection from protection relays or sensor modules. • Arduino reacts by cutting load and showing a warning on LCD. • Recovery logic restores power when voltage returns to normal. 2.2.7. Functional Flow in Circuit • Sensors → Arduino inputs. • Arduino runs decision logic → decides which source to activate. • LEDs light up for the active source. • LCD updates with live status. • If a fault is detected, Arduino switches off load and warns user. • Solar input & battery voltage readings help decide when to switch between inverter and generator. 2.2.8. Simplified Circuit Connection Table Table 4 A simplified circuit connection table Component Arduino Pin(s) Notes Main’s sensor D2 Digital input Generator sensor D3 Digital input Inverter sensor D4 Digital input Overvoltage trip D9 Digital input Undervoltage trip D10 Digital input Solar voltage sensor A0 Voltage divider Battery voltage sensor A2 Voltage divider Mains LED D5 With resistor Generator LED D6 With resistor Inverter LED D7 With resistor Load LED D8 With resistor LCD SDA A4 I2C data LCD SCL A5 I2C clock 2.3. The Generator Triggering Prototyped Simulation Results This section demonstrated the developed system of the study where applicable smart grid significantly upgrade traditional power systems by improving efficiency, reliability, and consumer interaction. The system promised automated energy adjustments, sustainable practices, and greater consumer participation, offering businesses operational efficiencies and new revenue opportunities. This makes smart grid technology a strategic investment for future-focused companies. This section describes the outcome of laboratory prototyping work and the study's outcome. The simulated system designed circuit diagram in figure 4a shows that the generator automatically starts up World Journal of Advanced Research and Reviews, 2025, 28(01), 363-378 371 immediately the system battery voltage dropped to 12.2V by ensuring that the LED light comes ON thereby keeping the system running on On-grid mode while the Figure 5 shows that the generator automatically shut down immediately the system battery voltage rises to 13.5V by ensuring that the LED light goes OFF thereby keeping the system running on Off-grid mode. Hence, the system can only automatically trigger into Island mode at any time of the day with a severe cloudy weather or at night when other integrating sources remains idle. At this time, the system will be running on Battery Energy Storage System (BESS) Figure 4 Simulated System Circuit Diagram of Battery Voltage at 12.2Vdc World Journal of Advanced Research and Reviews, 2025, 28(01), 363-378 378 References [1] Adeoye, J and Okonkwo, M (2021) “Design of Low-Cost Automatic Transfer Switch Using Arduino,” IEEE Access, vol. 9, pp. 105233–105240, 2021. [2] Ajao, K. R., Ogunmokun, A. A., Nangolo, F., & Adebo, E. O. (2016). Electricity transmission losses in Nigeria power sector: A smart grid approach. ATBU Journal of Science, Technology & Education (JOSTE), 4(2), 47–63. [3] Ajayi, A. O., Alese, B. K., Fadugba, S. E., & Owoeye, K. (2014). Sensing the nation: Smart grid's risks. Scientific Research Publishing Inc., 7(May), 151–163. [4] Ajay, S., & Ibe-Enwo, O. (2019). Smart energy system: The panacea to Nigeria epileptic power supply. 2nd International Conference of the IEEE Nigeria Computer Chapter: IEEEnigComputConf'19, 62–69. [5] Carvalho, O. M., Garcia, M., Roloff, E., Carreño, E. D., & Navaux, P. O. A. (2018). IoT Workload Distribution Impact Between Edge and Cloud Computing in a Smart Grid Application. In High Performance Computing (Communications in Computer and Information Science), Vol. 978-3-319-73353-1. pp. 203-217. Springer. [6] Gupta, A and Kumar, S (2022) “Microcontroller-Based Automatic Power Switching Systems,” International Journal of Engineering Research, vol. 8, no. 3, 2022. [7] Kakran, S., & Chanana, S. (2018). Smart operations of smart grids integrated with distributed generation: A review. Renewable and Sustainable Energy Reviews, 81 (Part 1), 524-535. doi: 10.1016/j.rser.2017.07.045 [8] Ozger, M., Cetinkaya, O., & Akan, O. B. (2018). Energy Harvesting Cognitive Radio Networking for IoT-enabled Smart Grid. Mobile Networks and Applications, 23, 956–966. DOI: 10.1007/s11036-017-0961-3 [9] Tuballa, M. L., & Abundo, M. L. (2016). A review of the development of Smart Grid technologies. Renewable and Sustainable Energy Reviews, 59, 710-725. DOI: 10.1016/j.rser.2016.01.011 [10] Wang, Pan; Liu, Shidong; Ye, Feng; Chen, Xuejiao. (2008) A Fog-based Architecture and Programming Model for IoT Applications in the Smart Grid. arXiv preprint arXiv:1804.01239, April 2018. [11] Y. Saleem, N. Crespi and M. H. Rehmani, (2019) “Internet of Things-Aided Smart Grid: Technologies, Architectures, Applications, Prototypes and Future Research Directions,” 2019. [12] Tamara-Tarime T. G., Makanju T. D., Kibuebu E. F., and Famoriji O. J. (2024) “Development of a Smart and Cost Effective Gas Leakage and Flame Detection System for Homes and Industries,” IEEE 5th International Conference on Electro-Computing Technologies for Humanity (NigerCon), Ado-Ekiti, Nigeria. [13] Makanju T. D., Omojoyegbe M. O., Salau A. O., and Famoriji O. J., (2024) “Optimizing Renewable Energy Sale Price with Linear Programming Techniques,” IEEE 5th International Conference on Electro-Computing Technologies for Humanity (NigerCon), Ado-Ekiti, Nigeria. [14] Makanju T. D. (2024), Famoriji O. J., Hasan A. N., and Shongwe T., (2024) ” Enhancing Power Quality and the Corresponding Expenses in Distribution Networks with High Levels of Harmonic Loads,” 2024 IEEE PES/IAS Power Africa, Johannesburg, South Africa. [15] Famoriji O. J., Ogundepo O. Y., and Qi X., (2020) “An intelligent deep learning based direction-of-arrival estimation scheme using spherical antenna array with unknown mutual coupling,” IEEE Access, vol. 8, pp. 179259-179271.