Automated Power Source Selection System for Uninterrupted Supply: Integration of Main Power, Solar Energy, and Generator Power

: A consistent power supply is indispensable across various sectors, spanning from households to critical institutions like research facilities, hospitals, and financial institutions. This study endeavors to ensure uninterrupted power provision to a load through an automated selection process among three primary power sources: main power, solar energy, and generator power, with main power being the primary preference. Implemented using an 8051 microcontroller, the system is linked to three switches representing each power source for simulation purposes. Upon detection of a switch release or deactivation, signifying the absence of that particular power source, the microcontroller promptly deactivates the corresponding relay driver. This relay driver then switches the relevant relay, facilitating seamless power continuity to the load if any switch is activated. A lamp or bulb serves as a demonstrative load powered by the primary source. In the event of a power outage, the system seamlessly transitions to the next available source, such as solar energy, and if required, to generator power. An LCD is employed to indicate the currently active power source, ensuring operational transparency and facilitating swift troubleshooting when necessary.


Introduction
In an era where energy efficiency and sustainability take center stage, the integration of diverse power sources into a unified and efficient system has become imperative.The Design and Simulation of a Multi-Source Power Control System, encompassing main grid power, solar energy, and generator input, represents a significant leap toward creating resilient and eco-friendly energy infrastructures [1] [2] [3] [4] [5].This innovative system not only addresses the growing need for reliable power supply but also seeks to optimize energy utilization by seamlessly managing the dynamic interplay between conventional grid power, clean solar energy, and auxiliary generator sources.This multifaceted approach to power control is poised to revolutionize the way we harness and distribute energy, offering a robust solution for diverse applications ranging from residential setups to industrial complexes.As the world grapples with the challenges of climate change and the depletion of traditional energy resources, the integration of renewable sources like solar power, coupled with intelligent control mechanisms, emerges as a beacon of sustainable energy management [6] [7] [8] Efficiently harnessing power from multiple sources is a pivotal strategy in ensuring a continuous and reliable power supply, a practice known as multi-power supply control [7] [2].This technique is imperative in various sectors, including telecommunications, data centers, and industrial automation, where power interruptions can precipitate severe consequences such as data loss, equipment damage, and systemic failure.The central goal of multi-power supply control is to mitigate these risks by implementing redundant power sources and thereby bolstering reliability [3] [8].
This research sets the stage for a deeper exploration into the intricacies of the Multi-Source Power Control System, unveiling the sophistication and foresight required to harmonize a trio of power sources into a unified, adaptive, and efficient energy ecosystem.The ensuing analysis will dig into the design principles, simulation methodologies, and real-world implications of this transformative system, shedding light on its potential to reshape the landscape of power generation and consumption in a rapidly evolving global world.
The study's primary objective is to formulate and evaluate a cutting-edge multi-power supply control technique, facilitating the efficient utilization of three distinct power sources.To achieve this goal, our study encompasses a comprehensive approach, including a literature review of existing multi-power supply control methodologies, identification of gaps in the literature, development of a new control technique suitable for three power sources, performance evaluation of the proposed technique, and a comparative analysis against existing methods.This holistic approach aims to provide a comprehensive understanding of the proposed technique's merits and its potential impact on the field of multi-power supply control.

