You are on page 1of 57

A MAJOR PROJECT REPORT ON

WATER TANK DEPTH SENSOR USING ARDUINO-LABVIEW


INTERFACE

Project report submitted in partial fulfillment of the requirement for the
Award of the Degree of

BACHELOR OF TECHNOLOGY
IN
ELECTRICAL & ELECTRONICS ENGINEERING

By
G.GIRI KUMAR 09241A0211
K.MOSES PAUL 09241A0219
C.SURESH KUMAR 10245A0203
K.J AGADEESH 10245A0205

UNDER THE GUIDANCE OF
Mrs. S.RADHIKA
Assistant professor











DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING
GOKARAJU RANGARAJU INSTITUTE OF ENGINEERING &
TECHNOLOGY
BACHUPALLY, HYDERABAD 500090


2012-2013

GOKARAJU RANGARAJU INSTITUTE OF ENGINEERING &
TECHNOLOGY

Hyderabad, Andhra Pradesh.



DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING



C E R T I F I C A T E

This is to certify that the project report entitled WATER TANK DEPTH SENSOR USING
ARDUINO-LABVIEW INTERFACE that is being submitted by Mr. G.GIRI KUMAR, Mr.
K.MOSES PAUL, Mr. C.SURESH KUMAR, Mr. K.JAGADEESH in partial fulfillment for
the award of the Degree of Bachelor of Technology in Electrical and Electronics Engineering
to the Jawaharlal Nehru Technological University as a record of bonafide work carried out by
them under my supervision. The results embodied in this project report have not been submitted
to any other University or Institute for the award of any graduation degree.


Prof. P.M.SARMA External Examiner Mrs. S. RADHIKA
HOD, EEE Assistant Professor, Internal guide
GRIET, Hyderabad GRIET, Hyderabad

ACKNOWLEDGEMENT
We would like to express our gratitude for all the people who extended unending support
at all stages of our project work.
This report is product of not only our sincere efforts but also the guidance and moral
support given by faculty of Electrical and electronics department, GRIET College.
We express our deep sense of gratitude and sincere thanks to Mr.P.S.RAJU, Director,
GRIET for giving such an opportunity.
We take immense pleasure in thanking Prof.P.M.Sharma, Head of the department of
Electrical and Electronics Engineering GRIET for having permitted us to carry out this project.
We express our sincere gratitude to our project guide Mrs.S.Radhika, Assistant
Professor, Department of Electrical and Electronics Engineering GRIET for sparing valuable
time in giving information & suggestions all through, for successful completion of the project.
We express our gratitude to Mr.E.Venkateshwarlu, Associate Professor, Project
Coordinator, Project Review Committee, GRIET for his valuable recommendations and for
accepting this project report.

By
G.GIRI KUMAR (09241A0211)
K.MOSES PAUL (09241A0219)
C.SURESH KUMAR (10245A0203)
K.JAGADEESH (10245A0205)


ABSTRACT

This paper presents the water tank depth sensor system design for measurement of water
level using arudino software. Here we used a float to measure the water resistance, and from that
measurement it calculates how full the tank is. This sensor switches ON the pump when the
water level in the tank goes low and switches it OFF as soon as the water level reaches a pre-
determined level. The sensor analog output is fed to the arduino board as a input signal. The
Arduino then reads the height of the water and reports the depth of the tank.
The same program is interfaced with labview and in the front panel of labview which we
can visually see the level of water tank and how the motor is ON and OFF depend on the water
level requirement.




i

CONTENTS
LIST OF CONTENTS PAGE NO
CHAPTER 1
INTRODUCTION 1
CHAPTER 2
COMPONENTS DESCRIPTION
2.1 LIST OF COMPONENTS 2
2.2 RELAY 2
2.3 FLOAT 5
2.4 PUMP 7
2.5 TRANSISTOR 9
2.6 RESISTOR 10
2.7 12V DC ADAPTER 11
2.8 7805 VOLTAGE REGULATOR 12
2.9 WATER TANKS 13
2.10 CONNECTING WIRES 15
CHAPTER 3
LABVIEW 16
CHAPTER 4
ARDUINO 19
CHAPTER 5
LABVIEW ARDUINO INTERFACE 24

ii

CHAPTER 6
BLOCK DIAGRAM AND CIRCUIT OPERATION
6.1 BLOCK DIAGRAM 28
6.2 WORKING PROCEDURE 29
CHAPTER 7
SIMULATION
7.1 LABVIEW CIRCUIT 30
7.2 HARDWARE CIRCUIT 31
7.3 LABVIEW FRONT PANEL 32
CHAPTER 8
ADVANTAGES AND APPLICATIONS
8.1 ADVANTAGES 35
8.2 APPLICATIONS 35
CHAPTER 9
DISCUSSIONS
9.1 CONCLUSION 36
9.2 SCOPE FOR RUTURE WORK 36
REFERENCES
APPENDIX



