Download as pdf or txt
Download as pdf or txt
You are on page 1of 76

Solar based mobile charger

CHAPTER 1
OVERVIEW OF THE SOLAR BASED MOBILE
CHARGER
1.1 INTRODUCTION

In today life each & every person is using a mobile. The chargers of mobile phones
can carry everywhere but we can’t say that, everywhere there is availability of
electricity. During summer days this problem occurs usually more times, to overcome
this problem of charging of mobile phones in public places & especially for rural people
this system designed. Now a days there is no any such type of facility is available at the
public places & at rural area. The mobile phone business is currently worth billions of
dollars, and supports millions of phones. The need to provide a public charging service
is essential. Many critics argued that a public mobile phone charging service is not a
lucrative business because most users can charge their phones at home, in their office
or in their cars. Coin operated mobile phone charger is new business milestone because
many are attending business conventions and forgetting their charger at home or in
hotel rooms. Students and many people use the public transportation that don’t know
that their level of their battery is low are prospective customers for coin operated mobile
phone charger service. Recommended locations include: Hotels, Conference Centre’s,
Exhibition halls, Serviced offices, Exchange halls, Motels, Leisure Centre, Health
clubs, Training Centre, Golf clubs, Retail outlets, Internet cafes, Universities, Colleges,
Airports, Train terminals, etc., so that the mobile phone users can reactivate a low or
dead battery by simply plugging in and charging for one rupee, two rupee, & five rupee.

The sun is a star made up of hydrogen and helium gas and it radiates an enormous
amount of energy every second. Solar cell works on the principle of “photovoltaic
effect”. Sun light is composed of photons, or “packets” of energy. This photon contains
various amount of energy corresponding to the different wavelength of light. When a
photon is absorbed, the energy of the photon is transferred to an electron in an atom of
the cell.

Though the years, technology has allowed the cellular phone to shrink not only the size
of the ICs, but also the batteries. However, as technology has advanced and made our
phone smaller and still have one of the original problems that we must plug the phones

Department of ECE, MRITS. 1


Solar based mobile charger

into the walls in order to recharge the battery. Most people accept the reality as there is
no other option to this problem so they carry extra batteries with them. Every time it is
not possible to charge mobile batteries everywhere at any time so we design this mobile
charger from which we can charge the mobile battery anywhere at any time. In this
project we are using the concept of energy harvesting by using solar energy for battery
charging purpose. By using this we can charge our mobile battery in remote areas where
there is a problem of electricity. Cost of this circuitry can be reduced to certain extend
so that common man can easily purchase that and get benefit from that. We will give
the wide scope to this project by making certain modifications and we can use this
charger for different handsets. Modification to this project will be applying to any
battery operate devices like laptop. This project can be divided into two main parts
which are hardware and software development. The hardware development includes
the solar panel connection, charging and control circuit and microcontroller. The
software developments include the microcontroller programming.

Solar energy is the energy produced directly by the sun and collected elsewhere,
normally the Earth. The process creates heat and electromagnetic radiation. Only a very
small fraction of the total radiation produced reaches the Earth. The radiation that does
reach the Earth is the indirect source of nearly every type of energy used today. The
exceptions are geothermal energy, and nuclear fission and fusion. Even fossil fuels owe
their origins to the sun; they were once living plants and animals whose life was
dependent upon the sun. Much of the world's required energy can be supplied directly
by solar power. More still can be provided indirectly. The practicality of doing so will
be examined, as well as the benefits and drawbacks. In addition, the uses solar energy
is currently applied to will be noted. Due to the nature of solar energy, two components
are required to have a functional solar energy generator. These two components are a
collector and a storage unit. The collector simply collects the radiation that falls on it
and converts a fraction of it to other forms of energy (either electricity and heat or heat
alone). The storage unit is required because of the non-constant nature of solar energy;
at certain times only a very small amount of radiation will be received. At night or
during heavy cloud cover, for example, the amount of energy produced by the collector
will be quite small. The storage unit can hold the excess energy produced during the
periods of maximum productivity, and release it when the productivity drops. In
practice, a backup power supply is usually added, too, for the situations when the

Department of ECE, MRITS. 2


Solar based mobile charger

amount of energy required is greater than both what is being produced and what is
stored in the container.

Department of ECE, MRITS. 3


Solar based mobile charger

CHAPTER 2

2 HISTORY

The history begins with the advent of solar energy. From the dawn of mankind,
people try to capture the power of the sun. From the beginning to realize that it gives
the power of heat and light. Leonardo da Vinci studied the sun and used it in the 15th
century.

Although modern science has taken the sun god, mysterious creatures and other myths
and stories away, it has not lost its curiosity. Since France decided to have a shortage
of fuel in the 1970s, it needed an alternative energy source that would use the energy
of the sun to be used in batteries.

In 1883, Charles Fritz succeeded in turning the solar rays into the first solar cell. Until
the late 1880s, solar cells were used for warm water at home. Researched. The
possibility of using all non-renewable resources was well known in the 19th century.
People around the world still choose to use coal and other non-renewable energy
sources, because they will never end, nor will there be any consequences.

Three scientists from Bell Labs, Calvin Fuller, Daryl Chaplin and Gerald Pearson found
that silicon is a very good semiconductor material. Today, solar and solar panels are
usually made of silicon.

These small and applause steps are today for many solar energies used baby steps. Now,
solar energy than the historical imagination can affect the energy production. It is no
longer history, but depends on the future of solar energy, as well as the use of the sun
as the energy capacity, rather than exhaust the non-renewable resources of the Earth.

In the seventies, oil prices doubled, the US government finally decided to invest time
and money to develop solar cells. It was the same solar cell produced by Bell Labs
scientists in 1953.

Today, the classification of solar cell chargers is amazing. When you count your
electronic product, you know that everyone needs to charge in one way or another. You
will find that most electric chargers can be replaced by solar battery chargers.

The solar charger is equipped with solar panels. When these panels are placed in direct
sunlight, the solar panels will convert solar energy into electricity and store it in
batteries. The more energy you want, the more solar panels you need. Portable solar

Department of ECE, MRITS. 4


Solar based mobile charger

chargers are available for many small devices. Solar calculators have been around for
decades. At first, they are big and bulky, and now pocket size, much more efficient.

Internal solar cells are usually found in these small hand-held devices. Price calculation.
Some sizes are too small to charge with the sun alone but can charge the internal battery.
The internal battery is likely to need to be replaced before the equipment is exhausted.
Replacement of the internal battery is likely to occur every few years, posing a threat
to the ecosystem. A weak battery of a new device is also a potential problem.

When you are not near the power outlet, the external solar charger is good. You can
plug the charger into your device, on the beach, abroad, or on a boat without AC power.
If you are in camping, they are also very good. In the absence of electricity, they are
good for any emergency, survival, or your happiness.

Before you invest in a solar charger, it is important to see if your home appliances and
equipment can be used. In some cases, additional cables may be required.

In order to recharge the battery, you need a separate solar charger. Because it is likely
to be used outdoors, so it is important to buy a weatherproof product. Keep the
connections clean and away from anything that might block them to ensure that they
could work more effectively.

Department of ECE, MRITS. 5


Solar based mobile charger

CHAPTER 3

3 PHOTOVOLTAIC CELLS

The term "photovoltaic" comes from the Greek (photo) means "light", and "voltaic",
means electric from the name of the Italian physicist “VOLTA "after whom a unit of
electromotive force, the volt is named. The sun is a star made up of hydrogen and
helium gas and it radiates an enormous amount of energy. Photovoltaic cell is an
electrical device that convert the energy of light directly into electricity by photovoltaic
effect. Photovoltaics is the field of technology and research related to the practical
application of photovoltaic cells in producing electricity from light, though it is often
used specifically to refer to the generation of electricity from sunlight. Cells can be
described as photovoltaic even when the light source is not necessarily sunlight
(lamplight, artificial light, etc.). In such cases the cell is sometimes used as a
photodetector (for example infrared detectors, detecting light or other electromagnetic
radiation near the visible range, or measuring light intensity. The operation of a
photovoltaic (PV) cell requires 3 basic attributes: The absorption of light, generating
either electron-hole pairs or excitons. The separation of charge carriers of opposite
types. The separate extraction of those carriers to an external circuit. In contrast, a solar
thermal collector collects heat by absorbing sunlight, for the purpose of either direct
heating or indirect electrical power generation. "Photo voltaic cell"
(photoelectrochemical cell), on the other hand, refers either a type of photovoltaic cell
(like that developed by A.E. Becquerel and modern dye-sensitized solar cells or a
device that splits water directly into hydrogen and oxygen using only solar illumination.

Photovoltaic power generation employs solar panels composed of a number of solar


cells containing a photovoltaic material. Materials presently used for photovoltaics
include monocrystalline silicon, polycrystalline silicon, amorphous silicon, cadmium
telluride, and copper indium gallium selenide/sulfide. Due to the increased demand for
renewable energy sources, the manufacturing of solar cells and photovoltaic arrays has
advanced considerably in recent years. Solar photovoltaics is a sustainable energy
source. By the end of 2011, a total of 71.1 GW had been installed, sufficient to generate
85 TWH/year. By end of 2012, the 100 GW installed capacity milestone was achieved.
Solar photovoltaics is now, after hydro and wind power, the third most important
renewable energy source in terms of globally installed capacity. More than 100

Department of ECE, MRITS. 6


Solar based mobile charger

countries use solar PV. Installations may be ground-mounted (and sometimes


integrated with farming and grazing) or built into the roof or walls of a building (either
building-integrated photovoltaics or simply rooftop). Driven by advances in technology
and increases in manufacturing scale and sophistication, the cost of photovoltaics has
declined steadily since the first solar cells were manufactured, and the cost of electricity
(LCOE) from PV is competitive with conventional electricity sources in an expanding
list of geographic regions. Net metering and financial incentives, such as preferential
feed-in tariffs for solar-generated electricity, have supported solar PV installations in
many countries. With the current technology, photovoltaics recoupling the energy
needed to manufacture them in 3 to 4 years.

Fig 3.1: Solar Panel

3.1 PRINCIPLE OF PV CELL

Solar cell works on the principle of photovoltaic effect. Sunlight is composed of


photons, or "packets “of energy. These photons contain various amounts of energy
corresponding to the different wavelengths of light. When photons strike a solar cell,
they may be reflected or absorbed. When a photon is absorbed, the energy of the photon
is transferred to an electron in an atom of the cell (which is actually a semiconductor).
With its new found energy, the electron is able to escape from its normal position
associated with that atom to become part of the current in an electric

Conversion of light energy in electrical energy is based on a phenomenon called


photovoltaic cell. When semiconductor materials are exposed to light, the some of the
photons of light ray are absorbed by the semiconductor crystal which causes a
significant number of free electrons in the crystal. This is the basic reason for producing
electricity due to photovoltaic effect. Photovoltaic cell is the basic unit of the system

Department of ECE, MRITS. 7


Solar based mobile charger

where the photovoltaic effect is utilized to produce electricity from light energy. Silicon
is the most widely used semiconductor material for constructing the photovoltaic cell.
The silicon atom has four valence electrons. In a solid crystal, each silicon atom shares
each of its four valence electrons with another nearest silicon atom hence creating
covalent bonds between them. In this way, silicon crystal gets a tetrahedral lattice
structure. While light ray strikes on any materials some portion of the light is reflected,
some portion is transmitted through the materials and rest is absorbed by the materials.

The same thing happens when light falls on a silicon crystal. If the intensity of incident
light is high enough, sufficient numbers of photons are absorbed by the crystal and these
photons, in turn, excite some of the electrons of covalent bonds. These excited electrons
then get sufficient energy to migrate from valence band to conduction band. As the
energy level of these electrons is in the conduction band, they leave from the covalent
bond leaving a hole in the bond behind each removed electron. These are called free
electrons move randomly inside the crystal structure of the silicon. These free electrons
and holes have a vital role in creating electricity in photovoltaic cell. These electrons
and holes are hence called light-generated electrons and holes respectively. These light
generated electrons and holes cannot produce electricity in the silicon crystal alone.
There should be some additional mechanism to do that.

Fig 3.2: Solar Panel diagram

Department of ECE, MRITS. 8


Solar based mobile charger

CHAPTER 4

4 MANUFACTURING OF SOLAR CELLS

• Raw Materials: The basic component of a solar cell is pure silicon, which is not pure
in its natural state

• Purifying the silicon

• Making single crystal silicon

• Making silicon wafers that is making small silicon crystal.

• Doping: Doping is used to increase the strength of the material.

• The anti-reflective coating: It is a type of optical coating applied to the surface of


lenses. It improves efficiency.

• Encapsulating the cell.

Fig 4.1: Charging of a mobile

Department of ECE, MRITS. 9


Solar based mobile charger

4.1 Specifications of Charger

• Uses high-efficiency mono crystalline silicon.

• Solar panel:5.5v/1000mA

• Output voltage:5.5v

• Output current:300-550mA

Time taken to charge mobile phone using the charger: about 60 minutes for typical
mobile

These were the considerations we took into account while designing our project:

1) The finished product should cost less than $20 in order to compete with the $20
China-made model available in Managua 3

2) The entire system should be built indigenously order to provide jobs and a sustaining
production system

