SlideShare a Scribd company logo
1 of 66
ABSTRACT
About 71% of earth is covered with water but sadly only 2.5% of it is used for drinking
purpose, the reason for this is with rise in population, pollution and climate change, humans
waste a lot of water due to our negligence. In this paper the automatic water dispenser is been
proposed using sensors.
For a automatic water dispenser they used node MCU and ultrasonic sensor. Here the
manual taps are replaced with a smart taps that opens and closes on its own automatically due to
this saving of water is achieved which is a biggest challenge nowadays. This technique changes
the lifestyle of the public since they don’t need to operate the tap manually through their hands.
In this paper not only saves the water provide faster, easier, and cost-effective management.
CHAPTER-1
INTRODUCTION TO EMBEDDED SYSTEMS
An embedded system is a special-purpose computer system designed to perform one or a
few dedicated functions, often with real-time computing constraints. It is usually embedded as
part of a complete device including hardware and mechanical parts. In contrast, a general-
purpose computer, such as a personal computer, can do many different tasks depending on
programming. Embedded systems control many of the common devices in use today .Since the
embedded system is dedicated to specific tasks; design engineers can optimize it, reducing the
size and cost of the product, or increasing the reliability and performance. Some embedded
systems are mass-produced, benefiting from economies of scale.
Physically, embedded systems range from portable devices such as digital watches and
MP3 players, to large stationary installations like traffic lights, factory controllers, or the systems
controlling nuclear power plants. Complexity varies from low, with a single microcontroller
chip, to very high with multiple units, peripherals and networks mounted inside a large chassis or
enclosure
In general, "embedded system" is not an exactly defined term, as many systems have
some element of programmability. For example, Handheld computers share some elements with
embedded systems — such as the operating systems and microprocessors which power them —
but are not truly embedded systems, because they allow different applicationsto be loaded and
peripherals to be connected. Embedded systems span all aspects of modern life and there are
many examples of their use. Telecommunications systems employ numerous embedded systems
from telephone switches for the network to mobile phones at the end-user. Computer networking
uses dedicated routers and network bridges to route data.
Characteristics:
1. Embedded systems are designed to do some specific task, rather than be a general-
purpose computer for multiple tasks. Some also have real-time performance constraints
that must be met, for reasons such as safety and usability; others may have low or no
performance requirements, allowing the system hardware to be simplified to reduce costs.
2. Embedded systems are not always standalone devices. Many embedded systems consist
of small, computerized parts within a larger device that serves a more general purpose.
For example, the Gibson Robot Guitar features an embedded system for tuning the
strings, but the overall purpose of the Robot Guitar is, of course, to play music. Similarly,
an embedded system in an automobile provides a specific function as a subsystem of the
car itself.
3. The software written for embedded systems is often called firmware, and is usually stored
in read-only memory or Flash memory chips rather than a disk drive. It often runs with
limited computer hardware resources: small or no keyboard, screen, and little memory.
CPU Platforms:
Embedded processors can be broken into two broad categories: ordinary microprocessors
(μP) and microcontrollers (μC), which have many more peripherals on chip, reducing cost and
size. Contrasting to the personal computer and server markets, a fairly large number of basic
CPU architectures are used; there are Von Neumann as well as various degrees of Harvard
architectures, RISC as well as non-RISC and VLIW; word lengths vary from 4-bit to 64-bits and
beyond (mainly in DSP processors) although the most typical remain 8/16-bit. Most architecture
comes in a large number of different variants and shapes, many of which are also manufactured
by several different companies.
ASIC and FPGA solutions:
A common configuration for very-high-volume embedded systems is the system on a
chip (SoC), an application-specific integrated circuit (ASIC), for which the CPU core was
purchased and added as part of the chip design. A related scheme is to use a field-programmable
gate array (FPGA), and program it with all the logic, including the CPU.
Peripherals: Embedded Systems talk with
the outside world via peripherals, such as
 Serial Communication Interfaces (SCI): RS-232, RS-422, RS-485etc
 Synchronous Serial Communication Interface: I2C, JTAG, SPI, SSC and ESSI
 Universal Serial Bus (USB)
 Networks: Ethernet, Controller Area Network, LAN networks, etc
 Timers: PLL(s), Capture/Compare and Time Processing Units
 Discrete IO: aka General Purpose Input/output (GPIO)
 Analog to Digital/Digital to Analog (ADC/DAC)
Tools:
As for other software, embedded system designers use compilers, assemblers, and debuggers
to develop embedded system software. However, they may also use some more specific tools:
 In circuit debuggers or emulators
 Utilities to add a checksum or CRC to a program, so the embedded system can check if
the program is valid.
 For systems using digital signal processing, developers may use a math workbench such
as MATLAB, Simulink, MathCad, or Mathematica to simulate the mathematics. They
might also use libraries for both the host and target which eliminates developing DSP
routines as done in DSPnano RTOS and Unison Operating System.
 Custom compilers and linkers may be used to improve optimization for the particular
hardware.
 An embedded system may have its own special language or design tool, or add
enhancements to an existing language such as Forth or Basic.
 Another alternative is to add a Real-time operating system or Embedded operating
system, which may have DSP capabilities like DSP nano RTOS.
Software tools can come from several sources:
 Software companies that specialize in the embedded market
 Ported from the GNU software development tools
 Sometimes, development tools for a personal computer can be used if the embedded