iii

LIST OF FIGURES PAGE NO
Fig 2.1 Internal relay circuit 3
Fig 2.2 Relay schematic 4
Fig 2.3 Relay 5
Fig 2.4 Float 6
Fig 2.5 Pump 7
Fig 2.6 Submersible pump 8
Fig 2.7 Transistor 9
Fig 2.8 Resistor 10
Fig 2.9 Adapter 11
Fig 2.10 Regulator 13
Fig 2.11 Water tank 14
Fig 2.12 Connecting wires 15
Fig 3.1 Labview Block Diagram 17
Fig 4.1 Arduino UNO board 21
Fig 4.2 Arduino IDE 23
Fig 6.1 Block diagram of water tank depth sensor 28
Fig 7.1 Labview circuit 30
Fig 7.2 Hardware circuit 31
Fig 7.3 Front panel of Labview 32





iv


LIST OF NOTATIONS AND SYMBOLS

AC - Alternate Current
DC - Direct Current
USB - Universal Serial Board
LED - Light Emitting Diode
VI - Virtual Instruments
IDE - Integrated Development Environment
PCB - Printed Circuit Board
PWM - Pulse Width Modulation
CMD - Command
GPM - Gallons per Minute
ESP - Electric Submersible Pump


1

CHAPTER 1
INTRODUCTION
Water is a precious resource in many parts of the world and many people rely on water
tanks to supplement their water supply by storing collected rainwater or water pumped from a
well or bore. But how do you measure how full a tank is? Tanks are constructed of opaque
material to prevent algae growth and are often kept closed up to prevent mosquito infestation or
access by rodents, so its inconvenient to physically look inside. And besides, having a way to
measure tank depth electronically opens up a world of possibilities, such as automatic control of
pumps to fill tanks when they get low or to disable irrigation systems when not enough water is
available.
During these days of high rise Buildings, apartments, Commercial houses and Industries,
it has become necessary to store water in overhead water storage tanks. Since water pressure in
most localities is not sufficient, water is pumped from ground level tank to overhead tank for
storage & use. It is very difficult for someone to monitor water level in ground and overhead
tanks and switch On OFF water pump accordingly. So a water level controller prevents overflow
& dry running of your water pump, thus saves water, electricity & manpower.
Here in this project we have assembled two bottles one above the other which represents
the underground tank and overhead tank respectively. The water level in the upper bottle is
controlled with the help of relay circuit using the arduino and lab view interfacing. A water level
sensing device in this case a float is placed in the upper tank to sense the water level. A pump is
placed in the lower tank to pump water to the overhead tank. Whenever the water in the upper
tank is beyond the determined level the arduino and lab view arrangement gives signal to the
relay circuit thus turning pump on and off according to the requirement.
Generally arduino alone is sufficient for the operation of the circuit. Lab view is used so
that the graphical and visual operation can be obtained.




2

CHAPTER 2
COMPONENTS DESCRIPTION

2.1 LIST OF COMPONENTS
1. Relay
2. Float
3. Pump
4. Transistor
5. Resistor
6. 12V Adapter
7. 7805 Voltage regulator
8. Water tanks
9. Connecting wires
10. PCB
2.2 RELAY:
A relay is an electrically operated switch. Many relays use an electromagnet to operate a
switching mechanism mechanically, but other operating principles are also used. Relays are used
where it is necessary to control a circuit by a low-power signal, or where several circuits must be
controlled by one signal. The first relays were used in long distance telegraph circuits, repeating
the signal coming in from one circuit and re-transmitting it to another. Relays were used
extensively in telephone exchanges and early computers to perform logical operations.
A type of relay that can handle the high power required to directly control an electric
motor or other loads is called a contactor. Solid-state relays control power circuits with
no moving parts, instead using a semiconductor device to perform switching. Relays with

3

calibrated operating characteristics and sometimes multiple operating coils are used to protect
electrical circuits from overload or faults; in modern electric power systems these functions are
performed by digital instruments still called "protective relays".
A simple electromagnetic relay consists of a coil of wire wrapped around a soft iron core,
an iron yoke which provides a low reluctance path for magnetic flux, a movable iron armature,
and one or more sets of contacts (there are two in the relay pictured). The armature is hinged to
the yoke and mechanically linked to one or more sets of moving contacts. It is held in place by
a spring so that when the relay is de-energized there is an air gap in the magnetic circuit. In this
condition, one of the two sets of contacts in the relay pictured is closed, and the other set is open.
Other relays may have more or fewer sets of contacts depending on their function. The relay in
the picture also has a wire connecting the armature to the yoke. This ensures continuity of the
circuit between the moving contacts on the armature, and the circuit track on the printed circuit
board (PCB) via the yoke, which is soldered to the PCB.