3) The product should be easy to visualize and should minimize design complexity, but
should be durable and able to resist damage when handled on a daily basis

4) It should be aesthetically appealing and easy to use so that the public can use it
without assistance 5) The product should be able to charge a cell phone in a similar
time frame to the current method, meaning within 6 hours for a complete charge cycle.

6) The product should be versatile and charge the different cell phone brands available
in the community.

Department of ECE, MRITS. 10


Solar based mobile charger

4.2 Procedure

• keep the solar panel in sunlight.

• As solar panel gets heated up it charges the mobile connected to the output pin.

• During night mobile can also be charged by using power supply circuit.

Department of ECE, MRITS. 11


Solar based mobile charger

Fig 4.2: Modern Solar devices

Department of ECE, MRITS. 12


Solar based mobile charger

4.3 Circuit Diagram

Fig4.3: Circuit Diagram

The solar panel is used to charge the rechargeable battery. This rechargeable battery is
interfaced with the 78L05 and 78L09 voltage regulators to charge 5V, 9V, 12V loads.
The 5V output is also used to power-up the analyzer circuit. Analyzer circuit consists
of Schmitt trigger, ADC, Micro-controller and LCD. The Schmitt trigger CD4093 acts
as the timer to ADC, generating a clock of 550kHz frequency. The ADC analyzes the
voltage across the battery terminals and converts it into digital form. The micro-
controller displays the charge in the battery on the LCD. It also displays whether the
battery is fully charged and if the battery charge is below 20%, stating “low battery”.
The Schmitt trigger frequency can be varied by varying the external resistor, capacitor
values. The digitized output from the ADC (AD0-AD7) transfers the voltage across the
battery terminals in digital form to the port 1 of the microcontroller. The voltage-divider
circuit scales-down the battery terminal voltage to a maximum of 5V. Based on this
voltage, the micro controller analyzes the charge in the battery and displays this on the
LCD through port 2. The flowchart to analyze the charge in there chargeable battery is
shown in the figure.

Department of ECE, MRITS. 13


Solar based mobile charger

4.4 Block Diagram

Figure5: Block diagram of solar based charging.

Department of ECE, MRITS. 14


Solar based mobile charger

CHAPTER 5

5 POWER SUPPLY

The input to the circuit is applied from the regulated power supply. The ac input i.e.,
230V from the mains supply is step down by the transformer to 12V and is fed to a
rectifier. The output obtained from the rectifier is a pulsating dc voltage, the output
voltage from the rectifier is fed to a filter to remove any ac components present even
after rectification. Now, this voltage is given to a voltage regulator to obtain a pure
constant dc voltage.

Fig 5.1: Power supply of solar based mobile charger

5.1 Filter:

Capacitive filter is used in this project. It removes the ripples from the output of rectifier
and smoothens the D.C. Output?? received from this filter is constant until the mains
voltage and load is maintained constant. However, if either of the two is varied, D.C.
voltage received at this point changes. A regulator is applied at the output stage.

Department of ECE, MRITS. 15


Solar based mobile charger

5.2 Final design:

The prototype uses a simple hinged system which serves two purposes:

1) To angle the panel towards the sun so as to maintain a perpendicular planar angle.
The panel is held in position by a notched wedge system

2) To protect the circuitry and phone from any light rain that may begin before the user
has a chance to bring the system indoors. Its compact design makes it portable, while
its easy-to-use plug makes it simple for anyone to use.

Three solar cells (shown below left) produce a voltage difference of 1.5V. 5 This is fed
into the internal circuitry which is covered by the metal panel next to the hinge (shown
below right) where it is stepped up to an even 5V using a differential amplifier in
conjunction with the required circuitry (See Fig 5). This is the required voltage input to
charge any of the cell phones we encountered in Sabana Grande.

Fig 5.2: Top panel, 3 solar cells Fig 5.3: Inside, circuitry metal panel

Department of ECE, MRITS. 16


Solar based mobile charger

5.3 CELL IN SERIES

Fig 5.4: Cell in series

Department of ECE, MRITS. 17


Solar based mobile charger

5.4 ADVANTAGES

• Solar energy is a renewable energy source. We get solar energy directly from
resources from sun. The solar charger power source comes from the solar energy which
is reliable alternative.

• Solar energy comes in free of charge. The energy from the sun is free. The source of
energy is practically free because we get sunlight directly from sun.

• Solar cells panel on the solar charger does not require much maintenance. As, the
solar cells panel is very reliable as it can last longer than other Source of energy.

• The solar charger also does emit zero pollution and is very ECO friendly which helps
in reducing global warming and greenhouse effect.

• . It also helps reduces cost such as electric bills as the solar charger source of energy
is free.

• The solar charger also operates quietly and this does not contribute to noise pollution.

Department of ECE, MRITS. 18


Solar based mobile charger

5.5 DISADVANTAGES

• Solar charger need light to work. The efficiency of the photo-voltaic panels has
increased greatly over the last decade or so, reaching the point where they do not need
direct sunlight to work but will now create a satisfactory current even under overcast
conditions. But it is still something we should be aware of depending where in the world
we are based.

• Charging a device by solar charger is much slower than the main charger. This is due
to the current generated by the solar panels being a lot less than what you would find at
home.

Department of ECE, MRITS. 19


Solar based mobile charger

5.6 CONCLUSION

• To make sure we have plenty of energy in the future, it's up to all of us to use energy
wisely.

• We must all conserve energy and use it efficiently. It's also up to those who will create
the new energy technologies of the future.

• All energy sources have an impact on the environment. Concerns about the
greenhouse effect and global warming, air pollution, and energy security have led to
increasing interest and more development in renewable energy sources such as solar,
wind, geothermal, wave power and hydrogen

• In solar mobile charger ripples will not be there as we use DC power directly to charge
the mobile.

• Battery life is more as high voltages are not developed.

• Versatility of Solar mobile charger is high.

• Life of the battery will be high as we use solar mobile charger.

• Adaptability is high.

Department of ECE, MRITS. 20


Solar based mobile charger

5.7 REFERENCES

www.google.com

www.wikipedia.com

www.studymafia.org

Department of ECE, MRITS. 21


Solar based mobile charger

Department of ECE, MRITS. 22


Solar based mobile charger

Department of ECE, MRITS. 23


Solar based mobile charger

Firstly the Microcontroller will switches on the water supply once to water the
entire garden for few hours before opening of the garden for public.

All the timing works are done with the help of RTC .and Rain sensor is used to
sense the rain, based on that condition motor will on or off.
This come up with a low cost and portable solution and decided to design and
implement an Time indication and watering the garden in the absence of rain based on
ATmega328 microcontroller.
Along with the ATmega328 microcontroller (Arduino Uno), LCD, pump motor,
buzzer, real time clock (RTC), rain sensor are used in this system.

1.2 PROBLEM STATEMENT


Watering system is the most important thing on a greenhouse system. The water
is the main element, will make sure the plants survive on certain circumstances. As all
know, most of the gardener use the manual system to water their plant but this system
is not efficient. The plants will either die if there is not enough water supplies to the
plant or vice versa.
The aims to conserve water and start new ways of watering plants and save
water during rainy seasons. Application of science, technology and innovation to raise
productivity and efficiency but Automatic watering expansion is likely to increase the

Department of ECE, MRITS. 24


Solar based mobile charger

scarcity of water which will lead to the competition to increase more plants. It
recognizes the critical role played by research and development in accelerating
economic development.
In order to maintain the condition and overcome the problem, Time indication
and watering the garden in the absence of rain is used. System is created to reduce the
time by using automatic system rather than manual way of watering. In other words,
RTC and Rain sensor will control the condition in the garden. These way workers are
not needed to maintain the plants.

1.3 MOTIVATION
Water is the most important element in our life. Without it, living beings cannot
survive. Watering system can be defined as a system to deliver water to the plants in a
garden. These types vary from simple ones to most sophisticated systems and has to
choose the best suited one for plants. In short, such system takes care of the water
requirements of plants and totally eliminates manual watering.

In keeping abreast technology, Intelligent Automatic Plant Irrigation System is


created. This arrangement is constructed to provide opportunity for the gardener to
manage their plants. The heart of this automatic watering system is microprocessor.
This system has capability to control the watering system.

a) To save water energy and man power in the public garden.


b) Converting from labour-intensive method to modern-scientific method. Hence
reduce labour costs.
c) Much watering to plants results in disease and may even die out, with the help
of microcontrollers watering can be uniformly precise and at required level. this
reduces unwanted weed growth and is a major step for water conversation
d) RTC control access of the system as well as handle the system manually.
e) To design which will less costly, easy to handle, efficient and putting minimal
efforts of the gardener.

1.4 OBJECTIVE

The objective is to design a system to control the amount of water delivered to


the plants on specific time. It also can detect rain by rain sensor and control the water
in the garden during rainy seasons.

Department of ECE, MRITS. 25


Solar based mobile charger

1.5 METHODOLOGY ADOPTED

Watering is the most important cultural practice and most labor intensive task
in daily greenhouse operation. Watering systems ease the burden of getting water to
plants when needed. Knowing when and how much to water is two important aspects
of watering process. To make the gardener works easily, the automatic garden watering
system is created. There have a various type using automatic watering system that are
by using sprinkler system, tube, nozzles and other.

Watering the plants located in the garden to roots of plants and grass. System is
often used for general plant care, as part of caring for small and large gardens.
Normally, the plants need to be watered twice daily, morning and evening. So, the
microprocessor has to be coded to water the plants in the garden about two times per
day writing code and gives it to the microprocessor according to that it performs.

The automatic watering system was designed to continuously to keep water to


