Professional Documents
Culture Documents
Solar Modified Document
Solar Modified Document
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
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
amount of energy required is greater than both what is being produced and what is
stored in the container.
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
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.
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.
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.
CHAPTER 4
• Raw Materials: The basic component of a solar cell is pure silicon, which is not pure
in its natural state
• 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.
4.2 Procedure
• 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.
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.
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.
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.
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
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.
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.
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.
• Adaptability is high.
5.7 REFERENCES
www.google.com
www.wikipedia.com
www.studymafia.org
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.
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.
1.4 OBJECTIVE
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.
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.
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
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
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,
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.
Communication
Application specific circuitry interferences
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
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.
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
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.
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.
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.
F. TWI: A4 or SDA pin and A5 or SCL pin Support TWI communication using
the Wire library.
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.
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,
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.
a. Operating voltage - 5v
3.7 CONCLUSION
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,
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.
a. Operating voltage - 5v
c. Horizontal characters - 16
d. Vertical characters - 2
1 𝑉𝑠𝑠 Ground
15 LED-(K) Ground
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
2 Return Home
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.
c. Consumes less than 500nA battery backup mode with oscillator running.
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.
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
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.
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.
Designing a small application where an LDR is used to detect the light intensity and
automatically turn on or off the relay.
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.
Power
LCD
supply
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
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.
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.
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
used with an additional pin called Control Pin on the Relay Module. Interfacing with
the arduino board is shown in Figure 5.7.
CHAPTER 6
Department of ECE, MRITS. 59
Solar based mobile charger
Figure 6.8 shows there is no rain so the rain sensor sends low signal to
microcontroller
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.
2 . Environment balancing like tree plantation & saving trees kind of activities will
become come easy once implemented.
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.
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();
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
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.
8.2.3 Improvement of R3
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.
1. Microcontroller ATmega2560
2. Operating Voltage 5V
10. SRAM 8 KB
11. EEPROM 4 KB
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. /=
7. =
8. +
9. -
10. *
11. /
12. %
13. ==
14. !=
15. <
16. >
17. <=
18. >=
19. &&
20. ||
21. !
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
Analog I/O
intanalogRead(pin)pin 0~5.