Fig 2.1 Internal relay circuit
When an electric current is passed through the coil it generates a magnetic field that
activates the armature and the consequent movement of the movable contacts either makes or
breaks (depending upon construction) a connection with a fixed contact. If the set of contacts
was closed when the relay was de-energized, then the movement opens the contacts and breaks
the connection, and vice versa if the contacts were open. When the current to the coil is switched
off, the armature is returned by a force, approximately half as strong as the magnetic force, to its

4

relaxed position. Usually this force is provided by a spring, but gravity is also used commonly in
industrial motor starters. Most relays are manufactured to operate quickly. In a low-voltage
application this reduces noise; in a high voltage or current application it reduces arcing.

Fig 2.2 Relay schematic

When the coil is energized with direct current, a diode is often placed across the coil to
dissipate the energy from the collapsing magnetic field at deactivation, which would otherwise
generate a voltage spike dangerous to semiconductor circuit components. Some automotive
relays include a diode inside the relay case. Alternatively, a contact protection network
consisting of a capacitor and resistor in series (snubber circuit) may absorb the surge. If the coil
is designed to be energized with alternating current (AC), a small copper "shading ring" can be
crimped to the end of the solenoid, creating a small out-of-phase current which increases the
minimum pull on the armature during the AC cycle.
A solid-state relay uses a thyristor or other solid-state switching device, activated by the
control signal, to switch the controlled load, instead of a solenoid. An optocoupler (a light-
emitting diode (LED) coupled with a photo transistor) can be used to isolate control and
controlled circuits.


5


Fig 2.3 Relay
JQC-3FC RELAY RATINGS:

MAX. SWITCHING CURRENT: 7A, 10A
MAX. SWITCHING VOLTAGE: 28V DC/ 250V AC
DIELECTRIC STRENGTH VR.M.S: BETWEEN OPEN CONTACTS: 750VAC
BETWEEN COIL AND CONTACTS =1000VAC
BETWEEN CONTACTS FORM =1000VAC
AMBIENT TEMPERATURE: -40-+85oC
OPERATION/RELEASE TIME: =10/8MS
CONTACT CAPACITY: 10A 125V, 7A 250V.

2.3 FLOAT:
A float is a device used to measure the level of water in the water tank. It consists of a
fixed contact and moving contact. The fixed contact is fixed to the tank and the moving contact
moves up and down based on the level of water. The switch may be used in a pump, an indicator,
an alarm, or other devices.

6


Fig 2.4 Float
Float switches range from small to large and may be as simple as a mercury switch inside
a hinged float or as complex as a series of optical or conductance sensors producing discrete
outputs as the liquid reaches many different levels within the tank. Perhaps the most common
type of float switch is simply a float raising a rod that actuates a micro-switch.
A very common application is in sump pumps and condensate pumps where the switch
detects the rising level of liquid in the sump or tank and energizes an electrical pump which then
pumps liquid out until the level of the liquid has been substantially reduced, at which point the
pump is switched off again. Float switches are often adjustable and can include substantial
hysteresis. That is, the switch's "turn on" point may be much higher than the "shut off" point.
This minimizes the on-off cycling of the associated pump.
Some float switches contain a two-stage switch. As liquid rises to the trigger point of the
first stage, the associated pump is activated. If the liquid continues to rise (perhaps because the
pump has failed or its discharge is blocked), the second stage will be triggered. This stage may
switch off the source of the liquid being pumped, trigger an alarm, or both.


7

2.4 SUBMERSIBLE PUMP:
A submersible pump (or electric submersible pump (ESP)) is a device which has
a hermetically sealed motor close-coupled to the pump body. The whole assembly is submerged
in the fluid to be pumped. The main advantage of this type of pump is that it prevents pump
cavitation, a problem associated with a high elevation difference between pump and the fluid
surface. Submersible pumps push fluid to the surface as opposed to jet pumps having to pull
fluids. Submersibles are more efficient than jet pumps.

Fig 2.5 Pump
WORKING PRINCIPLE:
The submersible pumps used in ESP installations are multistage centrifugal pumps
operating in a vertical position. Although their constructional and operational features underwent
a continuous evolution over the years, their basic operational principle remained the same.
Produced liquids, after being subjected to great centrifugal forces caused by the high rotational
speed of the impeller, lose their kinetic energy in the diffuser where a conversion of kinetic to
pressure energy takes place. This is the main operational mechanism of radial and mixed flow
pumps.


8