plants according to time. The system responds appropriately by watering the plants with
the exact amount of water required and then shuts down the water supply when the
required amount of water. The rain sensors and RTC were designed using probes made
from corrosion resistant material.

1.6 TOOLS USED


1.6.1 Software
1. Arduino IDE
1.6.2 Hardware
1. Arduino Uno microcontroller (ATmega328)
2. LCD (16x2)
3. Water pump
4. Buzzer
5. Real time clock (RTC)
6. Relay
7. Rain sensor

1.7 ORGANIZATION OF REPORT


Chapter 1 describes the introduction, problem statement, Motivation, objective,
methodology adapted, tools used were discussed. Chapter 2 describes about the
literature review. Chapter 3 describes about embedded systems, microcontroller and

Department of ECE, MRITS. 26


Solar based mobile charger

Arduino Uno board. Chapter 4 describes about the communication module and motors.
Chapter 5 describes about implementation of time indication and watering the garden
in the absence of rain. Chapter 6 describes the results and discussions. Chapter 7
describes about the conclusion and future scope followed by references.

CHAPTER 2
LITERATURE REVIEW
2.1 INTRODUCTION
In the previous chapter, introduction, problem statement, motivation, objective,
methodology adopted, tools used and organization of the project were discussed. In this
chapter literature review is discussed.

2.2 GENESIS OF WATER PROTECTION


The proposed system is mainly concerned with the real time operation of
watering to plants in garden depending on the time and rain. But there are many other
parameters that has to be considered when system is implemented in real.
M.Nesa Sudha et al., 2011 [1] proposed a TDMA based MAC protocol used for
collect data such as soil moisture and temperature for optimum irrigation to save
energy. MAC protocol plays an important role to reduce energy consumption. Two
methods used for energy efficiency as Direct Communication method and aggregation
method. Direct Communication method provides collision free transmission of data.
This method is better where the base station is near but it is not optimum where the base

Department of ECE, MRITS. 27


Solar based mobile charger

station is far because sensor nodes consume more energy during transmission of data
and if there is much data to the sensor node, sensor nodes quickly damaged. The data
aggregation method is better to use rather than direct communication method. The
sensor node senses the data and send to the head node. The head node collects data from
the entire sensor node, performs aggregation using various aggregation techniques, and
then sends data to the base station. Thus by using aggregation method overall energy
consumption reduce of the network. The simulation result show that aggregation
method provide better performance rather than direct communication method.
Anuj Nayak et al., 2014 [2] describe that sensor nodes batteries are charged by
using harnessing wind energy. A routing algorithm named DEHAR is proposed to
extend overall batteries power. The proposed method is efficient. A small band belt
used to harness wind energy to sensor nodes. Wind belt is aero elastic flutter, which is
capable for harnessing wind energy. Harnessing wind energy is a renewable energy
source. However, the main problem using harnessing wind energy is the unreliability
as the power of the wind is not permanent.

Man Zhang et al., 2012 [3] analysis the temporal and spatial variability of soil
moisture for the realization of variable irrigation and for improve yield in the farm.
Temporal variability adopts the changes of soil moisture at the place where the sensor
nodes installed and analyze soil moisture variation at different times according to
season. Spatial variability analyses calculate all parameter of soil moisture as average,
maximum, minimum in whole area. The temporal variability curve has drawn according
to measure data. It showed that the corn was in severe water stress state during the
completely monitoring period.
B. Balaji Bhan et al., 2014 [4] proposed a system to develop WSN based soil
moisture controllers that determine the water requirement by comparing soil moisture
with predefined threshold value. An intelligent remote system consists of wireless
sensor nodes and computer system in which data is transmitted to a server system from
where the data accessed by individuals for decision making for automated control of
irrigation for the yield productivity. Field validation tests routinely performed on
different soils to measure the soil moisture, water amount in soil for efficient irrigation
system. If the stored data does not match with the soilmeasured data, an interrupt sent
to the pressure unit and stop irrigation automatically

Department of ECE, MRITS. 28


Solar based mobile charger

Macro Mancuso et al. [5] the Rinnovando group (Rgroup) is working with
agriculture experts that concentrate on monitoring microclimate in tomato greenhouse.
The main goal of monitoring is to measure when the crop is on risk of developing and
the farmer treat the field with fertilizer only when needed.
Alvindarjit Singh et al., 2010 [6] represents the design of a system which takes
soil samples when an event triggered with an outside event such as rain event. The
system has variable sampling rates with interface to soil sensors and rain gauge.
Wireless soil sensor network monitor an event of rain and soil moisture content. Such
system consists of rain detection module and sensory module. Rain detection module
detect event of rain and Sensor module measure the soil moisture level and both module
measure data based on sampling rate set by gateway. Star mesh hybrid topology used
to organize sensor nodes in star topology around routers that provide fault tolerance.
M. Usha Rani et al., 2014 [7] proposed an AIS based on moisture level by using
Grove moisture sensor to control the water level available on the pipe. Depending on
moisture level of the soil, the water flow sensor sense the flow range and operating
pressure. The monitored data updated in a database along with the time and displayed
in the web portal through the web service technology, the information updated via web
technology and updated information will be available on the webpage from where the
farmer checks the moisture level and motor status. By using GSM motor’s functionality
status will also be sent to the farmer.
Xinrong Zhang et al., 2011 [8] represents the design of distributed control
system of indoor wireless temperature and humidity to improve the overall performance
of the system by detect change in the temperature and humidity. The fuzzy control
algorithm used to control the system environmental factor and software tools have used
for aided design of fuzzy control system. The real time data collected by monitoring
software and the reports formed for decision-making.
Scott Fazackerley et al., 2009 [9] represents the design of an adaptive irrigation
controller using WSN for monitoring the soil moisture status and controlling the
irrigation program schedule irrigation based on input takes from wireless soil moisture
sensor nodes and controller analyze the data to determine when and how much water is
required to each part of the field. Water can be monitored by controller through a flow
meter and it use time clock to control watering start and end times and when program
event triggered it is added to a water queue and at one time delivered water only

Department of ECE, MRITS. 29


Solar based mobile charger

required part. Experimental results show that irrigation water consumption reduced by
using adaptive water program in turfgrass.

2.3 CONCLUSION
In this chapter, reference links have been referred and the analysis of the
literature review was discussed.

CHAPTER 3
EMBEDDED SYSTEMS AND ARDUINO UNO
ATMEGA 328 MICROCONTROLLER
3.1 INTRODUCION
In the previous chapter, the literature review was discussed. This chapter deals
with the discussion of embedded systems and the architecture of the embedded systems.
3.2 EMBEDDED SYSTEMS
An Embedded System is a combination of computer hardware and software, and
perhaps additional mechanical or other parts, designed to perform a specific function.
A good example is the microwave oven. Almost every household has one, and tens of
millions of them are used every day, but very few people realize that a processor and
software were involved in the preparation of their lunch or dinner. Frequently, an
embedded system is a component within some larger system. For example, modern cars
and trucks contain many embedded systems.
It is important to point out that a general-purpose computer is itself made up of
numerous embedded systems. For example, computer consists of a keyboard, mouse,

Department of ECE, MRITS. 30


Solar based mobile charger

video card, modem, hard drive. Each of these devices contains a processor and software
and is designed to perform a specific function.
If an embedded system is designed well, the existence of the processor and
software could be completely unnoticed by the user of the device. Such is the case for
a microwave oven, alarm clock. In some cases, it would even be possible to build an
equivalent device that does not contain the processor and software. This could be done
by replacing the combination with a custom integrated circuit that performs the same
functions in hardware. It is much easier, and cheaper, to change a few lines of software
than to redesign a piece of custom hardware.
Languages used in embedded systems are assembly language, embedded- c
language, embedded java language.
Embedded systems are classified into three types
1. Small scale embedded systems.

2. Medium scale embedded systems.

3. Sophisticated embedded systems.

3.2.1 Small scale embedded systems


Small scale embedded system are of 8 or 16 bit microprocessor. Languages used
in small scale were assembly level language and embedded c. Its cost and performance
are low compared to medium and sophisticated embedded systems.
3.2.2 Medium scale embedded systems
Medium scale embedded system are of 16 bit or 32 bit microprocessors.
Languages used in medium scale were embedded c and embedded java. Its cost and
performance are better than small scale.
3.2.3 Sophisticated embedded systems
Sophisticated scale embedded systems are highly complex. Languages used in
sophisticated scale were RTOS. Its cost and performance are high compared to small
scale and medium scale.
3.3 OVERVIEW OF EMBEDDED SYSTEM ARCHITECTURE

Department of ECE, MRITS. 31


Solar based mobile charger

Every embedded system consists of custom-built hardware built around a


Central Processing Unit (CPU). This hardware also contains memory chips onto which
the software is loaded. The software residing on the memory chip is also called the
‘firmware’. The embedded system architecture can be represented as a layered
architecture.

Figure 3.1: Embedded System design.


The Figure 3.1 shows about the embedded system design in which the operating
software is embedded in hardware.
For small appliances such as remote control units, air conditioners, toys etc.,
there is no need for an operating system and can write only the software specific to that
application. For applications involving complex processing, it is advisable to have an
operating system. In such a case, needed to integrate the application software with the
operating system and then transfer the entire software on to the memory chip. Once the
software is transferred to the memory chip, the software will continue to run for a long
time and don’t need to reload new software. Now, let us see the details of the various
building blocks of the hardware of an embedded system. As shown in Figure 3.2 the
building blocks are:

1. Central Processing Unit (CPU).


2. Memory (Read-only Memory and Random Access Memory).
3. Input Devices.
4. Output devices.
5. Communication interfaces.
6. Application-specific circuitry.

Read only memory Random access memory

Input Central processing unit (CPU) Output devices


Department of ECE, MRITS. 32
devices
Solar based mobile charger

Communication
Application specific circuitry interferences

Figure 3.2: Hardware Architecture of an Embedded System.


The Figure 3.2 shows the hardware architecture of the embedded system with
input, outputs and communication interferences. The CPU acts as an interface between
input as well as output devices. It also consists of RAM and ROM memories, which will
be storing temporary and permanent data respectively. Communication system acts as an
interface between CPU to other embedded systems. Application specific circuitry, and
are the one that are used for specific purposes like rain sensor.

3.3.1 Central processing unit (CPU)

The Central Processing Unit (processor, in short) can be any of the


following: microcontroller, microprocessor or Digital Signal Processor (DSP). A
micro-controller is a low-cost processor. Its main attraction is that on the chip itself,
there will be many other components such as memory, serial communication interface,
analog-to digital converter etc.

3.3.2 Memory
The memory is categorized as Random Access 11emory (RAM) and Read Only
Memory (ROM). The contents of the RAM will be erased if power is switched off to
the chip, whereas ROM retains the contents even if the power is switched off. So, the
firmware is stored in the ROM. When power is switched on, the processor reads the
ROM; the program is program is executed.
3.3.3 Input devices
Unlike the desktops, the input devices to an embedded system have very limited
capability. There will be no keyboard or a mouse and hence interacting with the
embedded system is no easy task.
3.3.4 Output devices

Department of ECE, MRITS. 33


Solar based mobile charger