Literature Review
Several strategies have been proposed in prior research to control multi-power supply systems, including priority-based selection, load sharing, and adaptive selection.In a study conducted by [9], a dynamic load balancing technique for multi-power source systems was introduced.This method employs a real-time power flow control algorithm to dynamically distribute the load among available power sources.Similarly, the scholar in [10], presented a load balancing and failure recovery technique for multi-power source systems, utilizing a distributed algorithm to balance the load and recover from power source failures [9] [10].
Despite these advancements, there exists a scarcity of research on control techniques specifically tailored for three or more power sources.Addressing this gap, [11] proposed a priority-based selection technique for three-power source systems, prioritizing the most reliable power source and proceeding to the next in order.Additionally, [12] introduced an adaptive selection technique for three-power source systems, which considers both load requirements and power source availability for selection [11] [12] However, after the comprehensive review, several research gaps have been identified, prompting the need for this study to address them.The issue of power interruptions poses a significant challenge in numerous countries, especially those grappling with low power generation and infrastructure issues.These interruptions can lead to substantial financial losses and jeopardize human lives, particularly in critical sectors such as healthcare.While emergency power systems are available, their reliability in providing uninterrupted power remains questionable, necessitating the exploration of specialized or automated emergency power systems.
A scholar in [13] designed and implemented a cost-effective smart surveillance security system for homes, and supermarkets.The system utilizes a Raspberry Pi camera module and a PIR sensor to automatically capture images of intruders and send them via email to the user's registered address through Wi-Fi.Upon detecting motion, the Pi Camera is triggered to capture and save the intruder's image, which is then sent to the user via email using command codes embedded in the Raspberry Pi microcontroller.The research aims to provide an affordable solution for enhancing security and enabling remote monitoring of premises, utilizing Proteus 2022 as the simulation tool [14] [15].
The scholar in [16] [17] conducted a comprehensive analysis of the renewable energy landscape spanning from 2010 to 2023, with a specific focus on solar photovoltaic (PV) energy.It underscored solar PV as the predominant force driving growth and innovation in power generation.Noteworthy findings included recent advancements in solar PV optimization techniques [18] [19] [20], particularly highlighting the efficacy of hybridizing intelligent and non-intelligent maximum power point tracking methods [21] [22] [23] for enhancing tracking power conversion efficiency.Additionally, the paper scrutinized the pros and cons of solar PV, delved into emerging trends in solar optimization and innovation, and ultimately forecasted a continued expansion of clean and renewable energy sources, notably solar energy [24].Forecasts indicate substantial growth and swift innovation within the solar energy sector over the next decade [25] [26] [27].Building upon the observed momentum in solar energy development, the researchers posited that the world is poised to access abundant, affordable, and eco-friendly energy well before 2050.
In this regard, this paper proposes a solution involving multi-power supply control from three distinct sources to ensure consistent and dependable power delivery.The primary aim is to leverage multiple power sources effectively, introducing redundancy and enhancing reliability to mitigate the adverse impacts of interruptions.Developing an appropriate control technique is paramount to address this challenge effectively.However, existing research predominantly focuses on control techniques for two power sources, leaving a noticeable gap in the literature regarding techniques suitable for managing three or more power sources.
Hence, this study aims to devise a novel control technique facilitating the efficient utilization of three different power sources to ensure an uninterrupted power supply.This technique will be designed to seamlessly transition between available power sources based on their availability and reliability, integrating priority-based and adaptive selection mechanisms to optimize the utilization of all available resources.The proposed technique will undergo rigorous evaluation through simulation to assess its effectiveness and performance.

Methodology
The multi-power supply system has been meticulously designed to seamlessly integrate three distinct power sources: mains (grid), solar, and generator, ensuring uninterrupted power supply for various applications.The system employs a prioritization scheme, with the grid serving as the primary power source, followed by solar and generator, respectively.Automatic prioritization is achieved through intelligent control logic, where the system defaults to grid power when all sources are available.Manual intervention is facilitated by a set of normally open switches, allowing users to manually switch between power sources as required.
In the event of a mains (grid) power failure, the system swiftly transitions to solar power, maintaining continuous operation.If solar power becomes unavailable, the system seamlessly switches to the next priority source, guaranteeing uninterrupted power delivery.To detect power source failures, the system incorporates three normally open switches, each corresponding to a specific power source.Additionally, three relays are employed for output protection, ensuring the safety of connected loads.
The system is versatile and capable of powering various loads such as lamps or motors.LEDs provide a visual indication of the active power source, offering users clear feedback on the system status.Efficiency is further enhanced by automatic reversion to the primary power source upon its restoration, minimizing downtime.Additionally, each output port of the microcontroller is connected to a positive DC voltage, with relays facilitating seamless switching at the output ports, ensuring efficient and reliable power distribution throughout the system.