Fig 2.6 Submersible Pump
The pump shaft is connected to the gas separator or the protector by a mechanical
coupling at the bottom of the pump. Well fluids enter the pump through an intake screen and are
lifted by the pump stages. Other parts include the radial bearings (bushings) distributed along the
length of the shaft providing radial support to the pump shaft turning at high rotational speeds.
An optional thrust bearing takes up part of the axial forces arising in the pump but most of those
forces are absorbed by the protectors thrust bearing.
APPLICATIONS:
Submersible pumps are found in many applications. Single stage pumps are used for
drainage, sewage pumping, general industrial pumping and slurry pumping. They are also
popular with aquarium filters. Multiple stage submersible pumps are typically lowered down
a borehole and used for water abstraction, water wells and in oil wells.
Submersible pumps are used in applications:
Sewage treatment plants
Seawater handling

9

Groundwater pumping
Mine dewatering
Irrigation systems
Water supply systems.
2.5 TRANSISTOR:
A transistor is a semiconductor device used to amplify and switch electronic signals and
electrical power. It is composed of semiconductor material with at least three terminals for
connection to an external circuit. A voltage or current applied to one pair of the transistor's
terminals changes the current through another pair of terminals. Because the controlled
(output) power can be higher than the controlling (input) power, a transistor can amplify a signal.
Today, some transistors are packaged individually, but many more are found embedded
in integrated circuits.
The transistor is the fundamental building block of modern electronic devices, and is
ubiquitous in modern electronic systems. Following its development in the early 1950s, the
transistor revolutionized the field of electronics, and paved the way for smaller and
cheaper radios, calculators, and computers, among other things. Transistors are manufactured in
different shapes but they have three leads (legs). They are Base, Emitter and Collector. The
diagram below shows the symbol of an NPN transistor.


Fig 2.7 Transistor
Transistors can be regarded as a type of switch, as can many electronic components.
They are used in a variety of circuits. They are central to electronics and there are two main

10

types; NPN and PNP. Most circuits tend to use NPN. There are hundreds of transistors which
work at different voltages but all of them fall into these two categories.
2.6 RESISTOR:
A resistor is a passive two-terminal electrical component that implements electrical
resistance as a circuit element. The current through a resistor is in direct proportion to
the voltage across the resistor's terminals. This relationship is represented by Ohm's law:

where I is the current through the conductor in units of amperes, V is the potential difference
measured across the conductor in units of volts, and R is the resistance of the conductor in units
of ohms.


Fig 2.8 Resistor

The ratio of the voltage applied across a resistor's terminals to the intensity of current in the
circuit is called its resistance, and this can be assumed to be a constant (independent of the
voltage) for ordinary resistors working within their ratings.
Resistors are common elements of electrical networks and electronic circuits and are
ubiquitous in electronic equipment. Practical resistors can be made of various compounds and
films, as well as resistance wire (wire made of a high-resistivity alloy, such as nickel-chrome).

11

Resistors are also implemented within integrated circuits, particularly analog devices, and can
also be integrated into hybrid and printed circuits.
2.7 12V ADAPTER:
The AC adapter, AC/DC adapter or AC/DC converter is a type of external power supply,
often enclosed in a case similar to an AC plug. Other names include plug pack, plug-in
adapter, adapter block, domestic mains adapter, line power adapter, wall wart, or power adapter.
AC adapters are used with electrical devices that require power but do not contain internal
components to derive the required voltage and power from mains power. The internal circuitry of
an external power supply is very similar to the design that would be used for a built-in or internal
supply.

Fig 2.9 Adapter
External power supplies are used both with equipment with no other source of power and
with battery-powered equipment, where the supply, when plugged in, can sometimes charge the
battery in addition to powering the equipment. Use of an external power supply allows
portability of battery-powered equipment without the added bulk of internal power components
and makes it unnecessary to produce equipment for use only with a specified power source.
External AC adapters are widely used to power small or portable electronic devices. The
advantages include:
Safety External power adapters can free product designers from worrying about some
safety issues. Much of this style of equipment uses only voltages low enough not to be
a safety hazard internally, although the power supply must out of necessity use dangerous
mains voltage. If an external power supply is used (usually via a power connector, often of
coaxial type), the equipment need not be designed with concern for hazardous voltages

12