processor is a close relative to a common PC processor
As the complexity of embedded systems grows, higher level tools and operating systems are
migrating into machinery where it makes sense. For example, cell phones, personal digital
assistants and other consumer computers often need significant software that is purchased or
provided by a person other than the manufacturer of the electronics. In these systems, an open
programming environment such as Linux, NetBSD, OSGi or Embedded Java is required so that
the third-party software provider can sell to a large market.
CHAPTER-2
PROJECT DESCRIPTION
Introduction:
In day to day life Water is very essential for Public, so there is a requirement of avoiding
wastage of Drinking water. About 71% of earth is covered with water, but sadly only 2.5% of it
is drinking water. With rise in population, pollution and climate change, it is expected that by as
soon as 2025 we will experience perennial water shortages. At one hand there are already minor
disputes among nations and states for sharing river water on the other hand we as humans waste
a lot of drinking water due to our negligence.
There are many places were water gets wasted due to human negligence
where people forget to off the tap after drinking the water. It is necessary for controlling the
drinking water by using Automatic Water Dispenser based on sensors used to „ON‟ and „OFF‟
the water taps automatically using sensors and also monitor the water level and gives notification
about level of water to the authorized person by informing when the water level becomes LOW.
Hence replace all manual taps with smart one that „ON‟ and „OFF‟ automatically, we don‟t
have to operate tap with our hands. In day to day life there are a number of water dispensers for
providing drinking water. Such as in colleges, office and in many institutions. These dispensers
are managed manually by a person checks each of the dispensers individually and accordingly
manages it. Many offices nowada2ys are superstructure buildings and occupy a large workforce.
Same goes for colleges too. In order to fulfil the drinking water requirement a number of
dispensers are placed throughout the building. Now their management has become difficult.
Existing method:
1. In previous stages the water dispensers are nothing but a manual tap , by using this so
huge amount of water will be wasted ,we need to remember our earth depends on water
quantity.
2. Some of the people are implemented using IR technology with only hard ware design
part, so this is also leads to system failure conditions because of controlling the only
hardware part is leads to error with out program.
Proposed system:
Wastage of water not appear big at the first time, but if your tap dripped a drop of water once
every second it would take only about five hours for you to waste one gallon of water, that is
enough water for an average human to survive for two days. So what can be done to stop this?
As always the answer, for this, lies with improvement in technology. If we replace all the manual
taps with a smart one that opens and closes on its own automatically not only we can save water
but also have a healthier lifestyle since we don’t have to operate the tap with our dirty hands. So
in this project we will build a Automatic Water Dispenser using Arduino and sensors that
can automatically give you water when a glass is placed near it
The system monitors the water dispensers by ultrasonic sensors placed
over the dispenser and compare the fault conditions to give the alert for water leakage
conditions . The main goal of our paper is to monitor the water leakage and manage the overall
water dispenser. It will provide faster, easier, and cost-effective management. It also includes the
design of monitoring system with advantages of low cost and accuracy.
This project titled automatic water dispenser is a modern approach to the onventional water
dispenser that we use in our daily life. In this system we use a proximity switch which is
connected to a relay which controls the water solenoid which acts as a valve to control the water
flow to the tap. The water dispensers that we use in our daily life are mechanically operated. The
water flows through the tap when we press the concerned button and the water flow stops once
we release the button. This button system is prone to water loss and wear and tear of the button
and therefore the dispenser requires a constant maintenance. We can make the dispenser handy
and user friendly by giving it an electronic touch. We can make use of the sensor technology
and make machine far advanced than its counterparts. We can make use of a IR Sensor or
Ultrasonic Sensor or a proximity switch. If we use IR sensor then there are possibilities of false
switching on the machine. So we can’t implement the IR based sensor.
Water dispenser management system proposed here it involves building of
the smarter and automatic water dispensers. It opens and closes automatically. These dispensers
are built with the help of Arduino
Block DIAGRAM
POWER SUPPLY
ARDUINO UNO
ULTRASONIC
SENSOR
RELAY MODULE WATER PUMP
BUZZER
BUZZER
LCD DISPLAY
CIRCUIT DIAGRAM
Working:
In this projects Ultrasonic sensor acts as a input device and water pump acts a load or output
device, here we are using relay to control the load and we are using a LCD display as data
monitor unit.
Here the automatic process is works by detecting ultrasonic sensor . Ultrasonic sensor
continuously measure the distance ,in our program we need to fix the threshold distance, when
ever the distance limits the threshold distance sensor is detected .
So whe ever the sensor distance reaches its threshold limits arduino send a control signal to the
Relay module to trigger the water pump .that means when the distance is at threshold limits
Relay the ON the water motor and if the distance is above the threshold limits Relay module
OFF the water pump.
And also here we are creating a fault condition to stop the extra wastage of water by detecting
the water leakage due to any system failure conditions.
CHAPTER-3
ARDUINO
Arduino interface boards provide the engineers, artists, designers, hobbyists and
anyone who tinker with technology with a low-cost, easy-to-use technology to create their
creative, interactive objects, useful projects etc., A whole new breed of projects can now be built
that can be controlTRANSMITTER from a computer.
1.1 WHAT IS ARDUINO?
Figure 1.1 ARDUINO UNO
Arduino is a open source electronics prototyping platform based on flexible, easy-to-use
hardware and software.It’s intended for artists,designers, hobbyists,and anyone interested in
creating interactive objects or environments. It’s an open-source physical computing platform
based on a microcontroller board, and a development environment for writing software for the
board.computer or programmed by the computer and then disconnected and allowed to work
independently.Anyone can buy this device through online auction site or search engine.Since
theArduino is an open-source hardware designs and ccreate their own clones of the Arduino and
sell them,so the market for the boards is competitive. An official Arduino costs about $30,and a
clone often less than $20.
The name “Arduino” is reserved by the original makers. However, clone Arduino designs
often have the letters “duino” on the end of their name, for example, Freeduino or DFRduino.
The software for programming your Arduino is easy to use and also freely available for
Windows, Mac, and LINUX computers at no cost.
1.1.1 MICROCONTROLLER
Microcontroller can be described as a computer embedded on a rather small circuit board.To
describe the function of a microcontroller more precisely,it is a single chip that can perform
various calculations and tasks,and send/receive signals from other devices via the available pins.
Precisely what tasks and communication with the world it does, is what is governed by what
instructions we give to the Microcontroller. It is this job of telling the chip what to do, is what we
refer to as programming on it.
However, the uC by itself, cannot accomplish much; it needs several external inputs:
power, for one; a steady clock signal, for another. Also, the job of programming it has to be
accomplished by an external circuit. So typically, auC is used along with a circuit which
provides these things to it; this combination is calTRANSMITTER a microcontroller board. The
Arduino Uno that you have recieved, is one such microcontroller board. The actual
microcontroller at its heart is the chip calTRANSMITTER Atmega328. The advantages that
Arduino offers over other microcontroller boards are largely in terms of reliability of the circuit
hardware as well as the ease of programming and using it.
1.1.2 OPEN-SOURCE HARDWARE
Open-source hardware shares much of the principles and approach of free and open-
source software.The founders of Arduino wanted people to study their hardware,to understand
how it works,make changes to it,and share those changes with the world.To facilitate this,they
release all of the original design files(Eagle CAD)for the Arduinohardware.These files are
licensed under a Creative Common Attribution Share-Alike license,which allows for both
personal and commercial derivative works,as long as they(people) credit Arduino and release
their designs under the same license.
The Arduino software is also oen-source.The source code for the Java environment is released
under the GPL and the C/C++ microcontroller libraries are under the LGPL
1.2 HISTORY OF ARDUINO
While teaching a physical computing class at the Interaction Design Institute Ivrea in 2005,
Massimo Banzi’s students were unwilling to spend the 76 euros for the BASIC Stamp
microcontrollers commonly used in such applications. Banzi and his collegues looked for
alternatives, finally settling on the wiring platform developed by one of Banzi’s students. In his
own words:
“…we started to figure out how could we make the whole platform even simpler, even cheaper,
even easier to use. And then we started to essentially reimplement the whole thing as an open
source project.”
Once they had a prototype, a student wrote the software that would allow wiring programs to run
on the new platform. Upon seeing the project, visiting professor Casey Reas suggested that there
might be wider applications than just design schools for the new product. The prototype was
redesigned for mass production and a test run of 200 boards was made. Orders began coming in
from other design schools and the students looking for Arduinos, and the Arduino project was
born and MassimoBanzi and David Cuartielles became its founders.”ARDUINO” is an Italian
word,meaning “STRONG FRIEND”.The English version of the name is “Hardwin”. As of May
2011,more than 300,000 Arduino units are “in the wild”.
1.2.1 Design Goals
 Work with a Mac (as most design students use one)
 USB connectivity (MacBooks don’t have serial ports
 Look nice
 Cheap (about 20 euros, the cost of going out for pizza in Europe)
 More powerful than a BASIC stamp
 Something you could build/fix yourself
Simple and easy to use by someone without formal electronics training
1.2.2 Business Models
Since the entire project is open source, anyone can build and sell Arduino-compatible devices.
So in this sense, the Arduino project relies heavily on its branding for it’s financial success .
Other projects manufacture compatible and cheaper boards, however people are loyal to the
Arduino branded boards because they associate quality and a certain image to the final product .
1.2.2.1 By the Numbers
Year Units Sold
2005 200
2006 10 000
2010 120 000
2011 300 000
1.2.3 Competitors
Before Arduino, the largest players in the design/hobbyist market segment were the PIC
microcontroller family (made by Microchip) and the BASIC Stamp (made by Parallax). Since
the introduction of the Arduino, other large companies have tried to enter the hobbyist market,
including Texas Instruments , and even Microsoft . However, the open-sourced toolsof the
Arduino and the size of its community are large barriers for new platforms to overcome.
1.2.4 COMMUNITY
Figure 3.1GOOGLE trends comparing ARDUINO with its biggest competitors
As the project is aimed at students and hobbyists who may not have any formal electronics
background, there are many excellent guides online covering everything from making a light
blink to creating a laser harp. The official forum has almost 60 000 registered users, and along
with helping users with their projects, is extremely active in developing new libraries to extend
the functionality of the Arduino . The open-source share and share alike sentiment is very strong,
and the vast majority of users freely publish the code to their projects.
1.3 PHYSICAL COMPUTING
Physical Computing is an approach to learn how humans communicate through computers that
starts by considering how humans express themselves physically.
PLATFORM DESIGN FOR ARUINO
2.1 HARDWARE
2.1.1 ARDUINO Board Layout
Figure 2.2: ARDUINO board layout
2.1.2 ARDUINO pin diagram
Figure 3.3: ARDUINO pin diagram
2.1.2.1 ATmega328(Microcontroller)
 16 MHz
 8 Kbyte Flash RAM(1K taken by the boot loader)
 1 Kbyte RAM(eg.for auto/local variables and stack)
 14 digital Input/Output Ports
Fig3.4: ATmega328
2.1.2.2 Single chip USB to async. Serial data transfer interface
 USB 2.0 compatible
 Transmit and receive TRANSMITTER frive signals
 256 Byte receive,128 Byte transmit buffer
 Data transfer rate from 300bits/sec to 2 Mb/sec
2.1.3 EXTERNAL power
Fig 3.5: ARDUINO can run off with USB or EXTERNAL power source
The power requirement for ARDUINO is 9 to 12V DC,250mA or more,2.1mm
plug,centre pin positive.
The OFF-the shelf adapter
 must be a DC adapter (i.e. it has to put out DC, not AC)
 should be between 9V and 12V DC
 must be rated for a minimum of 250mA current output, although you will likely want
something more like 500mA or 1A output, as it gives you the current necessary to power a servo
or twenty TRANSMITTERs if you want to.
 must have a 2.1mm power plug on the Arduino end, and
 the plug must be "centre positive", that is, the middle pin of the plug has to be the +
connection.
Current rating: Since you'll probably be connecting other things to the Arduino
(TRANSMITTERs, MONITORs, servos) you should get an adapter that can supply at least
500mA, or even 1000 mA (1 ampère). That way you can be sure you have enough juice to make
each component of the circuit function reliably.
The Arduino's on-board regulator can actually handle up to 20V or more, so you can actually use
an adapter that puts out 20V DC. The reasons you don't want to do that are twofold: you'll lose
most of that voltage in heat, which is terribly inefficient. Secondly, the nice 9V pin on the
Arduino board will actually be putting out 20V or so, which could lead to potential disaster when
you connect something expensive to what you thought was the 9V pin. Our advice is to stick
with the 9V or 12V DC adapter.
2.1.4 ARDUINO flavors!!
There have been many revisions of the USB Arduino.some of them are
1. Arduino UNO:
This is the latest revision of the basic Arduino USB board. It connects to the computer
with a standard USB cable and contains everything else you need to program and use the board.
It can be extended with a variety of shields: custom daughter-boards with specific features. It is
similar to the Duemilanove, but has a different USB-to-serial chip the ATMega8U2, and newly
designed labeling to make inputs and outputs easier to identify.
2. Arduino Mega 2560:
A larger, more powerful Arduino board. Has extra digital pins, PWM pins, analog inputs, serial
ports, etc. The version of the Mega released with the Uno, this version features the Atmega2560,
which has twice the memory, and uses
the ATMega 8U2 for USB- to-serial
communication.
Fig3.6: ATmega2560
Basic Terminologies in ARDUINO:
1.Analog to digital converter(ADC)
The process of Analog to digital conversion is shown in figure.
The Arduino has 10 bits of Resolution when reading analog signals.
2 power 10=1024 increments
2.Pulse width modulation (PWM)
The Arduino has 8bit of resolution,when outputting a signal using PWM.The range of output
voltage is from 0 to 5 Volts
2power 8=255 Increments
Average of on/off(digital signals to make an average voltage),Duty cycle in 100% of 5Volts.
2.3 LANGUAGE REFERENCES:
The Microcontroller on the board is programmed using the Arduino programming
language(based on wiring) and the arduino development environment(based on processing).
2.3.1 Arduino Programming Language(APL)(based on wiring)
The Arduino programming language is an implementation of Wiring, a similar physical
computing platform, which is based on the Processing multimedia programming environment.
2.3.1.1 Wiring
Wiring is an open-source programming framework for microcontrollers. Wiring allows writing
cross-platform software to control devices attached to a wide range of microcontroller boards to
create all kinds of creative coding, interactive objects, spaces or physical experiences. The
framework is thoughtfully created with designers and artists in mind to encourage a community
where beginners through experts from around the world share ideas, knowTRANSMITTERge
and their collective experience. There are thousands of students, artists, designers, researchers,
and hobbyists who use Wiring for learning, prototyping, and finished professional work
production.
2.3.2 Arduino development environment(based on processing)
2.3.2.1 Processing
Processing is an open source programming language and environment for people who want to
create images, animations, and interactions. Initially developed to serve as a software sketchbook
and to teach fundamentals of computer programming within a visual context, Processing also has
evolved into a tool for generating finished professional work. Today, there are tens of thousands
of students, artists, designers, researchers, and hobbyists who use Processing for learning,
prototyping, and production.
APPLICATIONS OF ARDUINO
Arduino was basically designes to make the process of using electronics in multidisciplinary
projects more accessible.It is intended for artists,designers,hobbyists,and anyone interested in
creating interactive objects or environments.Arduino can sense the environment by receiving
input from a variety of sensors and can affect its surroundings by controlling lights,motors,and
other actuators.because of these features,arduino finds extensive application in various
fields.Arduino projects can be stand-alone or they can communicate with software running on a
computer.
Arduino received anHonarary Mention in Digital Communication section of the 2006 Ars
Electronica Prix
Arduino is used by all class of people in a different way.some students use it in their
projects,some using arduino for fun,some went out to become entreupreuners.This only shows
how useful is this tiny device.
ARDUINO is spreading rapidly across the globe. Arduino is actually an open source
hardware project that can be pro grammed to read temperatures, control a motor, and sense
touch.theArduino is both a cute, blue micro controller platform that fits nicely in the palm of
your hand and an expanding community of developers who support it, distributed across two
dozen coun tries, four continents, and counting.
The Arduino board is for anyone who wants to build a basic level of intelligence into an object.
Once programmed, it can read sensors, make simple decisions, and control myriad devices in the
real world. Using it is a snap: first, hook up a few sensors and output devices to the Arduino,
then program it using the free developer’s software. Next, debug your code and disconnect the
Arduino.Then,the little blue Arduino becomes a standalone computer.
The original intention of the Arduino project was to see what would happen if community
support were substituted for the corporate support that is usually required for electronics
development. The first developers — Massimo Banzi, David Cuartielles, David Mellis, and
Nicholas Zambetti — ran a series of workshops on assembling the Arduino, giving away the
board to stimulate development.
Thousands of projects have been done worldwide using this tiny little device.some of which to
mention are:
 Simple room temperature readout
 Interactive real-time auditory feedback system
 GPS receiver Module
 Ultrasonic Sensor
 Infrared detectors
 SONAR
 Various sensor projects like
 Keypad security code
 Sensor tube for heart monitor
 Pulse rate monitor
 Various light projects like
 Multicolor light display
 Seven-segment TRANSMITTER display
 Double seven-segment TRANSMITTER dice
 TRANSMITTER array
 MONITOR module
 Various sound projects like
 Oscilloscope
 Light harp
 VU meter
 Various power projects like
 MONITOR Thermostat
 Computer controlTRANSMITTER fan
 The hypnotizer
 Miscellaneous Projects like
 Lie detector
 Magnetic door lock
 Infrared remote
 Lilypad binary clock
Just to name a few….as the trademark goes,there are nearly infinite possible projects
using this tiny device,which we still yet to discover
Some of the major applications are 3D printers,whos founder went out to become an
euntreuprenuer,and major pride came to ARDUINO,when giant firm GOOGLE’s most ambitious
ANDROID,deployed ARDUINO in its new venture “ANDROID OPEN ACCESSORY
DEVELOPMENT KIT”.which allows external USB hardware to interact with an Android-
powered device in a special accessory mode.ANDROID executive announced this in annual
GOOGLE IO meet conference 2011.ANDROID calls that device made of arduino as
ADK(Android development kit).
Arduino also has won annual “2012 INTERACTION AWARD” sponsored by GOOGLE,for its
extensive applications in various fields.
CHAPTER-4
HARDWARE EQUIPMENTS
RELAYS
Introduction:
A relay is an electrical switch that opens and closes under the control of another electrical
circuit. In the original form, the switch is operated by an electromagnet to open or close one or
many sets of contacts. A relay is able to control an output circuit of higher power than the input
circuit, it can be considered to be, in a broad sense, a form of an electrical amplifier.
Relays are usuallly SPDT (single pole double through switch)or DPDT (double pole double
throughswitch) buttheycan have many more sets of switch contacts, for example relays with 4 sets of
changeover contacts are readily available.
Basic operation of a relay:
An electric current through a conductor will produce a magnetic field at right angles to the
direction of electron flow. If that conductor is wrapped into a coil shape, the magnetic field
produced will be oriented along the length of the coil. The greater the current, the greater the
strength of the magnetic field, all other factors being equal.
Inductors react against changes in current because of the energy stored in this magnetic
field. When we construct a transformer from two inductor coils around a common iron core, we
use this field to transfer energy from one coil to the other. However, there are simpler and more
direct uses for electromagnetic fields than the applications we've seen with inductors and
transformers. The magnetic field produced by a coil of current-carrying wire can be used to exert
a mechanical force on any magnetic object, just as we can use a permanent magnet to attract
magnetic objects, except that this magnet (formed by the coil) can be turned on or off by
switching the current on or off through the coil.
If we place a magnetic object near such a coil for the purpose of making that object move
when we energize the coil with electric current, we have what is called a solenoid. The movable
magnetic object is called an armature, and most armatures can be moved with either direct
current (DC) or alternating current (AC) energizing the coil. The polarity of the magnetic field is
irrelevant for the purpose of attracting an iron armature. Solenoids can be used to electrically
open door latches, open or shut valves, move robotic limbs, and even actuate electric switch
mechanisms and is used to actuate a set of switch contacts
Relays can be categorized according to the magnetic system and operation:
Neutral Relays:
This is the most elementary type of relay. The neutral relays have a magnetic coil, which
operates the relay at a specified current, regardless of the polarity of the voltage applied.
Biased Relays:
Biased relays have a permanent magnet above the armature. The relay operates if the
current through the coil winding establishes a magneto-motive force that opposes the flux by the
permanent magnet. If the fluxes are in the same direction, the relay will not operate, even for a
greater current through the coil.
Polarized Relays:
Like the biased relays, the polarized relays operate only when the current through the coil
in one direction. But there the principle is different. The relay coil has a diode connected in
series with it. This blocks the current in the reverse direction.
The major difference between biased relays and polarized relays is that the former allows
the current to pass through in the reverse direction, but does the not operate the relay and the
later blocks the current in reverse direction. You can imagine how critical these properties when
relays are connected in series to form logic circuits.
Magnetic Stick Relays or Perm polarized Relays:
These relays have a magnetic circuit with high permanence. Two coils, one to operate
(pick up) and one to release (drop) are present. The relay is activated by a current in the operate
coil. On the interruption of the current the armature remains in picked up position by the residual
magnetism. The relay is released by a current through the release coil.
Slow Release Relays:
These relays have a capacitor connected in parallel to their coil. When the operating
current is interrupted the release of relay is delayed by the stored charge in the capacitor. The
relay releases as the capacitor discharges through the coil.
Relays for AC:
These are neutral relays and picked up for a.c. current through their coil. These are very
fast in action and used on power circuits of the point motors, where high current flows through
the contacts. A normal relay would be slow and make sparks which in turn may weld the
contacts together.
All relays have two operating values (voltages), one pick-up and the other other drop
away. The pick-up value is higher than the drop away value.
Applications:
 To control a high-voltage circuitwithalow-voltage signal,asinsome types of modems or audio
amplifiers,
 To control a high-current circuit with a low-current signal, as in the starter solenoid of an
automobile,
 To detectand isolate faultsontransmissionanddistributionlinesby opening and closing circuit
breakers (protection relays),
 To isolate the controlling circuit from the controlled circuit when the two are at different
potentials, for example when controlling a mains-powered device from a low-voltage switch.
The latteris oftenappliedtocontrol office lightingasthe low voltage wiresare easilyinstalledin
partitions, which may be often moved as needs change. They may also be controlled by room
occupancy detectors in an effort to conserve energy,
 To performlogicfunctions.Forexample,the booleanANDfunctionisrealisedbyconnectingNO
relaycontacts inseries,the ORfunctionbyconnecting NOcontactsinparallel.The change-over
or Form C contacts performthe XOR(exclusive or) function.SimilarfunctionsforNANDandNOR
are accomplishedusingNCcontacts.The Ladder programminglanguage isoftenusedfor
designingrelaylogicnetworks.
o Early computing.Before vacuumtubesandtransistors,relayswere usedaslogical
elementsin digital computers.See ARRA (computer),HarvardMark II, Zuse Z2, and Zuse
Z3.
o Safety-criticallogic.Because relaysare muchmore resistantthansemiconductors to
nuclearradiation,theyare widelyusedinsafety-critical logic,suchasthe control panels
of radioactive waste-handlingmachinery.
 To performtime delayfunctions.Relayscanbe modifiedtodelayopeningordelayclosingaset
of contacts.A veryshort(a fractionof a second) delaywoulduse acopperdiskbetweenthe
armature and movingblade assembly.Currentflowinginthe diskmaintainsmagneticfieldfora
short time,lengtheningrelease time.Foraslightlylonger(uptoa minute) delay,adashpotis
used.A dashpotis a pistonfilledwithfluidthatisallowedtoescape slowly.The time periodcan
be variedbyincreasingordecreasingthe flow rate.Forlongertime periods,amechanical
clockworktimerisinstalled
Ultra-Sonic Ranger
Technical Specification
Introduction
The SRF05 is an evolutionary step from the SRF04, and has been designed to increase
flexibility, increase range, and to reduce costs still further. As such, the SRF05 is fully
compatible with the SRF04. Range is increased from 3 meters to 4 meters. A new
operating mode (tying the mode pin to ground) allows the SRF05 to use a single pin
for both trigger and echo, thereby saving valuable pins on your controller. When the
mode pin is left unconnected, the SRF05 operates with separate trigger and echo pins,
like the SRF04. The SRF05 includes a small delay before the echo pulse to give
slower controllers such as the Basic Stamp and Picaxe time to execute their pulse in
commands.
Mode 1 - SRF04 compatible - Separate Trigger and Echo
This mode uses separate trigger and echo pins, and is the simplest mode to use. All
code examples for the SRF04 will work for the SRF05 in this mode. To use this mode,
just leave the mode pin unconnected - the SRF05 has an internal pull up resistor on
this pin.
Mode 2 - Single pin for both Trigger and Echo
This mode uses a single pin for both Trigger and Echo signals, and is designed to save
valuable pins on embedded controllers. To use this mode, connect the mode pin to the
0v Ground pin. The echo signal will appear on the same pin as the trigger signal. The
SRF05 will not raise the echo line until 700uS after the end of the trigger signal. You
have that long to turn the trigger pin around and make it an input and to have your
pulse measuring code ready. The PULSIN command found on many popular
controllers does this automatically.
Calculating the Distance
The SRF05 Timing diagrams are shown above for each mode. You only need to
supply a short 10uS pulse to the trigger input to start the ranging. The SRF05 will
send out an 8 cycle burst of ultrasound at 40khz and raise its echo line high (or trigger
line in mode 2). It then listens for an echo, and as soon as it detects one it lowers the
echo line again. The echo line is therefore a pulse whose width is proportional to the
distance to the object. By timing the pulse it is possible to calculate the range in
inches/centimeters or anything else. If nothing is detected then the SRF05 will lower
its echo line anyway after about 30mS.
The SRF04 provides an echo pulse proportional to distance. If the width of the pulse
is measured in uS, then dividing by 58 will give you the distance in cm, or dividing by
148 will give the distance in inches. uS/58=cm or uS/148=inches.
The SRF05 can be triggered as fast as every 50mS, or 20 times each second. You
should wait 50ms before the next trigger, even if the SRF05 detects a close object and
the echo pulse is shorter. This is to ensure the ultrasonic "beep" has faded away and
will not cause a false echo on the next ranging.
The other set of 5 pins
The 5 pins marked "programming pins" are used once only during manufacture to
program the Flash memory on the PIC16F630 chip. The PIC16F630's programming
pins are also used for other functions on the SRF05, so make sure you don't connect
anything to these pins, or you will disrupt the modules operation.
Changing beam pattern and beam width
You can't! This is a question which crops up regularly, however there is no easy way
to reduce or change the beam width that I'm aware of. The beam pattern of the SRF05
is conical with the width of the beam being a function of the surface area of the
transducers and is fixed. The beam pattern of the transducers used on the SRF05,
taken from the manufacturers data sheet, is shown below.
BUZZER
A buzzer or beeper is a signaling device, usually electronic, typically used in automobiles,
household appliances such as a microwave oven, or game shows.
It most commonly consists of a number of switches or sensors connected to a control unit that
determines if and which button was pushed or a preset time has lapsed, and usually illuminates a
light on the appropriate button or control panel, and sounds a warning in the form of a
continuous or intermittent buzzing or beeping sound. Initially this device was based on an
electromechanical system which was identical to an electric bell without the metal gong . Often
these units were anchored to a wall or ceiling and used the ceiling or wall as a sounding board.
Another implementation with some AC-connected devices was to implement a circuit to make
the AC current into a noise loud enough to drive a loudspeaker and hook this circuit up to a
cheap 8-ohm speaker. Nowadays, it is more popular to use a ceramic-based piezoelectric sounder
like a Son alert which makes a high-pitched tone. Usually these were hooked up to "driver"
circuits which varied the pitch of the sound or pulsed the sound on and off.
In game shows it is also known as a "lockout system," because when one person
signals ("buzzes in"), all others are locked out from signaling. Several game shows have large
buzzer buttons which are identified as "plungers".
The word "buzzer" comes from the rasping noise that buzzers made when they were
electromechanical devices, operated from stepped-down AC line voltage at 50 or 60 cycles.
Other sounds commonly used to indicate that a button has been pressed are a ring or a beep.
LCD (Liquid Cristal Display)
Introduction:
A liquid crystal display (LCD) is a thin, flat display device made up of any number of
color or monochrome pixels arrayed in front of a light source or reflector. Each pixel consists of a
columnof liquidcrystal moleculessuspendedbetween two transparent electrodes, and two polarizing
filters, the axes of polarity of which are perpendicular to each other. Without the liquid crystals
between them, light passing through one would be blocked by the other. The liquid crystal twists the
polarization of light entering one filter to allow it to pass through the other.
A program must interact with the outside world using input and output devices that
communicate directlywithahumanbeing.One of the mostcommondevicesattachedtoancontroller is
an LCD display. Some of the most common LCDs connected to the contollers are 16X1, 16x2 and 20x2
displays. This means 16 characters per line by 1 line 16 characters per line by 2 lines and 20 characters
per line by 2 lines, respectively.
Many microcontrollerdevicesuse 'smartLCD' displaysto output visual information. LCD displays
designedaroundLCDNT-C1611 module,are inexpensive,easytouse,andit iseven possible to produce
a readoutusingthe 5X7 dotspluscursor of the display. Theyhave astandard ASCIIsetof characters and
mathematical symbols. Foran 8-bitdata bus,the displayrequiresa +5V supply plus 10 I/O lines (RS RW
D7 D6 D5 D4 D3 D2 D1 D0). For a 4-bit data bus it only requires the supply lines plus 6 extra lines(RS
RW D7 D6 D5 D4). Whenthe LCD displayisnotenabled,datalinesare tri-state andtheydonotinterfere
with the operation of the microcontroller.
Features:
(1) Interface with either 4-bit or 8-bit microprocessor.
(2) Display data RAM
(3) 80x
(4) Character generator ROM
(5). -matrix character patterns.
(6). Character generator RAM
(7) different user programmed 5 -matrix patterns.
(8).Display data RAM and character generator RAM may be
Accessed by the microprocessor.
Shapes and S
available. Line lengt
(9) Numerous instructions
(10) .Clear Display,Cursor Home,Display ON/OFF,Cursor ON/OFF,
Blink Character,Cursor Shift,Display Shift.
(11). Built-in reset circuit is triggered at power ON.
(12). Built-in oscillator.
Data can be placedat any locationonthe LCD. For16×1 LCD, the addresslocationsare:
Fig : Address locations for a 1x16 line LCD
Shapes and sizes:
Even limited to character based modules,there is still a wide variety of shapes and sizes available.
Line lenghs of 8,16,20,24,32 and 40 charecters are all standard, in one, two and four line versions.
Several differentLCtechnologiesexists.“supertwist”types,forexample,offerImprovedcontrastand
viewingangle overthe older“twistednematic”types.Somemodulesare available withbacklighting, so
so that they can be viewed in dimly-lit conditions. The back lighting may be either “electro-
luminescent”, requiring a high voltage inverter circuit, or simple LED illumination.
Electrical blockdiagram:
Power supply for lcd driving:
PIN DESCRIPTION:
Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins (two pins are
extra in both for back-light LED connections).
Fig: pin diagram of 1x16 lines lcd
CONTROL LINES:
EN:
Line is called "Enable." This control line is used to tell the LCD that you are sending it
data. To send data to the LCD, your program should make sure this line is low (0) 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 high (1) and wait for the minimum amount of time required by the LCD
datasheet (this varies from LCD to LCD), and end by bringing it low (0) again.
RS:
Line is the "Register Select" line. 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 being sent is text data which sould be displayed on the screen. For example, to display
the letter "T" on the screen you would set RS high.
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 always be low.
Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation selected
by the user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1, DB2, DB3,
DB4, DB5, DB6, and DB7.
Logic status on control lines:
• E - 0 Access to LCD disabled
- 1 Access to LCD enabled
• R/W - 0 Writing data to LCD
- 1 Reading data from LCD
• RS - 0 Instructions
- 1 Character
Writing data to the LCD:
1) Set R/W bit to low
2) Set RS bit to logic 0 or 1 (instruction or character)
3) Set data to data lines (if it is writing)
4) Set E line to high
5) Set E line to low
Read data from data lines (if it is reading)on LCD:
1) Set R/W bit to high
2) Set RS bit to logic 0 or 1 (instruction or character)
3) Set data to data lines (if it is writing)
4) Set E line to high
5) Set E line to low
Entering Text:
First, a little tip: it is manually a lot easier to enter characters and commands in hexadecimal
ratherthanbinary(although,of course,youwill needtotranslatecommands from binary couple of sub-
miniature hexadecimalrotaryswitchesisasimple matter,althougha little bit into hex so that you know
which bits you are setting). Replacing the d.i.l. switch pack with a of re-wiring is necessary.
The switchesmustbe the type where On =0, so that when they are turned to the zero position,
all four outputs are shorted to the common pin, and in position “F”, all four outputs are open circuit.
All the available characters that are built into the module are shown in Table 3. Studying the
table,youwill see thatcodesassociatedwiththe charactersare quotedinbinaryandhexadecimal, most
significant bits (“left-hand” four bits) across the top, and least significant bits (“right-hand” four bits)
down the left.
Most of the characters conform to the ASCII standard, although the Japanese and Greek
characters (and a few other things) are obvious exceptions. Since these intelligent modules were
designedinthe “Landof the RisingSun,”itseemsonly fair that their Katakana phonetic symbols should
alsobe incorporated.The more extensiveKanjicharacterset,whichthe Japanese sharewiththe Chinese,
consisting of several thousand different characters, is not included!
Usingthe switches,of whatever type, and referring to Table 3, enter a few characters onto the
display, both letters and numbers. The RS switch (S10) must be “up” (logic 1) when sending the
characters,andswitchE (S9) mustbe pressedforeachof them.Thusthe operationalorderis:setRShigh,
enter character, trigger E, leave RS high, enter another character, trigger E, and so on.
The first 16 codes in Table 3, 00000000 to 00001111, ($00 to $0F) refer to the CGRAM. This is
the Character Generator RAM (random access memory), which can be used to hold user-defined
graphics characters. This is where these modules really start to show their potential, offering such
capabilities as bar graphs, flashing symbols, even animated characters. Before the user-defined
characters are set up, these codes will just bring up strange looking symbols.
Codes 00010000 to 00011111 ($10 to $1F) are not used and just display blank characters. ASCII
codes “proper” start at 00100000 ($20) and end with 01111111 ($7F). Codes 10000000 to 10011111 ($80
to $9F) are not used, and 10100000 to 11011111 ($A0 to $DF) are the Japanese characters.
Initializationby Instructions:
If the power conditions for the normal operation of the internal reset circuit are
not satisfied,thenexecutingaseriesof instructionsmust initialize LCDunit. The procedure
for this initialization process is as above show.
SWITCHES
Introduction:
A switch is a mechanical device used to connect and disconnect an electric circuit at will.
Switches cover a wide range of types, from subminiature up to industrial plant switching
megawatts of power on high voltage distribution lines.
In applications where multiple switching options are required (e.g., a telephone service),
mechanical switches have long been replaced by electronic switching devices which can be
automated and intelligently controlled.
The switch is referred to as a "gate" when abstracted to mathematical form. In the philosophy of
logic, operational arguments are represented as logic gates. The use of electronic gates to
function as a system of logical gates is the fundamental basis for the computer i.e. a computer is
a system of electronic switches which function as logical gates. A railroad switch is not
electrical, but a mechanical device to divert a train from one track to another.
Three tactile switches.Majorscale isinches.
Types ofswitches:
A pair of contacts is said to be 'closed' when there is no space between them, allowing
electricity to flow from one to the other. When the contacts are separated by an insulating air
gap, an air space, they are said to be 'open', and no electricity can flow at typical voltages.
Switches can be and are classified according to the arrangement of their contacts in electronics
field, but electricians in the electrical wiring service business and their electrical supplier
industries use different nomenclature, such as "one-way", "two-way", "three-way" and "four-
way" switches.
We have types of switches also,
 SPST (single pole single through),
 SPDT(single pole double through),
 DPST(double pole single through),
 DPDT (double pole double through)
