0% found this document useful (0 votes)
234 views40 pages

Report - Fish Tank Maintenance System Using Arduino

The document outlines the development of a mobile app and hardware system to help aquarists easily track and monitor the water parameters in their fish tanks. The proposed system uses sensors to measure pH levels and water levels which are connected to an Arduino board. The Arduino communicates wirelessly with the mobile app via Bluetooth to display readings and alert users if any parameters fall outside safe ranges. The system aims to simplify tank maintenance and reduce frustrations compared to existing manual methods or complex computer software. Chapters discuss the project design including UML diagrams, system architecture, and implementation details.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
234 views40 pages

Report - Fish Tank Maintenance System Using Arduino

The document outlines the development of a mobile app and hardware system to help aquarists easily track and monitor the water parameters in their fish tanks. The proposed system uses sensors to measure pH levels and water levels which are connected to an Arduino board. The Arduino communicates wirelessly with the mobile app via Bluetooth to display readings and alert users if any parameters fall outside safe ranges. The system aims to simplify tank maintenance and reduce frustrations compared to existing manual methods or complex computer software. Chapters discuss the project design including UML diagrams, system architecture, and implementation details.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 40

CHAPTER 1

INTRODUCTION

1.1 Outline of the Project

Aquariums are not only for homes. Many businesses are now installing
aquariums in their waiting rooms. The lazy, unhurried and fluid motions of fish relax
waiting clients and are far more absorbing than the dog-eared and coffee stained
lifestyle magazines that have been collecting dust for the last decade. However, a
green algae-contained tank with shabby plants, slimy gravel and fish performing a
realistic mime of the last moments of the Titanic is not an asset to any office or
home. We always keep track of tank parameters and changes in health, growth,
color, diseases, etc., to make sure our ecosystem is healthy and thriving. In our busy
life, sometimes, we try to find it difficult to remember the progress of all the livestock
in our tanks and when something goes wrong, we try to find the cause by referring to
our not so good memory to remember our activities and the progress to determine
the cause of the problem. This usually leads to frustration which can sometimes
drive hobbyists away from this extremely rewarding hobby.

Our app is a comprehensive mobile app that is built to help all aquarists, whether
hobbyist or professional, to maintain their tanks properly.

1.2 Purpose of project

Today in this present era where technological advances are at its vertex, there is
not even a single sector which remains untouched by technology. Technology has
not merely established our lives simpler, but also offers a high level of safety and
security wherever required. Technological devices are available which provides
refuge for all the mankind. We all want to stay on top of our water parameters and
track our test results easily and reliably. Now with our app you can keep track of the
pH value and water level in the tank with just a few taps and then view the history of

1
each parameter in any time period you desire. No more pen and paper,
spreadsheets or complicated computer software. This paper basically deals with the
development of fish tank maintenance at the initial stage and the transforming this
simple device into a most advanced aquarium-based maintenance system in the
future.

1.3 Existing system

Nowadays, we always have to keep track of tank parameters and changes in


health, growth, color, diseases, etc., to make sure our ecosystem is healthy and
thriving. This usually leads to frustration which can sometimes drive hobbyists away
from this extremely rewarding hobby. The systems present in the market are either
too expensive or too complicated to operate. Also, the system present in the market
are not embedded i.e., every product has to be purchased separately.

Disadvantages

1) Too expensive to combine all the required system for aquarium.


2) Proper result cannot be obtained.

1.4 Proposed system

We all want to stay on top of our water parameters and track our test results
easily and reliably. Now with our app you can keep track of your test results with just
a few taps and then view the history of each parameter along with a beautiful graph
in any time period you desire. No more pen and paper, spreadsheets or complicated
computer software! We have also included a handy timer to help you perform timed
tests easier. Our app includes the most popular water parameters based on your
aquarium type also we have added other major facilities such as water level
sensors, pH value sensors, a buzzer (quick alarm). The system consists of hardware
and software; all were designed, built, programmed and integrated. The program
codes written using Embedded C-language and system test carried out to ensure
optimum performance.

2
Advantages

 Reduces human effort to larger extent.


 User friendly embedded system along with app to stay updated.
 Cost efficient.
 Less complex circuit.
 No environmental effect or no effect of physical conditions.

3
CHAPTER 2

PROJECT DESIGN

2.1 UML DIAGRAM

MOBILE
BLUETOOTH

APPLICATION

USER
DETAILS

2.1 Use case Diagram

4
2.2 System Architecture

PH Sensor

BUZZER
ARDUNIO
CONTROLLER
Water Level
Sensor

BLUETOOTH

ANDROID MOBILE

2.2 Block Diagram

5
CHAPTER 3

PROJECT IMPLEMENTATION

3.1 Introduction

This project is loaded with arduino software IDE which controls the
microprocessor connected with sensors and the Bluetooth module. This is connected to
a mobile phone to display the result in the application.

3.2 Hardware Requirements


 Arduino UNO Atmega 16U2
 Bluetooth module – HC05
 Water level sensor
 pH sensor
 Buzzer
 Mobile phone