inside the enclosure. This is particularly relevant for equipment with lightweight cases which
may break and expose internal electrical parts.
Heat reduction Heat reduces reliability and longevity of electronic components, and can
cause sensitive circuits to become inaccurate or malfunction. A separate power supply
removes a source of heat from the apparatus.
Electrical noise reduction Because radiated electrical noise falls off with the square of the
distance, it is to the manufacturer's advantage to convert potentially noisy AC line power or
automotive power to "clean", filtered DC in an external adapter, at a safe distance from
noise-sensitive circuitry.
Weight and size reduction Removing power components and the mains connection plug
from equipment powered by rechargeable batteries reduces the weight and size which must
be carried.
Ease of replacement Power supplies are more prone to failure than other circuitry due to
their exposure to power spikes and their internal generation of waste heat. External power
supplies can be replaced quickly by a user without the need to have the powered device
repaired.
Configuration versatility Externally powered electronic products can be used with
different power sources as needed (e.g. 120VAC, 240VAC, 12VDC, or external battery
pack), for convenient use in the field, or when traveling.
2.8 7805 VOLTAGE REGULATOR:
A voltage regulator is a system used to maintain a steady voltage. The resistance of the
regulator varies in accordance with the load resulting in a constant output voltage. The regulating
device is made to act like a variable resistor, continuously adjusting a voltage divider network to
maintain a constant output voltage, and continually dissipating the difference between the input
and regulated voltages as waste heat. By contrast, a switching regulator uses an active device that
switches on and off to maintain an average value of output. Because the regulated voltage of a
linear regulator must always be lower than input voltage, efficiency is limited and the input
voltage must be high enough to always allow the active device to drop some voltage.

13



Fig 2.10 Regulator
Linear regulators may place the regulating device between the source and the regulated
load ( a series regulator), or may place the regulating device in parallel with the load (shunt
regulator). Simple linear regulators may only contain a Zenar diode and a series resistor; more
complicated regulators include separate stages of voltage reference, error amplifier and power
pass element. Because a linear voltage regulator is a common element of many
devices, integrated circuit regulators are very common; linear regulators may also be made up of
assemblies of discrete solid-state or vacuum tube components.

2.9 WATER TANK:
A water tank is a container for storing water. The need for a water tank is as old as
civilized man, providing storage of water for drinking water, irrigation-agriculture, fire-
suppression, agricultural farming both for plants and livestock, chemical manufacturing, food
preparation as well as many other applications.
Throughout history, wood, ceramic and stone have been used as water tanks. These were
all naturally occurring and manmade and some tanks are still in service. Various materials are
used for making a water tank are plastic (polyethylene, polypropylene), fiberglass,
concrete, stone, steel (welded or bolted, carbon, or stainless), Earthen ponds function as water
storage.


14



Fig 2.11 Water tank
Water tank parameters include the general design of the tank, choice of materials of
construction, as well as the following.
1. Location of the water tank (indoors, outdoors, above ground or underground)determines color
and construction characteristics.
2. Volume of water tank will need to hold to meet design requirements.
3. Purpose for which the water will be used, human consumption or industrial determines
concerns for materials that do not have side effects for humans.
4. Temperature of area where water will be stored, may create concern for freezing and delivery
of off setting heat.
5. Delivery pressure requirements, domestic pressures range from 35-60 PSI, the demand for a
given gpm (gallons per minute) of delivered flow requirements.

15

6. How is the water to be delivered to the point of use, into and out of the water tank i.e. pumps,
gravity or reservoir.
7. Wind and Earthquake design considerations allow a design of water tank parameters to
survive seismic and high wind events.
8. Back flow prevention, are check valve mechanisms to allow single direction of water flow,
9. Chemical injection systems for algae, bacteria and virus control to allow long term storage of
water.
10. Algae in water tanks can be mitigated by removing sunlight from access to the water being
stored.
2.10 CONNECTING WIRES:
A wire is a single, usually cylindrical, flexible strand or rod of metal. Wires are used to
bear mechanical loads and to carry electricity and telecommunications signals. Wire is
commonly formed by drawing the metal through a hole in a die or draw plate. Standard sizes are
determined by various wire gauges. The term wire is also used more loosely to refer to a bundle
of such strands, as in 'multi-stranded wire', which is more correctly termed a wire rope in
mechanics, or a cable in electricity.

Fig 2.12 Connecting wires
Although usually circular in cross-section, wire can be made in square, hexagonal,
flattened rectangular, or other cross-sections, either for decorative purposes, or for technical
purposes such as high-efficiency voice coils in loudspeakers. Edge-wound coil springs, such as
the Slinky toy, are made of special flattened wire.

16