Make-before-break,break-before-make:
In a multi-throw switch, there are two possible transient behaviors as you move from one
position to another. In some switch designs, the new contact is made before the old contact is
broken. This is known as make-before-break, and ensures that the moving contact never sees an
open circuit (also referred to as a shorting switch). The alternative is break-before-make, where
the old contact is broken before the new one is made. This ensures that the two fixed contacts are
never shorted to each other. Both types of design are in common use, for different applications.
Biased switches
The momentary push-button switch is a type of biased switch. In this contact is made by spring.
The most commontype isa push-to-makeswitch,whichmakescontactwhen the button is pressed and
breaks when the button is released. A push-to-break switch, on the other hand, breaks contact when
the buttonis pressedandmakescontactwhenitis released. An example of a push-to-break switch is a
button used to release a door held open by an electromagnet. Changeover push button switches do
exist but are even less common.
Mercury tilt switch
The mercury switch consists of a drop of mercury inside a glass bulb with 2 contacts. The
two contacts pass through the glass, and are connected by the mercury when the bulb is tilted to
make the mercury roll on to them. This type of switch performs much better than the ball tilt
switch, as the liquid metal connection is unaffected by dirt, debris and oxidation, it wets the
contacts ensuring a very low resistance bounce free connection, and movement and vibration do
not produce a poor contact.
Knife switch
Knife switches are unique, because rather than employing an enclosed circuit connection area
with a rubber- or plastic-insulated section for the user, the contacts and bridge are fully exposed.
The "knife", a flat metal swinging arm, oscillates via user operation between a set of two or more
contact areas. The knife and contacts are typically formed of copper, steel, or brass, depending
on the application. Although knife switches are inferior to traditional switches in applications
where user safety are paramount, knife switches are still commonly employed in everyday high-
voltage applcations such as building transformers, large power relays, air-conditioning units, etc.
Changeover switch
A changeover switch provides two distinct events, the making of one contact and the breaking of
the other. These can be used to feed the inputs of a flip-flop. This way the press will only be
detected when the pressed contact is made and the release will only be detected when the
released contact is made. When the switch is bouncing around in the middle no change is
detected. To get a single logic signal from such a setup a simple SR latch can be used.
Toggle switches are actuated by a lever angled in one of two or more positions. The common
light switch used in household wiring is an example of a toggle switch. Most toggle switches will
come to rest in any of their lever positions, while others have an internal spring mechanism
returning the lever to a certain normal position, allowing for what is called "momentary"
operation.
Pushbutton switches are two-position devices actuated with a button that is pressed and released.
Most pushbutton switches have an internal spring mechanism returning the button to its "out," or
"unpressed," position, for momentary operation. Some pushbutton switches will latch alternately
on or off with every push of the button. Other pushbutton switches will stay in their "in," or
"pressed," position until the button is pulled back out. This last type of pushbutton switches
usually have a mushroom-shaped button for easy push-pull action.
Selector switches are actuated with a rotary knob or lever of some sort to select one of two or
more positions. Like the toggle switch, selector switches can either rest in any of their positions
or contain spring-return mechanisms for momentary operation.
A joystick switch is actuated by a lever free to move in more than one axis of motion. One or
more of several switch contact mechanisms are actuated depending on which way the lever is
pushed, and sometimes by how far it is pushed. The circle-and-dot notation on the switch symbol
represents the direction of joystick lever motion required to actuate the contact. Joystick hand
switches are commonly used for crane and robot control.
Some switches are specifically designed to be operated by the motion of a machine rather than
by the hand of a human operator. These motion-operated switches are commonly called limit
switches, because they are often used to limit the motion of a machine by turning off the
actuating power to a component if it moves too far. As with hand switches, limit switches come
in several varieties:
These limit switches closely resemble rugged toggle or selector hand switches fitted with a lever
pushed by the machine part. Often, the levers are tipped with a small roller bearing, preventing
the lever from being worn off by repeated contact with the machine part.
Proximity switches sense the approach of a metallic machine part either by a magnetic or high-
frequency electromagnetic field. Simple proximity switches use a permanent magnet to actuate a
sealed switch mechanism whenever the machine part gets close (typically 1 inch or less). More
complex proximity switches work like a metal detector, energizing a coil of wire with a high-
frequency current, and electronically monitoring the magnitude of that current. If a metallic part
(not necessarily magnetic) gets close enough to the coil, the current will increase, and trip the
monitoring circuit. The symbol shown here for the proximity switch is of the electronic variety,
as indicated by the diamond-shaped box surrounding the switch. A non-electronic proximity
switch would use the same symbol as the lever-actuated limit switch.
Another form of proximity switch is the optical switch, comprised of a light source and
photocell. Machine position is detected by either the interruption or reflection of a light beam.
Optical switches are also useful in safety applications, where beams of light can be used to detect
personnel entry into a dangerous area.
In many industrial processes, it is necessary to monitor various physical quantities with switches.
Such switches can be used to sound alarms, indicating that a process variable has exceeded
normal parameters, or they can be used to shut down processes or equipment if those variables
have reached dangerous or destructive levels. There are many different types of process
switches:
These switches sense the rotary speed of a shaft either by a centrifugal weight mechanism
mounted on the shaft, or by some kind of non-contact detection of shaft motion such as optical or
magnetic.
Gas or liquid pressure can be used to actuate a switch mechanism if that pressure is applied to a
piston, diaphragm, or bellows, which converts pressure to mechanical force.
An inexpensive temperature-sensing mechanism is the "bimetallic strip:" a thin strip of two
metals, joined back-to-back, each metal having a different rate of thermal expansion. When the
strip heats or cools, differing rates of thermal expansion between the two metals causes it to
bend. The bending of the strip can then be used to actuate a switch contact mechanism. Other
temperature switches use a brass bulb filled with either a liquid or gas, with a tiny tube
connecting the bulb to a pressure-sensing switch. As the bulb is heated, the gas or liquid
expands, generating a pressure increase which then actuates the switch mechanism.
CHAPTER-6
SOFTWARE IMPLEMMENTATION
SOFTWARE
The software used by the arduino is Arduino IDE.
heArduino IDE is a cross-platform application written in Java, and is derived from the IDE for
the Processing programming language and the Wiringproject. It is designed to introduce
programming to artists and other newcomers unfamiliar with software development. It includes a
code editor with features such as syntax highlighting, brace matching, and automatic indentation,
and is also capable of compiling and uploading programs to the board with a single click. There
is typically no need to edit makefiles or run programs on acommand-line interface. Although
building on command-line is possible if required with some third-party tools such as Ino.
The Arduino IDE comes with a C/C++ library called "Wiring" (from the project of the same
name), which makes many common input/output operations much easier. Arduino programs are
written in C/C++, although users only need define two functions to make a runnable program:
 setup() – a function run once at the start of a program that can initialize settings
 loop() – a function called repeatedly until the board powers off