3.3 Software Requirements


 Windows xp,7,8,10
 Arduino software IDE version- 1.8.5
 Blue term application

3.4 Working Explanation


1. The output of the sensor goes LOW when the water level and the pH value
dropped from base values.

6
2. This is detected by the Microcontroller (Arduino) and gives direction to make a
call using a Bluetooth Module and to turn off the power supply using by power
control unit.
3. Water sensor brick is designed for water detection which has several lines of
bare conducting wires when exposed it gives traces to 1MΩ.
4. pH sensor id used for detection of base and acid level in water.
Arduino Uno
Arduino Uno R3 Front Arduino Uno R3 Back
Arduino Uno R2 Front Arduino Uno SMD Arduino Uno Front Arduino Uno
Back

Overview
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 analogue 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 an
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.

7
Fig 3.1 Arduino Board

Revision 2 of the Uno board has a resistor pulling the 8U2 HWB line to ground, making
it easier to put into DPU mode. Revision 3 of the board has the following new features:

 0pinout: added SDA and SCL pins that are near to the AREF pin and two other
new pins placed near to the RESET pin, the IOREF that allow the shields to
adapt to the voltage provided from the board. In future, shields will be compatible
both with the board. In future, shields will be compatible with both the boards that

8
use the AVR, which operate with 5V and with the Arduino Due that operate with
3.3V. The second one is not connected pin that is reserved for future purposes.
 Stronger RESET circuit.
 Atmega 16U2 replace the 8U2.

“Uno” means one in Italian and is named to mark the upcoming release of Arduino 1.0.
The Uno and version 1.0 will be the reference versions of Arduino, moving forward. The
Uno is the latest in a series of USB Arduino boards, and the reference model for the
Arduino platform; for a comparison with previous versions, see the index of Arduino
boards.

Summary

 Microcontroller Atmega328
 Operating Voltage 5V
 Input Voltage (recommended) 7-12V
 Input Voltage (limits) 6-20V
 Digital I/O Pins 14 (of which 6 provide PWM output)
 Analog Input Pins 6
 DC Current per I/O Pin 40mA
 DC Current for 3.3V Pin 50mA
 Flash Memory 32 KB (Atmega328) of which 0.5KB used by boot loader
 SRAM 2KB (Atmega328)
 EEPROM 1KB (Atmega328)
 Clock Speed 16 MHz

Schematic and Reference Design

9
EAGLE files: arduino-uno-Rev3-reference-design.zip (NOTE: works with Eagle
6.0 and newer)

Schematic: arduino-uno-Rev-schematic.pdf

Note: The Arduino reference design can use an ATmega8, 168, or 328, Current models
use an Atmega328, but an Atmega8 is shown in the schematic for reference. The pin
configuration is identical on all three processors.

Power

The Arduino Uno can be powered via the USB connection or with an external
power supply. The power source is selected automatically. External (non-USB) power
can come either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be
connected by plugging a 2.1mm centre-positive plug into the board’s power jack. Leads
from a battery can be inserted in the ground 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.

The power pins are as follows:

 VIN: The input voltage to the Arduino board when it’s using an external power
source (as opposed to 5 volts from the USB connection or other regulated
power source). You can supply voltage through this pin, or, if supplying
voltage via the power jack, access it through this pin.
 5V: This pin outputs a regulated 5V from the regulator on the board. The
board can be supplied with power either from DC power jack (7-12V), the
USB connector (5V), or the VIN pin of the board (7-12V). Supplying voltage
via the 5V or 3.3V pins bypasses the regulator, and can damage your board.
We don’t advice it.
 3V3: A 3.3 volt supply generated by the on-board regulator. Maximum current
draw is 50mA.

10
 GND: Ground pins.

Memory

The Atmega328 has 32 KB (with 0.5 KB used for the boot loader). It also has 2 KB of
SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library).

Input and Output

Each of the digital pins on the Uno can be used as an input or output, using pin mode (),
Digital write (), and digital read () functions. They operate at 5 volts. Each pin can
provide or receive a maximum of 40mA and has an internal pull-up resistor
(disconnected by default) of 20-50 kms. In addition, some pins have specialized
functions:

 Serial: 0 (RX) and 1(TX). Used to receive (RX) and transmit (TX) TTL serial data.
These pins are connected to the corresponding pins of Atmega8U2 USB-to-TTL
Serial chip.
 External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt
on a low value, a rising or falling edge, or a change in value. See the attach
interrupt () function for details.
 PWM: 3, 5, 6, 9, 10 and 11. Provide 8-bit PWM output with the analogue write ()