The output devices of the embedded systems also have very limited capability.
Some embedded systems will have a few Light Emitting Diodes (LEDs) to indicate the
health status of the system modules, or for visual indication of alarms.
3.3.5 Communication interfaces
The embedded systems may need to, interact with other embedded systems at
they may have to transmit data to a desktop. To facilitate this, the embedded systems
are provided with one or a few communication interfaces such as RS232, RS422,
RS485, Universal Serial Bus (USB) and IEEE 1394, Ethernet etc.
3.3.6 Application-specific circuitry
Sensors, transducers, special processing and control circuitry may be required
fat an embedded system, depending on its application. This circuitry interacts with the
processor to carry out the necessary work. The entire hardware has to be given power
supply either through the 230 volts main supply or through a battery. Embedded
Systems plays a vital role in our day today life. They are used for household appliances
like microwave oven to the satellite applications.
3.4 ARDUINO WITH MICRO CONTROLLER
Arduino is an open-source computer hardware and software company, User
community that designs and manufactures kits for building digital devices and
interactive objects that can sense and control the physical world. Arduino boards may
be purchased, pre-assembled, at the same time. The hardware design information is
available for those who would like to assemble an Arduino from scratch. An Arduino
board consists of an Atmel 8-16 or 32-bit AVR microcontroller with complementary
components that facilitate programming and incorporation into other circuits.
An important aspect of the Arduino is its standard connectors, which lets users
connect the CPU board to a variety of interchangeable add-on modules known as
shields. Some shields communicate with the Arduino board directly over various pins,
but many shields are individually addressable via an I²C serial bus so many shields can
be stacked and used in parallel. Official Arduino’s have used the mega AVR series of
chips, specifically the ATmega8, ATmega168, ATmega328, ATmega1280, and
ATmega2560. A handful of other processors have been used by Arduino compatibles.

Department of ECE, MRITS. 34


Solar based mobile charger

Figure 3.3: Arduino Board with Micro Controller.


The Figure 3.3 shows that board can operate on an external supply of 6 to 20
volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts
and the board may be unstable. If using more than 12V, the voltage regulator may
overheat and damage the board. The recommended range is 7 to 12 volts.
Most of the boards with oscillator (or ceramic resonator in some variants),
although some designs such as the Lily Pad run at 8 MHz and dispense with the onboard
voltage regulator due to specific form-factor restrictions. An Arduino's microcontroller
is also pre-programmed with a boot loader that simplifies uploading of programs to the
on-chip flash memory, compare to other memory these required external programmer.
This makes using an Arduino more straight forward by allowing the use of an ordinary
computer as the programmer.
The Arduino Uno can be powered via the USB connection or with an external
power supply. The power source is selected automatically. External (non-USB) power
can come either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be
connected by plugging a 2.1mm centre-positive plug into the board's power jack. Leads
from a battery can be inserted in the Gnd and Vin pin headers of the POWER connector.
3.5 POWER PINS

A. VIN. The input voltage to the Arduino board when it's using an external power
source (as opposed to 5 volts from the USB connection or other regulated power
source). the supply voltage through this pin or if supplying voltage via the power
jack, access it through this pin.

B. 5V.This pin outputs a regulated 5V from the regulator on the board. The board
can be supplied with power either from the DC power jack (7 - 12V), the USB

Department of ECE, MRITS. 35


Solar based mobile charger

connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the
5V or 3.3V pins by passes the regulator, and can damage the board.

C. 3V 3A 3.3 volt supply generated by the on-board regulator. Maximum current


draw is 50 mA.

D. GND. Ground pins.

E. IOREF. This pin on the Arduino board provides the voltage reference with
which the microcontroller operates. A properly configured shield can read the
IOREF pin voltage and select the appropriate power source or enable voltage
translators on the outputs for working with the 5V or 3.3V.
F. The ATmega328 has 32 KB (with 0.5 KB used for the boot loader). It also has
2 KB of SRAM and 1 KB of EEPROM (which can be read and written with
the EEPROM library). Each of the 14 digital pins on the Uno can be used as an
input or output, using pin Mode (), digital Write (), and digital Read
() functions. operate at 5 volts. Each pin can provide or receive a maximum of
40 mA and has an internal pull-up resistor (disconnected by default) of 20-50
kilo ohm.

In addition, some pins have specialized functions:

A. Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial
data. These pins are connected to the ATmega8U2 USB-to-TTL Serial chip.
External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt
on a low value, a rising or falling edge, or a change in value. See the attach
Interrupt () function for details.
B. PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analog Write
() function.
C. SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication using the SPI library.
D. LED: 13. There is a built-in LED connected to digital pin 13. When the pin is
HIGH value, the LED is on, when the pin is LOW, it's off.
E. The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10
bits of resolution (i.e. 1024 different values). By default measure from ground
to 5 volts, though is it possible to change the upper end of their range using the
AREF pin and the analog Reference () function.

Department of ECE, MRITS. 36


Solar based mobile charger

F. TWI: A4 or SDA pin and A5 or SCL pin Support TWI communication using
the Wire library.

There are a couple of other pins on the board:

1. AREF. Reference voltage for the analog inputs. Used with analog Reference ().
2. Reset. Bring this line LOW to reset the microcontroller. Typically used to add
a reset button to shields which block the one on the board.

The Arduino Uno has a number of facilities for communicating with a computer,
another Arduino, or other microcontrollers. The ATmega328 provides UART TTL
(5V) serial communication, which is available on digital pins 0 (RX) and 1 (TX).
An ATmega16U2 on the board channels this serial communication over USB and
appears as a virtual com port to software on the computer. The '16U2 firmware uses the
standard USB COM drivers, and no external driver is needed. However, on Windows,
an information file is required. The Arduino software includes a serial monitor which
allows simple textual data to be sent to and from the Arduino board. The RX and
TX LEDs on the board will flash when data is being transmitted via the USB-to-serial
chip and USB connection to the computer.

A Software Serial library allows for serial communication on any of the Uno's
digital pins. The ATmega328 also supports I2C (TWI) and SPI communication. The
Arduino software includes a Wire library to simplify use of the I2C bus. For SPI
communication, use the SPI library. The Arduino Uno can be programmed with the
Arduino software (download).Select "Arduino UNO from the Tools > Board menu
(according to the microcontroller on the board).

The ATmega328 on the Arduino Uno comes pre burned with a boot loader that
allows to upload new code to it without the use of an external hardware programmer. It
communicates using the original STK500 protocol (reference, C header files).Bypass
the boot loader and program the microcontroller through the ICSP (In-Circuit Serial
Programming) header using Arduino ISP or similar; see these instructions for details.

The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code
is available. The ATmega16U2/8U2 is loaded with a DFU boot loader, which can be
activated by:

1. On Rev1 boards: connecting the solder jumper on the back of the board (near
the map of Italy) and then resetting the 8U2.

Department of ECE, MRITS. 37


Solar based mobile charger

2. On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line
to ground, making it easier to put into DFU mode.
The use of Atmel's FLIP Software (Windows) or the DFU programmer (Mac
OS X and Linux) to load a new firmware or use the ISP header with an external
programmer (overwriting the DFU boot loader).
Rather than requiring a physical press of the reset button before an upload, the
Arduino Uno is designed in a way that allows it to be reset by software running on a
connected computer. One of the hardware flow control lines (DTR) of the
ATmega8U2/16U2 is connected to the reset line of the ATmega328 via a 100 Nano
farad capacitor. When this line is asserted (taken low), the reset line drops long enough
to reset the chip. The Arduino software uses this capability to allow to upload code by
simply pressing the upload button in the Arduino environment. This means that the boot
loader can have a shorter timeout, as the lowering of DTR can be well co-ordinate with
the start of the upload.
This setup has other implications. When the Uno is connected to either a
computer running Mac OS X or Linux, it resets each time a connection is made to it
from software (via USB). For the following half-second or so, the boot loader is running
on the Uno. While it is programmed to ignore malformed data (i.e. anything besides an
upload of new code), it will intercept the first few bytes of data sent to the board after
a connection is opened. If a sketch running on the board receives one-time configuration
or other data when it first starts, make sure that the software with which it communicates
waits a second after opening the connection and before sending this data.
The UNO contains a trace that can be cut to disable the auto-reset. The pads on
either side of the trace can be soldered together to re-enable it. It's labeled "RESET-
EN". May also be able to disable the auto-reset by connecting a 110 ohm resistor from
5V to the reset line.
The Arduino UNO has a resetf poly fuse that protects computer's USB ports
from shorts and over current. Although most computers provide their own internal
protection, the fuse provides an extra layer of protection. If more than 500 mA is applied
to the USB port, the fuse will automatically break the connection until the short or
overload is removed.
The Arduino UNO is a microcontroller board based on the ATmega328. It has
14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs,

Department of ECE, MRITS. 38


Solar based mobile charger

a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a
reset button. It contains everything needed to support the microcontroller; simply
connect it to a computer with a USB cable or power it with a AC-to-DC adapter or
battery to get started.

3.6 ATmega328 MICROCONTROLLER


The ATmega328 is a single chip microcontroller created by Atmel and
belongs to the mega AVR series as shown in Figure 3.4

Figure 3.4: ATmega328 Micro Controller.


The Figure 3.4 shows that ATmega328 micro controller with 28 input and
output pins, 32kb flash memory ,2kb SRAM ,1kb EEPROM.
The Atmel 8-bit AVR RISC-based with read-while-write capabilities, 1KB
EEPROM, 2 KB SRAM, 23 general purpose I/O lines, 32 general purpose working
registers, three flexible timer/counters with compare modes, internal and external
interrupts, serial programmable USART, programmable watchdog timer with internal
oscillator and five software selectable power saving modes. The device operates
between 1.8-5.5 volts. The device achieves throughputs approaching 1 MIPS per MHZ.
A common alternative to the ATmega328 is the "Pico Power" ATmega328P.
A comprehensive list of all other member of the ATmega AVR series can be found on
the Atmel website.

Today the ATmega328 is commonly used in many systems and autonomous


systems where a simple, low-powered, low-cost micro-controller is needed. Perhaps the
most common implementation of this chip is on the popular Arduino development
platform, namely the Arduino UNO and Arduino Nano models.

3.6.1 Features of ATmega328 microcontroller

a. Operating voltage - 5v

Department of ECE, MRITS. 39


Solar based mobile charger

b. Clock frequency - 16Mhz

c. Input voltage recommended - 7-12 v

d. Input voltage limited to - 6-20 v

e. Digital in/out pins - 14

f. Analog input pins - 6

g. Dc current per input pins - 40Ma

h. Dc current for input pins - 50mA

i. Flash memory - 32kb memory

j. SRAM memory - 2kb memory

k. EEPROM memory - 1kb memory

3.7 CONCLUSION

In this chapter, description of Arduino Uno Board, ATmega328 microcontroller


and embedded systems was discussed.

CHAPTER 4
HARDWARE MODULES
4.1 INTRODUCTION
In the previous chapter introduction to the embedded systems and its
architecture were discussed. This chapter deals with the discussion of the ATmega328
microcontroller, sensors and other peripherals of the air and sound pollution monitoring
system.
4.2 LIQUID CRYSTAL DISPLAY (LCD)
A liquid crystal display is a video display that utilizes the light modulating
properties of liquid crystals to display pictures or text on a screen. Since their invention
in 1964, LCD screens have grown to be used in a very wide variety of applications,

Department of ECE, MRITS. 40


Solar based mobile charger