Figure 5.1 : A screenshot of the Arduino IDE showing the "Blink"program,a simple
biginner program
A typical first program for a microcontroller simply blinks a LED on and off. In the Arduino
environment, the user might write a program like this:
#define LED_PIN 13
void setup () {
pinMode (LED_PIN, OUTPUT); // enable pin 13 for digital output
}
void loop () {
digitalWrite (LED_PIN, HIGH); // turn on the LED
delay (1000); // wait one second (1000 milliseconds)
digitalWrite (LED_PIN, LOW); // turn off the LED
delay (1000); // wait one second
}
For the above code to work correctly, the positive side of the LED must be connected to pin 13
and the negative side of the LED must be connected to ground. The above code would not be
seen by a standard C++ compiler as a valid program, so when the user clicks the "Upload to I/O
board" button in the IDE, a copy of the code is written to a temporary file with an extra include
header at the top and a very simple main() function at the bottom, to make it a valid C++
program.
The Arduino IDE uses the GNU toolchain and AVR Libc to compile programs, and
uses avrdude to upload programs to the board.
For educational purposes there is third party graphical development environment called Minibloq
available under a different open source license.
2.3.3.1 language reference
Arduino programs can be divided in three main parts: structure, values (variables and constants),
and functions.
Available datatypes in ARDUINO IDE are
•void
•boolean
•char ( 0 – 255)
•byte - 8 bit data ( 0 – 255)
•int - 16-bit data (32,767 - -32,768)
•long – 32 bit data (2,147,483,647 to -2,147,483,648)
•float
•double
•string - char array
•String - object
•array
Arithmetic operators
Arithmetic operators include addition,subtraction,multiplication and division.For math that
requires fractions,you can use float variables,if you can bear large size and slow computation
speeds in your microcontroller.
e.g. ,
y = y + 3;
x = x – 7;
i = j * 6;
r = r / 5;
Comparision operators
Comparisons of one variable or constant against another are often used in if statements to test if a
specified condition is true.
e.g. ,
x == y // x is equal to y
x != y // x is not equal to y
x < y // x is less than y
x > y // x is greater than y
x <= y // x is less than or equal to y
x >= y // x is greater than or equal to y
Logical operators
Logical operators are usually a way to logically combine two expressions and return a TRUE or
FALSE depending on the operator.
There are three logical operators, AND, OR, and NOT.
e.g. ,
Logical AND:
if (x > 0 && x < 5) // true only if both expressions are true
Logical OR:
if (x > 0 || y > 0) // true if either expression is true
Logical NOT:
if (!x > 0) // true only if expression
TRUE/FALSE
These are Boolean constants that define logic levels of the arduino.
FALSE is easily defined as 0 (zero)
TRUE is often defined as 1, but can also be anything else except zero. So in a Boolean sense, -1,
2, and -200 are all also defined as TRUE.
e.g. ,
if (abcd== TRUE);
{
DoSomethingNice;
}
else
{
DoSomethingHorrible;
}
HIGH/LOW
These constants define pin levels as HIGH or LOW and are used when reading or writing to
digital pins.
HIGH is defined as logic level 1, ON, or 5 volts
LOW is logic level 0, OFF, or 0 volts.
e.g. ,
digitalWrite(13, HIGH);
INPUT/OUTPUT
These constants define pin levels as HIGH or LOW and are used when reading or writing to
digital pins.
HIGH is defined as logic level 1, ON, or 5 volts
LOW is logic level 0, OFF, or 0 volts.
e.g. ,
pinmode(13, OUTPUT);
2.3.3.2 Arduino/processing language Comparision
The Arduino language (based on Wiring) is implemented in C/C++, and therefore has some
differences from the Processing language, which is based on Java.
SIMULATOR for ARDUINO:
The Arduino Simulator app gives the user the freedom to work without the basic setup of
hardware and software. It is designed to be used by beginners and also, experienced developers,
who want to quickly develop Arduino projects.
The developer can make the necessary changes in the code - delay, pin number, and state - 0
(low) 1 (high) - and check it immediately. The app shows the breadboard, complete with 14 LED
pins.
You can drag and place the wires in the correct positions to connect to Arduino. If the wires are
placed according to the code, then it will show the expected results. Once satisfied, you can save
it and email it. The code can be copied and used in an actual project just as easily.
This app is an easy way to work through Arduino projects. With customisable codes, and a
simple to use interface, thisArduino Simulator app from Schogini Systems is a convenient app
for Arduino developers.
A screenshot of Arduino simulator is shown in the figure below
Figure 3: screenshot of ARDUINO simulator
CODE:
#include<SoftwareSerial.h>
#include<LiquidCrystal.h>
LiquidCrystal lcd(2,3,4,5,6,7);
int trigPin1=11;
int echoPin1=12;
int sw=10;
int b=9;
int r=13;
long int distance,duration;
unsigned char ch;
int i,j;
void setup()
{
Serial.begin(9600);
pinMode(echoPin1,INPUT);
pinMode(trigPin1,OUTPUT);
pinMode(r,OUTPUT);
pinMode(b,OUTPUT);
pinMode(sw,INPUT_PULLUP);
lcd.begin(16,2);
lcd.print("WELCOME");
digitalWrite(r,LOW);
digitalWrite(b,LOW);
delay(2000);
lcd.clear();
lcd.print("AUTOMATIC WATER");
lcd.setCursor(0,1);
lcd.print(" SYSTEM");
delay(2000);
lcd.clear();
lcd.print("DISTANCE: cm");
}
void loop()
{
SonarSensor(trigPin1,echoPin1);
lcd.setCursor(10,0);
lcd.print(" ");
lcd.setCursor(11,0);
lcd.print(distance);
if(distance<20)
{
digitalWrite(r,HIGH);
digitalWrite(b,LOW);
lcd.setCursor(0,1);
lcd.print("MOTOR ON ");
}
if(distance>20)
{
digitalWrite(r,LOW);
digitalWrite(b,LOW);
lcd.setCursor(0,1);
lcd.print("MOTOR OFF");
}
if(!digitalRead(sw))
{
digitalWrite(r,HIGH);
lcd.clear();
lcd.print("WATER LEAKAGE");
lcd.setCursor(0,1);
lcd.print("plz check...");
while(1)
{
digitalWrite(b,HIGH);
delay(500);
digitalWrite(b,LOW);
delay(500);
}
}
delay(100);
}
void SonarSensor(int trigPin,int echoPin)
{
digitalWrite(trigPin, LOW);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
duration = pulseIn(trigPin, HIGH);
distance = (duration/2);
}
ADVANTAGES AND APPLICATIONS
ADVANTAGES:
1.Fully automation
2. contact less, water control
3. reduce the water wastage
4. reduce the health deceases by contacts
5. Shows the luxury model.
APPLICATIONS:
House hold appliances
Gardens
Plants irrigation
Commercial applications
Industries
Hotels
Forming
CONCLUSION
The advancements in science and technology are taking humanrace to the era of artificial
intelligence and thereby reducing the human interaction with machines. The automatic water
dispenser is such amachine which is capable of making the human work a lot easier. We can
integrate this machine to the existing water purifiers and thereby we can eliminate the water
spillage and this technique is far more hygienic as it eliminates the human touch from the
process. This method can be implemented in the public water podium stands which are
maintained by the government and eliminate the usage of water taps which are very in-efficient.
The automatic water dispenser can be made more remotely using sensors
REFERENCES
[1]. Poonam J. Chavan, Manoj Mechkul “IoT Based Water quality Monitoring”, IJMTER
Journal, Vol 3, 2016, pp.746-750. [2]. Aaina Venkateshwaran, Harsha Menda P. prof. Priti Bodar
“An IoT based system for water quality monitoring” ,IJRCCE, 2017, pp. 2510-2515. [3]. Mithali
Borbade, Shruthi Danve “Real Time Water Quality monitoring system” IJIRCE journal, Vol 3,
2015, water pp.5046- 5068. [4]. Anuradha T, Bhakti, Chitra R, pooja D. “IOT based low cost
system for monitoring of water quality in real time”, International Research Journal of
Engineering and Technology, Vol 05, Issue 05, pp. 1658-1663. [5]. Anuradha T. “The
monitoring of water quality in IoT Environment”, IJSRT, March 2018, Volume 4, Issue 5, pp.
[6]. Jyoti Bhatt, Jignesh Pataliya “IoT based water quality monitoring system”, IJIEE journal,
Vol 4, 2016, pp. 44-48. [7]. S.Geeta, S.Goutham “Internet of Things enabled real time water
quality monitoring system” springer open journal Vol 5, pp. 1-19, 2017. [8]. Pradeep Kumar M.
Manisha J. Praveen Sha R. Proiserin V. Suganya Devi, “The real time monitoring of water
quality in IoT Environment”, Vol 5, 2016, pp.4419-4427.

More Related Content

What's hot

Raspberry Pi (Introduction)
Raspberry Pi (Introduction)Raspberry Pi (Introduction)
Raspberry Pi (Introduction)Mandeesh Singh
 
Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoVishnu
 
IOT: Home Automation using Android Application
IOT: Home Automation using Android ApplicationIOT: Home Automation using Android Application
IOT: Home Automation using Android ApplicationNikhil Jadav
 
ARM7-ARCHITECTURE
ARM7-ARCHITECTURE ARM7-ARCHITECTURE
ARM7-ARCHITECTURE Dr.YNM
 
IoT home automation project
IoT home automation projectIoT home automation project
IoT home automation projectShohin Aheleroff
 
Smart irrigation system using Internet Of Things
Smart irrigation system using Internet Of ThingsSmart irrigation system using Internet Of Things
Smart irrigation system using Internet Of ThingsBasavaraj Galagi
 
Iot based water quality monitoring system
Iot based water quality monitoring systemIot based water quality monitoring system
Iot based water quality monitoring systemBinayakreddy
 
Password based door locking system
Password based door locking systemPassword based door locking system
Password based door locking systemArjun Singh
 
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauriArduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauriGaurav Pandey
 
AUTOMATIC BELL FOR COLLEGE
AUTOMATIC BELL FOR COLLEGEAUTOMATIC BELL FOR COLLEGE
AUTOMATIC BELL FOR COLLEGEbharath405
 
Ppt on brake failure indicator.
Ppt on brake failure indicator.Ppt on brake failure indicator.
Ppt on brake failure indicator.mmnbaig
 
Final year project presentation IOT Based home security system
Final year project presentation IOT Based home security systemFinal year project presentation IOT Based home security system
Final year project presentation IOT Based home security systemSarmadMalik18
 
Automatic control of street light using LDR
Automatic control of street light using LDRAutomatic control of street light using LDR
Automatic control of street light using LDRDevang Loharikar
 
IOT based air quality and monitoring by using arduino
IOT based air quality and monitoring by using arduinoIOT based air quality and monitoring by using arduino
IOT based air quality and monitoring by using arduinoGopikrishnateja Goli
 

What's hot (20)

Raspberry Pi (Introduction)
Raspberry Pi (Introduction)Raspberry Pi (Introduction)
Raspberry Pi (Introduction)
 
Smart Irrigation System
Smart Irrigation SystemSmart Irrigation System
Smart Irrigation System
 
Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic Arduino
 
Introduction to Node MCU
Introduction to Node MCUIntroduction to Node MCU
Introduction to Node MCU
 
IOT: Home Automation using Android Application
IOT: Home Automation using Android ApplicationIOT: Home Automation using Android Application
IOT: Home Automation using Android Application
 
ARM7-ARCHITECTURE
ARM7-ARCHITECTURE ARM7-ARCHITECTURE
ARM7-ARCHITECTURE
 
IoT home automation project
IoT home automation projectIoT home automation project
IoT home automation project
 
TinyOS
TinyOSTinyOS
TinyOS
 
Smart irrigation system using Internet Of Things
Smart irrigation system using Internet Of ThingsSmart irrigation system using Internet Of Things
Smart irrigation system using Internet Of Things
 
Iot based water quality monitoring system
Iot based water quality monitoring systemIot based water quality monitoring system
Iot based water quality monitoring system
 
Password based door locking system
Password based door locking systemPassword based door locking system
Password based door locking system
 
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauriArduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
 
AUTOMATIC BELL FOR COLLEGE
AUTOMATIC BELL FOR COLLEGEAUTOMATIC BELL FOR COLLEGE
AUTOMATIC BELL FOR COLLEGE
 
Ardui no
Ardui no Ardui no
Ardui no
 
Wi-Fi Esp8266 nodemcu
Wi-Fi Esp8266 nodemcu Wi-Fi Esp8266 nodemcu
Wi-Fi Esp8266 nodemcu
 
Ppt on brake failure indicator.
Ppt on brake failure indicator.Ppt on brake failure indicator.
Ppt on brake failure indicator.
 
Final year project presentation IOT Based home security system
Final year project presentation IOT Based home security systemFinal year project presentation IOT Based home security system
Final year project presentation IOT Based home security system
 
Automatic control of street light using LDR
Automatic control of street light using LDRAutomatic control of street light using LDR
Automatic control of street light using LDR
 
IOT based air quality and monitoring by using arduino
IOT based air quality and monitoring by using arduinoIOT based air quality and monitoring by using arduino
IOT based air quality and monitoring by using arduino
 
PPT ON Arduino
PPT ON Arduino PPT ON Arduino
PPT ON Arduino
 

Similar to Automatic water dispenser arduino

Density based traffic light controlling (2)
Density based traffic light controlling (2)Density based traffic light controlling (2)
Density based traffic light controlling (2)hardik1240
 