CHAPTER 3
LABVIEW
LabVIEW is a graphical programming language for instrumentation, data-acquision &
analysis, automation & control and communication. LabVIEW is a program development
application, much like various commercial C/C++, FORTRAN or BASIC development systems.
However, LabVIEW uses graphical programming language, G, to create programs allowing the
program to be in a "Block Diagram" form. This creates excellent GUI capabilities built-in in
LabVIEW programs.
LabVIEW is the software that was used to interface the computer with the control device.
It allows for easy interfacing and control because of the fundamental concept behind which it has
been developed, that is, graphical programming. In order to interface the parallel port of the
computer with the drive control hardware, and ultimately, the synchro pair, National Instruments
LabVIEW was used. LabVIEW is an acronym for: Laboratory Virtual Instrumentation
Engineering Workbench.
The programs written in LabVIEW are called "Virtual Instruments" or VIs due to the
instrumentation-related origin. The programs created are independent of the type of machine that
they are created for so programs can be transferred between different operating systems.
Additionally LabVIEW has a large set of built-in mathematical functions and graphical data
visualization and data input objects typically found in data acquisition and analysis applications.
You can write most of your "code" with only the mouse. If structured "properly", this "code" can
pass as your flow chart.
The advantage of using graphical programming as in LabVIEW is that it avoids the
user having to go into the programming aspect of the required action. Users can place graphical
representations of hardware by examining their respective hardware drivers or dynamic link
libraries (dlls). Each VI has two components: a block diagram and a front panel as shown in
Figure. The front panel can be run either as a program, prompting the user for input, or as a
function if it is implemented on another block diagram.

17


Fig 3.1 Labview Block Diagram
BENEFITS:
The main benefit of LabVIEW over other development environments is the extensive
support for accessing instrumentation hardware. Drivers and abstraction layers for many
different types of instruments and buses are included or available. These present themselves as
easy-to-use graphical nodes. The abstraction layers allow isolation between hardware
implementation and software solution. Without the provided software driver interfaces, this
would be extremely time consuming. The sales pitch of National Instruments is therefore that
people with little or no coding experience can write programs and deploy test solutions in a
reduced time frame when compared to more conventional or competing systems. The main
competitor for instrument control and data acquisition is perhaps Agilent VEE. An alternative
driver framework for Linux is the Comedi driver library. TCL with the TK add-on is also used
for the same applications as LabVIEW, on both Linux and Windows platforms.
In terms of performance, LabVIEW includes an actual compiler that produces native
code for the CPU platform. The graphical code is compiled, rather than interpreted. Compilation
occurs on saving the VIs (Or upon compiling to an executable of course - see application builder

18

below)), as the graphical code of a VI is being edited is executed. The generated code can be
somewhat slower than equivalent compiled C code, although the differences often lie more with
the reduced optimization possibilities than inherent execution speed. However this is considered
a small price to pay for the increased productivity offered by the unique patented graphical code
design system.
Some features of LabVIEW:
1. Graphical programming called as "G" language.
2. Real time visual debugging features.
3. Simple file input-output operations.
4. A wealth of visual debugging tools.
5. "Plug-and-play" interface devices for most types of an external equipment.
6. Built in drivers and function libraries for the serial, parallel and network computer ports.
7. Data-flow-controlled execution, as compared to sequential execution of text-line based
languages.
8. Add-on software packages for specific extension of the program features, for instance
image processing.
9. Built-in interactive graphic control and display.
10. Direct program portability (binary files) between different Platforms: PCs, Macintosh,
HP-UX, and operating systems.








19

CHAPTER 4
ARDUINO
Arduino is an open-source single-board microcontroller, descendant of the open-source
Wiring platform, designed to make the process of using electronics in multidisciplinary projects
more accessible. The hardware consists of a simple open hardware design for the Arduino board
with an Atmel AVR processor and on-board input/output support. The software consists of a
standard programming language compiler and the boot loader that runs on the board. Arduino
hardware is programmed using a Wiring-based language (syntax and libraries), similar to C++
with some slight simplifications and modifications, and a Processing-based integrated
development environment. Current versions can be purchased pre-assembled; hardware design
information is available for those who would like to assemble an Arduino by hand. Additionally,
variations of the Italian-made Arduinowith varying levels of compatibilityhave been
released by third parties; some of them are programmed using the Arduino software.
The original Arduino hardware is manufactured by the Italian company Smart
Projects. Some Arduino-branded boards have been designed by the American
company SparkFun Electronics.
Sixteen versions of the Arduino hardware have been commercially produced to date:
1. The Serial Arduino, programmed with a DE-9 serial connection and using an ATmega8
2. The Arduino Extreme, with a USB interface for programming and using an ATmega8
3. The Arduino Mini, a miniature version of the Arduino using a surface-
mounted ATmega168
4. The Arduino Nano, an even smaller, USB powered version of the Arduino using a
surface-mounted ATmega168 (ATmega328 for newer version)
5. The LilyPad Arduino, a minimalist design for wearable application using a surface-
mounted ATmega168
6. The Arduino NG, with a USB interface for programming and using an ATmega8
7. The Arduino NG plus, with a USB interface for programming and using an ATmega168

20