including computer monitors, televisions, and instrument panels. One way to utilize an
LCD is with an Arduino microcontroller. By wiring an Arduino microcontroller to the
pins of an LCD display it is possible to program the microcontroller to display a desired
text string or image on the screen.
To fully understand how to interface an Arduino microcontroller to an LCD
screen, it is important to understand how an LCD functions. An LCD display is
composed of pixels made up of liquid crystals as shown in Figure 4.1. Liquid crystals
exist in a state that’s between a solid and a liquid. At any time liquid crystals can be in
a variety of phases, most notably the nematic phase or the sematic phase.

Figure 4.1: Liquid Crystal Display in ON & OFF States


In the nematic phase the crystals act more like a liquid, allowing the molecules
of the crystals to rearrange themselves while remaining oriented in a uniform direction.
In the sematic phase, the molecules can form into layers that can move past one another
relatively easily. Molecules of a certain layer can move freely within that layer, but
cannot move to adjacent layers.
In order to give some context on how it is possible to program an LCD screen
to display certain information the Arduino microcontroller should be briefly discussed.
The Arduino Uno board consists of ATmega328 microcontroller, 14 digital
input/output pins, 6 analog inputs, a 16 MHz resonator, a USB connection, a power jack
and an ICSP header. the most important features of the board are the microcontroller,
which allows for the building of programs in the JAVA programming language, and
the digital input/output pins, which allows for the transfer of information between the
board and the LCD display.
4.2.1 Features of LCD

a. Operating voltage - 5v

Department of ECE, MRITS. 41


Solar based mobile charger

b. Backlight color - green

c. Horizontal characters - 16

d. Vertical characters - 2

e. Microcontroller unit speed - 2Mhz

f. Interface - 4-bit & 8-bit MPU