embeddedsystemspresentation-140524063909-phpapp01-converted.pptx
embeddedsystemspresentation-140524063909-phpapp01-converted.pptxembeddedsystemspresentation-140524063909-phpapp01-converted.pptx
embeddedsystemspresentation-140524063909-phpapp01-converted.pptxDrVikasMahor
 
N414 Documentation Data.docx
N414 Documentation Data.docxN414 Documentation Data.docx
N414 Documentation Data.docxRAGU83
 
Automatic solar LED street light automation by using RTC and I2C protocols d...
Automatic solar LED street light automation by using RTC and I2C protocols  d...Automatic solar LED street light automation by using RTC and I2C protocols  d...
Automatic solar LED street light automation by using RTC and I2C protocols d...PRASHANTH RAO
 
Embedded system by abhishek mahajan
Embedded system by abhishek mahajanEmbedded system by abhishek mahajan
Embedded system by abhishek mahajanabhimaha09
 
Embedded system by abhishek mahajan
Embedded system by abhishek mahajanEmbedded system by abhishek mahajan
Embedded system by abhishek mahajanAbhishek Mahajan
 
Embedded system by abhishek mahajan
Embedded system by abhishek mahajanEmbedded system by abhishek mahajan
Embedded system by abhishek mahajanAbhishek Mahajan
 
embeddedsystemspresentation-140524063909-phpapp01.pdf
embeddedsystemspresentation-140524063909-phpapp01.pdfembeddedsystemspresentation-140524063909-phpapp01.pdf
embeddedsystemspresentation-140524063909-phpapp01.pdfAshwin180668
 
EMBEDDED_SYSTEM_INTRODUCTION.pdf
EMBEDDED_SYSTEM_INTRODUCTION.pdfEMBEDDED_SYSTEM_INTRODUCTION.pdf
EMBEDDED_SYSTEM_INTRODUCTION.pdfNadiSarj2
 
Microprocessors and microcontrollers
Microprocessors and microcontrollersMicroprocessors and microcontrollers
Microprocessors and microcontrollersAditya Porwal
 
Embedded system projects for final year Bangalore
Embedded system projects for final year BangaloreEmbedded system projects for final year Bangalore
Embedded system projects for final year BangaloreAidell2583
 
IRJET- Smart Water Management
IRJET-  	  Smart Water ManagementIRJET-  	  Smart Water Management
IRJET- Smart Water ManagementIRJET Journal
 
Trainingreport on embedded system
Trainingreport on embedded systemTrainingreport on embedded system
Trainingreport on embedded systemMukul Mohal
 
EMBEDDED SYSTEMS INTRODUCTION.pptx
EMBEDDED SYSTEMS INTRODUCTION.pptxEMBEDDED SYSTEMS INTRODUCTION.pptx
EMBEDDED SYSTEMS INTRODUCTION.pptxMohammedtajuddinTaju
 
Project Report on Embedded Systems
Project Report on Embedded Systems Project Report on Embedded Systems
Project Report on Embedded Systems Suhani Singh
 

Similar to Automatic water dispenser arduino (20)

Embedded systems
Embedded systemsEmbedded systems
Embedded systems
 
Embeddedsystems 091130091010-phpapp02
Embeddedsystems 091130091010-phpapp02Embeddedsystems 091130091010-phpapp02
Embeddedsystems 091130091010-phpapp02
 
Density based traffic light controlling (2)
Density based traffic light controlling (2)Density based traffic light controlling (2)
Density based traffic light controlling (2)
 
embeddedsystemspresentation-140524063909-phpapp01-converted.pptx
embeddedsystemspresentation-140524063909-phpapp01-converted.pptxembeddedsystemspresentation-140524063909-phpapp01-converted.pptx
embeddedsystemspresentation-140524063909-phpapp01-converted.pptx
 
N414 Documentation Data.docx
N414 Documentation Data.docxN414 Documentation Data.docx
N414 Documentation Data.docx
 
Automatic solar LED street light automation by using RTC and I2C protocols d...
Automatic solar LED street light automation by using RTC and I2C protocols  d...Automatic solar LED street light automation by using RTC and I2C protocols  d...
Automatic solar LED street light automation by using RTC and I2C protocols d...
 
Embedded system by abhishek mahajan
Embedded system by abhishek mahajanEmbedded system by abhishek mahajan
Embedded system by abhishek mahajan
 
Embedded system by abhishek mahajan
Embedded system by abhishek mahajanEmbedded system by abhishek mahajan
Embedded system by abhishek mahajan
 
Embedded system by abhishek mahajan
Embedded system by abhishek mahajanEmbedded system by abhishek mahajan
Embedded system by abhishek mahajan
 
Embedded System Presentation
Embedded System PresentationEmbedded System Presentation
Embedded System Presentation
 
embeddedsystemspresentation-140524063909-phpapp01.pdf
embeddedsystemspresentation-140524063909-phpapp01.pdfembeddedsystemspresentation-140524063909-phpapp01.pdf
embeddedsystemspresentation-140524063909-phpapp01.pdf
 
EMBEDDED_SYSTEM_INTRODUCTION.pdf
EMBEDDED_SYSTEM_INTRODUCTION.pdfEMBEDDED_SYSTEM_INTRODUCTION.pdf
EMBEDDED_SYSTEM_INTRODUCTION.pdf
 
Water level monitoring system
Water level monitoring systemWater level monitoring system
Water level monitoring system
 
Microprocessors and microcontrollers
Microprocessors and microcontrollersMicroprocessors and microcontrollers
Microprocessors and microcontrollers
 
Embedded system projects for final year Bangalore
Embedded system projects for final year BangaloreEmbedded system projects for final year Bangalore
Embedded system projects for final year Bangalore
 
IRJET- Smart Water Management
IRJET-  	  Smart Water ManagementIRJET-  	  Smart Water Management
IRJET- Smart Water Management
 
Embeddedsystems
EmbeddedsystemsEmbeddedsystems
Embeddedsystems
 
Trainingreport on embedded system
Trainingreport on embedded systemTrainingreport on embedded system
Trainingreport on embedded system
 
EMBEDDED SYSTEMS INTRODUCTION.pptx
EMBEDDED SYSTEMS INTRODUCTION.pptxEMBEDDED SYSTEMS INTRODUCTION.pptx
EMBEDDED SYSTEMS INTRODUCTION.pptx
 
Project Report on Embedded Systems
Project Report on Embedded Systems Project Report on Embedded Systems
Project Report on Embedded Systems
 

Recently uploaded

Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 

Recently uploaded (20)

Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 