8. The Arduino Bluetooth, with a Bluetooth interface for programming using an
ATmega168
9. The Arduino Diecimila, with a USB interface and utilizes an ATmega168 in a DIP28
package (pictured)
10. The Arduino Duemilanove ("2009"), using the ATmega168 (ATmega328 for newer
version) and powered via USB/DC power, switching automatically
11. The Arduino Mega, using a surface-mounted ATmega1280 for additional I/O and
memory.
12. The Arduino UNO, uses the same ATmega328 as late-model Duemilanove, but whereas
the Duemilanove used an FTDI chipset for USB, the Uno uses an ATmega8U2
programmed as a serial converter.
13. The Arduino Mega2560, uses a surface-mounted ATmega2560, bringing the total
memory to 256 kB. It also incorporates the new ATmega8U2 (ATmega16U2 in revision
3) USB chipset.
14. The Arduino Leonardo, with an ATmega32U4 chip that eliminates the need
for USB connection and can be used as a virtual keyboard or mouse. It was released at
the Maker Faire Bay Area 2012.
15. The Arduino Esplora, resembling a video game controller, with a joystick and built-in
sensors for sound, light, temperature, and acceleration.
16. The Arduino Due is a microcontroller board based on the Atmel SAM3X8E ARM
Cortex-M3 CPU. It is the first Arduino board based on a 32-bit ARM core
microcontroller.

21


Fig 4.1 Arduino UNO Board
The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It has 14
digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a
16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset button.
It contains everything needed to support the microcontroller; simply connect it to a computer
with a USB cable or power it with a AC-to-DC adapter or battery to get started. The Uno differs
from all preceding boards in that it does not use the FTDI USB-to-serial driver chip. Instead, it
features the Atmega16U2 (Atmega8U2 up to version R2) programmed as a USB-to serial
converter.
The Arduino Uno can be powered via the USB connection or with an external power supply. The
power source is selected automatically.

22

External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery.
The adapter can be connected by plugging a 2.1mm center-positive plug into the board's power
jack. Leads from a battery can be inserted in the Gnd and Vin pin headers of the POWER
connector.
The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V,
however, the 5V pin may supply less than five volts and the board may be unstable. If using
more than 12V, the voltage regulator may overheat and damage the board. The recommended
range is 7 to 12 volts.
It is a feature of most Arduino boards that they have an LED and load resistor connected
between pin 13 and ground, a convenient feature for many simple tests. 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. As the Arduino platform uses Atmel microcontrollers
Atmels development environment, AVR Studio or the newer Atmel Studio, may also be used to
develop software for the Arduino.
SOFTWARE:
The Arduino integrated development environment (IDE) is a cross-platform application
written in Java, and is derived from the IDE for the Processing programming language and
the Wiring projects. 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 make
files or run programs on a command-line interface.


23


Fig 4.2 Arduino IDE


Developer(s)


Arduino Software
Stable release
1.0.3 / December 10, 2012; 3
months ago
Written in Java, C and C++
Operating system Cross-platform
Type
Integrated development
environment
License LGPL or GPL license
Website arduino.cc
Arduino programs are written in C or C++. The Arduino IDE comes with a software
library called "Wiring" from the original Wiring project, which makes many common
input/output operations much easier. Users only need define two functions to make a
runnable cyclic executive 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

24

CHAPTER 5
LABVIEW ARDUINO INTERFACE
The LabVIEW Interface for Arduino (LIFA) provides an interface between LabVIEW and an
Arduino. LIFA was developed and tested using an Arduino Uno but should work with most
Arduino compatible hardware. The LabVIEW Interface for Arduino includes opens source
firmware for the Arduino as well as over 100 VIs to access the Arduino functionality from within
LabVIEW. LIFA is a tethered solution and requires a data connection between LabVIEW and
the Arduino at all times. This is typically accomplished via USB but can also be accomplished
using Xbees or bluetooth. LIFA does not allow the user to deploy LabVIEW code the Arduino.
ARDUINO FIRMWARE:
After installing LIFA the Arduino firmware can be found in <LabVIEW>\vi.lib\LabVIEW
Interface for Arduino\Firmware\LIFA_Base\LIFA_Base.ino. The firmware consists of two
main functions:
syncLV()
syncLV() is called in the setup function and establishes the connection between the Arduino and
LabVIEW. This function should only be called once when the Arduino boots.
Check For Command();
Check For Command() is called repeatedly inside the main loop of the Arduino sketch. This
command checks the Arduino serial buffer for data from LabVIEW. If a full packet is available
this command will process the packet and send the appropriate response to LabVIEW.


25