4.2.2 Pin Description for LCD
VCC, VSS and VEE
While VCC and VSS provide +5V and ground respectively, VEE is used for
controlling LCD contrast.
RS (Register Select)
While VCC and VSS provide +5V and ground respectively, VEE is used for
controlling LCD contrast. There are two important registers inside the LCD. When RS
is low (0), the data is to be treated as a command or special instruction (such as clear
screen position cursor, etc.). When RS is high (1), the data that is sent is a text data
which should be displayed on the screen. For example, to display the letter "T" on the
screen that would set RS high.
RW (Read/Write)
The RW line is the "Read/Write" control line. When RW is low (0), the
information on the data bus is being written to the LCD. When RW is high (1), the
program is effectively querying (or reading) the LCD. Only one instruction ("Get LCD
status") is a read command. All others are write commands, so RW will almost be low.
Table 4.1 shows the pins which were used in the LCD for specific functions

Pin No. Symbol Function

1 𝑉𝑠𝑠 Ground

2 𝑉𝐷𝐷 Power supply

3 𝑉𝑂 Power supply for LCD

4 RS Select Display data or instructions

5 RW Read / Write select signal

Department of ECE, MRITS. 42


Solar based mobile charger

6 E Read/Write Enable signal

7 to 14 DBO TO DB7 Display data signal

15 LED-(K) Ground

16 LED+(K) Power supply

Table 4.1: Pin out of a typical LCD Screen

EN (Enable)
The EN line is called "Enable". This control line is used to tell the LCD that is
sending it to data. To send data to the LCD, program should first set this line high (1)
and then set the other two control lines and/or put data on the data bus. When the other
lines are completely ready, bring EN low (0) again. The 1-0 transition tells the 44780
to take the data currently found on the other control lines and on the data bus and to
treat it as a command.
D0-D7 (Data Lines)
The 8-bit data pins, D0-D7 are used to send information to the LCD or read the
content of the LCD’s internal registers.
To display letters and numbers, we send ASCII codes for the letters A-Z, a-z
and numbers 0-9 to these pins while making RS=1.
There are also instruction command codes that can be sent to the LCD to clear
the display or force the cursor to the home position or blink the cursor.
In the LCD, RS=0 to check the busy flag bit to see if the LCD is ready to receive
the information. The busy flag is D7 and can be read when R/W=1 and RS=0, as
follows: if R/W =1, RS=0. When D7=1 (busy flag=1), the LCD is busy taking care of
internal operations and will not accept any new information. When D7=0, the LCD is
ready to receive new information. Table 4.2 shows the ASCII codes which should be
used for running specific commands.
Table 4.2: LCD Command Codes
CODE (HEX) COMMAND TO LCD INSTRUCTION REGISTER

1 Clear Display Screen

2 Return Home

Department of ECE, MRITS. 43


Solar based mobile charger

4 Decrement Cursor(Shift Cursor To Left)

6 Increment Cursor(Shift Cursor To Right)

5 Shift Display Right

7 Shift Display Left

8 Display Off, Cursor Off

A Display Off, Cursor On

C Display On, Cursor Off

E Display On Cursor Blinking

F Display On Cursor Blinking

10 Shift Cursor Position To Left

14 Shift Cursor Position To Right

18 Shift The Entire Display To The Left

1C Shift The Entire Display To The Right

80 Force Cursor To Beginning Of 1st Line

C0 Force Cursor To Beginning Of 2nd Line

4.3 REAL TIME CLOCK (DS1307)


Real time clocks (RTC), as the name called clock modules. The DS1307 RTC
IC is an 8 pin device using an I2C interface. The DS1307 is a low-power clock with
56 bytes of battery backup SRAM shown in4.2. This clock provides seconds, minutes,
hours, day, date, month and year qualified data. The end date of each month is
automatically displayed, especially for months with less than 31 days.
RTC are available as integrated circuits (ICs) and treats timing like a clock and
also operate date like a calendar. The main advantage of RTC is having an arrangement
of battery backup which keeps the clock running even if there is power get turned off .
An exceptionally little current is required for keeping the RTC animated. RTCs are
there in many applications like embedded systems and computer mother boards, etc.
4.3.1 Pin description of DS1307

Department of ECE, MRITS. 44


Solar based mobile charger

Pin 1, 2 : Connections for standard 32.768 kHz quartz crystal. The internal oscillator
circuitry is intended for operation with a crystal having a specified load capacitance of
12.5pF. X1 is the input to the oscillator and can alternatively be connected to an external
32.768 kHz oscillator. The output of the internal oscillator, X2 is drifted if an external
oscillator is connected to X1.
Pin 3: Battery input for any standard 3V lithium cell or other energy source. Battery
voltage should be between 2V and 3.5V for suitable operation. The nominal write
protect trip point voltage at which access to the RTC and user RAM is denied is set by
the internal circuitry as 1.25 x VBAT nominal. A lithium battery with 48mAhr or
greater will backup the DS1307 for more than 10 years in the absence of power at 25ºC.
Pin 4: Ground.
Pin 5: Serial data input/output. The input/output for the I2C serial interface is the SDA,
which is open drain and requires a pull up resistor, allowing a pull up voltage up to
5.5V. Regardless of the voltage on VCC.
Pin 6: Serial clock input. It is the I2C interface clock input and is used in data
synchronization.
Pin 7: Square wave/output driver. When enabled, the SQWE bit set to 1, the SQW/OUT
pin outputs one of four square-wave frequencies (1Hz, 4 kHz, 8 kHz, and 32 kHz). This
is also open drain and requires an external pull-up resistor. It requires application of
either Vcc or Vb at to operate SQW/OUT, with an allowable pull up voltage of 5.5V
and can be left floating, if not used.
Pin 8: Primary power supply. When voltage is applied within normal limits, the device
is fully accessible and data can be written and read. When a backup supply is connected
to to the device and VCC is below VTP, read and writes are inhibited.

Figure 4.2: Real time clock


4.3.2 Features of real time clock

Department of ECE, MRITS. 45


Solar based mobile charger

a. Programmable square wave output signal.

b. Automatic power fail detector and circuitry.

c. Consumes less than 500nA battery backup mode with oscillator running.

d. Available in 8-pin DIP or SOIC

e. Real-time clock(RTC) clock seconds, minutes, hours, date of the month, date
of the week, year with leap year compensation valid up to 2100.

f. 56-byte non-volatile RAM for data storage.

g. Two wire interface(l2C).


4.3.3 Working of DS1307
In the simple circuit the two inputs X1 and X2 are connected to a 32.768 kHz
crystal oscillator as the source for the chip. VBAT is connected to positive culture of a
3V battery chip. Vcc power to the I2C interface is 5V and can be given using
microcontrollers. If the power supply Vcc is not granted read and writes are inhibited.
START and STOP conditions are required when a device wants to establish
communication with a device in the I2C network. The rtc is shown in Figure 4.2.
1. By providing a device identification code and a register address, implementation
of START condition to access the device.
2. The registers can be accessed in serial order until a STOP condition is implemented
The START condition and STOP condition when the DS1307 I2C communication with
the microcontroller.
4.4 FUNDUINO RAIN SENSOR
Rain sensor brick is designed for water detection, which can be widely used in
sensing the rainfall, water level, even the liquate leakage. The brick is mainly comprised
of three parts: An Electronic brick connector, a 1 MΩ resistor, and several lines of bare
conducting wires. This sensor works by having a series of exposed traces connected to
ground and interlaced between the grounded traces are the sense traces.
The sensor traces have a weak pull-up resistor of 1 MΩ. The resistor will pull
the sensor trace value high until a drop of water shorts the sensor trace to the grounded
trace. Believe it or not this circuit will work with the digital I/O pins of Arduino or can
use it with the Analog pins to detect the amount of water induced contact between the

Department of ECE, MRITS. 46


Solar based mobile charger

grounded and sensor traces. This sensor can judge the water level through with a series
of exposed parallel wires stitch to measure the water droplet/water size.
This sensor can easily change the water size to Analog signal, and output
Analog value can directly be used in the program function. These sensors have low
power consumption, and high sensitivity, which are the biggest characteristics of this
module. This sensor can be compatible with Arduino UNO, Arduino mega2560,
Arduino ADK etc.
This sensor is supplied to 5V or 3.3V on VCC and GND pins. The pin S will
give us an analog value between VCC and GND Using the S pin as analog input
connecting Arduino shown in Figure 4.3, the value read will be higher depending on
the sensor surface is covered with water. This is because the water acts as a conductor,
given that the water use in our deposits not be pure water (H2O), since if water is
nonconductive. But rarely use this type of sensors to measure the water level in a tank
of pure water.
Rain sensor brick is designed for water detection, which can be widely used in
sensing rainfall, water level, and even liquid leakage.
Connecting a rain sensor to an Arduino is a great way to detect a leak, spill,
flood, rain, etc. It can be used to detect the presence, the level, the volume and/or the
absence of water. While this could be used to remind to water plants, there is a better
Grove sensor for that. The sensor has an array of exposed traces, which read LOW
when water is detected. In this chapter connecting the rain sensor to Digital Pin 8 on
Arduino, and will enlist the very handy LED to help identify when the rain sensor comes
into contact with a source of water.
To use it as level detector in a deposit have to install the sensor on the inside of
the tank at the level where wanted to control the water level. The sensor must be
positioned so that parallel lines are perpendicular to the sensor water level. The pin S
will give us a greater value as the sensor is immersed.
To detect whether it is raining with this sensor have to position it horizontally
so that is falling on the sensor, as raindrops fall on the sensor film of water on the
surface will be formed by increasing the value of the pin S, this how it can deduce if it
is raining.
4.4.1 Features of Funduino Rain sensor
a. Working voltage - 5V

Department of ECE, MRITS. 47


Solar based mobile charger

b. Working Current - <20ma


c. Interface - Analog
d. Width of detection - 40mm×16mm
e. Working Temperature - 10℃~30℃
f. Weight - 3g
g. Size - 65mm×20mm×8mm
h. Output voltage signal - 0~4.2V
i. Humidity - 10% -90% non-condensing
j. Arduino compatible interface
k. Low power consumption
l. High sensitivity
4.4.2 Pin Definition
"S" stand for signal input, "+" stand for power supply, "-" stand for GND.
The Figure 4.3 is Funduino rain sensor which is used.

Figure 4.3: Rain sensors


4.5 BUZZER
The "Piezoelectric sound components" introduced here in operate on an
innovative principle utilizing natural oscillation of piezoelectric ceramics. These
buzzers are offered in lightweight compact sizes from the smallest diameter of 12mm
to large Piezo electric sounders. Buzzer will be interfaced with the Arduino so that,
when gates open, buzzers will ring. Figure 4.4 shows the buzzer used for alerting the
facility.
The buzzer produces a same noisy sound irrespective of the voltage variation
applied to it. It consists of piezo crystals between two conductors. When a potential is
applied across these crystals, that push on one conductors and pull on other . this , push

Department of ECE, MRITS. 48


Solar based mobile charger

and pull action results in a sound wave. Most buzzers produce sound in the range of 2
to 4khz. The red lead is connected to the input and the black lead is connected to ground.
It is an electronic device commonly used to produce sound. Light weight, simple
construction and low price make it usable in various applications like car/truck
reversing indicator, computers, call bells etc. Piezo buzzer is based on the inverse
principle of piezo electricity discovered in 1880 by Jacques and Pierre Curie. It is the
phenomena of generating electricity when mechanical pressure is applied to certain
materials and the vice versa is also true. Such materials are called piezo electric
materials. Piezo electric materials are either naturally available or manmade.
Piezoceramic is class of manmade material, which poses piezo electric effect and is
widely used to make disc, the heart of piezo buzzer. When subjected to an alternating
electric field by stretch or compress, in accordance with the frequency of the signal
thereby producing sound.

Figure 4.4: Buzzer with internal parts


4.5.1 Working of piezo buzzer
A small DC voltage is applied to the input pins, it is first converted to an
oscillating signal using the combination of resistor and transistor. These oscillating
signals are amplified using the inductor coil. When high voltage alternating signals are
applied to the piezo ceramic disc, it causes mechanical expansion and contraction in
radial direction. This causes the metal plate to bend in opposite direction. When metal
plate bends and shrinks in opposite direction continuously it produces sound waves in
the air. The piezo buzzer outer look can be shown in Figure 4.5.

Department of ECE, MRITS. 49


Solar based mobile charger

Figure 4.5: Piezo Buzzer


4.6 PUMP MOTOR
A Pump motor is any of a class of electrical machines that converts direct
current electrical power into mechanical power. The most common types rely on the
forces produced by magnetic fields. Nearly all types of DC motors have some internal
mechanism, either electromechanical or electronic; to periodically change the direction
of current flow in part of the motor. Most types produce rotary motion; a linear motor
directly produces force and motion in a straight line.
Pump motors were the first type widely used, since they could be powered from
existing direct-current lighting power distribution systems. A pump motor's speed can
be controlled over a wide range, using either a variable supply voltage or by changing
the strength of current in its field windings. Small pump motors are used in tools, toys,
and appliances. The universal motor can operate on direct current but is a lightweight
motor used for portable power tools and appliances. Larger dc motors are used in
propulsion of electric vehicles, elevator and hoists, or in drives for steel rolling mills.
This pump motor internally has DC motor
4.6.1 Principle of pump Motor
This pump or direct current motor works on the principal, when a current
carrying conductor is placed in a magnetic field, it experiences a torque and has a
tendency to move.
This is known as motoring action. If direction of current in the wire is reversed,
the direction of rotation also reverses. When magnetic field and electric field interact
produce a mechanical force, and based on that, the working principle of DC motor is
established. The Fleming’s left hand rule principle is shown in Figure 4.6.

Figure 4.6: Flemings Left Hand Rule

Department of ECE, MRITS. 50


Solar based mobile charger

The direction of rotation of a this motor is given by Fleming’s left hand rule,
which states that if the index finger, middle finger and thumb of left hand are extended
mutually perpendicular to each other and if the index finger represents the direction of
magnetic field, middle finger indicates direction of current, then the thumb represents
the direction in which force is experienced by the shaft of the DC motor.
4.7 RELAY
A relay is an electrically operated or electromechanical switch composed of an
electromagnet, an armature, a spring and a set of electrical contacts. The
electromagnetic switch is operated by a small electric current that turns a larger current
on or off by either releasing or retracting the armature contact, thereby cutting or
completing the circuit. Relays are necessary when there must be electrical isolation
between controlled and control circuits, or when multiple circuits need to be controlled
by a single signal.
4.7.1 Pins configuration
Inside the relay is a 120-240V switch that’s connected to an electromagnet.
When the relay receives a HIGH signal at the signal pin, the electromagnet becomes
charged and moves contacts of the switch open or closed as pins shown in Figure 4.7.

Figure 4.7: Relay pin diagram


NC: Normally closed 120-240V terminal
NO: Normally open 120-240V terminal
C: Common terminal
Ground: Connects to the ground pin on the Arduino
5V Vcc: Connects the Arduino’s 5V pin
Signal: Carries the trigger signal from the Arduino that activates the relay
Arduino UNO controls a relay. The working is based on the functioning of the
Relay and the ability of Arduino to control the relay. By interfacing Arduino with relay
module, we intend to operate an AC load like lamp. Instead of using it directly,

Department of ECE, MRITS. 51


Solar based mobile charger

Designing a small application where an LDR is used to detect the light intensity and
automatically turn on or off the relay.

4.8 POWER SUPPLY

Step Down Bridge Filter Regulator


Rectifier Circuit section
Transformer

Figure 4.8: Block Diagram of Power Supply


In the above block diagram Figure 4.8, the step down transformer will be
stepping down the 230v to the voltage required for the system. Bridge rectifier will be
achieving full wave rectification. Filter circuit will filter the AC current and will allow
DC current to pass through. The regulators section will be regulating the constant
voltage without fluctuations in current.
4.8.1 Step Down Transformer
Step down transformer: is one whose secondary voltage is less than its primary
voltage. It is designed to reduce the voltage from the primary winding to the secondary
winding. This kind of transformer “steps down” the voltage applied to it. As a step-
down unit, the transformer converts high-voltage, low-current power into low-voltage,
high-current power. The larger-gauge wire used in the secondary winding is necessary
due to the increase in current. The primary winding, which doesn’t have to conduct as
much current, may be made of smaller-gauge wire.
4.8.2 Bridge Rectifier
A bridge circuit is a topology of electrical circuit in which two circuit branches
(usually in parallel with each other) are "bridged" by a third branch connected between
the first two branches at some intermediate point along them. The bridge was originally
developed for laboratory measurement purposes and one of the intermediate bridging
points is often adjustable when so used. Bridge circuits now find many applications,
both linear and non-linear, including in instrumentation, filtering and power
conversion.
4.8.3 Filter Circuit

Department of ECE, MRITS. 52


Solar based mobile charger

Electronic filters are circuits which perform signal processing functions,


specifically to remove unwanted frequency components from the signal, to enhance
wanted ones, or both. Electronic filters can be passive or active, analog or digital, High-
pass, low-pass, band-pass, band-stop, or all-pass. Discrete-time (sampled) or
continuous-time, linear or non-linear, infinite impulse response(IIR type) or finite
impulse response (FIR type).
4.8.4 Regulator Section
Voltage regulator is designed to automatically maintain a constant voltage level.
A voltage regulator may be a simple "feed-forward" design or may include negative
feedback control loops. It may use an electromechanical mechanism, or electronic
components. Depending on the design, it may be used to regulate one or more AC or
DC voltages. In automobile alternators and central power station generator plants,
voltage regulators control the output of the plant. In an electric power distribution
system, voltage regulators may be installed at a substation or along distribution lines so
that all customers receive steady voltage independent of how much power is drawn
from the line.
4.9 CONCLUSION
In this chapter, description of LCD (16X2), buzzer, Rain sensor, Real time
clock, Pump motor modules were described in detail.

CHAPTER 5
IMPLEMENTATION OF TIME INDICATION AND
WATERING THE GARDEN IN THE ABSENCE OF RAIN
5.1 INTRODUCTION
In the previous chapter discussed about modules of LCD (16X2), Buzzer, Rain
sensor, Real time clock (RTC), DS 1307, Pump motor. In this chapter block diagram,
implementation, working of Time indication and watering the garden in the absence of
rain and interfacing of modules are discussed.

Department of ECE, MRITS. 53


Solar based mobile charger

5.2 BLOCK DIAGRAM OF TIME INDICATION AND WATERING


THE GARDEN IN THE ABSENCE OF RAIN
Block diagram of Time indication and watering the garden in the absence of
rain is shown in Figure 5.1

Power
LCD
supply

Rain sensor MICRO


CONTROLLER

RTC
Relay water
Pump
Buzzer

Figure 5.1: Block diagram of Time indication and watering the garden in the
absence of rain.
5.2.1 Implementation of water gardening system
The implementation of this article is the design and implementation of Watering
in public gardens automatically using the Arduino microcontroller. The control
interface of the time based system was created. The present solution is very cheap and
effective especially for home usage, small gardens and parks. Following the extension,
it can also be applied on a larger scale e.g. for building greenhouse, public gardens and
others. Using these hardware components for realization the microcontroller Arduino
Uno, real-time clock DS1302, rain sensors, Reactions and all functions of proposed
intelligent system were verified with statistical surveys results were evaluated.
5.3 INTERFACING LCD WITH ARDUINO
Interfacing an Arduino microcontroller with an LCD display consists of two
parts, wiring and programming.
5.3.1 LCD Wiring
A typical LCD display consists of 16 pins that control various features of the
screen. The Arduino microcontroller can output voltages of either 5V or 3.3V, so the

Department of ECE, MRITS. 54


Solar based mobile charger

LCD can be powered by wiring Vss and Vdd to the ground and 5V pins on the
microcontroller. It is possible to adjust the contrast of the screen by wiring a variable
resistor to V0 located at pin 3 on the screen. The RS, R/W, and E pins are wired to pins
12, ground, and 11 respectively on the Arduino. The LCD screen can operate in both 8-
but mode and 4 bit. For this application note only 4 bit mode will be discussed, as it
requires fewer pins and is generally easier to use.
To interface with the LCD in 4 bit mode the Arduino only needs to be connected
to pins DB4-DB7, which will connected to digital output pins 5-2 respectively. Pins 15
and 16 on the LCD screen are used to power a backlight in the screen. In order to power
the backlight pin 15 should be connected to ground while pin 16 should be connected
to the 5V output of the Arduino. To power the Arduino, a 9V battery can be connected
to the Vin and ground pins on the Arduino. Figure 5.2 shows what the final wiring
scheme should look like, after all connections were made.

Figure 5.2: Wiring Schematic for LCD-Arduino Interfacing


5.3.2 LCD Programming
Once all of the wiring is completed, the Arduino can write text to the LCD via
programs that were loaded onto the microcontroller. Programs utilizing the JAVA
programming language can be uploaded to the microcontroller via free open source
software made by Arduino. A library made by Arduino called “Liquid Crystal” can
download and used in any programs written to interface with the LCD display. The
“Liquid Crystal” library contains a variety of built in functions that allow an Arduino
to control an LCD. These functions allow the user to do things like print text strings to
the screen, initialize the screen cursor to a certain pixel, scroll the screen left or right,
clear the display, as well as a variety of other things.
By adding further hardware to the circuit described here things like real time
clocks and thermometers can be added, allowing the LCD to display the current time

Department of ECE, MRITS. 55


Solar based mobile charger

and temperature. The simplicity of their design and ease of interface allow for LCD
screens to be used in a variety of devices on both a large and small scale.
5.4 INTERFACING REAL TIME CLOCK (RTC) WITH ARDUINO
a. Real Time Clock (RTC) is used for monitoring time and maintaining a calendar.

Figure 5.3: Interfacing real time clock with Arduino.


b. In order to use an RTC, first to program it with the current date and time. Once this
is done, the RTC registers can be read any time to know the time and date.
c. DS1307 is an RTC which works on I2C protocol. Data from various registers can be
read by accessing their addresses for reading using I2C communication.
EXAMPLE: if the time was set at 6:00AM it starts watering at a given time which
produced by the given program, if it is kept for half an hour it will stop at 6:30AM and
again it repeats. Interfacing real time clock with Arduino is shown Figure 5.3.

5.5 INTERFACING OF RAIN SENSOR WITH ARDUINO UNO


Rain sensor used in this system i.e. Funduino rain sensor is an Analog one. So,
it will be giving analog values of output (water level) to the Arduino board.
Rain sensor has three terminals S, Vout (+), and GND (-). Connect the sensor
as follows to the Arduino board. Connect the +Vs to +5v on Arduino board. Connect
S to digital pin number A0 on Arduino board, which is Analog input to the Arduino
board. Connect GND with GND of Arduino.
The sensor detects water level as follows
1. Water level low, when the water level shows up till the value 450.

Department of ECE, MRITS. 56


Solar based mobile charger

2. Water level medium, when the water level shows up between the values 450 to
550.
3. Water level high, when the water level shows up above the value 550.
As the water level given to Arduino board were of analog type, ATmega328
microcontroller will be converting them into digital values as they have analog to digital
convertors. Interfacing the rain sensor with Arduino Uno board is shown in Figure 5.4.

Figure 5.4: Interfacing Funduino Water Level Senor with Arduino Uno

5.6 INTERFACING BUZZER WITH ARDIUNO


If a buzzer operates from a low enough voltage and draws low enough current,
it can be interfaced directly to an Arduino Uno pin as shown in Figure 5.5.
The buzzer used in this example can operate from a voltage between 3 to 28V
and draws only 4mA of current at 12V. When the current drawn by the buzzer was
measured at 5V, it was found that it only drew about 1.1mA which is well within the
drive capability of an Arduino Uno pin. In the Figure 5.5 interfacing between a Buzzer
to the Arduino is done to Digital pin 8.

Department of ECE, MRITS. 57


Solar based mobile charger

Figure 5.5: Interfacing of Buzzer with Arduino


5.7 INTERFACING PUMP MOTOR WITH AURDINO
The main aim of interfacing pump motor with any microcontroller is to control
the direction and speed of a pump motor. But due to high voltage and current
requirement of pump motors, it cannot be interfaced directly with microcontrollers. For
to interface pump motor with any microcontroller, need a driver circuit. Driver circuit
is basically a current amplifier which takes a low-current signal from the
microcontroller and gives out a proportionally higher current signal which can control
and drive a motor as shown in Figure 5.6. Digital pins of Arduino board were given to
driver circuit.

Figure 5.6: Interfacing Pump Motor with Arduino

5.8 INTERFACING RELAY WITH ARDUINO


A simple Single Pole – Single Throw (SPST) relay, like the one used consists
of 5 Terminals: 5V, GND, Normally Open (NO), Normally Close (NC) and Common
(COMM). Since we need to control this relay with the help of Arduino, a transistor is

Department of ECE, MRITS. 58


Solar based mobile charger

used with an additional pin called Control Pin on the Relay Module. Interfacing with
the arduino board is shown in Figure 5.7.

Figure 5.7 : interfacing relay with arduino


Logic GND: This will be connected to GND on your Arduino.
Input 1 (IN 1): This will be connected to digital pin on your Arduino, or leave
it unconnected if you do not want to use this channel.
Logic VCC: This will be connected to the 5v pin of the Arduino power the relay
module.
COM (Common connection): The COM is the center terminal of the relay and
it is used in both (Normally open and normally closed) connections.
NO (Normally open): This act like a switch. In normally open connection, there
will be no contact between COM and NO, since it is normally open. But when activate
the relay module, then it will get connected to the COM and will supply power to the
load, which will power up the light. Thus the circuit will initially be in open state until
we trigger the state.
NC (Normally closed): its behavior is opposite to the normally open connection.
It always remains in contact with COM, even when relay module is not powered. When
trigger the relay module then it will open the circuit, so the connection is lost.
5.9 CONCLUSION
In this chapter block diagram , implementation working of Time indication and
watering the garden in the absence of rain and interfacing of modules required in the
system were discussed.

CHAPTER 6
Department of ECE, MRITS. 59
Solar based mobile charger

RESULTS AND DISCUSSION


6.1 INTRODUCTION
In the previous chapter discussed about the block diagram of proposed system,
Implementation and working of Time indication and watering the garden in the absence
of rain and interfacing of modules. In this chapter, results of Time indication and
watering the garden in the absence of rain are discussed.
6.2 RESULT OF THE GARDEN WATERING SYSTEM
The Design and its implementation of ATmega328 processor based electronics
for the time based public garden is shown in Figure 6.1 and it was effectively carried
out with the advantages of minimum peripheral interfaces, low power consumption,
low cost, high portability. The system was tested with the help of motor and rain sensor.
The response of the system is successfully tested in all the conditions of the system that
is mentioned in the system functionality.
When time does not matches with the specified time then normal time and date
will be displayed on LCD and buzzer is mute along with the motor pump. When the
time matches with the specified time then LCD will show the message “WELCOME
TO PUBLIC GARDEN” and the buzzer activates along with pump motor that watering
to plants, only when there is no rain and that is detected by rain sensor.

Figure 6.1: System with hardware components


Figure 6.2 shows the 16x2 LCD used here in which it is showing output of date and
time.

Department of ECE, MRITS. 60


Solar based mobile charger

Figure 6.2: Initial display output.


When the system is connected to the power supply, and gets on, then LCD is
displayed with “normal time with week, date, time” as shown in Figure 6.2.
6.2.1 When specified time does not matches with normal time
When the required specified time not arrives, the sensor will send the values as
low to the microcontroller. The microcontroller will send instructions accordingly to
the motor not to pump the water the arrangement can be seen in Figure 6.3
While in the LCD, it will be displayed that the normal time, the same as that
buzzer also becomes off.

Figure 6.3: System in non-specified time


Figure 6.4 shows the position of the pump motor is switched off and no watering
to plants because it pumps only in specified time and lcd is showing normal time.

Figure 6.4: Switched off pump motor and LCD display

Department of ECE, MRITS. 61


Solar based mobile charger

6.2.2 In specified time when there is no rain


When the given specified time arrives, and there is no rain then sensor will send
the values corresponding to it to the microcontroller. The microcontroller will send
instructions accordingly to the motor to pump the water to plants this total system
arrangement is given in Figure 6.5
While in the LCD, it will be displayed the message given and buzzer also
activates with a sound

Figure 6.5: System when there is no rain


Figure 6.6 shows the motor is running with this pump motor it can water to
plants

Figure 6.6: Motor pumping water


Figure 6.7 shows the LCD, which is displaying message “WELCOME TO
PUBLIC GARDEN”.

Figure 6.7: LCD Display in specified time

Department of ECE, MRITS. 62


Solar based mobile charger

Figure 6.8 shows there is no rain so the rain sensor sends low signal to
microcontroller

Figure 6.8 : Rain sensor when not raining


6.2.3 In specified time when it is raining
When the given specifies time arrives and rain sensor is activated because there
is raining outside and the sensor will send the values of it correspondingly to the
microcontroller. The microcontroller will send instructions accordingly to the motor to
not to switch on but the buzzer makes sound according to time the total system
arrangement is shown in Figure 6.9
While in the LCD, it will be displayed the message given and buzzer is activated
which makes sound in the given specified time

Figure 6.9: System when it is raining


Figure 6.10 shows the position of the motor when its raining it is in off position
and this motor pump is not watering to plants

Figure 6.10: Switched off motor when raining

Department of ECE, MRITS. 63


Solar based mobile charger

Figure 6.11 shows the LCD, which is displaying “WELCOME TO PUBLIC


GARDEN” when its raining.

Figure 6.11: LCD Display when its raining


Figure 6.12 shows the rain sensor activated with raining and sends signals to
micro controller.

Figure 6.12: Activated Rain sensor when raining.


6.3 CONCLUSION
In this chapter, results of Time indication and watering the garden in the absence
of rain are discussed with Figures related to each lcd, buzzer, rain sensor, and rtc.

Department of ECE, MRITS. 64


Solar based mobile charger

CHAPTER 7
CONCLUSION AND FUTURE SCOPE
7.1 CONCLUSION

The “Time indication and watering the garden in the absence of rain” using rain
sensor and real time clock (RTC) DS 1307 has been designed to operate a water pump
automatically based on the specified time and also rain sensor .The switching
mechanism can be done automatically with the help of microcontroller using relays.
The proposed controller eliminates the manual switching mechanism used by the
farmers to ON/OFF the irrigation system. The functionality of the entire system has
been tested thoroughly and is said to be function successfully.

7.2 FUTURE SCOPE

1 . Plantation will be successful in low water quantities.

2 . Environment balancing like tree plantation & saving trees kind of activities will
become come easy once implemented.

3 . It is possible to pumping the water by solar energy instead of 9V battery.

4 . Plan to incorporate to our system the ability to be managed remotely

Department of ECE, MRITS. 65


Solar based mobile charger

REFERENCES
[1] M. Nesa Sudha, M.L. Valarmathi, Anni Susan Babu, Energy efficient data
transmission in automatic irrigation system using wireless sensor networks,
Computers and Electronics in Agriculture, Volume 78, Issue 2, September 2011,
Pages 215-221, ISSN 0168-1699, http://dx.doi.org/10.1016/j.compag.2011.07.009
[2] A. Nayak, G. Prakash and A. Rao, "Harnessing wind energy to power sensor
networks for agriculture," Advances in Energy Conversion Technologies
(ICAECT), 2014 International Conference on, Manipal, 2014, pp. 221-226
[3] Man Zhang, Minzan Li, Weizhen Wang, Chunhong Liu, Hongju Gao, Temporal
and spatial variability of soil moisture based on WSN, Mathematical and Computer
Modelling, Volume 58, Issues 3–4, August 2013, Pages 826833, ISSN 0895-7177,
[4] B. Balaji Bhanu, M. A. Hussain and P. Ande, "Monitoring of soil parameters for
effective irrigation using Wireless Sensor Networks," 2014 Sixth International
Conference on Advanced Computing (ICoAC), Chennai, 2014, pp. 211-215.
[5] M. Mancuso and F. Bustaffa, "A wireless sensors network for monitoring
environmental variables in a tomato greenhouse," 2006 IEEE International -
Workshop on Factory Communication Systems, Torino, Italy, 2006, pp. 107-110.
[6] A. Singh, Lee Sheng Chyan and P. Sebastian, "Sensor integration in a Wireless
Sensor Network system for environmental monitoring system," Intelligent and
Advanced Systems (ICIAS), 2010 International Conference on, Kuala Lumpur,
Malaysia, 2010, pp. 1-5.
[7] M. Usha Rani and S. Kamalesh, "Web based service to monitor automatic irrigation
system for the agriculture field using sensors," Advances in Electrical Engineering
(ICAEE), 2014 International Conference on, Vellore, 2014, pp. 1-5.
[8] Xinrong Zhang and Bo Chang, "Research of temperature and humidity monitoring
system based on WSN and fuzzy control," Electronics and Optoelectronics
(ICEOE), 2011 International Conference on, Dalian, 2011, pp. V4-300-V4303.
[9] S. Fazackerley and R. Lawrence, "Reducing turfgrass water consumption using
sensor nodes and an adaptive irrigation controller," Sensors Applications
Symposium (SAS), 2010 IEEE, Limerick, 2010, pp. 90-94.

Department of ECE, MRITS. 66


Solar based mobile charger

APPENDIX-A
SOURCE CODE
#include <SoftwareSerial.h>
#include <Wire.h>
#include <LiquidCrystal.h>
#include "RTClib.h"
RTC_DS1307 rtc;
LiquidCrystal lcd(7, 6, 5, 4, 3, 2); // (rs, e, d4, d5, d6, d7)
char daysOfTheWeek[7][12] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
void setup ()
{
Serial.begin(9600);
lcd.begin(16, 2);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
if (! rtc.begin())
{
lcd.print("Couldn't find RTC");
while (1);
Serial.print("Couldn't find RTC");
}
if (! rtc.isrunning())
{
lcd.print("RTC is NOT running!");
Serial.print("RTC is NOT running!");
}
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));//auto update from computer
time
//rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));// to set the time manualy
}
void loop ()
{
DateTime now = rtc.now();

Department of ECE, MRITS. 67


Solar based mobile charger

int sens = analogRead(A0);


lcd.setCursor(0, 1);
lcd.print(now.hour());
lcd.print(':');
lcd.print(now.minute());
lcd.print(':');
lcd.print(now.second());
lcd.print(" ");
if(now.second()==0)
{
if(sens>200)
{
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("WELCOME TO");
lcd.setCursor(0, 1);
lcd.print("PUBLIC GARDEN");
//digitalWrite(8,LOW);
digitalWrite(9,HIGH);
Serial.print("its raning");
delay(5000);
digitalWrite(8,LOW);
digitalWrite(9,LOW);
lcd.clear();
}
else
{
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("WELCOME TO");
lcd.setCursor(0, 1);
lcd.print("PUBLIC GARDEN");
digitalWrite(8,HIGH);
digitalWrite(9,HIGH);

Department of ECE, MRITS. 68


Solar based mobile charger

Serial.print("its not raining");


delay(5000);
digitalWrite(8,LOW);
digitalWrite(9,LOW);
lcd.clear();
}
}
lcd.setCursor(0, 0);
lcd.print(daysOfTheWeek[now.dayOfTheWeek()]);
lcd.print(" ,");
lcd.print(now.day());
lcd.print('/');
lcd.print(now.month());
lcd.print('/');
lcd.print(now.year());
}