Automatic water dispenser arduino

  • 1. ABSTRACT About 71% of earth is covered with water but sadly only 2.5% of it is used for drinking purpose, the reason for this is with rise in population, pollution and climate change, humans waste a lot of water due to our negligence. In this paper the automatic water dispenser is been proposed using sensors. For a automatic water dispenser they used node MCU and ultrasonic sensor. Here the manual taps are replaced with a smart taps that opens and closes on its own automatically due to this saving of water is achieved which is a biggest challenge nowadays. This technique changes the lifestyle of the public since they don’t need to operate the tap manually through their hands. In this paper not only saves the water provide faster, easier, and cost-effective management.
  • 2. CHAPTER-1 INTRODUCTION TO EMBEDDED SYSTEMS An embedded system is a special-purpose computer system designed to perform one or a few dedicated functions, often with real-time computing constraints. It is usually embedded as part of a complete device including hardware and mechanical parts. In contrast, a general- purpose computer, such as a personal computer, can do many different tasks depending on programming. Embedded systems control many of the common devices in use today .Since the embedded system is dedicated to specific tasks; design engineers can optimize it, reducing the size and cost of the product, or increasing the reliability and performance. Some embedded systems are mass-produced, benefiting from economies of scale. Physically, embedded systems range from portable devices such as digital watches and MP3 players, to large stationary installations like traffic lights, factory controllers, or the systems controlling nuclear power plants. Complexity varies from low, with a single microcontroller chip, to very high with multiple units, peripherals and networks mounted inside a large chassis or enclosure In general, "embedded system" is not an exactly defined term, as many systems have some element of programmability. For example, Handheld computers share some elements with embedded systems — such as the operating systems and microprocessors which power them — but are not truly embedded systems, because they allow different applicationsto be loaded and peripherals to be connected. Embedded systems span all aspects of modern life and there are many examples of their use. Telecommunications systems employ numerous embedded systems from telephone switches for the network to mobile phones at the end-user. Computer networking uses dedicated routers and network bridges to route data. Characteristics: 1. Embedded systems are designed to do some specific task, rather than be a general- purpose computer for multiple tasks. Some also have real-time performance constraints
  • 3. that must be met, for reasons such as safety and usability; others may have low or no performance requirements, allowing the system hardware to be simplified to reduce costs. 2. Embedded systems are not always standalone devices. Many embedded systems consist of small, computerized parts within a larger device that serves a more general purpose. For example, the Gibson Robot Guitar features an embedded system for tuning the strings, but the overall purpose of the Robot Guitar is, of course, to play music. Similarly, an embedded system in an automobile provides a specific function as a subsystem of the car itself. 3. The software written for embedded systems is often called firmware, and is usually stored in read-only memory or Flash memory chips rather than a disk drive. It often runs with limited computer hardware resources: small or no keyboard, screen, and little memory. CPU Platforms: Embedded processors can be broken into two broad categories: ordinary microprocessors (μP) and microcontrollers (μC), which have many more peripherals on chip, reducing cost and size. Contrasting to the personal computer and server markets, a fairly large number of basic CPU architectures are used; there are Von Neumann as well as various degrees of Harvard architectures, RISC as well as non-RISC and VLIW; word lengths vary from 4-bit to 64-bits and beyond (mainly in DSP processors) although the most typical remain 8/16-bit. Most architecture comes in a large number of different variants and shapes, many of which are also manufactured by several different companies. ASIC and FPGA solutions: A common configuration for very-high-volume embedded systems is the system on a chip (SoC), an application-specific integrated circuit (ASIC), for which the CPU core was purchased and added as part of the chip design. A related scheme is to use a field-programmable gate array (FPGA), and program it with all the logic, including the CPU. Peripherals: Embedded Systems talk with the outside world via peripherals, such as
  • 4.  Serial Communication Interfaces (SCI): RS-232, RS-422, RS-485etc  Synchronous Serial Communication Interface: I2C, JTAG, SPI, SSC and ESSI  Universal Serial Bus (USB)  Networks: Ethernet, Controller Area Network, LAN networks, etc  Timers: PLL(s), Capture/Compare and Time Processing Units  Discrete IO: aka General Purpose Input/output (GPIO)  Analog to Digital/Digital to Analog (ADC/DAC) Tools: As for other software, embedded system designers use compilers, assemblers, and debuggers to develop embedded system software. However, they may also use some more specific tools:  In circuit debuggers or emulators  Utilities to add a checksum or CRC to a program, so the embedded system can check if the program is valid.  For systems using digital signal processing, developers may use a math workbench such as MATLAB, Simulink, MathCad, or Mathematica to simulate the mathematics. They might also use libraries for both the host and target which eliminates developing DSP routines as done in DSPnano RTOS and Unison Operating System.  Custom compilers and linkers may be used to improve optimization for the particular hardware.  An embedded system may have its own special language or design tool, or add enhancements to an existing language such as Forth or Basic.  Another alternative is to add a Real-time operating system or Embedded operating system, which may have DSP capabilities like DSP nano RTOS. Software tools can come from several sources:  Software companies that specialize in the embedded market  Ported from the GNU software development tools  Sometimes, development tools for a personal computer can be used if the embedded processor is a close relative to a common PC processor
  • 5. As the complexity of embedded systems grows, higher level tools and operating systems are migrating into machinery where it makes sense. For example, cell phones, personal digital assistants and other consumer computers often need significant software that is purchased or provided by a person other than the manufacturer of the electronics. In these systems, an open programming environment such as Linux, NetBSD, OSGi or Embedded Java is required so that the third-party software provider can sell to a large market.
  • 6. CHAPTER-2 PROJECT DESCRIPTION Introduction: In day to day life Water is very essential for Public, so there is a requirement of avoiding wastage of Drinking water. About 71% of earth is covered with water, but sadly only 2.5% of it is drinking water. With rise in population, pollution and climate change, it is expected that by as soon as 2025 we will experience perennial water shortages. At one hand there are already minor disputes among nations and states for sharing river water on the other hand we as humans waste a lot of drinking water due to our negligence. There are many places were water gets wasted due to human negligence where people forget to off the tap after drinking the water. It is necessary for controlling the drinking water by using Automatic Water Dispenser based on sensors used to „ON‟ and „OFF‟ the water taps automatically using sensors and also monitor the water level and gives notification about level of water to the authorized person by informing when the water level becomes LOW. Hence replace all manual taps with smart one that „ON‟ and „OFF‟ automatically, we don‟t have to operate tap with our hands. In day to day life there are a number of water dispensers for providing drinking water. Such as in colleges, office and in many institutions. These dispensers are managed manually by a person checks each of the dispensers individually and accordingly manages it. Many offices nowada2ys are superstructure buildings and occupy a large workforce. Same goes for colleges too. In order to fulfil the drinking water requirement a number of dispensers are placed throughout the building. Now their management has become difficult. Existing method: 1. In previous stages the water dispensers are nothing but a manual tap , by using this so huge amount of water will be wasted ,we need to remember our earth depends on water quantity. 2. Some of the people are implemented using IR technology with only hard ware design part, so this is also leads to system failure conditions because of controlling the only hardware part is leads to error with out program.
  • 7. Proposed system: Wastage of water not appear big at the first time, but if your tap dripped a drop of water once every second it would take only about five hours for you to waste one gallon of water, that is enough water for an average human to survive for two days. So what can be done to stop this? As always the answer, for this, lies with improvement in technology. If we replace all the manual taps with a smart one that opens and closes on its own automatically not only we can save water but also have a healthier lifestyle since we don’t have to operate the tap with our dirty hands. So in this project we will build a Automatic Water Dispenser using Arduino and sensors that can automatically give you water when a glass is placed near it The system monitors the water dispensers by ultrasonic sensors placed over the dispenser and compare the fault conditions to give the alert for water leakage conditions . The main goal of our paper is to monitor the water leakage and manage the overall water dispenser. It will provide faster, easier, and cost-effective management. It also includes the design of monitoring system with advantages of low cost and accuracy. This project titled automatic water dispenser is a modern approach to the onventional water dispenser that we use in our daily life. In this system we use a proximity switch which is connected to a relay which controls the water solenoid which acts as a valve to control the water flow to the tap. The water dispensers that we use in our daily life are mechanically operated. The water flows through the tap when we press the concerned button and the water flow stops once we release the button. This button system is prone to water loss and wear and tear of the button and therefore the dispenser requires a constant maintenance. We can make the dispenser handy and user friendly by giving it an electronic touch. We can make use of the sensor technology and make machine far advanced than its counterparts. We can make use of a IR Sensor or Ultrasonic Sensor or a proximity switch. If we use IR sensor then there are possibilities of false switching on the machine. So we can’t implement the IR based sensor. Water dispenser management system proposed here it involves building of the smarter and automatic water dispensers. It opens and closes automatically. These dispensers are built with the help of Arduino
  • 8. Block DIAGRAM POWER SUPPLY ARDUINO UNO ULTRASONIC SENSOR RELAY MODULE WATER PUMP BUZZER BUZZER LCD DISPLAY
  • 9. CIRCUIT DIAGRAM Working: In this projects Ultrasonic sensor acts as a input device and water pump acts a load or output device, here we are using relay to control the load and we are using a LCD display as data monitor unit.
  • 10. Here the automatic process is works by detecting ultrasonic sensor . Ultrasonic sensor continuously measure the distance ,in our program we need to fix the threshold distance, when ever the distance limits the threshold distance sensor is detected . So whe ever the sensor distance reaches its threshold limits arduino send a control signal to the Relay module to trigger the water pump .that means when the distance is at threshold limits Relay the ON the water motor and if the distance is above the threshold limits Relay module OFF the water pump. And also here we are creating a fault condition to stop the extra wastage of water by detecting the water leakage due to any system failure conditions.
  • 11. CHAPTER-3 ARDUINO Arduino interface boards provide the engineers, artists, designers, hobbyists and anyone who tinker with technology with a low-cost, easy-to-use technology to create their creative, interactive objects, useful projects etc., A whole new breed of projects can now be built that can be controlTRANSMITTER from a computer. 1.1 WHAT IS ARDUINO? Figure 1.1 ARDUINO UNO Arduino is a open source electronics prototyping platform based on flexible, easy-to-use hardware and software.It’s intended for artists,designers, hobbyists,and anyone interested in creating interactive objects or environments. It’s an open-source physical computing platform based on a microcontroller board, and a development environment for writing software for the board.computer or programmed by the computer and then disconnected and allowed to work independently.Anyone can buy this device through online auction site or search engine.Since theArduino is an open-source hardware designs and ccreate their own clones of the Arduino and sell them,so the market for the boards is competitive. An official Arduino costs about $30,and a clone often less than $20.
  • 12. The name “Arduino” is reserved by the original makers. However, clone Arduino designs often have the letters “duino” on the end of their name, for example, Freeduino or DFRduino. The software for programming your Arduino is easy to use and also freely available for Windows, Mac, and LINUX computers at no cost. 1.1.1 MICROCONTROLLER Microcontroller can be described as a computer embedded on a rather small circuit board.To describe the function of a microcontroller more precisely,it is a single chip that can perform various calculations and tasks,and send/receive signals from other devices via the available pins. Precisely what tasks and communication with the world it does, is what is governed by what instructions we give to the Microcontroller. It is this job of telling the chip what to do, is what we refer to as programming on it. However, the uC by itself, cannot accomplish much; it needs several external inputs: power, for one; a steady clock signal, for another. Also, the job of programming it has to be accomplished by an external circuit. So typically, auC is used along with a circuit which provides these things to it; this combination is calTRANSMITTER a microcontroller board. The Arduino Uno that you have recieved, is one such microcontroller board. The actual microcontroller at its heart is the chip calTRANSMITTER Atmega328. The advantages that Arduino offers over other microcontroller boards are largely in terms of reliability of the circuit hardware as well as the ease of programming and using it. 1.1.2 OPEN-SOURCE HARDWARE Open-source hardware shares much of the principles and approach of free and open- source software.The founders of Arduino wanted people to study their hardware,to understand how it works,make changes to it,and share those changes with the world.To facilitate this,they release all of the original design files(Eagle CAD)for the Arduinohardware.These files are licensed under a Creative Common Attribution Share-Alike license,which allows for both personal and commercial derivative works,as long as they(people) credit Arduino and release their designs under the same license. The Arduino software is also oen-source.The source code for the Java environment is released under the GPL and the C/C++ microcontroller libraries are under the LGPL
  • 13. 1.2 HISTORY OF ARDUINO While teaching a physical computing class at the Interaction Design Institute Ivrea in 2005, Massimo Banzi’s students were unwilling to spend the 76 euros for the BASIC Stamp microcontrollers commonly used in such applications. Banzi and his collegues looked for alternatives, finally settling on the wiring platform developed by one of Banzi’s students. In his own words: “…we started to figure out how could we make the whole platform even simpler, even cheaper, even easier to use. And then we started to essentially reimplement the whole thing as an open source project.” Once they had a prototype, a student wrote the software that would allow wiring programs to run on the new platform. Upon seeing the project, visiting professor Casey Reas suggested that there might be wider applications than just design schools for the new product. The prototype was redesigned for mass production and a test run of 200 boards was made. Orders began coming in from other design schools and the students looking for Arduinos, and the Arduino project was born and MassimoBanzi and David Cuartielles became its founders.”ARDUINO” is an Italian word,meaning “STRONG FRIEND”.The English version of the name is “Hardwin”. As of May 2011,more than 300,000 Arduino units are “in the wild”. 1.2.1 Design Goals  Work with a Mac (as most design students use one)  USB connectivity (MacBooks don’t have serial ports  Look nice  Cheap (about 20 euros, the cost of going out for pizza in Europe)  More powerful than a BASIC stamp  Something you could build/fix yourself Simple and easy to use by someone without formal electronics training 1.2.2 Business Models
  • 14. Since the entire project is open source, anyone can build and sell Arduino-compatible devices. So in this sense, the Arduino project relies heavily on its branding for it’s financial success . Other projects manufacture compatible and cheaper boards, however people are loyal to the Arduino branded boards because they associate quality and a certain image to the final product . 1.2.2.1 By the Numbers Year Units Sold 2005 200 2006 10 000 2010 120 000 2011 300 000 1.2.3 Competitors Before Arduino, the largest players in the design/hobbyist market segment were the PIC microcontroller family (made by Microchip) and the BASIC Stamp (made by Parallax). Since the introduction of the Arduino, other large companies have tried to enter the hobbyist market, including Texas Instruments , and even Microsoft . However, the open-sourced toolsof the Arduino and the size of its community are large barriers for new platforms to overcome. 1.2.4 COMMUNITY Figure 3.1GOOGLE trends comparing ARDUINO with its biggest competitors
  • 15. As the project is aimed at students and hobbyists who may not have any formal electronics background, there are many excellent guides online covering everything from making a light blink to creating a laser harp. The official forum has almost 60 000 registered users, and along with helping users with their projects, is extremely active in developing new libraries to extend the functionality of the Arduino . The open-source share and share alike sentiment is very strong, and the vast majority of users freely publish the code to their projects. 1.3 PHYSICAL COMPUTING Physical Computing is an approach to learn how humans communicate through computers that starts by considering how humans express themselves physically. PLATFORM DESIGN FOR ARUINO 2.1 HARDWARE 2.1.1 ARDUINO Board Layout Figure 2.2: ARDUINO board layout 2.1.2 ARDUINO pin diagram
  • 16. Figure 3.3: ARDUINO pin diagram 2.1.2.1 ATmega328(Microcontroller)  16 MHz  8 Kbyte Flash RAM(1K taken by the boot loader)  1 Kbyte RAM(eg.for auto/local variables and stack)  14 digital Input/Output Ports Fig3.4: ATmega328 2.1.2.2 Single chip USB to async. Serial data transfer interface
  • 17.  USB 2.0 compatible  Transmit and receive TRANSMITTER frive signals  256 Byte receive,128 Byte transmit buffer  Data transfer rate from 300bits/sec to 2 Mb/sec 2.1.3 EXTERNAL power Fig 3.5: ARDUINO can run off with USB or EXTERNAL power source The power requirement for ARDUINO is 9 to 12V DC,250mA or more,2.1mm plug,centre pin positive. The OFF-the shelf adapter  must be a DC adapter (i.e. it has to put out DC, not AC)  should be between 9V and 12V DC  must be rated for a minimum of 250mA current output, although you will likely want something more like 500mA or 1A output, as it gives you the current necessary to power a servo or twenty TRANSMITTERs if you want to.  must have a 2.1mm power plug on the Arduino end, and  the plug must be "centre positive", that is, the middle pin of the plug has to be the + connection.
  • 18. Current rating: Since you'll probably be connecting other things to the Arduino (TRANSMITTERs, MONITORs, servos) you should get an adapter that can supply at least 500mA, or even 1000 mA (1 ampère). That way you can be sure you have enough juice to make each component of the circuit function reliably. The Arduino's on-board regulator can actually handle up to 20V or more, so you can actually use an adapter that puts out 20V DC. The reasons you don't want to do that are twofold: you'll lose most of that voltage in heat, which is terribly inefficient. Secondly, the nice 9V pin on the Arduino board will actually be putting out 20V or so, which could lead to potential disaster when you connect something expensive to what you thought was the 9V pin. Our advice is to stick with the 9V or 12V DC adapter. 2.1.4 ARDUINO flavors!! There have been many revisions of the USB Arduino.some of them are 1. Arduino UNO: This is the latest revision of the basic Arduino USB board. It connects to the computer with a standard USB cable and contains everything else you need to program and use the board. It can be extended with a variety of shields: custom daughter-boards with specific features. It is similar to the Duemilanove, but has a different USB-to-serial chip the ATMega8U2, and newly designed labeling to make inputs and outputs easier to identify. 2. Arduino Mega 2560: A larger, more powerful Arduino board. Has extra digital pins, PWM pins, analog inputs, serial ports, etc. The version of the Mega released with the Uno, this version features the Atmega2560, which has twice the memory, and uses the ATMega 8U2 for USB- to-serial communication.
  • 19. Fig3.6: ATmega2560 Basic Terminologies in ARDUINO: 1.Analog to digital converter(ADC) The process of Analog to digital conversion is shown in figure. The Arduino has 10 bits of Resolution when reading analog signals. 2 power 10=1024 increments 2.Pulse width modulation (PWM) The Arduino has 8bit of resolution,when outputting a signal using PWM.The range of output voltage is from 0 to 5 Volts 2power 8=255 Increments Average of on/off(digital signals to make an average voltage),Duty cycle in 100% of 5Volts. 2.3 LANGUAGE REFERENCES: The Microcontroller on the board is programmed using the Arduino programming language(based on wiring) and the arduino development environment(based on processing). 2.3.1 Arduino Programming Language(APL)(based on wiring) The Arduino programming language is an implementation of Wiring, a similar physical computing platform, which is based on the Processing multimedia programming environment. 2.3.1.1 Wiring Wiring is an open-source programming framework for microcontrollers. Wiring allows writing cross-platform software to control devices attached to a wide range of microcontroller boards to create all kinds of creative coding, interactive objects, spaces or physical experiences. The framework is thoughtfully created with designers and artists in mind to encourage a community where beginners through experts from around the world share ideas, knowTRANSMITTERge and their collective experience. There are thousands of students, artists, designers, researchers, and hobbyists who use Wiring for learning, prototyping, and finished professional work production. 2.3.2 Arduino development environment(based on processing)
  • 20. 2.3.2.1 Processing Processing is an open source programming language and environment for people who want to create images, animations, and interactions. Initially developed to serve as a software sketchbook and to teach fundamentals of computer programming within a visual context, Processing also has evolved into a tool for generating finished professional work. Today, there are tens of thousands of students, artists, designers, researchers, and hobbyists who use Processing for learning, prototyping, and production. APPLICATIONS OF ARDUINO Arduino was basically designes to make the process of using electronics in multidisciplinary projects more accessible.It is intended for artists,designers,hobbyists,and anyone interested in creating interactive objects or environments.Arduino can sense the environment by receiving input from a variety of sensors and can affect its surroundings by controlling lights,motors,and other actuators.because of these features,arduino finds extensive application in various fields.Arduino projects can be stand-alone or they can communicate with software running on a computer. Arduino received anHonarary Mention in Digital Communication section of the 2006 Ars Electronica Prix Arduino is used by all class of people in a different way.some students use it in their projects,some using arduino for fun,some went out to become entreupreuners.This only shows how useful is this tiny device. ARDUINO is spreading rapidly across the globe. Arduino is actually an open source hardware project that can be pro grammed to read temperatures, control a motor, and sense touch.theArduino is both a cute, blue micro controller platform that fits nicely in the palm of your hand and an expanding community of developers who support it, distributed across two dozen coun tries, four continents, and counting. The Arduino board is for anyone who wants to build a basic level of intelligence into an object. Once programmed, it can read sensors, make simple decisions, and control myriad devices in the real world. Using it is a snap: first, hook up a few sensors and output devices to the Arduino,
  • 21. then program it using the free developer’s software. Next, debug your code and disconnect the Arduino.Then,the little blue Arduino becomes a standalone computer. The original intention of the Arduino project was to see what would happen if community support were substituted for the corporate support that is usually required for electronics development. The first developers — Massimo Banzi, David Cuartielles, David Mellis, and Nicholas Zambetti — ran a series of workshops on assembling the Arduino, giving away the board to stimulate development. Thousands of projects have been done worldwide using this tiny little device.some of which to mention are:  Simple room temperature readout  Interactive real-time auditory feedback system  GPS receiver Module  Ultrasonic Sensor  Infrared detectors  SONAR  Various sensor projects like  Keypad security code  Sensor tube for heart monitor  Pulse rate monitor  Various light projects like  Multicolor light display  Seven-segment TRANSMITTER display  Double seven-segment TRANSMITTER dice  TRANSMITTER array  MONITOR module  Various sound projects like  Oscilloscope  Light harp  VU meter
  • 22.  Various power projects like  MONITOR Thermostat  Computer controlTRANSMITTER fan  The hypnotizer  Miscellaneous Projects like  Lie detector  Magnetic door lock  Infrared remote  Lilypad binary clock Just to name a few….as the trademark goes,there are nearly infinite possible projects using this tiny device,which we still yet to discover Some of the major applications are 3D printers,whos founder went out to become an euntreuprenuer,and major pride came to ARDUINO,when giant firm GOOGLE’s most ambitious ANDROID,deployed ARDUINO in its new venture “ANDROID OPEN ACCESSORY DEVELOPMENT KIT”.which allows external USB hardware to interact with an Android- powered device in a special accessory mode.ANDROID executive announced this in annual GOOGLE IO meet conference 2011.ANDROID calls that device made of arduino as ADK(Android development kit). Arduino also has won annual “2012 INTERACTION AWARD” sponsored by GOOGLE,for its extensive applications in various fields.
  • 23. CHAPTER-4 HARDWARE EQUIPMENTS RELAYS Introduction: A relay is an electrical switch that opens and closes under the control of another electrical circuit. In the original form, the switch is operated by an electromagnet to open or close one or many sets of contacts. A relay is able to control an output circuit of higher power than the input circuit, it can be considered to be, in a broad sense, a form of an electrical amplifier. Relays are usuallly SPDT (single pole double through switch)or DPDT (double pole double throughswitch) buttheycan have many more sets of switch contacts, for example relays with 4 sets of changeover contacts are readily available.
  • 24. Basic operation of a relay: An electric current through a conductor will produce a magnetic field at right angles to the direction of electron flow. If that conductor is wrapped into a coil shape, the magnetic field produced will be oriented along the length of the coil. The greater the current, the greater the strength of the magnetic field, all other factors being equal.
  • 25. Inductors react against changes in current because of the energy stored in this magnetic field. When we construct a transformer from two inductor coils around a common iron core, we use this field to transfer energy from one coil to the other. However, there are simpler and more direct uses for electromagnetic fields than the applications we've seen with inductors and transformers. The magnetic field produced by a coil of current-carrying wire can be used to exert a mechanical force on any magnetic object, just as we can use a permanent magnet to attract magnetic objects, except that this magnet (formed by the coil) can be turned on or off by switching the current on or off through the coil. If we place a magnetic object near such a coil for the purpose of making that object move when we energize the coil with electric current, we have what is called a solenoid. The movable magnetic object is called an armature, and most armatures can be moved with either direct current (DC) or alternating current (AC) energizing the coil. The polarity of the magnetic field is irrelevant for the purpose of attracting an iron armature. Solenoids can be used to electrically open door latches, open or shut valves, move robotic limbs, and even actuate electric switch mechanisms and is used to actuate a set of switch contacts Relays can be categorized according to the magnetic system and operation: Neutral Relays: This is the most elementary type of relay. The neutral relays have a magnetic coil, which operates the relay at a specified current, regardless of the polarity of the voltage applied.
  • 26. Biased Relays: Biased relays have a permanent magnet above the armature. The relay operates if the current through the coil winding establishes a magneto-motive force that opposes the flux by the permanent magnet. If the fluxes are in the same direction, the relay will not operate, even for a greater current through the coil. Polarized Relays: Like the biased relays, the polarized relays operate only when the current through the coil in one direction. But there the principle is different. The relay coil has a diode connected in series with it. This blocks the current in the reverse direction. The major difference between biased relays and polarized relays is that the former allows the current to pass through in the reverse direction, but does the not operate the relay and the later blocks the current in reverse direction. You can imagine how critical these properties when relays are connected in series to form logic circuits. Magnetic Stick Relays or Perm polarized Relays: These relays have a magnetic circuit with high permanence. Two coils, one to operate (pick up) and one to release (drop) are present. The relay is activated by a current in the operate coil. On the interruption of the current the armature remains in picked up position by the residual magnetism. The relay is released by a current through the release coil. Slow Release Relays: These relays have a capacitor connected in parallel to their coil. When the operating current is interrupted the release of relay is delayed by the stored charge in the capacitor. The relay releases as the capacitor discharges through the coil. Relays for AC: These are neutral relays and picked up for a.c. current through their coil. These are very fast in action and used on power circuits of the point motors, where high current flows through
  • 27. the contacts. A normal relay would be slow and make sparks which in turn may weld the contacts together. All relays have two operating values (voltages), one pick-up and the other other drop away. The pick-up value is higher than the drop away value. Applications:  To control a high-voltage circuitwithalow-voltage signal,asinsome types of modems or audio amplifiers,  To control a high-current circuit with a low-current signal, as in the starter solenoid of an automobile,  To detectand isolate faultsontransmissionanddistributionlinesby opening and closing circuit breakers (protection relays),  To isolate the controlling circuit from the controlled circuit when the two are at different potentials, for example when controlling a mains-powered device from a low-voltage switch. The latteris oftenappliedtocontrol office lightingasthe low voltage wiresare easilyinstalledin partitions, which may be often moved as needs change. They may also be controlled by room occupancy detectors in an effort to conserve energy,  To performlogicfunctions.Forexample,the booleanANDfunctionisrealisedbyconnectingNO relaycontacts inseries,the ORfunctionbyconnecting NOcontactsinparallel.The change-over or Form C contacts performthe XOR(exclusive or) function.SimilarfunctionsforNANDandNOR are accomplishedusingNCcontacts.The Ladder programminglanguage isoftenusedfor designingrelaylogicnetworks. o Early computing.Before vacuumtubesandtransistors,relayswere usedaslogical elementsin digital computers.See ARRA (computer),HarvardMark II, Zuse Z2, and Zuse Z3. o Safety-criticallogic.Because relaysare muchmore resistantthansemiconductors to nuclearradiation,theyare widelyusedinsafety-critical logic,suchasthe control panels of radioactive waste-handlingmachinery.  To performtime delayfunctions.Relayscanbe modifiedtodelayopeningordelayclosingaset of contacts.A veryshort(a fractionof a second) delaywoulduse acopperdiskbetweenthe
  • 28. armature and movingblade assembly.Currentflowinginthe diskmaintainsmagneticfieldfora short time,lengtheningrelease time.Foraslightlylonger(uptoa minute) delay,adashpotis used.A dashpotis a pistonfilledwithfluidthatisallowedtoescape slowly.The time periodcan be variedbyincreasingordecreasingthe flow rate.Forlongertime periods,amechanical clockworktimerisinstalled Ultra-Sonic Ranger Technical Specification Introduction The SRF05 is an evolutionary step from the SRF04, and has been designed to increase flexibility, increase range, and to reduce costs still further. As such, the SRF05 is fully compatible with the SRF04. Range is increased from 3 meters to 4 meters. A new operating mode (tying the mode pin to ground) allows the SRF05 to use a single pin for both trigger and echo, thereby saving valuable pins on your controller. When the mode pin is left unconnected, the SRF05 operates with separate trigger and echo pins, like the SRF04. The SRF05 includes a small delay before the echo pulse to give slower controllers such as the Basic Stamp and Picaxe time to execute their pulse in commands.
  • 29. Mode 1 - SRF04 compatible - Separate Trigger and Echo This mode uses separate trigger and echo pins, and is the simplest mode to use. All code examples for the SRF04 will work for the SRF05 in this mode. To use this mode, just leave the mode pin unconnected - the SRF05 has an internal pull up resistor on this pin.
  • 30. Mode 2 - Single pin for both Trigger and Echo This mode uses a single pin for both Trigger and Echo signals, and is designed to save valuable pins on embedded controllers. To use this mode, connect the mode pin to the 0v Ground pin. The echo signal will appear on the same pin as the trigger signal. The SRF05 will not raise the echo line until 700uS after the end of the trigger signal. You have that long to turn the trigger pin around and make it an input and to have your pulse measuring code ready. The PULSIN command found on many popular controllers does this automatically.
  • 31. Calculating the Distance The SRF05 Timing diagrams are shown above for each mode. You only need to supply a short 10uS pulse to the trigger input to start the ranging. The SRF05 will send out an 8 cycle burst of ultrasound at 40khz and raise its echo line high (or trigger
  • 32. line in mode 2). It then listens for an echo, and as soon as it detects one it lowers the echo line again. The echo line is therefore a pulse whose width is proportional to the distance to the object. By timing the pulse it is possible to calculate the range in inches/centimeters or anything else. If nothing is detected then the SRF05 will lower its echo line anyway after about 30mS. The SRF04 provides an echo pulse proportional to distance. If the width of the pulse is measured in uS, then dividing by 58 will give you the distance in cm, or dividing by 148 will give the distance in inches. uS/58=cm or uS/148=inches. The SRF05 can be triggered as fast as every 50mS, or 20 times each second. You should wait 50ms before the next trigger, even if the SRF05 detects a close object and the echo pulse is shorter. This is to ensure the ultrasonic "beep" has faded away and will not cause a false echo on the next ranging. The other set of 5 pins The 5 pins marked "programming pins" are used once only during manufacture to program the Flash memory on the PIC16F630 chip. The PIC16F630's programming pins are also used for other functions on the SRF05, so make sure you don't connect anything to these pins, or you will disrupt the modules operation. Changing beam pattern and beam width You can't! This is a question which crops up regularly, however there is no easy way to reduce or change the beam width that I'm aware of. The beam pattern of the SRF05 is conical with the width of the beam being a function of the surface area of the transducers and is fixed. The beam pattern of the transducers used on the SRF05, taken from the manufacturers data sheet, is shown below.
  • 33. BUZZER A buzzer or beeper is a signaling device, usually electronic, typically used in automobiles, household appliances such as a microwave oven, or game shows. It most commonly consists of a number of switches or sensors connected to a control unit that determines if and which button was pushed or a preset time has lapsed, and usually illuminates a light on the appropriate button or control panel, and sounds a warning in the form of a continuous or intermittent buzzing or beeping sound. Initially this device was based on an electromechanical system which was identical to an electric bell without the metal gong . Often these units were anchored to a wall or ceiling and used the ceiling or wall as a sounding board. Another implementation with some AC-connected devices was to implement a circuit to make the AC current into a noise loud enough to drive a loudspeaker and hook this circuit up to a cheap 8-ohm speaker. Nowadays, it is more popular to use a ceramic-based piezoelectric sounder like a Son alert which makes a high-pitched tone. Usually these were hooked up to "driver" circuits which varied the pitch of the sound or pulsed the sound on and off.
  • 34. In game shows it is also known as a "lockout system," because when one person signals ("buzzes in"), all others are locked out from signaling. Several game shows have large buzzer buttons which are identified as "plungers". The word "buzzer" comes from the rasping noise that buzzers made when they were electromechanical devices, operated from stepped-down AC line voltage at 50 or 60 cycles. Other sounds commonly used to indicate that a button has been pressed are a ring or a beep. LCD (Liquid Cristal Display) Introduction: A liquid crystal display (LCD) is a thin, flat display device made up of any number of color or monochrome pixels arrayed in front of a light source or reflector. Each pixel consists of a columnof liquidcrystal moleculessuspendedbetween two transparent electrodes, and two polarizing filters, the axes of polarity of which are perpendicular to each other. Without the liquid crystals between them, light passing through one would be blocked by the other. The liquid crystal twists the polarization of light entering one filter to allow it to pass through the other.
  • 35. A program must interact with the outside world using input and output devices that communicate directlywithahumanbeing.One of the mostcommondevicesattachedtoancontroller is an LCD display. Some of the most common LCDs connected to the contollers are 16X1, 16x2 and 20x2 displays. This means 16 characters per line by 1 line 16 characters per line by 2 lines and 20 characters per line by 2 lines, respectively. Many microcontrollerdevicesuse 'smartLCD' displaysto output visual information. LCD displays designedaroundLCDNT-C1611 module,are inexpensive,easytouse,andit iseven possible to produce a readoutusingthe 5X7 dotspluscursor of the display. Theyhave astandard ASCIIsetof characters and mathematical symbols. Foran 8-bitdata bus,the displayrequiresa +5V supply plus 10 I/O lines (RS RW D7 D6 D5 D4 D3 D2 D1 D0). For a 4-bit data bus it only requires the supply lines plus 6 extra lines(RS RW D7 D6 D5 D4). Whenthe LCD displayisnotenabled,datalinesare tri-state andtheydonotinterfere with the operation of the microcontroller. Features: (1) Interface with either 4-bit or 8-bit microprocessor. (2) Display data RAM (3) 80x (4) Character generator ROM (5). -matrix character patterns. (6). Character generator RAM (7) different user programmed 5 -matrix patterns. (8).Display data RAM and character generator RAM may be Accessed by the microprocessor. Shapes and S available. Line lengt
  • 36. (9) Numerous instructions (10) .Clear Display,Cursor Home,Display ON/OFF,Cursor ON/OFF, Blink Character,Cursor Shift,Display Shift. (11). Built-in reset circuit is triggered at power ON. (12). Built-in oscillator. Data can be placedat any locationonthe LCD. For16×1 LCD, the addresslocationsare: Fig : Address locations for a 1x16 line LCD
  • 37. Shapes and sizes: Even limited to character based modules,there is still a wide variety of shapes and sizes available. Line lenghs of 8,16,20,24,32 and 40 charecters are all standard, in one, two and four line versions. Several differentLCtechnologiesexists.“supertwist”types,forexample,offerImprovedcontrastand viewingangle overthe older“twistednematic”types.Somemodulesare available withbacklighting, so so that they can be viewed in dimly-lit conditions. The back lighting may be either “electro- luminescent”, requiring a high voltage inverter circuit, or simple LED illumination.
  • 39. PIN DESCRIPTION: Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins (two pins are extra in both for back-light LED connections). Fig: pin diagram of 1x16 lines lcd
  • 40. CONTROL LINES: EN: Line is called "Enable." This control line is used to tell the LCD that you are sending it data. To send data to the LCD, your program should make sure this line is low (0) 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 high (1) and wait for the minimum amount of time required by the LCD datasheet (this varies from LCD to LCD), and end by bringing it low (0) again. RS: Line is the "Register Select" line. 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 being sent is text data which sould be displayed on the screen. For example, to display the letter "T" on the screen you would set RS high. RW:
  • 41. 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 always be low. Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation selected by the user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1, DB2, DB3, DB4, DB5, DB6, and DB7. Logic status on control lines: • E - 0 Access to LCD disabled - 1 Access to LCD enabled • R/W - 0 Writing data to LCD - 1 Reading data from LCD • RS - 0 Instructions - 1 Character Writing data to the LCD: 1) Set R/W bit to low 2) Set RS bit to logic 0 or 1 (instruction or character) 3) Set data to data lines (if it is writing) 4) Set E line to high 5) Set E line to low Read data from data lines (if it is reading)on LCD:
  • 42. 1) Set R/W bit to high 2) Set RS bit to logic 0 or 1 (instruction or character) 3) Set data to data lines (if it is writing) 4) Set E line to high 5) Set E line to low Entering Text: First, a little tip: it is manually a lot easier to enter characters and commands in hexadecimal ratherthanbinary(although,of course,youwill needtotranslatecommands from binary couple of sub- miniature hexadecimalrotaryswitchesisasimple matter,althougha little bit into hex so that you know which bits you are setting). Replacing the d.i.l. switch pack with a of re-wiring is necessary. The switchesmustbe the type where On =0, so that when they are turned to the zero position, all four outputs are shorted to the common pin, and in position “F”, all four outputs are open circuit. All the available characters that are built into the module are shown in Table 3. Studying the table,youwill see thatcodesassociatedwiththe charactersare quotedinbinaryandhexadecimal, most significant bits (“left-hand” four bits) across the top, and least significant bits (“right-hand” four bits) down the left. Most of the characters conform to the ASCII standard, although the Japanese and Greek characters (and a few other things) are obvious exceptions. Since these intelligent modules were designedinthe “Landof the RisingSun,”itseemsonly fair that their Katakana phonetic symbols should alsobe incorporated.The more extensiveKanjicharacterset,whichthe Japanese sharewiththe Chinese, consisting of several thousand different characters, is not included! Usingthe switches,of whatever type, and referring to Table 3, enter a few characters onto the display, both letters and numbers. The RS switch (S10) must be “up” (logic 1) when sending the characters,andswitchE (S9) mustbe pressedforeachof them.Thusthe operationalorderis:setRShigh,
  • 43. enter character, trigger E, leave RS high, enter another character, trigger E, and so on. The first 16 codes in Table 3, 00000000 to 00001111, ($00 to $0F) refer to the CGRAM. This is the Character Generator RAM (random access memory), which can be used to hold user-defined graphics characters. This is where these modules really start to show their potential, offering such capabilities as bar graphs, flashing symbols, even animated characters. Before the user-defined characters are set up, these codes will just bring up strange looking symbols. Codes 00010000 to 00011111 ($10 to $1F) are not used and just display blank characters. ASCII codes “proper” start at 00100000 ($20) and end with 01111111 ($7F). Codes 10000000 to 10011111 ($80 to $9F) are not used, and 10100000 to 11011111 ($A0 to $DF) are the Japanese characters.
  • 44.
  • 46. If the power conditions for the normal operation of the internal reset circuit are not satisfied,thenexecutingaseriesof instructionsmust initialize LCDunit. The procedure for this initialization process is as above show. SWITCHES Introduction: A switch is a mechanical device used to connect and disconnect an electric circuit at will. Switches cover a wide range of types, from subminiature up to industrial plant switching megawatts of power on high voltage distribution lines. In applications where multiple switching options are required (e.g., a telephone service), mechanical switches have long been replaced by electronic switching devices which can be automated and intelligently controlled. The switch is referred to as a "gate" when abstracted to mathematical form. In the philosophy of logic, operational arguments are represented as logic gates. The use of electronic gates to function as a system of logical gates is the fundamental basis for the computer i.e. a computer is a system of electronic switches which function as logical gates. A railroad switch is not electrical, but a mechanical device to divert a train from one track to another.
  • 47. Three tactile switches.Majorscale isinches. Types ofswitches: A pair of contacts is said to be 'closed' when there is no space between them, allowing electricity to flow from one to the other. When the contacts are separated by an insulating air gap, an air space, they are said to be 'open', and no electricity can flow at typical voltages. Switches can be and are classified according to the arrangement of their contacts in electronics field, but electricians in the electrical wiring service business and their electrical supplier industries use different nomenclature, such as "one-way", "two-way", "three-way" and "four- way" switches. We have types of switches also,  SPST (single pole single through),  SPDT(single pole double through),  DPST(double pole single through),  DPDT (double pole double through)
  • 48. Make-before-break,break-before-make: In a multi-throw switch, there are two possible transient behaviors as you move from one position to another. In some switch designs, the new contact is made before the old contact is broken. This is known as make-before-break, and ensures that the moving contact never sees an open circuit (also referred to as a shorting switch). The alternative is break-before-make, where the old contact is broken before the new one is made. This ensures that the two fixed contacts are never shorted to each other. Both types of design are in common use, for different applications. Biased switches The momentary push-button switch is a type of biased switch. In this contact is made by spring. The most commontype isa push-to-makeswitch,whichmakescontactwhen the button is pressed and breaks when the button is released. A push-to-break switch, on the other hand, breaks contact when the buttonis pressedandmakescontactwhenitis released. An example of a push-to-break switch is a button used to release a door held open by an electromagnet. Changeover push button switches do exist but are even less common. Mercury tilt switch The mercury switch consists of a drop of mercury inside a glass bulb with 2 contacts. The two contacts pass through the glass, and are connected by the mercury when the bulb is tilted to make the mercury roll on to them. This type of switch performs much better than the ball tilt switch, as the liquid metal connection is unaffected by dirt, debris and oxidation, it wets the contacts ensuring a very low resistance bounce free connection, and movement and vibration do not produce a poor contact. Knife switch Knife switches are unique, because rather than employing an enclosed circuit connection area with a rubber- or plastic-insulated section for the user, the contacts and bridge are fully exposed. The "knife", a flat metal swinging arm, oscillates via user operation between a set of two or more
  • 49. contact areas. The knife and contacts are typically formed of copper, steel, or brass, depending on the application. Although knife switches are inferior to traditional switches in applications where user safety are paramount, knife switches are still commonly employed in everyday high- voltage applcations such as building transformers, large power relays, air-conditioning units, etc. Changeover switch A changeover switch provides two distinct events, the making of one contact and the breaking of the other. These can be used to feed the inputs of a flip-flop. This way the press will only be detected when the pressed contact is made and the release will only be detected when the released contact is made. When the switch is bouncing around in the middle no change is detected. To get a single logic signal from such a setup a simple SR latch can be used. Toggle switches are actuated by a lever angled in one of two or more positions. The common light switch used in household wiring is an example of a toggle switch. Most toggle switches will come to rest in any of their lever positions, while others have an internal spring mechanism returning the lever to a certain normal position, allowing for what is called "momentary" operation. Pushbutton switches are two-position devices actuated with a button that is pressed and released. Most pushbutton switches have an internal spring mechanism returning the button to its "out," or "unpressed," position, for momentary operation. Some pushbutton switches will latch alternately on or off with every push of the button. Other pushbutton switches will stay in their "in," or "pressed," position until the button is pulled back out. This last type of pushbutton switches usually have a mushroom-shaped button for easy push-pull action.
  • 50. Selector switches are actuated with a rotary knob or lever of some sort to select one of two or more positions. Like the toggle switch, selector switches can either rest in any of their positions or contain spring-return mechanisms for momentary operation. A joystick switch is actuated by a lever free to move in more than one axis of motion. One or more of several switch contact mechanisms are actuated depending on which way the lever is pushed, and sometimes by how far it is pushed. The circle-and-dot notation on the switch symbol represents the direction of joystick lever motion required to actuate the contact. Joystick hand switches are commonly used for crane and robot control. Some switches are specifically designed to be operated by the motion of a machine rather than by the hand of a human operator. These motion-operated switches are commonly called limit switches, because they are often used to limit the motion of a machine by turning off the actuating power to a component if it moves too far. As with hand switches, limit switches come in several varieties: These limit switches closely resemble rugged toggle or selector hand switches fitted with a lever pushed by the machine part. Often, the levers are tipped with a small roller bearing, preventing the lever from being worn off by repeated contact with the machine part.
  • 51. Proximity switches sense the approach of a metallic machine part either by a magnetic or high- frequency electromagnetic field. Simple proximity switches use a permanent magnet to actuate a sealed switch mechanism whenever the machine part gets close (typically 1 inch or less). More complex proximity switches work like a metal detector, energizing a coil of wire with a high- frequency current, and electronically monitoring the magnitude of that current. If a metallic part (not necessarily magnetic) gets close enough to the coil, the current will increase, and trip the monitoring circuit. The symbol shown here for the proximity switch is of the electronic variety, as indicated by the diamond-shaped box surrounding the switch. A non-electronic proximity switch would use the same symbol as the lever-actuated limit switch. Another form of proximity switch is the optical switch, comprised of a light source and photocell. Machine position is detected by either the interruption or reflection of a light beam. Optical switches are also useful in safety applications, where beams of light can be used to detect personnel entry into a dangerous area. In many industrial processes, it is necessary to monitor various physical quantities with switches. Such switches can be used to sound alarms, indicating that a process variable has exceeded normal parameters, or they can be used to shut down processes or equipment if those variables have reached dangerous or destructive levels. There are many different types of process switches: These switches sense the rotary speed of a shaft either by a centrifugal weight mechanism mounted on the shaft, or by some kind of non-contact detection of shaft motion such as optical or magnetic.
  • 52. Gas or liquid pressure can be used to actuate a switch mechanism if that pressure is applied to a piston, diaphragm, or bellows, which converts pressure to mechanical force. An inexpensive temperature-sensing mechanism is the "bimetallic strip:" a thin strip of two metals, joined back-to-back, each metal having a different rate of thermal expansion. When the strip heats or cools, differing rates of thermal expansion between the two metals causes it to bend. The bending of the strip can then be used to actuate a switch contact mechanism. Other temperature switches use a brass bulb filled with either a liquid or gas, with a tiny tube connecting the bulb to a pressure-sensing switch. As the bulb is heated, the gas or liquid expands, generating a pressure increase which then actuates the switch mechanism.
  • 53. CHAPTER-6 SOFTWARE IMPLEMMENTATION SOFTWARE The software used by the arduino is Arduino IDE. heArduino IDE is a cross-platform application written in Java, and is derived from the IDE for the Processing programming language and the Wiringproject. It is designed to introduce programming to artists and other newcomers unfamiliar with software development. It includes a code editor with features such as syntax highlighting, brace matching, and automatic indentation, and is also capable of compiling and uploading programs to the board with a single click. There is typically no need to edit makefiles or run programs on acommand-line interface. Although building on command-line is possible if required with some third-party tools such as Ino. The Arduino IDE comes with a C/C++ library called "Wiring" (from the project of the same name), which makes many common input/output operations much easier. Arduino programs are written in C/C++, although users only need define two functions to make a runnable program:  setup() – a function run once at the start of a program that can initialize settings  loop() – a function called repeatedly until the board powers off
  • 54. Figure 5.1 : A screenshot of the Arduino IDE showing the "Blink"program,a simple biginner program A typical first program for a microcontroller simply blinks a LED on and off. In the Arduino environment, the user might write a program like this: #define LED_PIN 13 void setup () { pinMode (LED_PIN, OUTPUT); // enable pin 13 for digital output } void loop () { digitalWrite (LED_PIN, HIGH); // turn on the LED delay (1000); // wait one second (1000 milliseconds) digitalWrite (LED_PIN, LOW); // turn off the LED delay (1000); // wait one second }
  • 55. For the above code to work correctly, the positive side of the LED must be connected to pin 13 and the negative side of the LED must be connected to ground. The above code would not be seen by a standard C++ compiler as a valid program, so when the user clicks the "Upload to I/O board" button in the IDE, a copy of the code is written to a temporary file with an extra include header at the top and a very simple main() function at the bottom, to make it a valid C++ program. The Arduino IDE uses the GNU toolchain and AVR Libc to compile programs, and uses avrdude to upload programs to the board. For educational purposes there is third party graphical development environment called Minibloq available under a different open source license. 2.3.3.1 language reference Arduino programs can be divided in three main parts: structure, values (variables and constants), and functions. Available datatypes in ARDUINO IDE are •void •boolean •char ( 0 – 255) •byte - 8 bit data ( 0 – 255) •int - 16-bit data (32,767 - -32,768) •long – 32 bit data (2,147,483,647 to -2,147,483,648) •float •double •string - char array •String - object
  • 56. •array Arithmetic operators Arithmetic operators include addition,subtraction,multiplication and division.For math that requires fractions,you can use float variables,if you can bear large size and slow computation speeds in your microcontroller. e.g. , y = y + 3; x = x – 7; i = j * 6; r = r / 5; Comparision operators Comparisons of one variable or constant against another are often used in if statements to test if a specified condition is true. e.g. , x == y // x is equal to y x != y // x is not equal to y x < y // x is less than y x > y // x is greater than y x <= y // x is less than or equal to y x >= y // x is greater than or equal to y Logical operators Logical operators are usually a way to logically combine two expressions and return a TRUE or FALSE depending on the operator. There are three logical operators, AND, OR, and NOT. e.g. , Logical AND: if (x > 0 && x < 5) // true only if both expressions are true Logical OR:
  • 57. if (x > 0 || y > 0) // true if either expression is true Logical NOT: if (!x > 0) // true only if expression TRUE/FALSE These are Boolean constants that define logic levels of the arduino. FALSE is easily defined as 0 (zero) TRUE is often defined as 1, but can also be anything else except zero. So in a Boolean sense, -1, 2, and -200 are all also defined as TRUE. e.g. , if (abcd== TRUE); { DoSomethingNice; } else { DoSomethingHorrible; } HIGH/LOW These constants define pin levels as HIGH or LOW and are used when reading or writing to digital pins. HIGH is defined as logic level 1, ON, or 5 volts LOW is logic level 0, OFF, or 0 volts. e.g. , digitalWrite(13, HIGH); INPUT/OUTPUT These constants define pin levels as HIGH or LOW and are used when reading or writing to digital pins.
  • 58. HIGH is defined as logic level 1, ON, or 5 volts LOW is logic level 0, OFF, or 0 volts. e.g. , pinmode(13, OUTPUT); 2.3.3.2 Arduino/processing language Comparision The Arduino language (based on Wiring) is implemented in C/C++, and therefore has some differences from the Processing language, which is based on Java. SIMULATOR for ARDUINO: The Arduino Simulator app gives the user the freedom to work without the basic setup of hardware and software. It is designed to be used by beginners and also, experienced developers, who want to quickly develop Arduino projects. The developer can make the necessary changes in the code - delay, pin number, and state - 0 (low) 1 (high) - and check it immediately. The app shows the breadboard, complete with 14 LED pins. You can drag and place the wires in the correct positions to connect to Arduino. If the wires are placed according to the code, then it will show the expected results. Once satisfied, you can save it and email it. The code can be copied and used in an actual project just as easily. This app is an easy way to work through Arduino projects. With customisable codes, and a simple to use interface, thisArduino Simulator app from Schogini Systems is a convenient app for Arduino developers. A screenshot of Arduino simulator is shown in the figure below
  • 59. Figure 3: screenshot of ARDUINO simulator CODE: #include<SoftwareSerial.h> #include<LiquidCrystal.h> LiquidCrystal lcd(2,3,4,5,6,7); int trigPin1=11; int echoPin1=12; int sw=10;
  • 60. int b=9; int r=13; long int distance,duration; unsigned char ch; int i,j; void setup() { Serial.begin(9600); pinMode(echoPin1,INPUT); pinMode(trigPin1,OUTPUT); pinMode(r,OUTPUT); pinMode(b,OUTPUT); pinMode(sw,INPUT_PULLUP); lcd.begin(16,2); lcd.print("WELCOME"); digitalWrite(r,LOW); digitalWrite(b,LOW); delay(2000); lcd.clear(); lcd.print("AUTOMATIC WATER");
  • 61. lcd.setCursor(0,1); lcd.print(" SYSTEM"); delay(2000); lcd.clear(); lcd.print("DISTANCE: cm"); } void loop() { SonarSensor(trigPin1,echoPin1); lcd.setCursor(10,0); lcd.print(" "); lcd.setCursor(11,0); lcd.print(distance); if(distance<20) { digitalWrite(r,HIGH); digitalWrite(b,LOW);
  • 62. lcd.setCursor(0,1); lcd.print("MOTOR ON "); } if(distance>20) { digitalWrite(r,LOW); digitalWrite(b,LOW); lcd.setCursor(0,1); lcd.print("MOTOR OFF"); } if(!digitalRead(sw)) { digitalWrite(r,HIGH); lcd.clear(); lcd.print("WATER LEAKAGE"); lcd.setCursor(0,1); lcd.print("plz check..."); while(1) { digitalWrite(b,HIGH);
  • 63. delay(500); digitalWrite(b,LOW); delay(500); } } delay(100); } void SonarSensor(int trigPin,int echoPin) { digitalWrite(trigPin, LOW); digitalWrite(trigPin, HIGH); delayMicroseconds(10); duration = pulseIn(trigPin, HIGH); distance = (duration/2); }
  • 64. ADVANTAGES AND APPLICATIONS ADVANTAGES: 1.Fully automation 2. contact less, water control 3. reduce the water wastage 4. reduce the health deceases by contacts 5. Shows the luxury model. APPLICATIONS: House hold appliances Gardens Plants irrigation Commercial applications Industries Hotels Forming
  • 65. CONCLUSION The advancements in science and technology are taking humanrace to the era of artificial intelligence and thereby reducing the human interaction with machines. The automatic water dispenser is such amachine which is capable of making the human work a lot easier. We can integrate this machine to the existing water purifiers and thereby we can eliminate the water spillage and this technique is far more hygienic as it eliminates the human touch from the process. This method can be implemented in the public water podium stands which are maintained by the government and eliminate the usage of water taps which are very in-efficient. The automatic water dispenser can be made more remotely using sensors
  • 66. REFERENCES [1]. Poonam J. Chavan, Manoj Mechkul “IoT Based Water quality Monitoring”, IJMTER Journal, Vol 3, 2016, pp.746-750. [2]. Aaina Venkateshwaran, Harsha Menda P. prof. Priti Bodar “An IoT based system for water quality monitoring” ,IJRCCE, 2017, pp. 2510-2515. [3]. Mithali Borbade, Shruthi Danve “Real Time Water Quality monitoring system” IJIRCE journal, Vol 3, 2015, water pp.5046- 5068. [4]. Anuradha T, Bhakti, Chitra R, pooja D. “IOT based low cost system for monitoring of water quality in real time”, International Research Journal of Engineering and Technology, Vol 05, Issue 05, pp. 1658-1663. [5]. Anuradha T. “The monitoring of water quality in IoT Environment”, IJSRT, March 2018, Volume 4, Issue 5, pp. [6]. Jyoti Bhatt, Jignesh Pataliya “IoT based water quality monitoring system”, IJIEE journal, Vol 4, 2016, pp. 44-48. [7]. S.Geeta, S.Goutham “Internet of Things enabled real time water quality monitoring system” springer open journal Vol 5, pp. 1-19, 2017. [8]. Pradeep Kumar M. Manisha J. Praveen Sha R. Proiserin V. Suganya Devi, “The real time monitoring of water quality in IoT Environment”, Vol 5, 2016, pp.4419-4427.