System Operation
This research paper employs three relay switches to ensure continuous power supply to a load.Rather than utilizing three distinct physical power sources simultaneously (main supply, solar supply, and generator supply), the relay switches simulate these sources.A 240-volt power source is employed and connected to all three relay switches in parallel.The lamp's AC power source is likewise connected to these relay switches via normally open (NO) contacts and common contacts in parallel.Three selector switches, indicating the presence or failure of the corresponding power sources, draw power from these sources and link to pins 0, 1, and 2 on port "P1" of the microcontroller.Pull-up resistors of 1kΩ are applied to the port pins to ensure reliable operation, achieving high and low logic levels as required by the program.
The relay driver IC ULN2003, specifically PIN 1, receives a logic high signal from port "P1" pin 0 of the microcontroller.This action causes PIN 1B of the ULN2003 to go high, thereby activating relay 1 and supplying power to the lamp through its NO contacts.Should the selecting switch for the main power source be released, indicating its failure, port "P1" pin 1 or 2 goes high, prompting ULN2003 pin 1A to go low.Consequently, either PIN 2B or 3C of ULN2003 goes high, activating relay 2 or 3, representing the solar or generator power source respectively.The lamp then receives power from the available priority source in the event of a failure.

Figure 1. Block Diagram of the Multi-Source Power Control System
In the scenario where both the solar and generator switches are released, indicating the failure of both alternative power sources, port "P1" pin 0 goes high.This action causes pin 2B or 3B of ULN2003 to go low, leaving pin 1A high, thereby activating relay 1 (representing the main power source) while relays 2 and 3 remain inactive.Consequently, the lamp is powered by the main power source.If all power sources fail simultaneously, symbolized by the release of the generator, main, and solar switches, all relay switches are turned OFF, resulting in no power supply to the lamp.Real-time status updates of the power sources are displayed on a 16 x 2 lines LCD screen.Figure 1 and Figure 2 are the block diagrams showing the working principles of the design and flowchart of the system respectively.
Figure 2 illustrates the sequence of operations and decision-making processes involved in managing power generation and distribution.The flowchart begins with the system initialization process, where all components are initialized and set to their default states.The system continuously monitors and reads the power generation from each source, including the main grid, solar panels, and wind turbines.The system makes a decision on which switches (S1, S2, S3) to be given priority by evaluating the available power from each source and determines the optimal combination based on factors such as availability, cost, and environmental conditions.

Figure 2. Flowchart of the Multi-Source Power Control System
The system assesses the current load demand to determine the amount of power required to meet user needs.The flowchart defines how the system allocates power from different sources to meet the load demand.The flowchart concludes with an endpoint indicating the completion of the power control process or looping back to the beginning for continuous operation.
By visually representing these steps and decision points, the flowchart provides a clear overview of how the multi-source power control system operates, helping users understand and troubleshoot its functionality.

Simulation
 Initial State, First State; All Sources (Main, Solar, And Generator) are Off Figure 3 shows the situation when all switches are turned OFF, and the electrical circuit is open, meaning there is no complete path for electricity to flow.Consequently, no power is supplied to the load, which in this case is the 240V lamp.Therefore, the lamp remains unpowered and does not illuminate.It is evident that when switch S1 is in the ON position, the primary power source becomes active, as depicted in the LCD screen in Figure 4.The indicator lamp D11 displayed in Figure 4 signifies that the relay responsible for providing power to the 240V lamp corresponds to the main power supply source. Third state, the Main Supply Fails When switch S1 is in the OFF position, it indicates a fault or power failure within the main power source leading to an auto-switch.Consequently, the circuit promptly switches to the available power supply based on priority which is solar in this case.This transition is signaled by the status of the screen and the indicator lamp D10, both of which confirm that the 240V lamp is now being powered by relay 2, which is connected to the solar supply, as illustrated in Figure 5.
 Fourth State, the Solar Supply Fails When switch S2 is OFF, it signifies a fault within the solar power supply.Consequently, the system swiftly switches to the available generator supply.The screen status and indicator lamp D11 confirm this shift, showing that the 240V lamp is now powered by relay 3, connected to the generator supply.This setup as shown in Figure 6 ensures continuous power provision despite disruptions in the primary solar source.The circuit of Figure 7 ensures all supply sources are available and automatically shifts to the main source, which is determined to be the most cost-effective option among available alternatives.

 Logic Design