Check For Command() is implemented in LabVIEWInterface.ino and simply checks to see if a
full packet (15 bytes by default) is available in the Arduino serial buffer. If a full packet exists in
the buffer check For Command() calls:
Process Command()
The process Command() function reads the packet from the Arduino serial buffer, checks to
make sure all data was received correctly, and then processes the packet based on the CMD byte
(second byte of the packet) using a large case structure. Each case corresponds to a command
from LabVIEW and executes the appropriate Arduino functions before returning the expected
value(s) to LabVIEW.

STEPS FOR INSTALLATION:
Firstly install VI Package Manager
Here for installation Internet should be available throughout the installation process
After installing VI Package Manager, there it searches various options
Then we get a option of Lab view interface for Arduino, Now we have to install it
After installation we get the Icon of Labview beside Arduino interface for Arduino
Now, we have to open Labview 2012,We get the option of Arduino by Right click on
Front panel of Labview2012
Then We have to open Lab view2012 and connect the Required circuit using Adriano in
Labview2012 with proper input output(Read/write)







26

CHECKING SERIAL PORT OF ARDUINO:

MY COMPUTER

MANAGER

DEVICE MANAGER

SERIAL PORT

COM

SCAN

UPGRADE DRIVER

SAVE
STEPS FOR CODING:

MY COMPUTER

PROGRAM FILES

NATIONAL INSTRUMENTS

LAB VIEW 2012

27


VI.LIB

LAB VIEW INTERFACE

FIRMWARE

LIFA BASE

OPEN LIFABASE


GO TO TOOLS


SERIAL PORT


SELECT COM


VERIFY


UPLOAD







28

CHAPTER 6
BLOCK DIAGRAM AND OPERATION

6.1 BLOCK DIAGRAM

Fig 6.1Block diagram of water tank depth sensor




29

6.2 EXPLANATION:
1. LabVIEW is a software installed in a PC or LAPTOP with Arduino interface.
2. Pump is fixed in sump filled with water, a float is attached to the overhead tank.
3. The float senses the water level and gives reference voltage to arduino.
4. This reference voltage is the water level of the tank.
5. This signal is fed to the labview as a input, there the signal is compared with minimum
and maximum levels.
6. The output of labview is fed to the digital write of arduino as a input signal.
7. The output of digital write is given as a signal to the base of transistor.
8. The transistor controls the relay based on the signal, the relay turns ON and OFF the
motor based on the level of water.
9. The pump turns ON when the water level is low and turns OFF when the water level
reaches to a maximum level.
10. Again the pump turns ON when the water level reaches to a minimum level.










30

CHAPTER 7
SIMULATION
7.1 SIMULATION CIRCUIT:

Fig 7.1 Labview circuit

31


7.2 HARDWARE CIRCUIT:

Fig 7.2 Hardware circuit






32


7.3 LABVIEW FRONT PANEL:

At zero water level

Fig 7.3 front panel of labview





33

When the pump turns ON

Fig 7.4 When the Pump turns ON




34

When Pump turns OFF at maximum level

Fig 7.5 When the Pump turns OFF





35

CHAPTER 8
ADVANTAGES AND APPLICATIONS
8.1 ADVANTAGES:
No Man power required to operate, as fully automatic
Easy installation and Low maintenance
Advance Technology and simple to use
Saves water, motor and energy
Increases pump life.
Avoids seepage of water from roofs & walls due to overflowing tanks.
Consume very low energy, ideal for continuous operation.

8.2 APPLICATIONS:
Automatic Water level Controller for Hotels, Factories, Homes Apartments, colleges,
Commercial Complexes, etc., It can be fixed for single phase motor, Single Phase
Submersibles, open well, Bore well and Sump. Many models available in different ranges.









36

CHAPTER 9
DISCUSSIONS
9.1 CONCLUSION:
This project deals how to control the water level automatically by using labview and
arduino.
Hence we have a automatic water level controller with the following features
No Man power required to operate, as fully automatic
Easy installation and Low maintenance
Advance Technology and simple to use
Saves water, motor and energy
Avoids seepage of water from roofs & walls due to overflowing tanks.
Consume very low energy, ideal for continuous operation.

9.2 SCOPE FOR FUTURE WORK:
1. Facilitating the replacement of multiple MOSFET switches in parallel with a single(less
expensive) IGBT, without a compromise of the switching frequency. The design concepts
developed were then extended to the design of active clamp fly-back this can be used for
many applications.
2. The active-clamp switch on-time, might further improve converter efficiency and also
self-driven active-clamp switches might reduce costs associated with the extra control
circuitry these networks require.




REFERENCES:
1. www.arduino.cc
2. Google Books
3. Digital logic Design by Morris Mano
4. Practical Arduino: Cool Projects for Open Source Hardware by Jonathan Oxer, Hugh
Blemings.
5. www.alldatasheet.com.























APPENDIX

You might also like