function.
 SPI: 10(SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication using the SPI library.
 LED: 13. There is a built-in LED connected to digital pin 13. When the pin is
HIGH value, the LED is on, when the pin is LOW, it’s off.

The Uno has 6 analogue inputs, labeled A0 through A5, each of which provides 10 bits
of resolution (i.e. 1024 different values). By default they ensure from ground to 5 volts,

11
though is it possible to change the upper end of their range using the AREF pin and the
analogue reference () function. Additionally, some pins have specialized functionality:

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

There are a couple of other pins on the board:

 AREF: Reference voltage for the analogue inputs. Used with analogue reference
().
 Reset: Bring this line LOW to reset the microcontroller. Typically used to add a
reset button to shields which block the one on the board. See also the mapping
between Arduino pins and ATmega328 ports. The mapping between Arduino
pins and ATmega328 ports. The mapping for ATmega8, 168 and 328 is identical.

Communication

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

A software serial library allows for serial communication on any of the UNO’s digital
pins.

The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino
software includes the wire library to simplify use of the I2C; see the documentation for
details. For SPI communication, use the SPI library.

12
Programming

The Arduino UNO can be programmed with the Arduino software (download).
Select “Arduino UNO from the tools > Board menu” (according to the microcontroller on
your board). For details see the reference and tutorials.

The ATmega328 on the Arduino UNO comes pre-burned with a boot larder that allows
you to upload new code to it without the use of an external hardware programmer. It
communicates using the original STK500 protocol (reference header files).

You can also bypass the boot loader and program the microcontroller through the ICSP
(in circuit serial programming) header; See these instructions for details.

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

 On REV1 boards: connecting the shoulder jumper on the back of the board (near
the map of Italy) and then resetting the 8U2.
 On REV2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line
to ground; making a teaser to put into DFU mode. U can then use atmen’s FLIP
(windows) or the DFU programmer (Mac os X and Linux) to load a new firmware,
or u can use the ISP header with an external programmer (overwriting the DFU
boot loader). See this user tutorial for more information. Automatic (software)
reset rather than requiring a physical press of the reset button before an upload,
the Arduino UNO is design in a way that allows it to be reset by software running
on a connected computer. One of the hardware flow controls line (DTR) of the
ATmega8U2/16U2 is connected to the reset line of the ATmega328 via 100 Nano
farad capacitor. When this line is asserted (taken low), the reset lines drop long
enough to reset the chip. The Arduino software uses this capability to allow you
to upload code by simply pressing the upload button in the Arduino environment.
This means that the boot loader can have a shorter a timeout, as the lowering of
DTR can be well-coordinated with the start of the upload. This setup has other

13
implications. When the Uno is connected to either a computer running Mac OS X
or Linux, it resets each time a connection is made to it from software (via
USB).For the following half a second or so, the boot loader is running on the
Uno. While it is programmed to ignore malformed data (i.e., anything besides an
upload of the new code), it will intercept the first few bytes of data sent to the
board after a connection is opened. If a sketch running on the board receives one
time configuration or other data when it first starts, make sure that the software
with which it communicates waits a second after opening the connection and
before sending this data. The Uno contains a trace that can be cut to disable the
auto-reset. The pads on either side of the trace can be soldered together to re-
enable it. It’s labeled “RESET-EN”. You may also be able to disable the auto-
reset by connecting a 110 ohm resistor from 5V to the reset line; see this forum
thread for details.

USB Overcurrent Protection

The Arduino Uno has a resettable polyfused that protects your computer’s USB
ports from shorts and overcurrent. Although most computers provide their own internal
protection, the fuse provides an extra layer of protection. If more than 500mA is applied
to the USB port, the fuse will automatically break the connection until the short or
overload is removed.

Physical Characteristics

The maximum length and width of the Uno PCB are 2.7 and 2.1 inches
respectively, with the USB connector and power jack extending beyond the former
dimension. Four screw holes allow the board to be attached to a surface or case. Note
that the distance between digital pins 7 and 8 is 160mil (0.16”), not an even multiple of
the 100mil spacing of the other pins.

PH Sensor

14
In the process world, pH is an important parameter to be measured and
controlled. The pH of a solution indicates how acidic or basic (alkaline) it is! The pH
term translates the values of the hydrogen ion concentration which ordinarily ranges
between about 1 and 10 x -14 gram-equivalents per litre – into numbers between 0 and
14.

On the pH scale a very acidic solution has a low pH value such as 0, 1, or 2(which
corresponds to a large concentration of hydrogen ions; 10 x 0, 10 x -1, or 10 x -2 gram-
equivalents per litre) while a very basic solution has a high pH value, such as 12, 13, or
14 which corresponds to a small number of hydrogen ions (10 x -12, 10 x -13, or 10 x -
14 gram equivalents per litre). A neutral solution such as water has a pH of
approximately 7.

A pH measurement loop is made up of three components, the pH sensor, which


includes a measuring electrode, a reference electrode, and a temperature sensor; a
preamplifier; and an analyzer or transmitter. A pH measurement loop is essentially a
battery where the positive terminal is the measuring electrode and the negative terminal
is the reference electrode. The measuring electrode, which is sensitive to hydrogen ion,
develops a potential (voltage) directly related to the hydrogen ion concentration of the
solution. The reference electrode provides a stable potential against which the
measuring electrode can be compared.

15
Fig 3.2 pH Sensor

Typical pH sensor

When immersed in the solution, the reference electrode potential does not
change with the changing hydrogen ion concentration. A solution in the reference
electrode also makes contact with the sample solution and the measuring electrode
through a junction, completing the circuit. Output of the measuring electrode changes
with temperature (even though the process remains at a constant pH), so a temperature
sensor is necessary to correct for this change in output. This is done in the analyzer or
transmitter software.

The pH sensor components are usually combined into one device called a combination
pH electrode. The measuring electrode is usually glass and quite fragile. Recent
developments have replaced the glass with more durable solid-state sensors. The
preamplifier is signal-conditioning device. It takes the high-impedance ph electrode
signal and changes it into low impedance signal which the analyzer or transmitter can

16
accept. The preamplifier also strengthens and stabilizes the signal, making it less
susceptible to electrical noise.

The sensor’s electrical signal is then displayed. This is commonly done in a 120/240V
ac-powered analyzer or in a 24V DC loop-powered transmitter.

Additionally, the analyzer or transmitter has a man machine interface for calibrating the
sensor and configuring outputs and alarms, if pH control is being done.

Keep in mind, application requirements should be carefully considered when choosing a


pH electrode. Accurate pH measurement and the resulting precise control that it can
allow, can go a long way toward process optimization and result in increased product
quality and consistency. Accurate, stable pH measurement also controls and often
lowers chemical usage, minimizing system maintenance and expense.

Keeping the system up and running. A system’s pH electrodes require periodic


maintenance to clean and calibrate them. The length of time between cleaning and
calibration depends on process conditions and the user’s accuracy and stability
expectations. Overtime, electrical properties of measuring and reference electrode
change. Calibration in known-value pH solutions called buffers will correct for some
junction will also help. However, just as batteries have a limited life, a pH electrode’s
lifetime is also help. Even in the “friendliest” environments, pH electrodes have to be
replaced eventually.

From an article by Tom Griffiths, Honeywell a very important measurement in many


liquid chemical processes (industrial, pharmaceutical, manufacturing, food production,
etc.) is that of pH: the measurement of hydrogen ion concentration in a liquid solution. A
solution with a low pH value is called an “acid”, while one with high pH is called a
“caustic”. The common pH scale extends from 0 (strong acid) to 14 (strong caustic),
with 7 in the middle representing pure water (neutral).

17
Fig 3.3 pH Scale

pH is defined as follows: The lower-case letter “p” in pH stands for the negative
common (base ten) logarithm, while the upper-case letter “H” stands for the element
hydrogen. Thus, pH is a logarithmic measurement of the number of moles of hydrogen
ions (H+) per litre of solution. Incidentally, the “p” prefix is also used with other types of
chemical measurements where a logarithmic scale is desired, pCO2 (Carbon Dioxide)
and pO2 (Oxygen) being two such examples.

The logarithmic pH scale works like this: a solution with 10-12 moles of H+ ions per litre
has a pH of 12; a solution with 10-3 moles of H+ ions per lire has a pH of 3. While very
uncommon, there is such a thing as an acid with a pH measurement below 0 and a
caustic with pH above 14. Such solutions, understandably, are quite concentrated and
extremely reactive.

While pH can be measured by color changes in certain chemical powders (the “litmus
strip” being a familiar example from high school chemistry classes), continuous process
monitoring and control of pH requires a more sophisticated approach. The most
common approach is the use of specially-prepared electrode designed to allow
hydrogen ions in the solution to migrate through a selective barrier, producing a
measurable potential (voltage) difference proportional to the solution’s pH.

18
Fig 3.4 pH measurement using electrodes

The design and operational theory of pH electrodes is a very complex subject, explored
only briefly here. What is important to understand is that these two electrodes generate
a voltage directly proportional to the pH of the solution. At a pH of 7 (neutral), the
electrodes will produce 0 volts between them. At a low pH (acid) a voltage will be
developed of one polarity, and at a high pH (caustic) a voltage will be developed of the
opposite polarity.

An unfortunate design constraint of pH electrodes is that one of them (called the


measurement electrode) must be constructed of special glass to create the ion-selective
barrier needed to screen out hydrogen ions from all the other ions floating around in the
solution. This glass is chemically doped with lithium ions, which is what makes it react
electrochemically to hydrogen ions. Of course, glass is not exactly what you would call a
“conductor” rather; it is an extremely good insulator. This presents a major problem if
our intent is to measure voltage between the two electrodes. The circuit path from one

19
electrode contact, through the glass barrier, through the solution, to the other electrode,
and back through the other electrode’s contact, is one of extremely high resistance.

The other electrode (called the reference electrode) is made from a chemical solution of
neutral (7) pH buffer solution (usually potassium chloride) allowed to exchange ions with
the process solution through a porous separator, forming a relatively low resistance
connection to the test liquid. At first, one might be inclined to ask: Why not just dip a
metal wire into the solution to get an electrical connection to the liquid? The reason this
will not work is because metals tend to be highly reactive in ionic solutions and can
produce a significant voltage across the interface of metal-to-liquid contact. The use of a
wet chemical interface with the measured solution is necessary to avoid creating such a
voltage, which of course would be falsely interpreted by any measuring device as being
indicative of pH.

Here is an illustration of the measurement electrode’s construction. Note the thin,


lithium-doped glass membrane across which the pH voltage is generated:

Fig 3.5 Measurement electrode’s construction

Here is an illustration of the reference electrode’s construction. The porous junction


shown at the bottom of the electrode is where the potassium chloride buffer and
process liquid interface with each other:

20
Fig 3.6 Reference electrode’s construction

The measurement electrode’s purpose is to generate the voltage used to measure the
solution’s pH. This voltage appears across the thickness of the glass, placing the silver
wire on one side of the voltage and the liquid solution on the other. The reference
electrode’s purpose is to provide the stable, zero-voltage connection to the liquid
solution so that a complete circuit can be made to measure the glass electrode’s
voltage. While reference electrode’s connection to the test liquid may only be a few kilo-
ohms, depending on electrode design! Being that any current in this circuit must travel
through both electrodes’ resistances (and the resistance presented by the test liquid
itself), these resistances are in series with each other and therefore add to make an
even greater total.

An ordinary analog or even digital voltmeter has too much of a low internal resistance to
measure voltage in such a high-resistance circuit.

The equivalent circuit diagram of a typical pH probe circuit illustrates the problem:

21
Fig 3.7 Circuit diagram of pH probe circuit

Even a very small circuit current traveling through the high resistances of each
component in the circuit (especially the measurement electrode’s glass membrane); will
produce relatively substantial voltage drops across those resistances, seriously
reducing the voltage seen by the meter. Making matters worse is the fact that the
voltage differential generated by the measurement electrode is very small, in the
millivolts range (ideally 59.16 millivolts per pH unit at room temperature). The meter
used for this task must be very sensitive and have an extremely high input resistance.

The most common solution to this measurement problem is to use an amplified meter
with an extremely high internal resistance to measure the electrode voltage, so as to
draw as little current through the circuit as possible. With modern semiconductor
components, a voltmeter with an input resistance of up to 1017 O can be built with little
difficulty.

Another approach, seldom seen in contemporary use, is to a potentiometric “null-


balance” voltage measurement setup to measure this voltage without drawing any
current from the circuit from the circuit under test. If a technician desired to check the
voltage output between a pair of pH electrodes, this would probably be the most
practical means of doing so using only standard bench top metering equipment:

22
Fig 3.8 Potentiometric “null-balance” voltage measurement

As usual, the precision voltage supply would be adjusted by the technical until the null
detector register zero, then the voltmeter connected in parallel with the detector “nulled”
(registering exactly zero), there should be zero current in pH electrode, giving the real
electrode voltage at the voltmeter terminals.

Wiring requirements for pH electrodes tend to be even more severe than thermocouple
wiring, demanding very clean connections and short distances of wire (10 yards or less,
even with gold-plated contacts and shielding cable) for accurate and reliable
measurement. As with thermocouples, however, the disadvantages of electrode pH
measurement are offset by the advantages: good accuracy and relative technical
simplicity.

Few instrumentation technologies inspire the awe and mystique commanded by pH


measurement, because it is so widely misunderstood and difficult to troubleshoot.
Without elaborating on the exact chemistry of pH measurement, a few words of wisdom
can be given here about pH measurement systems:

All pH electrodes have a finite life, and that lifespan depends greatly on the type and
severity of service. In some applications, a pH electrode life of one month may be
considered long, and in other applications the same electrode(s) may be expected to
last for over a year.

Because the glass (measurement) electrode is responsible for generating the pH-
proportional voltage, it is the one to be considered suspect if the measurement system
fails to generate sufficient voltage change for a given change in pH (approximately 59
millivolts per pH unit), or fails to respond quickly enough to a fast change in test liquid
pH.

23
If a pH measurement system “drifts”, creating offset errors, the problem likely lies with
the reference electrode, which is supposed to provide a zero-voltage connection with
the measurement solution. Because pH measurement is a logarithmic representation of
ion concentration, there is an incredible range of process conditions represented in the
seemingly simple 0-14 pH scale. Also, due to the nonlinear nature of the logarithmic
scale, a change of 1 pH at the top end (say, from 12 to 13 pH) does not represent the
same quantity of chemical activity change of 1 pH at the bottom end (say, from 2 to 3
pH). Control system engineers and technicians must be aware of this dynamic if there is
to be any hope of controlling process pH at a stable value.

The following condition are hazardous to measurement (glass) electrodes: high


temperatures, extreme pH levels (either acidic or alkaline), high ionic concentration in
the liquid, abrasion, hydrofluoric acid in the liquid (HF acid dissolves glass!), and any
kind of material coating on the surface of the glass.

Temperature changes in the measured liquid effect both the response of the
measurement electrode to a given pH level (ideally at 59 mV per pH unit), and the
actual pH of the liquid. Temperature measurement devices can be inserted into the
liquid, and the signals from those devices used to compensate for the effect of
temperature on pH measurement, but this will only compensate for the measurement
electrode’s mV/pH response, not the actual pH change of the process liquid!

Advances are still being made in the field of pH measurement, some of which hold great
promise for overcoming traditional limitations of pH electrodes. One such technology
uses a device called a field-effect transistor to electro statically measure the voltage
produced by an ion-permeable membrane rather than measure the voltage with an
actual voltmeter circuit. While this technology harbors limitations of its own, it is at least
a pioneering concept, and may prove more practical at a later date.

Review:

 pH is a representation of hydrogen ion activity in a liquid. It is the negative


logarithm of the amount of hydrogen ions (in moles) per liter of liquid. Thus: 10-
11 moles of hydrogen ions in 1 liter of liquid =5.3 pH.
 The basic pH scale extends from 0 (strong acid) to 7 (neutral, pure water) to 14
(strong caustic). Chemical solutions with pH levels below zero and above 14 are
possible, but rare.
 pH can be measured by measuring the voltage produced between two special
electrodes immersed in the liquid solution.

24
 One electrode, made of a special glass, is called the measurement electrode. Its
job is to generate a small voltage proportional to pH (ideally 59.16 mV per pH
unit).
 The other electrode (called the reference electrode) uses a porous junction
between the measured liquid and a stable, neutral pH buffer solution (usually
potassium chloride) to create a zero-voltage electrical connection to the liquid.
This provides a point of continuity for a complete circuit so that the voltage
produced across the thickness of the glass in the measurement electrode can be
measured by an external voltmeter.
 The extremely high resistance of the measurement electrode’s glass membrane
mandates the use of a voltmeter, to measure the voltage.

Water Level Sensors

Level sensors are used to detect the level of substances that can flow. Such
substances include liquids, slurries, granular material and powders. Level
measurements can be done inside containers or it can be the level of a river or lake.
Such measurements can be used to determine the amount of materials within a closed
container or the flow of water in open channels.

Fig 3.9 Water level sensor

Features:

 High accuracy and reliability


 Completely submersible pressure transducer
 Compact, rugged design for easy installation
25
 Minimal maintenance and care
 Water level sensor compatible with most monitoring equipment
 4-20mA output
 Multiple level ranges available from 3’ to 500’
 Wet-wet water level sensor eliminates vent tube concerns
 Dynamic temperature compensation system
 Submersible pressure transducer not affected by foam, wind, or rain
 Monitors levels in groundwater wells, rivers, streams, tanks, lift stations and open
channels.

Different Types of Level Sensors and their Workings

Fig 3.10 Level Sensor

Liquid level Sensor

A wide range of level sensor measurement systems are made available for
addressing the various parameters such as a wide range of applications, high-accuracy
needs, and system installation requirements and practices. Measurement technologies
are made available in different versions to address a wide range of measurement
needs, or to address a specific application.

Liquid level sensors are termed as the sensors used for detecting liquid levels or
interfaces between liquids such as water and oil or solids and liquids. These sensors
can also be defined as transducers or as integrated systems with instrumentation and

26
control capabilities. This type of liquid level sensor is one of the most important sensors
and plays a vital role in variety of industrial and consumer applications.

Industrial applications include liquid-level sensing in transport tanks, storage tanks and
water treatment tanks, and also in the petrochemical industries for sensing liquids such
as petrol, diesel and other fuels. Liquid level measurement is significant in household
applications including electronic devices such as water dispensers, water evaporators,
steamers, monitoring system of boilers, heating systems, washing machines, steam
irons, juice squeezers, automated coffee machines, etc. Level sensors are designed for
specific applications compared to general applications.

Classification of Level Sensor Measuring Systems

The family of Level Sensor measurement systems is classified into different categories
such as:

 Liquids or Solid Level Measurement


 Point or Continuous Level Measurement
 Electromagnetic or Electromechanical Level Measurement
 Contacting or Non-Contacting Level Measurement

General Considerations for Liquid Level Sensor Selection:

 Density and viscosity


 Vapors mist and dust
 Chemical composition
 Interfaces and gradients
 Ambient temperature
 Humidity/moisture
 Process temperature
 Process pressure
 Regulated environment

Out of these four types of measurement systems, this article describes about the point
level measurement and detection system, and the Continuous Level Measurement and
Detection Systems are explained briefly in the following paragraphs. These both
measurement systems cover different types of level sensors.

Point/Liquid Level Switch Measurement and Detection Systems

Point level measurement sensors are used for the purpose of making a single liquid
height or for presetting a level condition. Usually, this sensor works as a high alarm that
ensures the overflow conditions in tanks through liquid level sensors, or works as a

27
marker to note down the low alarm conditions. The different types of sensors are given
below:

 Float Sensor
 Capacitance Sensor

1. Level Detection and Measurement by Using a Float Sensor

Fig 3.11Level Detection using Float Sensor

A float sensor is a type of level sensor, a device used to detect the level of
liquid within a tank. The switch may be used to control a pump, as an indicator, an
alarm, or to control other devices.

Principle of Operation: A liquid level control system by using a float sensor works on the
principle of buoyancy, which states, “A float immersed in a liquid is buoyed towards
upward direction by an applied equal force to the weight of the displaced liquid.” As a
result, the body drives partially and gets submerged upon the liquid surface and covers
the same distance the liquid level moves.

Construction: A level measurement float system consists of a float, a sensor stem, a


magnet, a reed switch and a weight suspended on the outside of the open tank. A scale
is fixed on the outside of the tank, and the contents of the tank’s level are indicated by
the position of the weight along the scale.

Working: Level detection of liquids is often done with a float-type liquid level switch. The
float transfers on a mechanical arm or sliding pole and activates a switch when the level
moves towards upward direction. Sometimes the float itself contains a small magnet
that varies the state of a switch when the liquid level gets moving up and moves into the
original position. This type of level sensor comes with many advantages like it is very
simple, highly accurate, and best suitable for various products.

The disadvantages of this sensor are that it requires various mechanical equipment,
especially the pressure vessels.

28
Applications: In view of the requirements pertaining to the increase in the usage of
sealed tanks, the current industrial systems make use of this type of float method for
precise reading and accuracy, which is a good example of electronics and mechanical
engineering, making it the most accurate level-measuring system for various
applications in the very large storage tanks.

2. Level Detection and Management by Using Capacitance Sensor

Fig 3.12 Level Detection using Capacitance Sensor

Capacitance level sensors are available for wide range of solids, aqueous,
organic liquids and slurries. This technique is frequently stated as the radio-frequency
signals applied to a capacitance circuit. The capacitive sensors are designed to sense
material with dielectric constants as low as 1.1 for coke and fly ash, and as high as 88
for water or other liquids.

Principle of operation: The principle of capacitive level measurement is based on the


change of capacitance. There are two plates in capacitive sensor: one plate acts as an
insulated electrode and the other plate acts as a tank wall. The capacitance depends on
the liquid level. An empty tank has low capacitance while a filled tank has higher
capacitance. A simple capacitor consists of two electrode plates separated by a small
thickness of an insulator such as solid, fluid, gas, or vacuum.

The value of C depends on dielectric constant used, area of the plate and also on the
distance between the plates.

C=E (KA/d) where: C=Capacitance in Pico farads (pF), E= a constant known as


absolute permittivity of free space, K= Relative dielectric constant of insulating material,
A=Effective area of conductors, d= distance between the conductors.

This change in capacitance can be measured by using an AC Bridge.

29
Construction and Working: The measurement of liquid level is done by applying a Radio
Frequency signal between the conductive probe and the vessel wall. The Radio
Frequency signal results in a very-low current which flows through the dielectric process
material in the tank from the probe to the vessel wall. If the liquid level in the tank drops,
then the dielectric constant decreases, which leads to drop in capacitance reading as
well as minute drop in current flow.

This change can be detected by the liquid-level switch’s internal circuitry and translated
into relay state changes of the level switch in case of a point level detection.

The main advantages of these capacitance systems include easy installation, broad
application range, good accuracy suitable for variety of applications and highly
recognized and well-proven technology.

The disadvantages include sensitivity to changes in the measurable properties such as


dielectric constant and conductivity which creates an issue; furthermore, it is an
intrusive system.

Application: They are used for measuring the levels of:

 Fluids
 Liquid metals at very-high temperature range
 Dissolved gases at very-low level of temperature
 Very-high density industrial processes

Bluetooth Technology

A Bluetooth device uses radio waves instead of wires or cables to connect


to a phone or computer. A Bluetooth product, like a headset or watch, contains a tiny
computer chip with a Bluetooth radio and software that makes it easy to connect. When
two Bluetooth devices want to talk to each other, they need to pair. Communication
between Bluetooth devices happens over short-range, ad hoc networks known as
piconets. A piconet is a network of devices connected using Bluetooth technology.
When a network is established, one device takes the role of master while all the other
devices act as slaves. Piconets are established dynamically and automatically as
Bluetooth devices enter and leave radio proximity.

The Bluetooth module is a MASTER/SLAVE module. By default the factory setting is


SLAVE. The role of the module (Mater or Slave) can be configured only by command.
The slave modules cannot initiate a connection to another Bluetooth device, but can
accept connections. Master module can initiate a connection to other devices. The user
can use it simply for a serial port replacement to establish connection between MCU
and GPS, PC to your embedded project, etc.

30
Hardware Features:

 Typical 80dBm sensitivity


 Up to +4dBm RF transmit power
 3.3 to 5V I/O
 PIO (Programmable Input/output) control
 UART interface with programmable baud rate
 With integrated antenna
 With edge connector

Software Features:

 Slave default Baud rate: 9600, Data bits:8, Stop bit:1, Parity: No parity
 Auto connect to the last device on the power as default
 Permit pairing device to connect as default
 Auto pairing PINCODE: “1234” as default

Bluetooth Diagram

Fig 3.13 Bluetooth Module

31
Pin Description:

The Bluetooth Module has 6 pins. They are as follows:

ENABLE: When enable is pulled LOW, the module is disabled which means the module
will not turn on and it fails to communicate. When enable is left open or connected to
3.3V, the module is enabled i.e. the module remains on and communication also takes
place.

Vcc: Supply voltage 3.3V to 5V

GND: Ground pin

TXD & RXD: These two pins acts as an UART interface for communication

STATE: It acts as a status indicator. When the module is not connected to / paired with
any other Bluetooth device, signal goes Low. At this low state, the led flashes
continuously which denotes that the module is not paired with other device. When this
module is connected to/paired with any other Bluetooth device, the signal goes high. At
this high state, the led blinks with a constant delay say for example 2s delay which
indicates that the module is paired.

BUTTON SWITCH: This is used to switch the module into AT command mode. To
enable AT command mode, press the button switch for a second. With the help of AT
commands, the user can change the parameters of this module but only when the
module is not paired with any other BT device. If the module is connected to any other
Bluetooth device, it starts to communicate with that device and fails to work in AT
command mode.

Working Principle
The Bluetooth standard, like Wi-Fi, uses the FHSS technique (Frequency-Hopping
Spread Spectrum), which involves splitting the frequency band of 2.402-2.480 GHz into
79 channels (called hops) each 1MHz wide, then transmitting the signal using a
sequence of channels known to both the sending and receiving stations.
Thus, by switching channels as often as 1600 times a second, the Bluetooth standard
can avoid interference with other radio signals.

Fig 3.14 Bluetooth working diagram

32
The Bluetooth standard is based upon a master/slave operational mode. The term
"piconet" is used to refer to the network formed by one device and all devices found
within its range. Up to 10 piconets can coexist within a single coverage area. A master
can be simultaneously connected to as many as 7 active slave devices (255 when
in parked mode). Devices in a piconet have a logical address of 3 bits, for a maximum
of 8 devices. Devices in parked mode are synchronized, but do not have their own
physical address in the piconet.

33
CHAPTER 4

RESULTS

Implemented Screenshots

34
35
CHAPTER 5

CONCLUSION
There are many reasons for having an aquarium- the colorful fascination of
the underwater world and the special ambience they provide in the home. In addition to
the current technology, a great many biological and biochemical processes play a part
in the ecological cycle of an aquarium. This app is suitable for everyone, from starters to
professionals to dealers. It is suitable for all aquaria, whether fresh water or marine
water. The choice is yours. The future aspects of this detector include the Bluetooth
module and a tripper circuit which increases the efficiency of the system and provides
more safety to the users. The other advantage of this system includes its audio-visual
warning systems. This detector is implemented successfully and is easy to use and also
a low cost product.

36
APPENDIX
A. SOURCE CODE:

#include <SoftwareSerial.h>

SoftwareSerial BTserial(12, 13); // RX, TX

int inPin = 2;

// the setup routine runs once when you press reset:

void setup() {

// initialize serial communication at 9600 bits per second:

Serial.begin(9600);

BTserial.begin(9600);

pinMode(LED_BUILTIN, OUTPUT);

pinMode(inPin, OUTPUT);

// the loop routine runs over and over again forever:

void loop() {

int Water_Level = analogRead(A3); /* Water Level */

delay(20);

int Water_pH = analogRead(A1); /* Water pH */

delay(20);

if (Water_Level <= 50) {

Serial.println("Water too Low");

37
BTserial.println("water too low");

digitalWrite(inPin, HIGH);

delay(3000);

digitalWrite(inPin, LOW);}

else if ((Water_Level > 50) && (Water_Level <= 100)) {

Serial.println("25% Water in Tank");

else if ((Water_Level > 100) && (Water_Level <= 200)) {

Serial.println("50% Water in Tank");

else if ((Water_Level > 200) && (Water_Level <= 300)) {

Serial.println("75% Water in Tank");}

else if (Water_Level > 300) {

Serial.print("Tank Full ");

Serial.println("100% Water in Tank");

digitalWrite(inPin, HIGH);

delay(3000);

digitalWrite(inPin, LOW); }

/* Water pH Level */

if (Water_pH > 100) {

Serial.print("Water Condaminated ");

38
Serial.println("Change the Water");

BTserial.print("Water Condaminated ");

digitalWrite(inPin, HIGH);

delay(3000);

digitalWrite(inPin, LOW);

// print the value you read:

Serial.print("Water pH: ");

Serial.println(Water_pH);

Serial.print("Water Level: ");

Serial.println(Water_Level);

delay(1000);

if (Serial.available())

// Write the character to the Serial Monitor

BTserial.write (Serial.available());

}}

39
REFERENCES

 https://play.google.com/store/books/details/Jack_Purdum_Beginning_
C_for_Arduino?id=zzxHR1yjucQC
 https://www.arduino.cc/reference/en/
 https://www.arduino.cc/reference/en/Reference/Libraries
 https://create.arduino.cc/projecthub?category=sensors-
environment&sort=trending
 https://www.arduino.cc/en/Main/Software
 https://play.google.com/store/apps/details?id=project.bluetoothtermin
al

40

You might also like