The primary goal of this research is to establish a seamless power supply to a designated load through automated means, utilizing three distinct sources: mains, solar, and generators.Three switches are integrated, each corresponding to one of the aforementioned sources.These switches interface with an AT89C51 microcontroller from the 8051 family, which interprets input signals indicating the presence or absence of a particular power source.Upon receiving these input signals, the microcontroller generates output signals directed towards a relay driver.The relay driver then triggers the appropriate relay linked with the available power source, facilitating uninterrupted power delivery to the load.
In the event of mains supply failure, the system seamlessly transitions to the next available source, such as solar power.Should solar power also become unavailable, the system seamlessly shifts to the subsequent source, and so forth.The current power source in use is visually displayed on an LCD screen, offering clear insight into the selected source.Hence, implementation of this automated system with robust switching mechanisms, and uninterrupted power delivery to the load is guaranteed, even in scenarios of power source failure.

Finding and Discussions 4.1. Results for Design Considerations
To enhance system maintainability and availability, the system was divided into modules.This allows for easy identification and replacement of faulty modules without impacting the rest of the system.Additionally, the market availability of components influenced the system design, considering that the best-quality components may not always be readily accessible.The system's main goal is maintaining uninterrupted power for utilities by overseeing multiple power sources.It autonomously switches to an alternative source upon detecting a failure, guided by preset logic.The LCD screen displays the current active power source as in Figure 8. Figure 9 is the circuit diagram operator that shows all the working procedures of the designed system.

Discussions
This research leverages relays as a practical alternative in addressing the challenge of non-steady power switching during power failure.The system ingeniously utilizes a single 240V mains supply and mimics the presence of three different sources by connecting them all in parallel.This arrangement is visually depicted in the schematic circuit diagram of Figure 9.To ensure a seamless power supply, the AC source linked to the load, symbolized by a lamp in this setup, undergoes a series of relay-based connections.The load is strategically connected from relay 1 to relay 2 and relay 3, with all normally open (NO) contacts of the relays arranged in parallel.Similarly, the common contacts of the relays are also interconnected in parallel.This configuration enables effortless switching between the three simulated supply sources, maintaining uninterrupted power flow.
To monitor the status of each supply source, the system incorporates three switches.These switches serve to indicate the presence or failure of the corresponding supply sources, facilitating effective monitoring and control of the multi-source power supply system.In essence, this research presents a practical solution to achieve continuous power supply by employing relay-based switching and simulating multiple supply sources from a single main supply.

Conclusion
The primary objective of this research was to devise a robust multi-power supply control system capable of seamlessly switching between three distinct power sources, ensuring continuous power delivery to the load even in the event of source failure.This was achieved through meticulous consideration of factors such as cost efficiency in selecting the power sources, which were then integrated into the system via 5-V relays.Subsequently, the circuitry was efficiently managed using the AT89C51 microcontroller programmed in C language.In conclusion, the research work effectively accomplished its goals, furnishing a reliable multi-power supply control solution.The significance of this achievement extends to its myriad advantages and versatile applications across various domains, underscoring its practical utility and relevance.
The following were recommended: 1. Enhancing the multi-power supply control circuit by adding a battery tracker for monitoring power levels.2. Integrating a GSM module for remote monitoring, and implementing a voltage monitoring system to detect and respond to electrical irregularities effectively.

Figure 3 .
Figure 3. Simulation Diagram of the Power Control System when All Switches are OFF

Figure 4 .
Figure 4. Simulation Diagram of the Power Control System when Switch 1 is ON

Figure 5 .Figure 6 .
Figure 5. Simulation Diagram of the Power Control System when the Solar Supply is Active

Figure 8 .
Figure 8. Complete Schematic Diagram of the Power Supply System of Three Different Sources

Figure 9 .
Figure 9. Diagram of Circuit Operation