Department of ECE, MRITS. 69


Solar based mobile charger

APPENDIX-B
ARDUINO SOFTWARE
8.1 OVERVIEW
8.1.1 Arduino
Arduino is a tool for making computers that can sense and control more of the
physical world than your desktop computer. It's an open source physical computing
platform based on a simple microcontroller board, and a development environment for
writing software for the board.
Arduino can be used to develop interactive objects, taking inputs from a variety
of switches or sensors, and controlling a variety of lights, motors, and other physical
outputs. Arduino projects can stand alone, or they can be communicated with software
running on your computer (e.g. Flash, Processing, Max MSP.) The boards can be
assembled or purchased preassembled; the open source IDE can be downloaded for
free.
The Arduino programming language is an implementation of Wiring, a similar
physical computing platform, which is based on the Processing multimedia
programming environment.
8.1.2 Features
Schematic design of the open source development interface free download, and
also according to the needs of their own changes
1. Download the program is simple and convenient.
2. Simply with the sensor, a wide range of electronic components connection
(such as: LED light, buzzer, keypad, photoresistor, etc.), make all sorts of
interesting things.
3. Using the high-speed micro-processing controller (ATMEGA328).
4. The development of language and development environment is very simple,
easy to understand, very suitable for beginners to learn.
8.1.3 Performance

