Solar UPS Solutions for India
Solar UPS Solutions for India
CHAPTER 1
INTRODUCTION
1.1 Background
Humankind are more favourable to comforts and inventing new things without
knowledge of hazard of the inventions, creating disturbance on the ecosystem of the
earth. As fuel depletion and changes in climate drive us into an energy crisis. We
realized the urgency of finding alternatives to our growing demand for energy. The
conventional sources are mainly non-renewable energy sources, their extensive use has
resulted in the rapid depletion of the known reserves. The known petroleum deposits
remain to last only a few decades in India alone, while coal reserves will last for just
another hundred years. Solving this energy crisis requires combined efforts from
economies around the world, which can only be accomplished with universal
government support. The rising energy costs have begun to force global leaders to
realize the importance of alternative energy sources research. It is hoped that this will
drive power - hungry nations to find ways to stop further deterioration of our planet's
resources.
Generally speaking, renewable energy sources are those that are naturally
continuously replenished. They are also called Green Energy or Clean Energy because
they are not contributing to global warming. In India in 2017-18, there was 1,303.49
TWh of gross electricity generated by utilities in India and 1,486.5 TWh of total
electricity generation in the country. India installed 350.162 GW capacity as of
February 28, 2019. Renewable power plants accounted for 21.4% of the total capacity
installed. Indian electricity generates electricity using approximately 72 percent of the
country's coal produced. In 2017 - 18 developed countries, coal consumption by utility
power is 608 million tons to indicate the role of power generation in greenhouse
emissions.
P a g e 1 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
In India, solar power is a fast-growing industry. India increased its solar power
capacity from 2650 MW on 26 May 2014 to more than 20 GW on 31 January 2018
eight times. The capacity of 20 GW was initially targeted for 2022, but four years ahead
of schedule, the government achieved the target. In 2015-2016, the country installed 3
GW of solar capacity and more than 5 GW in 2016-2017, the highest of any year, with
the average current solar electricity price falling to 18 percent below its coal-fired
average price. The Indian government expanded its interest in solar generation in
January 2015, targeting investment of US$ 100 billion and solar capacity of 100 GW
(including 40 GW from rooftop solar) by 2022. India's 100 GW solar energy initiative
by 2022 is an ambitious target, with 303 GW expected to be the world's installed solar
power capacity in 2017. This task has been made possible by the improvements in solar
thermal storage power technology in recent years as the cheaper solar power does not
need to rely on costly and polluting coal-based power generation to ensure stable grid
operation.
P a g e 2 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
In the energy industry, making solar base energy costs competitive with
traditional, fossil-based sources is a major challenge. If UPS and solar power systems
could be combined successfully (resulting in the lower overall cost of the system), many
users of UPS systems could consider investing in their own solar generation.
This would benefit users, energy systems as a whole, and the environment. The
benefit would be the installed system's lower lifetime cost compared to a conventional
stand-alone solar power system for users of the proposed system. Increased use of solar
energy also reduces the intensity of emissions if the energy sector contributes to a more
sustainable energy sources
The objective of the economic study is to assess the cost reduction of the
combined system compared to two separate systems as well as potential gains in total
system efficiency and therefore total energy generation.
1.3 Objective
1.4 Methodology
In this project, we are using solar energy for charging 12V DC battery. Solar
panel will constantly charge battery with a proper designed charge controller circuit
providing over voltage, under voltage protection and over charge protection. The charge
from the battery can be inverted to AC by designing an inverter circuit and stepping up
the voltage from 12V AC to 230 V AC. To design a circuit that can be suitable to switch
the source from the grid to the U.P.S by a proper relay logic circuit that can be
successfully used for emergency cases.
P a g e 3 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
1.5 Outline
Chapter 2 The literature review presents relevant literature on Solar Energy, UPS,
Power Electronics and Microgrids. Previous research is also discussed in the
combination of solar power and UPS.
Chapter 4 The results of each study are presented individually in this section. The
prototype results focus primarily on technical feasibility, while the economic analysis
compares the combined system with the standalone system.
Chapter 5 The conclusion of the combined studies and applications is presented in this
final section of the thesis.
P a g e 4 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
CHAPTER 2
LITERATURE REVIEW
2.1 Introduction
Solar energy is the energy comes from sunlight radiation to earth surface
captured using the photovoltaic panels (PV). The arrangement consists of several
components for absorbing and converting sunlight into electricity, such as solar panels,
a solar inverter for changing the electric current from DC to AC. It splits into two types
of systems stand-alone and grid tied.
Electricity generation system from solar that composed of the PV panels capture
the energy from sun light, the panels must be enough to cover the power needed. Using
a charge controller to have a suitable DC to charge the battery, to ensure the use of the
energy produced in the absence of sunlight and a battery bank for storage until energy
needed by the load. It will produce a DC current to the inverter for conversion to AC.
The main use of stand-alone systems is that it is used in applications in the rural and
the remote areas of the developing countries in telecommunication towers, water pumps
and the lightning uses, which can be considered as a social benefit. Although there was
a price reduction of the PV panels and the inverters involved, the batteries cost is the
main concern in off grid (stand-alone) systems, that it stays expensive specially if
energy stored in terms of KW or MW which increase the size of the batteries, they
should be replaced in every ten years and thus require regular maintenance, which
requires more investments in the application of off grid systems. A stand-alone system
is shown in the Figure (2.1).
P a g e 5 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
P a g e 6 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
2.2 Inverter
It pushes the design of the PV system to the limit with the increase in PV
system capacity and the interconnection with the existing power grid. One of the major
components of the PV system is to convert the DC power from the photovoltaic module
to the AC source, which allows the system to connect to the existing power grid. This
conversion is done using a circuit called an inverter called a power electronic device.
A typical inverter divided into two parts, the first circuit is the power circuit
and the second circuit is the control circuit. The power circuit built from MOSFET or
IGBT switches the simplest built from four switches shown in Figure 2.3.
Grid tie inverter main function is to convert the DC absorbed by the PV panels
to AC electricity equals to the grid voltage magnitude and frequency with phase leading
the grid voltage phase by suitable value.
As we can’t store AC for future use, whereas DC provides us with the possibility
of storage using a battery. The stored DC can be inverted to AC by using power
inverters.
Working of DC to AC Inverter
1) Solar charge controller is used to charge 12V DC battery.
2) The inverter is built with the help of IC CD4047 which is wired as Astable
multivibrator.
3) The operating frequency of Astable multivibrator is set to 50Hz.
The IRFZ44 MOSFETs are directly driven by CD4047's Q and Q output.
1) The MOSFETs are connected to the Push Pull (Power amplifier) configuration.
The MOSFETs are triggered by the CD4047 Astable multivibrator pulse. Thus,
an output AC voltage is transferred to the transformer primary; it is increased to
230V.
2) The transformer used here is an ordinary inverted step-down transformer. That
is, for this Solar UPS project, the primary step-down transformer from 230V to
12V-0-12V can be treated as secondary.
3) The C2 condenser filters the inverter output.
P a g e 8 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
Ideally, a UPS should be able to deliver uninterrupted power and provide the
power conditioning needed for power applications. It should therefore meet the
requirement of regulated sinusoidal output voltage with low total harmonic distortion
and be independent of changes in input voltage or load.
P a g e 9 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
The grid tied system shuts off during power outages, so we need the grid tie
inverter to keep working during power outages without injecting this power to grid to
avoid danger to the utility workers sent for fixing the lines here comes the islanding
process by connecting a distribution generation, conventional sources oil, gas, and coal
can be used or the use of the renewable sources such as hydro dams , wind farms , solar
stations always located close to the load to maintain a constant supply.
2.5 AC coupling
AC Coupling allows a grid-tie system to work together with a backup battery
system that is charged even during grid blackouts. It is perfect for people who want to
add a back-up package of batteries to their existing solar power grid-tie system. A grid-
tied inverter will continue to operate in an AC Coupled solar power system during grid
power outages by synchronizing with a battery-based inverter output. Both inverters
are connected to the sub-panel "critical loads" in this scenario.
By providing power to the critical loads in the subpanel, the off-grid inverter
creates a "local grid" during utility blackouts. The grid-tie inverter does not disconnect
because it does not know the difference between the grid produced by the utility and
the "local grid" of the inverter. When the grid is working, the inverter allows the grid
tie array to feed back to the main service breaker panel.
P a g e 10 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
It uses a home battery that stores solar energy so that it can be used to reduce
your reliance on demand and self-powering grid electricity in your home. The power
wall automatically integrates with the solar system in case of a grid breakdown to
ensure that your home is powered 24/7. You ensure energy security with power wall
and a clean energy lifestyle.
The power wall is compact, safe and includes a built-in battery inverter for
easier integration.
P a g e 11 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
CHAPTER 3
METHODOLOGY
3.1 Introduction
The simulation is intended to ensure that the proposed circuit is safe, flexible
and provides a reliable design environment in which the system can be easily adjusted
and tested without changing the physical system. The simulation's primary results
provide information on how to build the physical system in practice and how to operate
the system. The identification of potential system problems that may cause failure is
also an important part of the computer simulation. Thus, the MATLAB system helps to
find out the limitations of the simulation correspondence with the prototype system.
The inverter input impedance, transformer source impedance and load are one
of the major concerns related to simulation and practical output. As it has a large
capacitance element in the prototype system, it is modelled during simulation as a pure
resistive. The reason for this is that the simulation was conducted before selecting a
specific inverter and therefore the inverter topology was not known. Due to simplicity
and simulation speed, a purely resistive inverter was selected in the simulation. This
difference has the effect that the current entering the inverter in the prototype system is
significantly higher than the simulated system.
The simulation representation of the inverter can be shown in the figure 4.1. The
inverter converts the 12V DC supply voltage to the 12V AC. The output of the inverter
is fed to the filter circuit where the harmonics are filtered out. Based on the required
output, the triggering is provided to the MOSFETs.
P a g e 12 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
P a g e 13 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
Without Filter
With Filter
Figure 3.3 OUTPUT of the inverter circuit with and without the filter circuit
The prototype system's objective was to test the concept, a general indication is to be
the conclusion of the experiments conducted.
P a g e 14 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
We have chosen 12v,10wp solar panel for our setup. Solar has the major role in our
project.
Tolerance : +5%
P a g e 15 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
Solar panel is used to charge the 12V lead acid battery for increasing the reliability
of the supply from solar and to store the energy. We can directly connect the solar panel
to the lead acid battery but due to variation in the irradiance the current may follow in
the reverse direction from battery to panel. High voltages may damage the battery and
under voltages may decrease the charge of the battery. To overcome the above problems
charge controller is used. In our project we have designed a charge controller which has
3.3.3 Battery:
We used lead acid rechargeable battery in our project for storing solar energy in
form of chemical energy in sunny hours and to supply the energy in the off sunny hours
to the utilities.
P a g e 16 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
Battery ratings:
12V/1.3AH/20HR
3.3.4 Inverter:
Inverter is used to convert DC into AC. In our project the voltage of 12V is
obtained from the solar panel and charged the battery. The inverter is connected in
parallel to the battery. During sunny hours inverter is operated using solar panel power
and during off sunny hours inverter is operated using battery power
Inverter input will 12V DC and the output will be 12V AC, now we need to step
up the voltage from 12V to 220V using transformer.
P a g e 17 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
f = 1/4.4RC at pin#13
By solving t = 2.48RC where t is in seconds, R in Ohms and C in Farad, pulse time can
be obtained
P a g e 18 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
6 -Trigger High to Low transition will be given to this pin when used
in Monostable mode
8 +Trigger Low to high transition will be given to this pin when used
in Monostable mode
9 EXT Reset External reset triggers when a high pulse is provided to this
pin, resetting the output Q to low and Q’ to high
P a g e 19 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
We have chosen 2 MOSFETs inverter instead full bridge inverter to avoid the
leg shorting problem in practical scenario. So, in this circuit we need centre tapped
transformer to collect the output and step up the output. Here we used 9V-0V-9V to
220V transformer to get more output voltage as theoretical is not possible in practical.
Traditional FETs have a few features that are disadvantaged, such as high
drain resistance, moderate input impedance and slower operation. An advanced FET
that is MOSFET is invented to overcome these disadvantages.
P a g e 20 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
P a g e 21 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
The N-channel MOSFETs are simply called as NMOS. The symbols for N-channel
MOSFET are as shown in figure below.
The P-channel MOSFETs are simply called as PMOS. The symbols for P-channel
MOSFET are as shown in figure below.
P a g e 22 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
Because of the voltage between drain and source, some current is called leakage current
flows when no voltage is applied between gate and source. Let some positive voltage
apply to the VGG. Then the minority carriers are repelled, i.e. hole, and the SiO2 layer
attracts the majority of carriers.
A certain amount of drain current ID flows through source to drain with a certain
amount of positive potential at VGG. When this positive potential is further increased,
due to the flow of electrons from source, the current ID increases and these are further
pushed due to the voltage applied at VGG. The current ID of the drain is therefore
proportional to the level of voltage applied at the gate terminal. The current flow is
increased better than in depletion mode due to the increase in electron flow. This mode
is therefore referred to as MOSFET Enhanced Mode.
P a g e 23 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
The drain current Id should increase when Vds is increased, but the drain
current is controlled at some level due to the applied Vgs. Therefore, the current at the
gate controls the current at the output drain.
Transfer Characteristics
Transfer characteristics are defined as Vds value change with Id and Vgs change
in both depletion and enhancement modes. The characteristic curve below is drawn for
drain current versus gate to source voltage.
P a g e 24 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
IRFZ44N (N- Channel Enhancement MOSFET. The device has very low
ON state resistance and integral Zener diodes that provide up to 2kV of ESD protection.
It is generally used for switching.
P a g e 25 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
We used Arduino as controller for the logic controller for alternating the supply
between the solar power and conventional mains.
For this purpose, we must sense the voltage of solar incoming and have to set a
value below which the solar system should not supply the load to protect the battery
from over draining and under voltage problems in the utilities which will damage the
appliances. The set point of voltage varies with the battery manufacturers.
Module has two relay which are Switched on and off based on the input given
to IN1 & IN2 Pins. Module has two 817C optocouplers which are used as switch to turn
P a g e 26 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
on a BJT which in turn turns on the relay. Optocoupler plays an important role in this
module. Basically an Optocoupler is a an electronic component that transfers
electrical signals between two isolated circuits by using light.
When logic low is given to Optocoupler it closes the circuit which gives
a current to base of BJT which is connected in series in with the relay coil.
Voltage sensor is used to sense the voltage level of the battery. It has a voltage divider
circuit with two resistances of 30kohms and 7.5kohms in series. Output voltages is
taken across 7.5Kohms resistor. Here Output of sensor is an Analog signal, so it is
connected to Analog input pin of the Arduino.
P a g e 27 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
𝟕.𝟓
Output Voltage (Vo) =Vi* 𝟑𝟎 =Vi*1/5 Volts
3.3.7 Arduino:
Arduino is a micro controller designed for low power applications with ranges to a few
volts.
3.3.7.1 Overview
P a g e 28 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
Vin, 3.3V, 5V, GND Vin: Input voltage to Arduino when using an
external source.
I/O Pins Digital Pins 0 - 13 Can read and write digital values .
Serial 0(Rx), 1(Tx) Used to receive and transmit TTL serial data.
P a g e 29 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
Operating Voltage 5V
Digital I/O Pins 14 (In which 6 pins can provide PWM output)
SRAM 2 KB
EEPROM 1 KB
3.3.8 Transformer
P a g e 30 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
The two coil windings are electrically isolated from each other but are
magnetically coupled through the common core allowing the transfer of electrical
power from one coil to the next. When an electrical current passes through the primary
winding, a magnetic field is developed that induces a voltage into the secondary
winding that is supplied for loading as shown below.
P a g e 31 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
into an alternating magnetic field. While the secondary winding work is to convert this
alternating magnetic field into electrical power that produces the required voltage
output.
The design is providing the halls with electricity in two ways depending on whether the
grid is on or not.
The primary source is the Solar providing the load with power through the
charge controller, inverter and the step-up transformer. This bus is the one whom the
load takes its power from. In case of failure of solar, the UPS stop charging and the
load is fed through the energy stored in the batteries acting as standalone system.
P a g e 32 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
In this case the switch between the load and the grid is close which happens only when
both the solar and the UPS fails, that means the system is isolated from the solar and is
connected to the conventional grid.
3.3.10 Load
1.Solar Panel
2.Battery
P a g e 33 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
Chapter 4
HARDWARE SETUP
4.1 Introduction
A PCB is used for mechanical support and electrical connections between electronic
components, they are wire-wrapped, or point-to-point constructed circuits
P a g e 34 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
4.3.1 Soldering
Soldering is the process by which two metallic conductors are joined together,
the place where the two metallic conductors are to be joined or fused is heated with a
soldering iron device and then an alloy of tin and lead called soldering alloy is used
which melts on heating and is deposited in the joint thus covering it. .
4.3.3 Inverter
P a g e 36 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
4.4 Working
Here when the panel voltage is less than 8V Zener diode will not conduct so
no current passes through it which makes MOSFET Q2 to be in OFF condition. As soon
as voltage becomes greater than 8V Zener diode conducts and voltage is given to gate
of MOSFET Q2 which turns ON Q2 So, relay 1 connected to Q2 to will be switched
ON. Thus, providing Undervoltage Protection to battery.
Now, if voltage is greater than 15V then 15V Zener diode conducts turning ON
the BJT Q4 which connects gate terminal of MOSFET Q2 to ground turning it OFF,
P a g e 37 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
which in turn turns OFF relay 1 connected to it, Thus ,Providing Overvoltage
Protection.
MOSFET Q1 is used to prevent reverse flow of current when solar panel output
is less than battery voltage. This circuit can be used to charge any battery by using the
Bandwidth Setter, in which we have a rheostat whose movable terminal is connected
to gate terminal of MOSFET Q3 .By changing the value of resistance we can change
the voltage at which MOSFET gets turned ON ,so relay 2 connected to it switches ON.
LED across the relay are used to indicate the ON state of relays. Diodes are to
protect against reverse Polarity of solar panel.
CD4047 is used to get square wave output which are connected to gate
terminals of MOSFETs switching them ON and OFF periodically. Connections should
be done as per the diagram to configure so that it runs in Astable mode .the frequency
of the pulses produced are decided based on the RC values used .We has used RC values
such that frequency of pulses is 50Hz.
P a g e 38 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
P a g e 39 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
Depending of the output of solar panel Zener diode conducts and relay
switches ON and charge controller continuous to charge the battery. But when voltage
is higher than predetermined relay switches OFF and disconnects the battery.
Among all the sources power from solar panel is given the highest priority.it
is used to power load as default source and a part of solar energy is used to charge
battery simultaneously along with load but if voltage from solar panel is not enough
then power from battery is used to feed the load.
When voltage from battery also is low then Arduino senses this using voltage sensor
and switches the relay module to ON position and connects conventional source to
load. During this time solar panel can charge the battery in sunlight.
4.5 Applications
P a g e 40 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
4.6 Advantages
1. Constant and continuous supply.
2. Circuit can be controlled with a universal power supply of 12 volts (DC).
3. Its efficiency is further enhanced without any moving parts involved.
4. It acts as a solution for power backups.
5. Electricity and manpower are not required to operate the device.
6. It can be used in remote villages where there is a high transmission cost.
7. This is an environmentally friendly means of generating power.
8. It's one of the renewable generation methods.
9. Reduction of consumption from conventional energy sources.
4.7 Disadvantages
1. Initial installation costs are very high.
2. There is a large area required to install solar panels.
3. Because of lack of sunlight, it will be less effective in rainy days.
4. Protection system installation is complex.
5. Can cause eye problems due to solar reflectors.
P a g e 41 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
Chapter 5
CONCLUSION
5.1 Conclusion
The main objective of this project was to design a circuit that would minimize
the cost of the grid to the consumer while the grid is on and provide us with continuous
supply to the load regardless of the grid. The conclusions drawn regarding the combined
system's technical feasibility are that the combination of solar energy and UPS systems
is technically possible.
Adding solar energy has no significant impact on the UPS system's power
quality. In the event of power outages in the electricity grid, solar power can benefit the
system at the point of disconnection from the grid with both less impact on power
quality and increase the UPS ' autonomy time.
The economies of combining solar power and UPS systems are double: the
system's investment cost and the total energy generated. Based on prices for
commercially available inverters and solar charge controllers, it is concluded that the
combined system's investment cost is significantly lower than for separate systems
P a g e 42 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
The possibility of using the energy storage capacity in the UPS batteries to store
excessive energy from the solar panels is an interesting aspect when combining solar
panels and UPS. Dedicating a predetermined amount of battery capacity to be used by
solar panels would allow the solar energy system to provide a higher nominal solar
power installation and thus a higher percentage of total load demand.
The fluctuating output of the solar panel will be one issue of concern, which can
be eliminated by proper MTTP technique. Due to its many advantages, photovoltaic
power generation is gaining more importance as a source of renewable energy. These
benefits include eternal pollution-free energy generation scheme, ease of maintenance,
and direct sunbeam conversion to electricity. The high cost of installing PV, however,
is still a hindrance to this technology. In addition, the output power of the PV panel
fluctuates as weather conditions such as the level of insulation and the temperature of
the cell. Further improvements in functional and packaging integration will come.
Integration will be affected by
1. Further improvement in electronic and magnetic components and their material
2. Further improvement of topologies and control methods
3. Design of integrated housing with support of thermal simulation and new housing
materials.
The development of new power semiconductors based on Si, SiC or GaN gives
changes to reduce losses which results in a reduction of the cooling system. The change
to higher operation temperatures will influence the size of the cooling system
additional. Higher switching frequencies require new solutions for magnetic
components, magnetic materials and topologies. Topologies and control method have
to consider under the aspect of smaller components sizes. Thermal simulations will
establish better understanding of cooling processes and push the development of high
integrated housings of solar inverters.
P a g e 43 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
REFERENCES
P a g e 44 | 45
SOLAR POWERED UNINTERRUPTED POWER SUPPLY
ANNEXTURE 1
Arduino code for voltage sensing and Switching using Voltage sensor and 2
Channel relay module
void setup() {
Serial.begin(9600);
pinMode(9,OUTPUT);
pinMode(10,OUTPUT);
pinMode(A0,INPUT);
void loop() {
double vin=analogRead(A0);
double voltage=(vin*25/1024);
Serial.println(voltage);
if(voltage<12)
{digitalWrite(9,LOW);
digitalWrite(10,LOW);
else
{digitalWrite(9,HIGH);
digitalWrite(10,HIGH);
P a g e 45 | 45