1. Digital I/O 0~13.

2. Analog I/O 0~5.( R3 is 0~7 )

3. Support ISP Download Function

Department of ECE, MRITS. 70


Solar based mobile charger

4. Input voltage: when connected to the USB without external power supply or
external 5 V ~ 9V dc voltage input. Output Voltage: 5V dc voltage output and
3.3V dc voltage output and external power input.
5. Atmel Atmega328 micro-processing controller. Because of its many
supporters, the company has developed 32 bit MCU arduino platform support.
6. Arduino size: width of 70 mm X high 54 mm.
8.1.4 Special Port
1. VIN. The input voltage to the Arduino board when it's using an external power
source (as opposed to 5 volts from the USB connection or other regulated
power source). You can supply voltage through this pin, or, if supplying voltage
via the power jack, access it through this pin.
2. AREF. Reference voltage for the analog inputs. Used with analog Reference().
8.2 SAINSMART UNO R3
8.2.1 Uno R3
The Arduino Uno is a microcontroller board based on the ATmega328. It has
14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs,
a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a
reset button. It contains everything needed to support the microcontroller; simply
connect it to a computer with a USB cable or power it with a AC-to-DC adapter or
battery to get started.
Revision 3 is the last SainSmart UNO development board version.
8.2.2 Parameter

1. 3.3V/5V Supply Voltage and IO Voltage can be switched at the same time.

2. More 3.3V modules supported, such as Zigbee module, Bluetooth module, RF


module, GPRS module, GPS module, LCD5110 Backlight and so on, but the
original version can only support 5V IO.

3. Controller uses SMD MEGA328P-AU chip. Add A6/A7 port.

4. 5V Electric current : 500MA

5. 3.3V Electric current : 50MA

6. Input Voltage: 7-12V

Department of ECE, MRITS. 71


Solar based mobile charger

8.2.3 Improvement of R3

1. Working voltage 3.3V/5V is optional.

2. Arduino can only work at 5V voltage. When it comes to 3.3V Level module,
IO can’t be connected to it. The Level should be changed, like the SD card,
Bluetooth module and so on.

3. Sainsmart UNO R3 can work at 3.3V voltage by switching on the button. At


this time, IO port is 3.3V and it can work with 3.3V Level module. (R3 can
directly use the electronic building blocks on I / O port and elicit G, V, S).
8.3 SAINSMART MEGA2560 R3
8.3.1 Description
This is the new MEGA2560 R3. In addition to all the features of the previous
board, the MEGA now uses an ATMega16U2 instead of the ATMega8U2 chip. This
allows for faster transfer rates and more memory. No drivers needed for Linux or Mac
( inf file for Windows is needed and included in the Arduino IDE), and the ability to
have the Uno show up as a keyboard, mouse, joystick, etc.
The MEGA2560 R3 also adds SDA and SCL pins next to the AREF. In addition,
there are two new pins placed near the RESET pin. One is the IOREF that allow the
shields to adapt to the voltage provided from the board. The other is a not connected
and is reserved for future purposes. The MEGA2560 R3 works with all existing shields
but can adapt to new shields which use these additional pins.
8.3.2 Features

1. Microcontroller ATmega2560

2. Operating Voltage 5V

3. Input Voltage (recommended) 7-12V

4. Input Voltage (limits) 6-20V

5. Digital I/O Pins 54 (of which 15 provide PWM output)

6. Analog Input Pins 16

7. DC Current per I/O Pin 40 mA

8. DC Current for 3.3V Pin 50 mA

9. Flash Memory 256 KB of which 8 KB used by bootloader

Department of ECE, MRITS. 72


Solar based mobile charger

10. SRAM 8 KB

11. EEPROM 4 KB

12. Clock Speed 16 MHz


8.4 ARDUINO C GRAMMAR
Arduino grammar is built on the basis of C/C + +, in fact is also the basic C
grammar, Arduino grammar not only put some related parameters Settings are function
change, we have no need to understand his bottom, let us to know AVR micro control
unit (MCU) friend can also easy to fit in. So here I'll simple comment the Arduino
grammar.
8.4.1 Control Structures

1. If
2. if...else
3. for
4. switch case
5. while
6. do... while
7. break
8. continue
9. return
10. goto
8.4.2 Further Syntax
1. ;
2. {}
3. //
4. /* */
8.4.3 Operators
1. ++
2. --
3. +=
4. -=
5. *=
6. /=

Department of ECE, MRITS. 73


Solar based mobile charger

7. =
8. +
9. -
10. *
11. /
12. %
13. ==
14. !=
15. <
16. >
17. <=

18. >=

19. &&

20. ||

21. !

8.4.4 Data Type


1. boolean
2. char
3. byte
4. int
5. unsigned int
6. long
7. unsigned long
8. float
9. double
10. string
11. array
12. void
8.4.5 Constant
HIGH | LOW Said digital IO port level, HIGH Said high level(1), LOW Said low
electric flat(0).

Department of ECE, MRITS. 74


Solar based mobile charger

INPUT | OUTPUT Said digital IO port direction, INPUT Said input (high
impedance state)
OUTPUT Said output (AVR can provide 5 v voltage and ma current).
TURE | FALSE true (1),false (0).
8.4.6 Structure
1. void setup()
The setup() function is called when a sketch starts. Use it to initialize
variables, pin modes, start using libraries, etc. The setup function will only run
once, after each power up or reset of the Arduino board.
2. void loop()
After creating a setup() function, which initializes and sets the initial
values, the loop() function does precisely what its name suggests, and loops
consecutively, allowing your program to change and respond. Use it to actively
control the Arduino board.
8.4.7 Function
Digital I/O

pinMode(pin, mode)pin 0~13, mode is input or output.

digitalWrite(pin, value)pin 0~13, value is HIGH or LOW.

intdigitalRead(pin)pin 0~13, value is HIGH or LOW.

Analog I/O

intanalogRead(pin)pin 0~5.

analogWrite(pin, value)pin 3, 5, 6, 9, 10, 11, value is 0 to 255


8.4.8 Time
➢ Delay(ms)Pauses the program for the amount of time (in miliseconds) specified
as parameter. (There are 1000 milliseconds in a second.)(unitms).
➢ delayMicroseconds(us).
8.5 LCD PROGERAM
Here, we will learn use Arduino IDE serial interface tools to show the contents
that we want to display in the computer.
void setup()
{

Department of ECE, MRITS. 75


Solar based mobile charger

Serial.begin(9600);// opens serial port, sets data rate to 9600 bps


Serial.println("Hello World!");
}
void loop()
{
}
8.5.1 Explain
Serial.begin(9600); The comment says 9600 bps, and just so you know bps
stands for bits per second (we will refer to this as the baud rate). Communicate with
computer, you may choose these rate “300, 1200, 2400, 4800, 9600, 14400, 19200,
28800, 38400, 57600, 115200”.

Figure 8.1: LCD with Arduino


8.5.2 Operation
1. Download code to arduino.
2. After download, click “tool”, pick up relevant arduino board, and relevant com.
Then click “serial Monitor”, on the new open up window’s bottom right, choose
the relevant rate.

Figure 8.2: LCD Sample Compilation

Department of ECE, MRITS. 76

You might also like