SlideShare a Scribd company logo
1 of 77
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 1
CHAPTER 1
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 2
CHAPTER: 1
INTRODUCTION
1.1 PRESENT SCENARIO:
Now a day’s water demand is rapidly increasing with the increase in new
infrastructures, new businesses and homes. With the advancement of technology trend has
grown towards smart way of water metering, billing and controlling has come into existence.
In this project, water management by prepaying the water bills is discussed.
Water resources around the world are getting scarcer day after day. Climate, global
warming, and irresponsible usage are major factors the make the situation even harder.
Tremendous population growth causes insufficient and uneven distribution of water. So
measuring the water usage and providing it with proper amount will limit the wastage of
water in society. In the modern era of technology we came to know about various wireless
control systems for our appliances or machines.
Automatic meter reading is the technology of automatically collecting consumption,
diagnostic, and status data from water meter or energy metering devices (gas, electric) and
transferring that data to central database for billing, troubleshooting and analyzing.
1.2 PROPOSED SYSTEM:
With the advancement of technology trend has grown towards smart way of water
metering, billing and controlling has came into existence. In this project, water management
by prepaying the water bills is discussed. So it avoids the scarcity of water and knows how
pure the water is.
The aim of this paper is to help the water service providers to monitor the meter
readings from the location. The customer can buy water by sending SMS from his phone to
control station and automatically receive the bill in his phone through GSM. The number of
liters of water is determined, and then it transmitted to water meter through exiting GSM
network.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 3
1.3 OBJECTIVE:
The main objective of this project is:
 A system that keeps an eye on usage of water consumption.
 To provide water to everyone and avoid the scarcity of water.
1.4 LITERATURE SURVEY:
The Mogale City municipality, which borders western Johannesburg in South Africa,
is a pioneer of prepaid water, and possibly the first urban center to adopt prepaid water at
scale. It installed its first prepaid system in 1999, and within three years had 30,000 meters in
low and high income areas. Presently a prepaid water meter are available with smart card
technology in which consumer spend amount of water loaded from credit sales office by
loading the credit water meters via smart card.
1.5 IMPORTANCE OF WORK:
This project is aimed to propose water management by prepaying the water bills. It is
based on Arduino and GSM technologies. This project makes use of Arduino, GSM, flow
sensor and solenoid valve
1.6 MOTIVATION OF WORK:
Now a day’s technology has developed to a large extent. At the same time the need of
water also increased. Water resources around the world are getting scarcer day after day.
Some users disconnect the water supply line from the water meter and collect water directly
from the supply line. Because of the absence of automatic monitoring system with the
existing water meter, the water supply worker is unable to found the illegal users and this
leads to illegal use of water and wastage to a great extent.
Thus the billing system can become incorrect. It results in more amount of water
wastage. So, we proposed the prepaid Unit which keeps information about how much water
to be supplied. Depending on that information, the Prepaid Unit may disconnect the
customer's line and gives no more supply of water to the house.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 4
1.7 ADVANTAGES:
 Customer can easily monitor their use and spend as much as they can afford
 To eliminate bill debt problems.
 No need to send monthly usage bill.
1.8 DISADVANTAGES:
If customer didn’t have phone; he should go directly to Water Company to buy water.
1.9 APPLICATIONS:
 Residential applications.
 Household applications.
 Industrial applications.
1.10 ORGANIZATION OF THE REPORT:
Organization of the thesis gives the clear idea about the project and provides smooth
way to go through the project. Initially abstract gives an idea about the project, how it is
linked with the real world and what are going to get through the project.
 Chapter 1 deals with the introduction part of it. It mainly focuses on the object,
literature survey, and importance of work and organization of the project.
 Chapter 2 deals with block diagram description and schematic diagram description.
 Chapter 3 deals with Arduino.
 Chapter 4 deals with GSM Module.
 Chapter 5 deals with Hardware Design Consideration.
 Chapter 6 deals with Software Tools.
 Chapter 7 deals with Results, Conclusion & Future scope.
 APPENDIX-A Source Code.
 APPENDIX-B References.
 APPENDIX-C Bibliography.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 5
CHAPTER 2
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 6
CHAPTER-2
THEORY RELEVANT
2.1 INTRODUCTION:
 The purpose of the project is to avoid water scarcity and provide clean drinking water
take it for granted and do not use it wisely.
2.2 BLOCK DIAGRAM:
Fig. 2.1: Block Diagram Of Prepaid Water Meter
2.3 INDIVIDUAL BLOCKS DESCRIPTION:
This project mainly consists of Power Supply, Arduino, GSM, Flow Sensor and
Solenoid valve, Switching circuit and LCD Module
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 7
2.3.1 POWER SUPPLY:
In our project, we require 5v regulated power supply. In general, we use an AC
supply of 230V 50Hz, but this power has to be changed into the required form with
required values or voltage range for providing power supply to different types of devices.
There are various types of power electronic converters such as step-down converter, step-
up converter, voltage stabilizer, AC to DC converter, DC to DC converter, DC to AC
converter.
Fig 2.2: power supply
2.3.2 MICRO CONTROLLER:
In our project we are using ATMEGA328p microcontroller. This section forms the
control unit of the whole project. This section basically consists of a microcontroller with
its associated circuitry like capacitors, resistors, and reset circuitry and so on. The
microcontroller forms the heart of the project because it controls the devices being
interfaced and communicates with the devices according to the program being written.
2.3.3 FLOW SENSOR:
In our project we are using YF-S201 water flow sensor. The Water Flow sensor
measures the rate of a liquid flowing through it and consists of a plastic valve body, flow
rotor and Hall Effect sensor. It is usually used at the inlet end to detect the amount of flow.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 8
When liquid flows through the sensor, a magnetic rotor will rotate and the rate of
rotation will vary with the rate of flow. The Hall Effect sensor will then output a pulse
width signal.
Fig 2.3: Flow sensor
Fig 2.4: Inside view of Flow sensor
2.3.4 SOLENOID VALVE:
A solenoid valve is an electromechanically operated valve. Solenoid is the generic
term for a coil of wire used as an electromagnet. It also refers to any device that converts electrical
AN INTELLIGENT SMS BASED PREPAID WATER METERING
BY LAKSHMI PADMA
energy to mechanical energy using
electrical current to effect operations at expense of very little electrical
electrical current is applied to coil, based on polarity of magnet and direction of current flow
valve is latched or delatched.
2.3.5 LCD MODULE (JHD 162A):
In this project we are using
used in a wide range of applications, including palmtop computers, word processors,
photocopiers, point of sale terminals, medical instruments, cellular phones, etc. The 16x2
intelligent alphanumeric dot matrix displays is capable of displaying 224 different characters
and symbols.
Serial LCD firmware allows serial control of th
easier connection and use of the LCD module. The firmware enables microcontrollers (and
microcontroller based systems such as the PICAXE) to visually output user instructions or
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
energy to mechanical energy using a solenoid. A solenoid valve employs magnets and
electrical current to effect operations at expense of very little electrical
electrical current is applied to coil, based on polarity of magnet and direction of current flow
valve is latched or delatched.
Fig 2.5: solenoid valve
LCD MODULE (JHD 162A):
In this project we are using JHD 162A LCD Module. Alphanumeric displays are
used in a wide range of applications, including palmtop computers, word processors,
photocopiers, point of sale terminals, medical instruments, cellular phones, etc. The 16x2
intelligent alphanumeric dot matrix displays is capable of displaying 224 different characters
Serial LCD firmware allows serial control of the display. This option provides much
easier connection and use of the LCD module. The firmware enables microcontrollers (and
microcontroller based systems such as the PICAXE) to visually output user instructions or
AN INTELLIGENT SMS BASED PREPAID WATER METERING
Page 9
A solenoid valve employs magnets and
electrical current to effect operations at expense of very little electrical power. When
electrical current is applied to coil, based on polarity of magnet and direction of current flow
Alphanumeric displays are
used in a wide range of applications, including palmtop computers, word processors,
photocopiers, point of sale terminals, medical instruments, cellular phones, etc. The 16x2
intelligent alphanumeric dot matrix displays is capable of displaying 224 different characters
e display. This option provides much
easier connection and use of the LCD module. The firmware enables microcontrollers (and
microcontroller based systems such as the PICAXE) to visually output user instructions or
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 10
readings onto an LCD module. All LCD commands are transmitted serially via a single
microcontroller pin.
2.3.6 GSM (global system for mobile communication):
GSM is a mobile communication modem; it is stands for global system for mobile
communication (GSM). The idea of GSM was developed at Bell Laboratories in 1970. It is
widely used mobile communication system in the world. GSM is an open and digital cellular
technology used for transmitting mobile voice and data services operates at the 850MHz,
900MHz, 1800MHz and 1900MHz frequency bands.
GSM system was developed as a digital system using time division multiple access
(TDMA) technique for communication purpose. A GSM digitizes and reduces the data, then
sends it down through a channel with two different streams of client data, each in its own
particular time slot. The digital system has an ability to carry 64 kbps to 120 Mbps of data
rates.
2.3.7 RELAY:
In this project JQC3FC RELAY is used. A relay is an electromechanical device
which is used in the form of a switch. It is used to control a high power or high voltage
circuit by a low-power signal. Normally, Relay is in NC state.
Fig 2.6: Relay
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 11
2.4 SCHEMATIC DIAGRAM:
Fig 2.7: Schematic Diagram
Working of prepaid water metering system:
Arduino Uno Rev3 is used for water management. It is an in-built device. Arduino
needs DC supply of (6-12V) and it is provided from the power circuit or we can provide it
from USB. In our system pre-paid water metering system, we use a turbine based flow sensor
that gives pulses directly proportional to the flow of volume through it. It measures flow rate
by using the natural kinetic energy of the flow as it passes through the angled blades of the
turbine rotor. This causes the turbine to spin and as the blades pass by a close prepositioned
magnetic (Or other technology) “pick up” coil. The resulting interruption of the coils
magnetic field by each blade results in a pulse being produced.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 12
A solenoid valve is an electromechanically operated valve. Solenoid valves are the
most frequently used control elements in fluidics. A solenoid valve has two main parts: the
solenoid and the valve.
The solenoid converts electrical energy into mechanical energy which, in turn, opens
or closes the valve mechanically. A solenoid valve employs magnets and electrical current to
effect operations at expense of very little electrical power. When electrical current is applied
to coil, based on polarity of magnet and direction of current flow valve is latched or
delatched. When current polarity is reversed, valve latches if in delatched position and vice
versa.
A flow sensor is attached in the pipeline to the customer which gives the output in
pulses as consumption of water in liter. Microcontroller will count that pulses and decrement
the balance count which is added by the SMS send through GSM by water authority by
paying appropriate amount, when the balance count becomes less (threshold value) it sends a
message “Balance is less” to the display device.
 If customer recharge their account for uninterrupted water supply, the customer will
receive the bill and the water meter will recharge after the control station receive the
customer order to buy water; then control station issued a command to valve to be
open to allow the passage of water through pipes. In other side; in consumer premises
the LCD of water meter show the number of liters and the LED show green light.
 If customer didn’t recharge their account and balance count becomes zero
microcontroller will turn off the solenoid valve in the pipeline and water supply will
interrupted to the customer.
Thus, we can minimize the wastage of fresh water and prevent water shortage during
dry seasons. It can also Compel every customer to pay for the exact amount of water used or
wasted and make every customer a self-interested guardian of the water supply.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 13
CHAPTER 3
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 14
CHAPTER-3
ARDUINO
3.1 ARDUINO:
Arduino is an open source prototyping platform based on easy-to-use hardware and
software. Arduino boards are able to read inputs-light on a sensor, a finger on a button, or a
Twitter message- and turn it into an output-activating a motor, turning on an LED, publishing
something online. We can tell our board what to do by sending a set of instructions to the
microcontroller on the board. To do so we use the Arduino programming language (based on
wiring), and the Arduino software (IDE), based on processing.
Fig 3.1: Arduino Logo
Over the years Arduino has been the brain of thousands of projects, from everyday
objects to complex scientific instruments. A worldwide community of makers-students,
hobbyists, artists, programmers, and professionals- has gathered around this open-source
platform, their contributions have added up to an incredible amount of accessible knowledge
that can be of great help to novices and experts alike.
Arduino has born at the Ivrea Interaction Design Institute as an easy tool for fast
prototyping, aimed at students without a background in electronics and programming. As
soon as it reached a wider community, the Arduino board started changing to adapt to new
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 15
needs and challenges, differentiating its offer from simple 8-bit boards to products for IOT
applications, wearable, 3D printing, and embedded environments. All Arduino boards are
completely open-source, empowering users to build them independently and eventually adapt
them to their particular needs. The software, too, is open-source, and it is growing through
the contributions of users worldwide.
3.2 WHY ARDUINO:
Arduino has been used in thousands of different projects and applications. The
Arduino software is easy-to-use for beginners, at flexible enough for advanced users. It runs
on Mac, Windows, and Linux. Teachers and students use it to build low cost scientific
instruments, to prove chemistry and physics principles, or to get started with programming
and robotics. Designers and architects build interactive prototypes, musicians and artists used
for installation and to experiment with new musical instruments.
Makers, of course, use it to build many of the projects exhibited at the maker faire, for
example. Arduino is a key tool to learn new things. Any one-children, hobbyists, artists,
programmers- can start tinkering just following the step by step instructions of a kit.
There are many other microcontrollers and microcontroller platforms available for
physical computing. Parallax basic stamp, Net medias BX-24, Phidgets, MIT’s Handy board,
and many others offer similar functionality. All of these tools take the messy details of
microcontroller programming and wrap it up in an easy-to-use package. Arduino also
simplifies the process of working with microcontrollers, but it offers some advantage for
teachers, student, and interested amateurs over the systems.
3.3 ADVANTAGES:
 Inexpensive: Arduino boards are relatively inexpensive compared to other
microcontroller platforms. The least expensive version of the Arduino module can be
assembled by hand, and even the pre-assembled Arduino modules cost less than $50.
 Cross platform: The Arduino software (IDE) runs on Windows, Macintosh OSX,
and Linux operating systems. Most microcontroller systems are limited to Windows.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 16
 Simple, clear programming environment: The Arduino software (IDE) is
easy-to-use for beginners, at flexible enough for advanced users to take advantage of as
well. For teachers, it’s conveniently based on the processing programming
environment, so students learning to program in that environment will be familiar with
how the Arduino IDE works.
 Open source and extensible software: Arduino software is published as open
source tools, available for extension by experienced programmers. The language can be
expanded through C++ libraries, and people wanting to understand the technical details
can make the leap from Arduino to the AVR C programming language on which is
based. Similarly, we can add AVR-C code directly into our Arduino programs if we
want to.
 Open source and extensible hardware: The plans of the Arduino boards are
published under a creative commons license, so experienced circuit designers can make
their own version of the module, extending it and improving it. Even relatively
inexperienced users can build the bread board version of the module in order to
understand how it works and save money.
3.4 ARDUINO UNO:
The UNO is the best board to get started with electronics and coding. If this is your
experience tinkering with the platform, the UNO is the most robust board we can start
playing with. The UNO is the most used and documented board of the whole Arduino
Genuino family.
The Arduino UNO R3 is a microcontroller board based on the “ATmega328”. It has
14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16
MHz crystal oscillator, 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 (not included) or power it with an AC-to-DC adapter or battery to get
started. You can tinker with your UNO without working too much about doing something
wrong, worst case scenario we can replace the chip for a few dollars and start over again.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 17
Fig. 3.2: Arduino Uno Board
“Uno” means one in Italian and was chosen to mark the release of Arduino software
(IDE) 1.0. The Uno board and version 1.0 of Arduino Software (IDE) were the reference
versions of Arduino, now evolved to newer releases. The Uno board is the first in a series of
USB Arduino boards, and the reference model for the Arduino platform; for an extensive list
of current, past or outdated boards see the Arduino index of boards.
3.5 TECHNICAL SPECIFICATIONS:
Microcontroller : ATmega328P
Operating Voltage : 5V
Input Voltage (recommended) : 7-12V
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 18
Input Voltage (limit) : 6-20V
Digital I/O Pins : 14 (of which 6 provide PWM output)
PWM Digital I/O Pins : 6
Analog Input Pins : 6
DC Current per I/O Pin : 20Ma
DC Current for 3.3V Pin : 50Ma
Flash Memory : 32Kb (ATmega328P) of which 0.5 kB used by
bootloader
SRAM : 2 kB (ATmega328P)
EEPROM : 1 kB (ATmega328P)
Clock Speed : 16 MHz
Length : 68.6 mm
Width : 53.4 mm
Weight : 25 g
3.6 PROGRAMMING:
The Uno can be programmed with the Arduino Software (IDE).
The ATmega328 on the Uno comes preprogrammed with a bootloader 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, C header files).
We can also bypass the bootloader and program the microcontroller through the ICSP
(In-Circuit Serial Programming) header using Arduino ISP or similar.
The ATmega16U2 (or 8U2 in the Rev1 and Rev2 boards) firmware source code is
available in the Arduino repository. The ATmega16U2/8U2 is loaded with a DFU
bootloader, which can be activated by:
 On Rev1 boards: connecting the solder jumper on the back of the board (near the map
of Italy) and then resting the 8U2.
 On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 19
ground, making it easier to put into DFU mode.
We can then use Atmel’s FLIP software (Windows) or the DFU programmer (Mac OS X and
Linux) to load a new firmware. Or you can use the ISP header with an external programmer
(overwriting the DFU bootloader).
3.7 DIFFERENCE WITH OTHER BOARDS:
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.
Power:
The Uno board 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 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 from 6 to 20 volts. If supplied with less
than 7V, however, the 5V pin may supply less than five volts and the board may become
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 Uno board when it's using an external power source (as
opposed to 5V 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 the DC power jack (7 - 12V), the USB connector
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 20
(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 advise it.
 3V3: A 3.3 volt supply generated by the on-board regulator. Maximum current draw
is 50mA.
 GND: Ground pins.
 IOREF: This pin on the Uno board provides the voltage reference with which the
microcontroller operates. A properly configured shield can read the IOREF pin
voltage and select the appropriate power source or enable voltage translators on the
outputs to work with the 5V or 3.3V.
 Memory: The ATmega328 has 32 kB (with 0.5 kB occupied by 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: See the mapping between Arduino pins and ATmega328P ports.
The mapping for the Atmega8, 168, and 328 is identical.
3.8 PIN MAPPING:
Fig. 3.3: Pin Diagram Of Atmega328
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 21
3.9ATMEGA328P:
Each of the 14 digital pins on the Uno can be used as an input or output, using pin
Mode(), digital Write(), and digital Read() functions. They operate at 5 volts. Each pin can
provide or receive 20mA as recommended operating condition and has an internal pull-up
resistor (disconnected by default) of 20-50k ohm. A maximum of 40mA is the value that
must not be exceeded on any I/O pin to avoid permanent damage to the microcontroller.
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 the ATmega8U2 USB-to-TTL
Serial chip.
 External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on
a low value, a rising or falling edge, or a change in value. See the attach Interrupt()
function for details.
 PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analog 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 driven by digital pin 13. When the pin is HIGH
value, the LED is on, when the pin is LOW, it's off.
 TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the
Wire library. The Uno has 6 analog inputs, values). By default they measure from
ground to 5 volts, though is it possible to change the upper end of their range using
the AREF pin and the analog labeled A0 through A5, each of which provide 10 bits
of resolution (i.e. 1024 different Reference() function. There are a couple of other
pins on the board.
 AREF: Reference voltage for the analog inputs. Used with analog Reference()
 Reset: Bring this line LOW to reset the microcontroller.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 22
3.10 COMMUNICATION:
The Uno has a number of facilities for communicating with a computer, another Uno
board, 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 (IDE) includes a serial monitor which allows simple textual data to be sent to and
from the board. The RX and TX LEDs on the board will flash when data is being transmitted
via the USB-to-serial chip and USB connection to the computer (but not for serial
communication on pins 0 and 1).
A Software Serial library allows serial communication on any of the Uno's digital pins.
The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino
Software (IDE) includes a Wire library to simplify use of the I2C bus; see
the documentation for details. For SPI communication, use the SPI library.
3.11 AUTOMATIC (SOFTWARE) RESET:
Rather than requiring a physical press of the reset button before an upload, the Uno
board is designed in a way that allows it to be reset by software running on a connected
computer. One of the hardware flow control lines (DTR) of the ATmega8U2/16U2 is
connected to the reset line of the ATmega328 via a 100 nano Farad capacitor. When this line
is asserted (taken low), the reset line drops long enough to reset the chip. The Arduino
Software (IDE) uses this capability to allow you to upload code by simply pressing the
upload button in the interface toolbar. This means that the boot-loader can have a shorter
timeout, as the lowering of DTR can be well-coordinated with the start of the upload.
This setup has other implications. When the Uno is connected to either a computer
running Mac OS X or Linux, it resets each time a connection is made to it from software (via
USB). For the following half-second or so, the boot-loader is running on the Uno. While it is
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 23
programmed to ignore malformed data (i.e. anything besides an upload of new code), it will
intercept the first few bytes of data sent to the board after a connection is opened. If a sketch
running on the board receives one-time configuration or other data when it first starts, make
sure that the software with which it communicates waits a second after opening the
connection and before sending this data.
The Uno board 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.
3.12 APPLICATIONS OF ARDUNIO UNO:
 DIY project prototyping.
 Developing varied varieties of projects that require a code based control.
 Automation System development.
 Learning AVR programming.
 Entry level circuit designing.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 24
CHAPTER 4
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 25
CHAPTER-4
GSM MODULE
4.1 GSM:
Global System for Mobile Communication (GSM) is a set of ETSI standards
specifying the infrastructure for a digital cellular service. The standard is used in approx. 85
countries in the world including such locations as Europe, Japan and Australia. The idea of
GSM was developed at Bell Laboratories in 1970. It is widely used mobile communication
system in the world.
GSM is an open and digital cellular technology used for transmitting mobile voice
and data services operates at the 850MHz, 900MHz, 1800MHz and 1900MHz frequency
bands. There are various cell sizes in a GSM system such as macro, micro, pico and umbrella
cells. Each cell varies as per the implementation domain. There are five different cell sizes in
a GSM network macro, micro, pico and umbrella cells. The coverage area of each cell varies
according to the implementation environment.
4.2 GSM MODEM:
Fig 4.1: GSM modem
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 26
A GSM modem is a device which can be either a mobile phone or a modem device
which can be used to make a computer or any other processor communicate over a network.
A GSM modem requires a SIM card to be operated and operates over a network range
subscribed by the network operator. It can be connected to a computer through serial, USB
or Bluetooth connection.
A GSM modem can also be a standard GSM mobile phone with the appropriate cable
and software driver to connect to a serial port or USB port on your computer. GSM modem is
usually preferable to a GSM mobile phone. The GSM modem has wide range of applications
in transaction terminals, supply chain management, security applications, weather stations
and GPRS mode remote data logging.
4.3 WIRELESS MODEM:
Wireless MODEMs are the MODEM devices that generate, transmit or decode data
from a cellular network, for establishing communication between the cellular network and
the computer. These are manufactured for specific cellular network (GSM/UMTS/CDMA) or
specific cellular data standard (GSM/UMTS/GPRS/EDGE/HSDPA) or technology
(GPS/SIM). Wireless MODEMs like other MODEM devices use serial communication to
interface with and need Hayes compatible AT commands for communication with the
computer (any microprocessor or microcontroller system).
A GSM modem exposes an interface that allows applications such as now SMS to
send and receive messages over the modem interface. The mobile operator charges for this
message sending and receiving as if it was performed directly on a mobile phone. To perform
these tasks, a GSM modem must support an “extended AT commands set “ for sending
/receiving SMS messages, as defined in the ETSI GSM 07.05 and 3GPP TS 27.005
specifications.
Time Division Multiple Access
TDMA technique relies on assigning different time slots to each user on the same frequency.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 27
It can easily adapt to data transmission and voice communication and can carry 64kbps to
120mbps of data rate.
Fig 4.2: Types of wireless modems
4.4 GSM ARCHITECTURE:
A GSM network is composed of several functional entities, whose functions and
interfaces are defined. Figure 4.3 shows the layout of a generic GSM network. The GSM
network can be divided into three broad parts. The Mobile Station is carried by the
subscriber. The Base Station subsystem controls the radio link with the Mobile Station. The
Network Subsystem, the main part of which is the Mobile services Switching Center(MSC),
performs the switching of calls between the mobile and fixed network users. The Mobile
Station and the Base Station subsystem communicate across the Um interface, also known as
the air interface or radio link. The Base Station Subsystem communicates with the Mobile
service Switching Center across the interface.
The GSM network architecture as defined in the GSM specifications can be grouped
into three main areas:
 Mobile station (MS)
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 28
 Base-Station Subsystem (BSS)
 Network and Switching Subsystem (NSS)
The different elements of the GSM network operate together and the user is not aware of
the different entities within the system.
Fig 4.3: GSM architecture
4.4.1 Mobile station:
Mobile stations (MS), mobile equipment (ME) or as they are most widely known,
cell or mobile phones are the section of a GSM cellular network that the user sees and
operates. In recent years their size has fallen dramatically while the level of functionality has
greatly increased. A further advantage is that the time between charges has significantly
increased. There are a number of elements to the cell phone, although the two main elements
are the main hardware and the SIM.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 29
The hardware itself contains the main elements of the mobile phone including the
display, case, battery, and the electronics used to generate the signal, and process the data
receiver and to be transmitted. It also contains a number known as the International Mobile
Equipment Identity(IMEI). This is installed in the phone at manufacture and "cannot" be
changed. It is accessed by the network during registration to check whether the equipment
has been reported as stolen.
The SIM or Subscriber Identity Module contains the information that provides the
identity of the user to the network. It contains are variety of information including a number
known as the International Mobile Subscriber Identity (IMSI).
4.4.2 Base Station Subsystem (BSS):
The Base Station Subsystem (BSS) section of the GSM network architecture that
is fundamentally associated with communicating with the mobiles on the network. It consists
of two elements
Base Transceiver Station (BTS):
The BTS used in a GSM network comprises the radio transmitter receivers, and their
associated antennas that transmit and receive to directly communicate with the mobiles. The
BTS is the defining element for each cell.
The BTS communicates with the mobiles and the interface between the two is known
as the Um interface with its associated protocols.
Base Station Controller (BSC):
The BSC forms the next stage back into the GSM network. It controls a group of
BTSs, and is often co-located with one of the BTSs in its group. It manages the radio
resources and controls items such as handover within the group of BTSs, allocates channels
and the like. It communicates with the BTSs over what is termed the Abis interface.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 30
4.4.3 Network Switching Subsystem (NSS):
The GSM system architecture contains a variety of different elements, and is often
termed the core network. It provides the main control and interfacing for the whole mobile
network. The major elements within the core network include.
Mobile Services Switching Centre (MSC):
The main element within the core network area of the overall GSM network
architecture is the Mobile switching Services Centre (MSC). The MSC acts like a normal
switching node within a PSTN or ISDN, but also provides additional functionality to enable
the requirements of a mobile user to be supported. These include registration, authentication,
call location, inter-MSC handovers and call routing to a mobile subscriber. It also provides
an interface to the PSTN so that calls can be routed from the mobile network to a phone
connected to a landline. Interfaces to other MSCs are provided to enable calls to be made to
mobiles on different networks.
 Mobile switch center (MSC)
 Home location register (HLR)
 Visitor location Register (VLR)
 Authentications center (Auc)
 Equipment Identity Register (EIR)
 Interworking Functions (IWF)
Home Location Register (HLR):
This database contains all the administrative information about each subscriber along
with their last known location. In this way, the GSM network is able to route calls to the
relevant base station for the MS. When a user switches on their phone, the phone registers
with the network and from this it is possible to determine which BTS it communicates with
so that incoming calls can be routed appropriately. Even when the phone is not active (but
switched on) it re-registers periodically to ensure that the network (HLR) is aware of its latest
position.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 31
There is one HLR per network, although it may be distributed across various sub-
centres to for operational reasons.
Visitor Location Register (VLR):
This contains selected information from the HLR that enables the selected services
for the individual subscriber to be provided. The VLR can be implemented as a separate
entity, but it is commonly realised as an integral part of the MSC, rather than a separate
entity. In this way access is made faster and more convenient.
Equipment Identity Register (EIR):
The EIR is the entity that decides whether a given mobile equipment may be allowed
onto the network. Each mobile equipment has a number known as the International Mobile
Equipment Identity. This number, as mentioned above, is installed in the equipment and is
checked by the network during registration. Dependent upon the information held in the EIR,
the mobile may be allocated one of three states - allowed onto the network, barred access, or
monitored in case its problems.
White list:
This list contains the IMEI of the phones who are allowed to enter in the network.
Black list:
This list on the contrary contains the IMEI of the phones who are not allowed to enter
in the network, for example because they are stolen.
Grey list:
This list contains the IMEI of the phones momentarily not allowed to enter in the
network, for example because the software version is too old or because they are in repair.
Authentication Centre (AuC):
The AuC database holds different algorithms that are used for authentication and
encryptions of the mobile subscribers that verify the mobile user’s identity and ensure the
confidentiality of each call.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 32
The AuC holds the authentication and encryption keys for all the subscribers in both
the home and visitor location register.
Gateway Mobile Switching Centre (GMSC):
The GMSC is the point to which a ME terminating call is initially routed, without
any knowledge of the MS's location. The GMSC is thus in charge of obtaining the MSRN
(Mobile Station Roaming Number) from the HLR based on the MSISDN (Mobile Station
ISDN number, the "directory number" of a MS) and routing the call to the correct visited
MSC. The "MSC" part of the term GMSC is misleading, since the gateway operation does
not require any linking to an MSC.
SMS Gateway (SMS-G):
The SMS-G or SMS gateway is the term that is used to collectively describe the two
Short Message Services Gateways defined in the GSM standards. The two gateways handle
messages directed in different directions. The SMS-GMSC (Short Message Service Gateway
Mobile Switching Centre) is for short messages being sent to an ME. The SMS-IWMSC
(Short Message Service Inter-Working Mobile Switching Centre) is used for short messages
originated with a mobile on that network. The SMS-GMSC role is similar to that of the
GMSC, whereas the SMS-IWMSC provides a fixed access point to the Short Message
Service Centre.
4.5 FEATURES OF GSM MODULE:
 Improved spectrum efficiency
 International roaming
 Compatibility with integrated services digital network (ISDN)
 Support for new services.
 SIM phonebook management
 Fixed dialing number (FDN)
 Real time clock with alarm management
 High-quality speech
 Uses encryption to make phone calls more secure
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 33
 Short message service (SMS)
The security strategies standardized for the GSM system make it the most secure
telecommunications standard currently accessible. Although the confidentiality of a call and secrecy
of the GSM subscriber is just ensured on the radio channel, this is a major step in achieving end-to-
end security.
4.6 GSM CHARACTERISTICS:
 TDMA over radio carriers(200Khz carrier spacing)
 8 full rate or 16 half rate TDMA channels per carrier
 User or terminal authentication for fraud control
 Encryption of speech and data transmission over the radio path
 Low speed data services (up to 9.6 Kb/s)
 Support of short message service(SMS)
4.7 ADVANTAGES OF GSM:
 Capacity increases
 Reduced RF transmission power and longer battery life
 International roaming capability
 Better security against fraud
 Encryption capability for information security and privacy
 Compatibility with ISDN, leading to wider range of services
4.8 AT COMMANDS:
These are used to control MODEMs. AT is the abbreviation for Attention. These
commands come from Hayes commands that were used by Hayes smart modems. The Hayes
commands started with AT to indicate the attention from the MODEM. The dial up and
wireless MODEMs (device that involve machine to machine communication) needs AT
commands to interact with a computer. These includes the Hayes command set as a subset,
along with other extended AT commands.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 34
AT commands with a GSM/GPRS MODEM or mobile phone can be used to access
following information and services:
1. Information and configuration pertaining to mobile device or MODEM and
SIM card.
2. SMS services.
3. MMS services.
4. Fax services.
5. Data and voice link over mobile network.
AT commands are instructions used to control a modem. AT is the abbreviation of
ATtention. Every command line starts with "AT" or "at". That's why modem commands are
called AT commands. Many of the commands that are used to control wired dial-up modems,
such as ATD (Dial), ATA (Answer), ATH (Hook control) and ATO (Return to online data
state), are also supported by GSM/GPRS modems and mobile phones. Besides this common
AT command set, GSM/GPRS modems and mobile phones support an AT command set that
is specific to the GSM technology, which includes SMS-related commands like AT+CMGS
(Send SMS message), AT+CMSS (Send SMS message from storage), AT+CMGL (List SMS
messages) and AT+CMGR (Read SMS messages).
Note that the starting "AT" is the prefix that informs the modem about the start of a
command line. It is not part of the AT command name. For example, D is the actual AT
command name in ATD and +CMGS is the actual AT command name in AT+CMGS.
However, some books and web sites use them interchangeably as the name of an AT
command.
Here are some of the tasks that can be done using AT commands with a GSM/GPRS modem
or mobile phone:
 Get basic information about the mobile phone or GSM/GPRS modem. For example,
name of manufacturer (AT+CGMI), model number (AT+CGMM), IMEI number
(International Mobile Equipment Identity) (AT+CGSN) and software version
(AT+CGMR).
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 35
 Get basic information about the subscriber. For example, MSISDN (AT+CNUM) and
IMSI number (International Mobile Subscriber Identity) (AT+CIMI).
 Get the current status of the mobile phone or GSM/GPRS modem. For example,
mobile phone activity status (AT+CPAS), mobile network registration status
(AT+CREG), radio signal strength (AT+CSQ), battery charge level and battery
charging status (AT+CBC).
 Establish a data connection or voice connection to a remote modem (ATD, ATA, etc).
 Send and receive fax (ATD, ATA, AT+F*).
 Send (AT+CMGS, AT+CMSS), read (AT+CMGR, AT+CMGL), write
(AT+CMGW) or delete (AT+CMGD) SMS messages and obtain notifications of
newly received SMS messages (AT+CNMI).
 Read (AT+CPBR), write (AT+CPBW) or search (AT+CPBF) phonebook entries.
 Perform security-related tasks, such as opening or closing facility locks (AT+CLCK),
checking whether a facility is locked (AT+CLCK) and changing passwords
(AT+CPWD).
(Facility lock examples: SIM lock [a password must be given to the SIM card every
time the mobile phone is switched on] and PH-SIM lock [a certain SIM card is
associated with the mobile phone. To use other SIM cards with the mobile phone, a
password must be entered.])
 Control the presentation of result codes / error messages of AT commands. For
example, you can control whether to enable certain error messages (AT+CMEE) and
whether error messages should be displayed in numeric format or verbose format
(AT+CMEE=1 or AT+CMEE=2).
 Get or change the configurations of the mobile phone or GSM/GPRS modem. For
example, change the GSM network (AT+COPS), bearer service type (AT+CBST),
radio link protocol parameters (AT+CRLP), SMS center address (AT+CSCA) and
storage of SMS messages (AT+CPMS).
 Save and restore configurations of the mobile phone or GSM/GPRS modem. For
example, save (AT+CSAS) and restore (AT+CRES) settings related to SMS
messaging such as the SMS center address.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 36
 Note that mobile phone manufacturers usually do not implement all AT commands,
command parameters and parameter values in their mobile phones. Also, the behavior
of the implemented AT commands may be different from that defined in the standard.
In general, GSM/GPRS modems designed for wireless applications have better
support of AT commands than ordinary mobile phones.
In addition, some AT commands require the support of mobile network operators. For
example, SMS over GPRS can be enabled on some GPRS mobile phones and GPRS modems
with the +CGSMS command (command name in text: Select Service for MO SMS
Messages). But if the mobile network operator does not support the transmission of SMS
over GPRS, you cannot use this feature.
Basic Commands and Extended Commands
There are two types of AT commands: basic commands and extended commands.
 Basic commands are AT commands that do not start with "+". For example, D
(Dial), A (Answer), H (Hook control) and O (Return to online data state) are basic
commands.
 Extended commands are AT commands that start with "+". All GSM AT commands
are extended commands. For example, +CMGS (Send SMS message), +CMSS (Send
SMS message from storage), +CMGL (List SMS messages) and +CMGR (Read SMS
messages) are extended commands.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 37
CHAPTER 5
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 38
CHAPTER-5
HARDWARE DESIGN CONSIDERATIONS
The Hardware components used in this project are:
 Flow Sensor.
 Solenoid valve.
 JHD 162A LCD Module.
 Power Supply.
 Voltage Regulator.
5.1 FLOW SENSOR:
5.1.1 PRINCIPLE OF OPERATION:
The Water Flow sensor measures the rate of a liquid flowing through it. The YF-S201
water flow sensor consists of a plastic valve body, flow rotor and hall effect sensor. It is
usually used at the inlet end to detect the amount of flow. When liquid flows through the
sensor, a magnetic rotor will rotate and the rate of rotation will vary with the rate of flow.
The hall effect sensor will then output a pulse width signal. Connect it to a microcontroller
and you can monitor multiple devices such as your coffee maker, sprinkler or anything else,
and control the water flow rate to suit your needs!
 A 20 mm rifled pipe is recommended
 Avoid unit contact with corrosive chemicals
 The unit must be installed vertically, tilted no more than 5 degrees
 Liquid temperature should be less than 120 C to avoid damage to unit
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 39
5.1.2 SPECIFICATIONS:
Table no-1: Specifications
NO ITEM EXAMINATION REQUIREMENT
1
Water pressure
Resistance
performance
1.75 MPa pressure has no slack phenomenon, and parts no crack,
relaxation, inflation, and deformation anomaly
2 Operating voltage
range
DC3-18V
3
Maximum
operating current 15mA
4
The output pulse
high level
In 5 V rated voltage, the output of the high level requirements in
4.5 V above
5
The output pulse
duty ratio
In the rated voltage, the output pulse occupies empties compared
to 50%-10%
6
Flow pulse
characteristics [4.1Q]±10%
7 Insulating
property
Dielectric resistance>100MΩ
8 Electrical strength AC500V 50Hz(Don't breakdown or flash winding)
9
Electrical
strength(100℃)
In 100 ℃ temperature placed in 72 hours, in the environmental
temperature back after 1 hour the accuracy of measurement
requirements within the plus or minus 5%
10
Cold
resistance(-20℃)
In 20 ℃ temperature placed in-72 hours, in the environmental
temperature back after 1 hour the accuracy of measurement
requirements within the plus or minus 5%
11
Mode of
connection
Red: the positive, black: negative, yellow: pulse signal
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 40
Fig 5.1: Flow Sensor
5.2 SOLENOID VALVE:
A solenoid valve is an electromechanically operated valve. The valve is controlled by
an electric current through a solenoid: in the case of a two-port valve the flow is switched on
or off; in the case of a three-port valve, the outflow is switched between the two outlet ports.
Solenoid valves are the most frequently used control elements in fluidics. Their tasks are to
shut off, release, dose, distribute or mix fluids.
They are found in many application areas. Solenoids offer fast and safe switching,
high reliability, long service life, good medium compatibility of the materials used, low
control power and compact design. A solenoid valve has two main parts: the solenoid and the
valve.
The solenoid converts electrical energy into mechanical energy which, in turn, opens
or closes the valve mechanically. A solenoid valve employs magnets and electrical current to
effect operations at expense of very little electrical power. When electrical current is applied
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 41
to coil, based on polarity of magnet and direction of current flow valve is latched or
delatched. When current polarity is reversed, valve latches if in delatched position and vice
versa.
Fig 5.2: Basic operation of Solenoid
The plunger is being held about halfway out of the coil by a spring. When the coil is
energized, the resulting magnetic field pulls the plunger to the middle of the coil. The
magnetic force is unidirectional -a spring is required to return the plunger to its unenergized
position.
5.2.1 PRINCIPLE OF WORKING:
Solenoid valve may use metal seals or rubber seals, and may also have electrical
interfaces to allow for easy control. A spring may be used to hold the valve opened or closed
while the valve is not activated.
A solenoid valve is the combination of a basic solenoid and mechanical valve. So a
solenoid valve has two parts namely-
 Electrical solenoid
 Mechanical valve.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 42
Fig 5.3: Solenoid valve operation
A-Input side
B-Diaphragm
C-Pressure chamber
D-Pressure relief conduit
E-Solenoid
F-Output side
The diagram to the right shows the design of a basic valve. If we look at the top
figure we can see the valve in its closed state. The water under pressure enters at A. B is an
elastic diaphragm and above it is a weak spring pushing it down. The function of this spring
is irrelevant for now as the valve would stay closed even without it. The diaphragm has a
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 43
pinhole through its center which allows a very small amount of water to flow through it. This
water fills the cavity C on the other side of the diaphragm so that pressure is equal on both
sides of the diaphragm.
While the pressure is the same on both sides of the diaphragm, the force is greater on
the upper side which forces the valve shut against the incoming pressure. By looking at the
figure we can see the surface being acted upon is greater on the upper side which results in
greater force. On the upper side the pressure is acting on the entire surface of the diaphragm
while on the lower side it is only acting on the incoming pipe. This results in the valve being
securely shut to any flow and, the greater the input pressure, the greater the shutting force
will be.
Now let us turn our attention to the small conduit D. Until now it was blocked by a
pin which is the armature of the solenoid E and which is pushed down by a spring. If we now
activate the solenoid drawing the pin upwards via magnetic force from the solenoid current,
the water in chamber C will flow through this conduit D to the output side of the valve. The
pressure in chamber C will drop and the incoming pressure will lift the diaphragm thus
opening the main valve. Water now flows directly from A to F.
When the solenoid is again deactivated and the conduit D is closed again, the spring
needs very little force to push the diaphragm down again and the main valve closes. In
practice there is often no separate spring, the elastomer diaphragm is moulded so that it
functions as its own spring, preferring to be in the closed shape.
From this explanation it can be seen that this type of valve relies on a differential of
pressure between input and output as the pressure at the input must always be greater than the
pressure at the output for it to work. Should the pressure at the output, for any reason, rise
above that of the input then the valve would open regardless of the state of the solenoid and
pilot valve.
In some solenoid valves the solenoid acts directly on the main valve. Others use a
small, complete solenoid valve, known as a pilot, to actuate a larger valve. While the second
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 44
type is actually a solenoid valve combined with a pneumatically actuated valve, they are sold
and packaged as a single unit referred to as a solenoid valve. Piloted valves require much less
power to control, but they are noticeably slower. Piloted solenoids usually need full power at
all times to open and stay open, where a direct acting solenoid may only need full power for
a short period of time to open it, and only low power to hold it.
5.2.2 TYPES OF SOLENOID VALVE:
Solenoid valves generally have two ports: an inlet and an outlet port. There are
several types of solenoid valves that include three or more ports.
Three-way solenoids are used to operate single-acting actuators, such as diaphragm
actuators. They are designed to only send air to one chamber of an actuator. Three way
solenoids are used to interrupt or override an instrument signal for double-acting actuators
with a pneumatic positioner.
Four-way solenoids provide a positive two directional action. They can be used instead of
positioners to provide on-off operation of double-acting valves. When the solenoid is de-
energized, it sends the full air supply to one side of the actuator and exhausts the other side to
the atmosphere.
Fig 5.4: two and three way, normally open and normally closed solenoids.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 45
The effective size of a solenoid valve can be increased by servo or pilot operation.
The term servo-operated applies to solenoid valves to indicate the main valve is fluid-
powered and actuated by a small valve in a servo or pilot circuit.
5.3 JHD162A LCD MODULE (16×2):
Alphanumeric displays are used in a wide range of applications, including palmtop
computers, word processors, photocopiers, point of sale terminals, medical instruments,
cellular phones, etc. The 16x2 intelligent alphanumeric dot matrix displays is capable of
displaying 224 different characters and symbols.
Serial LCD firmware allows serial control of the display. This option provides much
easier connection and use of the LCD module. The firmware enables microcontrollers (and
microcontroller based systems such as the PICAXE) to visually output user instructions or
readings onto an LCD module. All LCD commands are transmitted serially via a single
microcontroller pin.
5.3.1 PIN DIAGRAM:
Fig. 5.5: LCD Module (JHD162A)
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 46
The function of each pin of the JHD162A LCD module is given below.
 Pin1 (GND): Ground pin of the LCD module.
 Pin2 (VCC): +5V power supply is given to this pin
 Pin3 (VEE): Contrast adjustment pin. This is done by connecting the ends of a 10K
potentiometer to +5V and ground and then connecting the slider pin to the VEE pin.
The voltage at the VEE pin defines the contrast. The normal setting is between 0.4
and 0.9V.
 Pin4 (RS): Register select pin. The JHD162A has two registers namely command
register and data register. Logic HIGH at RS pin selects data register and logic LOW
at RS pin will select command register. If we make the RS pin HIGH and put a data
on the data lines (DB0 to DB7) it will be recognized as a data. If we make the RS pin
LOW and put a data on the data lines, then it will be taken as a command.
 Pin5(R/W): Read/Write modes. This pin is used for selecting between read and write
modes. Logic HIGH at this pin activates read mode and logic LOW at this pin
activates write mode.
 Pin6 (E): This pin is meant for enabling the LCD module. A HIGH to LOW signal at
this pin will enable the module.
 Pin7 (DB0) to Pin14 (DB7): These are data pins. The commands and data are put on
these pins.
 Pin15 (LED+): Anode of the back light LED. When operated on 5V, a 560 ohm
resistor should be connected in series to this pin.
 Pin16 (LED-): Cathode of the back light LED.
5.3.2 FEATURES:
The JHD162A has 16 pins and can be operated in 4-bit mode or 8-bit mode. Here we
are using the LCD module in 4-bit mode.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 47
 If interface data is 4 bit long:
Data transfer are made through 4 bus lines DB4 to DB7 (while the rest of 4 bus lines
from DB0 to DB3 are not used).Data transfer with MPU are completed when 4-bit
data are transferred in twice.
 If interface data is 8 bit long:
Data transfer is made through all of 8 bus lines from DB0 to DB7.
 192 kinds of alphabets, numerals, symbols and special characters can be displayed by
built-in character generator (ROM) and other preferred characters can be displayed by
RAM.
 Low power consumption.
 Compact and light weight design which can be easily assembled in devices.
5.4 POWER SUPPLY:
Fig. 5.6: Power Supply Circuit
Every electrical and electronic device that we use in our day-to-day life will require a
power supply. In general, we use an AC supply of 230V 50Hz, but this power has to be
changed into the required form with required values or voltage range for providing power
supply to different types of devices. There are various types of power electronic converters
such as step-down converter, step-up converter, voltage stabilizer, AC to DC converter, DC
to DC converter, DC to AC converter, and so on. For example, consider the microcontrollers
that are used frequently for developing many embedded systems’ based projects and kits
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 48
used in real-time applications. These microcontrollers require a 5V DC supply, so the AC
230V needs to be converted into 5V DC using the step-down converter in their power supply
circuit.
5.4.1 CENTER TAPPED TRANSFORMER:
In this circuit, we are using a center tapped transformer. The transformer isused to step
down the 230 ac to 5V dc supply. The main difference of using center tapped transformer
instead of normal transformer is normal transformer gives single output voltage where center
tapped transformer gives two individual voltages to drive individual two loads. The
alternating voltage from secondary terminal of the transformer is given to a bridge rectifier.
Fig. 5.7: Center Tapped Transformer
5.4.2 BRIDGE RECTIFIER:
In this circuit, we are using bridge rectifier. A bridge rectifier makes use of four
diodes which are connected in the form a bridge. This is a widely used configuration, both
with individual diodes wired and with single component bridges where the diode bridge is
wired internally. The bridge rectifier converts alternating voltage to unidirectional voltage
with the switching action of diodes.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 49
For many applications especially with single phase AC where the full-wave bridge
serves to convert an AC input into a DC output, the addition of a capacitor may be desired
because the bridge alone supplies an output of fixed polarity but continuously varying or
pulsating magnitude.
The function of this capacitor, known as a reservoir capacitor is to lessen the variation in
the rectified AC output voltage waveform from the bridge. One explanation of smoothing is
that the capacitor provides a low impedance path to the AC component of the output,
reducing the AC voltage across, and AC current through, the resistive load. In less technical
terms, any drop in the output voltage and current of the bridge tends to be cancelled by loss
of charge in the capacitor. This charge flows out as additional current through the load.
Fig. 5.8: Bridge Rectifier
Thus the change of load current and voltage is reduced relative to what would occur
without the capacitor. Increases of voltage correspondingly store access charge in the
capacitor, thus moderating the change in the output voltage/current. The simplified circuit
shown as a well- deserved reputation for being dangerous, because, in some applications, the
capacitor can retain a lethal charge after the AC power source is removed. If supplying a
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 50
dangerous voltage, a practical circuit should include a reliable way to safely discharge the
capacitor.
The circuit should include a bleeder resistor connected as close as practical across the
capacitor. This resistor should consume a current large enough to discharge the capacitor in a
reasonable time, but small enough to minimize unnecessary power waste,. Because a bleeder
sets a minimum current drain, the regulation of the circuit, defined as percentage voltage
change from minimum to maximum load, is improved. However in many cases the
improvement is of in significant magnitude. Capacitor and the load resistance have a typical
time constant t=RC where C and R are capacitance and load resistance respectively.
As long as the load resistor is large enough so that this time constant is much longer
than the time of one ripple cycle, the above configuration will produce a smoothed DC
voltage across the load.
5.4.3 FILTER:
A filter is a device, which removes the AC component of rectifier output but allows the
DC component to reach the load.
Capacitor filter: we have seen that the ripple content in the rectified output of half-
wave rectifier is 121% or that of full-wave or bridge rectifier or bridge rectifier is 48% such
high percentages of ripples is not acceptable for most of the applications.
Fig. 5.9: capacitive filter
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 51
Filtering is performed by a large value electrolytic capacitor connected across the DC
supply to act as a reservoir, supplying current to the output when the varying DC voltage
from the rectifier is falling. The capacitor charges quickly near the peak of the varying DC,
and then discharges as it supplies current to the output. Filtering significantly increase the
average DC voltage to almost the peak value(1.4 x RMS value)
5.5 VOLTAGE REGULATOR IC:
In this circuit, we are using 7805 VOLTAGE REGULATOR. The voltage regulator
IC maintains the output voltage at a constant value. Regulators are designed to supply
required voltage without fluctuations. Capacitors of suitable values can be connected at input
and output pins depending upon the respective voltage levels which are used to eliminate the
ripples and make the output stable. After regulation we get a 5V DC voltage at the output of
7805 IC which is needed to give supply to our controller.
Fig. 5.10: Voltage Regulator
The LM7805, like most other regulators, is a three-pin IC.
 Pin1 (Input Pin): The Input pin is the pin that accepts the incoming DC voltage,
which the voltage regulator will eventually regulate down to 5 volts.
 Pin2 (Ground): Ground pin establishes the ground for the regulator.
 Pin3 (Output Pin): The Output pin is the regulated 5 volts DC.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 52
The maximum value for input to the voltage regulator is 35V. It can provide a
constant steady voltage flow of 5V for higher voltage input till the threshold limit of 35V. If
the voltage is near to 7.5V then it does not produce any heat and hence no need for heat sink.
If the voltage input is more, then excess electricity is liberated as heat from 7805.If adequate
heat sinking is provided, they can deliver over 1A output current.
5.5.1 CIRCUIT DIAGRAM:
Normally we get fixed output by connecting the voltage regulator at the output of the
filtered DC see in above diagram. It can also be used in circuits to get a low DC voltage from
a high DC voltage for example we use 7805 to get 5v from 12v.
There are two types of voltage regulators.
1. Fixed voltage regulators 78xx, 79xx.
2. Variable voltage regulators.
Fig. 5.11: Circuit Diagram Of Regulator IC7805
In fixed voltage regulators there is another classification.
1. Positive voltage regulators.
2. Negative voltage regulators.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 53
Positive voltage regulators include 78xx voltage regulators. The most commonly used
ones are 7805 and 7812. 7805 gives fixed 5v DC voltage if input voltage is in 7.5v, 20v.
7805 is a voltage regulator integrated circuit. It is a member of 78xx series of fixed linear
voltage regulator ICs. The voltage source in a circuit may have fluctuations and would not
give the fixed voltage output.
The voltage regulator IC maintains the output voltage at a constant value. The xx in
78xx indicates the fixed output voltage it is designed to provide. 7805 provides +5v regulated
power supply.
5.5.2 APPLICATIONS:
 Load Regulation.
 Ripple Rejection.
 Fixed Output Regulator.
 Constant Current Regulator.
 Switching Regulator.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 54
CHAPTER-6
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 55
CHAPTER-6
SOFTWARE TOOLS
6.1 EMBEDDED C:
Historically embedded C programming requires non-standard extensions to the C
language in order to support exotic features such as fixed point arithmetic, multiple distinct
memory banks, and basic I/O operations.
In 2008, the C standards committee published a technical report extending the C
language to address these issues by providing a common standard for all implementations to
adhere to. It includes a number of features not available in normal C, such as fixed point
arithmetic, named address and basic I/O hardware addressing. It is a set of language
extensions for the C programming language by the C standards committee to address
commonality issues that exists between c extensions for different embedded systems.
Embedded C uses most of the syntax and semantics of standard c, e.g., main()
function, variable definition, data type declaration, conditional statements(if, switch, case),
loops( while, for), functions, arrays and strings, structures and union, bit operation, macros.
6.1.1 EMBEDDED “C” COMPILER:
 ANSI C - full featured and portable
 Reliable - mature, field-proven technology
 Multiple C optimization levels
 An optimizing assembler
 Full linker, with overlaying of local variables to minimize RAM usage
 Comprehensive C library with all source code provided
 Includes support for 24-bit and 32-bit IEEE floating point and 32-bit long data types
 Mixed C and assembler programming
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 56
 Unlimited number of source files
 Listings showing generated assembler
 Compatible - integrates into the MPLAB IDE, MPLAB ICD and most 3rd-party
development tools
 Runs on multiple platforms: Windows, Linux, UNIX, Mac OS X, Solaris
6.2 ARDUINO PROGRAMMING ENVIRONMENT (IDE):
Arduino is an open-source computer hardware and software company, project and
user community that designs and manufactures microcontroller-based kits for building digital
devices and interactive objects that can sense and control the physical world. The project is
based on a family of microcontroller board designs manufactured primarily by Smart Projects
in Italy, and also by several other vendors, using various 8-bit Atmel AVR microcontrollers
or 32-bit Atmel ARM processors. These systems provide sets of digital and analog I/O pins
that can be interfaced to various expansion boards ("shields") and other circuits. The boards
feature serial communications interfaces, including USB on some models, for loading
programs from personal computers.
For programming the microcontrollers, the Arduino platform provides an integrated
development environment (IDE) based on the Processing project, which includes support for
C, C++ and Java programming languages. The first Arduino was introduced in 2005, aiming
to provide an inexpensive and easy way for novices and professionals to create devices that
interact with their environment using sensors and actuators. Common examples of such
devices intended for beginner hobbyists include simple robots, thermostats, and motion
detectors.
The Arduino integrated development environment (IDE) is a cross-
platform application written in Java, and derives 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
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 57
also capable of compiling and uploading programs to the board with a single click. A
program or code written for Arduino is called a "sketch".
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. The users need only to define two functions to make an
executable cyclic executive program:
 setup():A function that runs once at the start of a program and that can initialize
settings.
 loop(): A function called repeatedly until the board powers off.
Fig. 6.1: Arduino software page
The Arduino Integrated Development Environment - or Arduino Software (IDE) -
contains a text editor for writing code, a message area, a text console, a toolbar with buttons
for common functions and a series of menus. It connects to the Arduino and Genuino
hardware to upload programs and communicate with them.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 58
The arduino has two stages of execution one is the setup and the second was the loop.
In set up there was no iteration i.e. the whole function will run only once.
The arduino waits for serial initialization with a respective baud rate. If there was no
signal from the serial communication through i2c,then its waits there only until there was
signal. Once there was signal then it shows "DS1307RTC Read Test". Before going to start
the serial communication first of all we have to add the real time clock program to the main
program to get uploaded by clicking on file menu of the main program window and from that
menu click on examples and click on DS1037RTC and then set time and upload the both files
so that the RTC will get compiled with the pc time.
In order to view the above statement we have to upload the program and it click on the
search monitor key which was present on right most corners on the main program. After
clicking on this key the above statement"DS1307RTC Read Test" will be shown and in this
setup function we are assigning the port registers of the arduino to the loads we are
connecting .initially all the loads are in off state by giving the statement is equal to LOW of
the respective loads.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 59
CHAPTER-7
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 60
CHAPTER-7
RESULT, CONCLUSION & FUTURE SCOPE
7.1 RESULT:
Hence finally the output of project “AN INTELLIGENT SMS BASED PREPAID
WATER METERING SYSTEM” that is to avoid the scarcity of fresh and drinking water.
Fig 7.1: Hardware Kit
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 61
Fig 7.2(a): System Ready is
displayed
Fig 7.2(b): Message Received by the
Customer
Fig 7.3(a): System is Recharged by
the Customer
Fig 7.3(b): Recharge message is
displayed
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 62
Fig 7.4(a): Successfully Recharged
Message
Fig 7.4(b): Updated units is displayed
Fig 7.5(a): Low balance is displayed Fig 7.5(b): Low balance message alert
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 63
7.2CONCLUSION:
We hereby are stating from our project that we have implemented prepaid water
metering system. In this, it demands a house hold water metering system to save the
drinking water.
 In the present work wireless meter reading system is designed to measure the amount
of water used and to shut down the power supply remotely whenever the consumer
did not renew the purchase of water.
 Automatic water Meter reading avoids the human intervention, provides efficient
meter reading, avoid the billing error and reduce the maintenance cost. It displays the
corresponding information on LCD for user notification.
 Hence we introduced a low cost pre-paid embedded system that incorporates features
of remote monitoring and control of the water supply.
7.2 FUTURE SCOPE:
The scope of future work is this system can be further modified to incorporate
security aspect regarding tempering of the water meter finding leakage and location of the
leakage.
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 64
APPENDIX-A
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 65
APPENDIX-A
SOURCE CODE
#include<EEPROM.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
int led = 13;
#define pulsein 8
#define relay 12
unsigned int pusle_count = 0;
float units = 0;
unsigned int rupees = 0;
float water_factor = 0.00046;
unsigned int temp = 0, i = 0, x = 0, k = 0;
char str[70], flag1 = 0, flag2 = 0;
String bal = "";
int count = 0;
void setup()
{
lcd.begin(16, 2);
Serial.begin(9600);
pinMode(led, OUTPUT);
pinMode(pulsein, INPUT);
pinMode(relay, OUTPUT);
digitalWrite(pulsein, HIGH);
lcd.setCursor(0, 0);
lcd.print("PREPAID water");
lcd.setCursor(0, 1);
lcd.print(" METER ");
delay(2000);
lcd.clear();
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 66
lcd.print("BVCITS ECE");
delay(2000);
lcd.clear();
lcd.print("GSM Initilizing...");
gsm_init();
lcd.clear();
lcd.print("System Ready");
Serial.println("AT+CNMI=2,2,0,0,0");
init_sms();
send_data("System Ready");
send_sms();
delay(1000);
digitalWrite(led, LOW);
lcd.clear();
EEPROM.write(1, 0);
rupees = EEPROM.read(1);
}
void loop()
{
tds = analogRead(A5);
serialEvent();
rupees = EEPROM.read(1);
units = rupees / 0.2;
lcd.setCursor(0, 0);
lcd.print("Units:");
lcd.print(units);
lcd.print(" ");
lcd.setCursor(0, 1);
if (rupees < 15)
lcd.print("LOW Balance:");
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 67
else
lcd.print("Balance:");
lcd.print(rupees);
lcd.print(" ");
read_pulse();
check_status();
if (temp == 1)
{
decode_message();
send_confirmation_sms();
}
}
void serialEvent()
{
while (Serial.available())
{
char ch = (char)Serial.read();
str[i++] = ch;
if (ch == '*')
{
temp = 1;
lcd.clear();
lcd.print("Message Received");
delay(500);
break;
}
}
}
void init_sms()
{
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 68
Serial.println("AT+CMGF=1");
delay(200);
Serial.println("AT+CMGS="+91XXXXXXXXX"");
delay(200);
}
void send_data(String message)
{
Serial.println(message);
delay(200);
}
void send_sms()
{
Serial.write(26);
}
void read_pulse()
{
if (!digitalRead(pulsein))
{
digitalWrite(led, HIGH);
count++;
units = water_factor * count / 1000;
if (units < 1)
{
}
else
units--;
rupees = units * 2;
EEPROM.write(1, rupees);
while (!digitalRead(pulsein));
digitalWrite(led, LOW);
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 69
// delay(2000);
}
}
void check_status()
{
if (rupees > 15)
{
digitalWrite(relay, HIGH);
flag1 = 0;
flag2 = 0;
}
if (rupees < 15 && flag1 == 0)
{
lcd.setCursor(0, 1);
lcd.print("LOW Balance ");
init_sms();
send_data("water Meter Alert:");
send_data("Low Balancen");
Serial.println(rupees);
delay(200);
send_data("Please recharge your water meter.n Thank you");
send_sms();
message_sent();
flag1 = 1;
}
if (rupees < 5 && flag2 == 0)
{
digitalWrite(relay, LOW);
lcd.clear();
lcd.print("water disc to");
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 70
lcd.setCursor(0, 1);
lcd.print("Low Balance");
delay(2000);
lcd.clear();
lcd.print("Please Recharge ");
lcd.setCursor(0, 1);
lcd.print("UR water Meter ");
init_sms();
send_data("water Meter Balance Alert:n water cut due to low Balancen Please
recharge your water meter soon.n Thank you");
send_sms();
message_sent();
flag2 = 1;
}
if (tds >= 200)
{
digitalWrite(relay, LOW);
}
}
void decode_message()
{
x = 0, k = 0, temp = 0;
while (x < i)
{
while (str[x] == '#')
{
x++;
bal = "";
while (str[x] != '*')
{
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 71
bal += str[x++];
}
}
x++;
}
bal += '0';
}
void send_confirmation_sms()
{
int recharge_amount = bal.toInt();
rupees += recharge_amount;
EEPROM.write(1, rupees);
lcd.clear();
lcd.print("water Meter ");
lcd.setCursor(0, 1);
lcd.print("Recharged:");
lcd.print(recharge_amount);
init_sms();
send_data("water Meter Balance Alert:nYour water meter has been recharged Rs:");
send_data(bal);
send_data("Total Balance:");
Serial.println(rupees);
delay(200);
send_data("water connection disconnectednThank you");
send_sms();
temp = 0;
i = 0;
x = 0;
k = 0;
delay(1000);
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 72
message_sent();
}
void message_sent()
{
lcd.clear();
lcd.print("Message Sent.");
delay(1000);
}
void gsm_init()
{
lcd.clear();
lcd.print("Finding Module..");
boolean at_flag = 1;
while (at_flag)
{
Serial.println("AT");
while (Serial.available() > 0)
{
if (Serial.find("OK"))
at_flag = 0;
}
delay(1000);
}
lcd.clear();
lcd.print("Module Connected..");
delay(1000);
lcd.clear();
lcd.print("Disabling ECHO");
boolean echo_flag = 1;
while (echo_flag)
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 73
{
Serial.println("ATE0");
while (Serial.available() > 0)
{
if (Serial.find("OK"))
echo_flag = 0;
}
delay(1000);
}
lcd.clear();
lcd.print("Echo OFF");
delay(1000);
lcd.clear();
lcd.print("Finding Network..");
boolean net_flag = 1;
while (net_flag)
{
Serial.println("AT+CPIN?");
while (Serial.available() > 0)
{
if (Serial.find("+CPIN: READY"))
net_flag = 0;
}
delay(1000);
}
lcd.clear();
lcd.print("Network Found..");
delay(1000);
lcd.clear();
}
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 74
APPENDIX-B
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 75
APPENDIX-B
REFERENCES
 https://www.arduino.cc/
 https://en.wikipedia.org/wiki/GSM
 http://www.ijtrd.com/papers/IJTRD4034.pdf
 https://pdfs.semanticscholar.org
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 76
APPENDIX-C
AN INTELLIGENT SMS BASED PREPAID WATER METERING
SYSTEM
BY LAKSHMI PADMA Page 77
APPENDIX-C
BIBLIOGRAPHY
 NusratSharmin Islam and Md. Wasi-ur-Rahman,”An Intelligent SMS-Based Remote
Water Metering System”,Proceedings of 2009 12thInternational Conference on
Computer and Information Technology (ICCIT 2009), Dhaka, Bangladesh.
 L. Cao, J. Tianand D. Zhang, "Networked Remote Meter Reading System based on
Wireless Commu-nication Technology", proc. Of IEEE InternationalConference on
Information Acquisition, China,August 2006.
 X. Zhaoyin and H. Shiyong, "Automatic Remote Meter Reading System using
Bluetooth", Journal of Transducer Technology, vol. 23, no.7, pp. 68 70,2004.
 Q. Hao and Z. Song. "The Status and Development of the Intelligent Automatic
Meter Reading Sys-tem", proc of China Science andTechnology In-formation, no.19,
pp.72, October 2005.

More Related Content

What's hot

water level indicator alarm
water level indicator alarmwater level indicator alarm
water level indicator alarmAnish Anand
 
Smart Water Metering By Electronet Equipments Pvt Ltd
Smart Water Metering By Electronet Equipments Pvt LtdSmart Water Metering By Electronet Equipments Pvt Ltd
Smart Water Metering By Electronet Equipments Pvt LtdRajendra Nagaonkar
 
Micro Electronic Pill
Micro Electronic PillMicro Electronic Pill
Micro Electronic PillDarani Daran
 
Waterlevelindicator
WaterlevelindicatorWaterlevelindicator
WaterlevelindicatorShubhi Verma
 
wireless electronic notice board using GSM
wireless electronic notice board using GSMwireless electronic notice board using GSM
wireless electronic notice board using GSMVijeeth Anitha
 
Water quality monitoring in a smart city based on IOT
Water quality monitoring in a smart city based on IOTWater quality monitoring in a smart city based on IOT
Water quality monitoring in a smart city based on IOTMayur Rahangdale
 
automatic plant irrigation using aurdino and gsm technology
automatic plant irrigation using aurdino and gsm technologyautomatic plant irrigation using aurdino and gsm technology
automatic plant irrigation using aurdino and gsm technologythamil arasan
 
Microelectronic pill
Microelectronic pillMicroelectronic pill
Microelectronic pilldebabratrath
 
micro controller based heart rate monitoring system
micro controller based heart rate monitoring systemmicro controller based heart rate monitoring system
micro controller based heart rate monitoring systemEldhose George
 
Water level indicator by bhushan kumbhalkar
Water level indicator by  bhushan kumbhalkarWater level indicator by  bhushan kumbhalkar
Water level indicator by bhushan kumbhalkarBhushan Kumbhalkar
 
Project on soil moisture sensor
Project on soil moisture sensorProject on soil moisture sensor
Project on soil moisture sensorYADAVHEMANTSANTRAM
 
Ppt on water level indicator
Ppt on water level indicatorPpt on water level indicator
Ppt on water level indicatorpalwinder virk
 
Water level indicator
Water level indicatorWater level indicator
Water level indicatorJyotsna Rani
 
Automatic and low cost saline level monitoring system using wireless bluetoot...
Automatic and low cost saline level monitoring system using wireless bluetoot...Automatic and low cost saline level monitoring system using wireless bluetoot...
Automatic and low cost saline level monitoring system using wireless bluetoot...eSAT Journals
 
Iot based acquaponic system (dsd)
Iot based acquaponic system (dsd)Iot based acquaponic system (dsd)
Iot based acquaponic system (dsd)fahima meem
 
Smart Hydroponic Plant Growing System using IoT
Smart Hydroponic Plant Growing System using IoTSmart Hydroponic Plant Growing System using IoT
Smart Hydroponic Plant Growing System using IoTGustavo Sanchez Collado
 
Garbage monitoring system IOT
Garbage monitoring system IOTGarbage monitoring system IOT
Garbage monitoring system IOTamandeep singh
 

What's hot (20)

water level indicator alarm
water level indicator alarmwater level indicator alarm
water level indicator alarm
 
Smart Water Metering By Electronet Equipments Pvt Ltd
Smart Water Metering By Electronet Equipments Pvt LtdSmart Water Metering By Electronet Equipments Pvt Ltd
Smart Water Metering By Electronet Equipments Pvt Ltd
 
Micro Electronic Pill
Micro Electronic PillMicro Electronic Pill
Micro Electronic Pill
 
Waterlevelindicator
WaterlevelindicatorWaterlevelindicator
Waterlevelindicator
 
wireless electronic notice board using GSM
wireless electronic notice board using GSMwireless electronic notice board using GSM
wireless electronic notice board using GSM
 
Water quality monitoring in a smart city based on IOT
Water quality monitoring in a smart city based on IOTWater quality monitoring in a smart city based on IOT
Water quality monitoring in a smart city based on IOT
 
automatic plant irrigation using aurdino and gsm technology
automatic plant irrigation using aurdino and gsm technologyautomatic plant irrigation using aurdino and gsm technology
automatic plant irrigation using aurdino and gsm technology
 
Microelectronic pill
Microelectronic pillMicroelectronic pill
Microelectronic pill
 
micro controller based heart rate monitoring system
micro controller based heart rate monitoring systemmicro controller based heart rate monitoring system
micro controller based heart rate monitoring system
 
Water level indicator alarm
Water level indicator alarmWater level indicator alarm
Water level indicator alarm
 
Water level indicator by bhushan kumbhalkar
Water level indicator by  bhushan kumbhalkarWater level indicator by  bhushan kumbhalkar
Water level indicator by bhushan kumbhalkar
 
Digital voltmeter project
Digital voltmeter projectDigital voltmeter project
Digital voltmeter project
 
Project on soil moisture sensor
Project on soil moisture sensorProject on soil moisture sensor
Project on soil moisture sensor
 
Ppt on water level indicator
Ppt on water level indicatorPpt on water level indicator
Ppt on water level indicator
 
Water level indicator
Water level indicatorWater level indicator
Water level indicator
 
Automatic and low cost saline level monitoring system using wireless bluetoot...
Automatic and low cost saline level monitoring system using wireless bluetoot...Automatic and low cost saline level monitoring system using wireless bluetoot...
Automatic and low cost saline level monitoring system using wireless bluetoot...
 
Intravenous Drip Monitoring System
Intravenous Drip Monitoring SystemIntravenous Drip Monitoring System
Intravenous Drip Monitoring System
 
Iot based acquaponic system (dsd)
Iot based acquaponic system (dsd)Iot based acquaponic system (dsd)
Iot based acquaponic system (dsd)
 
Smart Hydroponic Plant Growing System using IoT
Smart Hydroponic Plant Growing System using IoTSmart Hydroponic Plant Growing System using IoT
Smart Hydroponic Plant Growing System using IoT
 
Garbage monitoring system IOT
Garbage monitoring system IOTGarbage monitoring system IOT
Garbage monitoring system IOT
 

Similar to AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM

IRJET- Automated Water Conservation and Theft Detection using IOT
IRJET-  	  Automated Water Conservation and Theft Detection using IOTIRJET-  	  Automated Water Conservation and Theft Detection using IOT
IRJET- Automated Water Conservation and Theft Detection using IOTIRJET Journal
 
iaetsd A novel approach towards automatic water conservation system
iaetsd A novel approach towards automatic water conservation systemiaetsd A novel approach towards automatic water conservation system
iaetsd A novel approach towards automatic water conservation systemIaetsd Iaetsd
 
Water Supply Measurement and Management System Based on IoT with Water Leakag...
Water Supply Measurement and Management System Based on IoT with Water Leakag...Water Supply Measurement and Management System Based on IoT with Water Leakag...
Water Supply Measurement and Management System Based on IoT with Water Leakag...IRJET Journal
 
Internet of Things (IoT) based Smart Water Tank Level Monitoring and Motor Pu...
Internet of Things (IoT) based Smart Water Tank Level Monitoring and Motor Pu...Internet of Things (IoT) based Smart Water Tank Level Monitoring and Motor Pu...
Internet of Things (IoT) based Smart Water Tank Level Monitoring and Motor Pu...IRJET Journal
 
IRJET- Smart Water Management
IRJET-  	  Smart Water ManagementIRJET-  	  Smart Water Management
IRJET- Smart Water ManagementIRJET Journal
 
Smart Water Meter System for Detecting Sudden Water Leakage
Smart Water Meter System for Detecting Sudden Water LeakageSmart Water Meter System for Detecting Sudden Water Leakage
Smart Water Meter System for Detecting Sudden Water LeakageAneekBanerjee4
 
IRJET - A Survey on Automation of Manually Operated Devices
IRJET - A Survey on Automation of Manually Operated DevicesIRJET - A Survey on Automation of Manually Operated Devices
IRJET - A Survey on Automation of Manually Operated DevicesIRJET Journal
 
IoT Based Water Management and Supervision System
IoT Based Water Management and Supervision SystemIoT Based Water Management and Supervision System
IoT Based Water Management and Supervision SystemKaushik Gupta
 
IRJET- Water Level Control, Monitoring and Altering System by using GSM i...
IRJET-  	  Water Level Control, Monitoring and Altering System by using GSM i...IRJET-  	  Water Level Control, Monitoring and Altering System by using GSM i...
IRJET- Water Level Control, Monitoring and Altering System by using GSM i...IRJET Journal
 
IRJET- Smart Aqua Meter with Live Usage Monitoring and Automatic Leakage Dete...
IRJET- Smart Aqua Meter with Live Usage Monitoring and Automatic Leakage Dete...IRJET- Smart Aqua Meter with Live Usage Monitoring and Automatic Leakage Dete...
IRJET- Smart Aqua Meter with Live Usage Monitoring and Automatic Leakage Dete...IRJET Journal
 
IRJET- Design and Implementation of Wireless based Water Level Monitoring Sys...
IRJET- Design and Implementation of Wireless based Water Level Monitoring Sys...IRJET- Design and Implementation of Wireless based Water Level Monitoring Sys...
IRJET- Design and Implementation of Wireless based Water Level Monitoring Sys...IRJET Journal
 
IOT Based Water Level Monitoring System For Lake
IOT Based Water Level Monitoring System For LakeIOT Based Water Level Monitoring System For Lake
IOT Based Water Level Monitoring System For LakeIRJET Journal
 
IRJET- Machine Learning System on Plant Growth using Aquaculture
IRJET- Machine Learning System on Plant Growth using AquacultureIRJET- Machine Learning System on Plant Growth using Aquaculture
IRJET- Machine Learning System on Plant Growth using AquacultureIRJET Journal
 
211184120 report-2013
211184120 report-2013211184120 report-2013
211184120 report-2013homeworkping8
 
Implementation of sequential design based water level monitoring and controll...
Implementation of sequential design based water level monitoring and controll...Implementation of sequential design based water level monitoring and controll...
Implementation of sequential design based water level monitoring and controll...IJECEIAES
 
Water Level and Leakage Detection System with its Quality Analysis based on S...
Water Level and Leakage Detection System with its Quality Analysis based on S...Water Level and Leakage Detection System with its Quality Analysis based on S...
Water Level and Leakage Detection System with its Quality Analysis based on S...IRJET Journal
 
IRJET - Advanced Flood Level Monitoring and Alerting System
IRJET -  	  Advanced Flood Level Monitoring and Alerting SystemIRJET -  	  Advanced Flood Level Monitoring and Alerting System
IRJET - Advanced Flood Level Monitoring and Alerting SystemIRJET Journal
 
IRJET- Software Sensor for Potable Water Quality through Qualitative and ...
IRJET-  	  Software Sensor for Potable Water Quality through Qualitative and ...IRJET-  	  Software Sensor for Potable Water Quality through Qualitative and ...
IRJET- Software Sensor for Potable Water Quality through Qualitative and ...IRJET Journal
 

Similar to AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM (20)

IRJET- Automated Water Conservation and Theft Detection using IOT
IRJET-  	  Automated Water Conservation and Theft Detection using IOTIRJET-  	  Automated Water Conservation and Theft Detection using IOT
IRJET- Automated Water Conservation and Theft Detection using IOT
 
iaetsd A novel approach towards automatic water conservation system
iaetsd A novel approach towards automatic water conservation systemiaetsd A novel approach towards automatic water conservation system
iaetsd A novel approach towards automatic water conservation system
 
Water Supply Measurement and Management System Based on IoT with Water Leakag...
Water Supply Measurement and Management System Based on IoT with Water Leakag...Water Supply Measurement and Management System Based on IoT with Water Leakag...
Water Supply Measurement and Management System Based on IoT with Water Leakag...
 
Internet of Things (IoT) based Smart Water Tank Level Monitoring and Motor Pu...
Internet of Things (IoT) based Smart Water Tank Level Monitoring and Motor Pu...Internet of Things (IoT) based Smart Water Tank Level Monitoring and Motor Pu...
Internet of Things (IoT) based Smart Water Tank Level Monitoring and Motor Pu...
 
IRJET- Smart Water Management
IRJET-  	  Smart Water ManagementIRJET-  	  Smart Water Management
IRJET- Smart Water Management
 
N044066769
N044066769N044066769
N044066769
 
Smart Water Meter System for Detecting Sudden Water Leakage
Smart Water Meter System for Detecting Sudden Water LeakageSmart Water Meter System for Detecting Sudden Water Leakage
Smart Water Meter System for Detecting Sudden Water Leakage
 
IRJET - A Survey on Automation of Manually Operated Devices
IRJET - A Survey on Automation of Manually Operated DevicesIRJET - A Survey on Automation of Manually Operated Devices
IRJET - A Survey on Automation of Manually Operated Devices
 
IoT Based Water Management and Supervision System
IoT Based Water Management and Supervision SystemIoT Based Water Management and Supervision System
IoT Based Water Management and Supervision System
 
IRJET- Water Level Control, Monitoring and Altering System by using GSM i...
IRJET-  	  Water Level Control, Monitoring and Altering System by using GSM i...IRJET-  	  Water Level Control, Monitoring and Altering System by using GSM i...
IRJET- Water Level Control, Monitoring and Altering System by using GSM i...
 
IRJET- Smart Aqua Meter with Live Usage Monitoring and Automatic Leakage Dete...
IRJET- Smart Aqua Meter with Live Usage Monitoring and Automatic Leakage Dete...IRJET- Smart Aqua Meter with Live Usage Monitoring and Automatic Leakage Dete...
IRJET- Smart Aqua Meter with Live Usage Monitoring and Automatic Leakage Dete...
 
IRJET- Design and Implementation of Wireless based Water Level Monitoring Sys...
IRJET- Design and Implementation of Wireless based Water Level Monitoring Sys...IRJET- Design and Implementation of Wireless based Water Level Monitoring Sys...
IRJET- Design and Implementation of Wireless based Water Level Monitoring Sys...
 
IOT Based Water Level Monitoring System For Lake
IOT Based Water Level Monitoring System For LakeIOT Based Water Level Monitoring System For Lake
IOT Based Water Level Monitoring System For Lake
 
IRJET- Machine Learning System on Plant Growth using Aquaculture
IRJET- Machine Learning System on Plant Growth using AquacultureIRJET- Machine Learning System on Plant Growth using Aquaculture
IRJET- Machine Learning System on Plant Growth using Aquaculture
 
211184120 report-2013
211184120 report-2013211184120 report-2013
211184120 report-2013
 
Automatic Dam Shutter Opening System: A Review
Automatic Dam Shutter Opening System: A ReviewAutomatic Dam Shutter Opening System: A Review
Automatic Dam Shutter Opening System: A Review
 
Implementation of sequential design based water level monitoring and controll...
Implementation of sequential design based water level monitoring and controll...Implementation of sequential design based water level monitoring and controll...
Implementation of sequential design based water level monitoring and controll...
 
Water Level and Leakage Detection System with its Quality Analysis based on S...
Water Level and Leakage Detection System with its Quality Analysis based on S...Water Level and Leakage Detection System with its Quality Analysis based on S...
Water Level and Leakage Detection System with its Quality Analysis based on S...
 
IRJET - Advanced Flood Level Monitoring and Alerting System
IRJET -  	  Advanced Flood Level Monitoring and Alerting SystemIRJET -  	  Advanced Flood Level Monitoring and Alerting System
IRJET - Advanced Flood Level Monitoring and Alerting System
 
IRJET- Software Sensor for Potable Water Quality through Qualitative and ...
IRJET-  	  Software Sensor for Potable Water Quality through Qualitative and ...IRJET-  	  Software Sensor for Potable Water Quality through Qualitative and ...
IRJET- Software Sensor for Potable Water Quality through Qualitative and ...
 

Recently uploaded

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 

Recently uploaded (20)

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 

AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM

  • 1. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 1 CHAPTER 1
  • 2. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 2 CHAPTER: 1 INTRODUCTION 1.1 PRESENT SCENARIO: Now a day’s water demand is rapidly increasing with the increase in new infrastructures, new businesses and homes. With the advancement of technology trend has grown towards smart way of water metering, billing and controlling has come into existence. In this project, water management by prepaying the water bills is discussed. Water resources around the world are getting scarcer day after day. Climate, global warming, and irresponsible usage are major factors the make the situation even harder. Tremendous population growth causes insufficient and uneven distribution of water. So measuring the water usage and providing it with proper amount will limit the wastage of water in society. In the modern era of technology we came to know about various wireless control systems for our appliances or machines. Automatic meter reading is the technology of automatically collecting consumption, diagnostic, and status data from water meter or energy metering devices (gas, electric) and transferring that data to central database for billing, troubleshooting and analyzing. 1.2 PROPOSED SYSTEM: With the advancement of technology trend has grown towards smart way of water metering, billing and controlling has came into existence. In this project, water management by prepaying the water bills is discussed. So it avoids the scarcity of water and knows how pure the water is. The aim of this paper is to help the water service providers to monitor the meter readings from the location. The customer can buy water by sending SMS from his phone to control station and automatically receive the bill in his phone through GSM. The number of liters of water is determined, and then it transmitted to water meter through exiting GSM network.
  • 3. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 3 1.3 OBJECTIVE: The main objective of this project is:  A system that keeps an eye on usage of water consumption.  To provide water to everyone and avoid the scarcity of water. 1.4 LITERATURE SURVEY: The Mogale City municipality, which borders western Johannesburg in South Africa, is a pioneer of prepaid water, and possibly the first urban center to adopt prepaid water at scale. It installed its first prepaid system in 1999, and within three years had 30,000 meters in low and high income areas. Presently a prepaid water meter are available with smart card technology in which consumer spend amount of water loaded from credit sales office by loading the credit water meters via smart card. 1.5 IMPORTANCE OF WORK: This project is aimed to propose water management by prepaying the water bills. It is based on Arduino and GSM technologies. This project makes use of Arduino, GSM, flow sensor and solenoid valve 1.6 MOTIVATION OF WORK: Now a day’s technology has developed to a large extent. At the same time the need of water also increased. Water resources around the world are getting scarcer day after day. Some users disconnect the water supply line from the water meter and collect water directly from the supply line. Because of the absence of automatic monitoring system with the existing water meter, the water supply worker is unable to found the illegal users and this leads to illegal use of water and wastage to a great extent. Thus the billing system can become incorrect. It results in more amount of water wastage. So, we proposed the prepaid Unit which keeps information about how much water to be supplied. Depending on that information, the Prepaid Unit may disconnect the customer's line and gives no more supply of water to the house.
  • 4. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 4 1.7 ADVANTAGES:  Customer can easily monitor their use and spend as much as they can afford  To eliminate bill debt problems.  No need to send monthly usage bill. 1.8 DISADVANTAGES: If customer didn’t have phone; he should go directly to Water Company to buy water. 1.9 APPLICATIONS:  Residential applications.  Household applications.  Industrial applications. 1.10 ORGANIZATION OF THE REPORT: Organization of the thesis gives the clear idea about the project and provides smooth way to go through the project. Initially abstract gives an idea about the project, how it is linked with the real world and what are going to get through the project.  Chapter 1 deals with the introduction part of it. It mainly focuses on the object, literature survey, and importance of work and organization of the project.  Chapter 2 deals with block diagram description and schematic diagram description.  Chapter 3 deals with Arduino.  Chapter 4 deals with GSM Module.  Chapter 5 deals with Hardware Design Consideration.  Chapter 6 deals with Software Tools.  Chapter 7 deals with Results, Conclusion & Future scope.  APPENDIX-A Source Code.  APPENDIX-B References.  APPENDIX-C Bibliography.
  • 5. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 5 CHAPTER 2
  • 6. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 6 CHAPTER-2 THEORY RELEVANT 2.1 INTRODUCTION:  The purpose of the project is to avoid water scarcity and provide clean drinking water take it for granted and do not use it wisely. 2.2 BLOCK DIAGRAM: Fig. 2.1: Block Diagram Of Prepaid Water Meter 2.3 INDIVIDUAL BLOCKS DESCRIPTION: This project mainly consists of Power Supply, Arduino, GSM, Flow Sensor and Solenoid valve, Switching circuit and LCD Module
  • 7. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 7 2.3.1 POWER SUPPLY: In our project, we require 5v regulated power supply. In general, we use an AC supply of 230V 50Hz, but this power has to be changed into the required form with required values or voltage range for providing power supply to different types of devices. There are various types of power electronic converters such as step-down converter, step- up converter, voltage stabilizer, AC to DC converter, DC to DC converter, DC to AC converter. Fig 2.2: power supply 2.3.2 MICRO CONTROLLER: In our project we are using ATMEGA328p microcontroller. This section forms the control unit of the whole project. This section basically consists of a microcontroller with its associated circuitry like capacitors, resistors, and reset circuitry and so on. The microcontroller forms the heart of the project because it controls the devices being interfaced and communicates with the devices according to the program being written. 2.3.3 FLOW SENSOR: In our project we are using YF-S201 water flow sensor. The Water Flow sensor measures the rate of a liquid flowing through it and consists of a plastic valve body, flow rotor and Hall Effect sensor. It is usually used at the inlet end to detect the amount of flow.
  • 8. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 8 When liquid flows through the sensor, a magnetic rotor will rotate and the rate of rotation will vary with the rate of flow. The Hall Effect sensor will then output a pulse width signal. Fig 2.3: Flow sensor Fig 2.4: Inside view of Flow sensor 2.3.4 SOLENOID VALVE: A solenoid valve is an electromechanically operated valve. Solenoid is the generic term for a coil of wire used as an electromagnet. It also refers to any device that converts electrical
  • 9. AN INTELLIGENT SMS BASED PREPAID WATER METERING BY LAKSHMI PADMA energy to mechanical energy using electrical current to effect operations at expense of very little electrical electrical current is applied to coil, based on polarity of magnet and direction of current flow valve is latched or delatched. 2.3.5 LCD MODULE (JHD 162A): In this project we are using used in a wide range of applications, including palmtop computers, word processors, photocopiers, point of sale terminals, medical instruments, cellular phones, etc. The 16x2 intelligent alphanumeric dot matrix displays is capable of displaying 224 different characters and symbols. Serial LCD firmware allows serial control of th easier connection and use of the LCD module. The firmware enables microcontrollers (and microcontroller based systems such as the PICAXE) to visually output user instructions or AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM energy to mechanical energy using a solenoid. A solenoid valve employs magnets and electrical current to effect operations at expense of very little electrical electrical current is applied to coil, based on polarity of magnet and direction of current flow valve is latched or delatched. Fig 2.5: solenoid valve LCD MODULE (JHD 162A): In this project we are using JHD 162A LCD Module. Alphanumeric displays are used in a wide range of applications, including palmtop computers, word processors, photocopiers, point of sale terminals, medical instruments, cellular phones, etc. The 16x2 intelligent alphanumeric dot matrix displays is capable of displaying 224 different characters Serial LCD firmware allows serial control of the display. This option provides much easier connection and use of the LCD module. The firmware enables microcontrollers (and microcontroller based systems such as the PICAXE) to visually output user instructions or AN INTELLIGENT SMS BASED PREPAID WATER METERING Page 9 A solenoid valve employs magnets and electrical current to effect operations at expense of very little electrical power. When electrical current is applied to coil, based on polarity of magnet and direction of current flow Alphanumeric displays are used in a wide range of applications, including palmtop computers, word processors, photocopiers, point of sale terminals, medical instruments, cellular phones, etc. The 16x2 intelligent alphanumeric dot matrix displays is capable of displaying 224 different characters e display. This option provides much easier connection and use of the LCD module. The firmware enables microcontrollers (and microcontroller based systems such as the PICAXE) to visually output user instructions or
  • 10. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 10 readings onto an LCD module. All LCD commands are transmitted serially via a single microcontroller pin. 2.3.6 GSM (global system for mobile communication): GSM is a mobile communication modem; it is stands for global system for mobile communication (GSM). The idea of GSM was developed at Bell Laboratories in 1970. It is widely used mobile communication system in the world. GSM is an open and digital cellular technology used for transmitting mobile voice and data services operates at the 850MHz, 900MHz, 1800MHz and 1900MHz frequency bands. GSM system was developed as a digital system using time division multiple access (TDMA) technique for communication purpose. A GSM digitizes and reduces the data, then sends it down through a channel with two different streams of client data, each in its own particular time slot. The digital system has an ability to carry 64 kbps to 120 Mbps of data rates. 2.3.7 RELAY: In this project JQC3FC RELAY is used. A relay is an electromechanical device which is used in the form of a switch. It is used to control a high power or high voltage circuit by a low-power signal. Normally, Relay is in NC state. Fig 2.6: Relay
  • 11. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 11 2.4 SCHEMATIC DIAGRAM: Fig 2.7: Schematic Diagram Working of prepaid water metering system: Arduino Uno Rev3 is used for water management. It is an in-built device. Arduino needs DC supply of (6-12V) and it is provided from the power circuit or we can provide it from USB. In our system pre-paid water metering system, we use a turbine based flow sensor that gives pulses directly proportional to the flow of volume through it. It measures flow rate by using the natural kinetic energy of the flow as it passes through the angled blades of the turbine rotor. This causes the turbine to spin and as the blades pass by a close prepositioned magnetic (Or other technology) “pick up” coil. The resulting interruption of the coils magnetic field by each blade results in a pulse being produced.
  • 12. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 12 A solenoid valve is an electromechanically operated valve. Solenoid valves are the most frequently used control elements in fluidics. A solenoid valve has two main parts: the solenoid and the valve. The solenoid converts electrical energy into mechanical energy which, in turn, opens or closes the valve mechanically. A solenoid valve employs magnets and electrical current to effect operations at expense of very little electrical power. When electrical current is applied to coil, based on polarity of magnet and direction of current flow valve is latched or delatched. When current polarity is reversed, valve latches if in delatched position and vice versa. A flow sensor is attached in the pipeline to the customer which gives the output in pulses as consumption of water in liter. Microcontroller will count that pulses and decrement the balance count which is added by the SMS send through GSM by water authority by paying appropriate amount, when the balance count becomes less (threshold value) it sends a message “Balance is less” to the display device.  If customer recharge their account for uninterrupted water supply, the customer will receive the bill and the water meter will recharge after the control station receive the customer order to buy water; then control station issued a command to valve to be open to allow the passage of water through pipes. In other side; in consumer premises the LCD of water meter show the number of liters and the LED show green light.  If customer didn’t recharge their account and balance count becomes zero microcontroller will turn off the solenoid valve in the pipeline and water supply will interrupted to the customer. Thus, we can minimize the wastage of fresh water and prevent water shortage during dry seasons. It can also Compel every customer to pay for the exact amount of water used or wasted and make every customer a self-interested guardian of the water supply.
  • 13. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 13 CHAPTER 3
  • 14. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 14 CHAPTER-3 ARDUINO 3.1 ARDUINO: Arduino is an open source prototyping platform based on easy-to-use hardware and software. Arduino boards are able to read inputs-light on a sensor, a finger on a button, or a Twitter message- and turn it into an output-activating a motor, turning on an LED, publishing something online. We can tell our board what to do by sending a set of instructions to the microcontroller on the board. To do so we use the Arduino programming language (based on wiring), and the Arduino software (IDE), based on processing. Fig 3.1: Arduino Logo Over the years Arduino has been the brain of thousands of projects, from everyday objects to complex scientific instruments. A worldwide community of makers-students, hobbyists, artists, programmers, and professionals- has gathered around this open-source platform, their contributions have added up to an incredible amount of accessible knowledge that can be of great help to novices and experts alike. Arduino has born at the Ivrea Interaction Design Institute as an easy tool for fast prototyping, aimed at students without a background in electronics and programming. As soon as it reached a wider community, the Arduino board started changing to adapt to new
  • 15. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 15 needs and challenges, differentiating its offer from simple 8-bit boards to products for IOT applications, wearable, 3D printing, and embedded environments. All Arduino boards are completely open-source, empowering users to build them independently and eventually adapt them to their particular needs. The software, too, is open-source, and it is growing through the contributions of users worldwide. 3.2 WHY ARDUINO: Arduino has been used in thousands of different projects and applications. The Arduino software is easy-to-use for beginners, at flexible enough for advanced users. It runs on Mac, Windows, and Linux. Teachers and students use it to build low cost scientific instruments, to prove chemistry and physics principles, or to get started with programming and robotics. Designers and architects build interactive prototypes, musicians and artists used for installation and to experiment with new musical instruments. Makers, of course, use it to build many of the projects exhibited at the maker faire, for example. Arduino is a key tool to learn new things. Any one-children, hobbyists, artists, programmers- can start tinkering just following the step by step instructions of a kit. There are many other microcontrollers and microcontroller platforms available for physical computing. Parallax basic stamp, Net medias BX-24, Phidgets, MIT’s Handy board, and many others offer similar functionality. All of these tools take the messy details of microcontroller programming and wrap it up in an easy-to-use package. Arduino also simplifies the process of working with microcontrollers, but it offers some advantage for teachers, student, and interested amateurs over the systems. 3.3 ADVANTAGES:  Inexpensive: Arduino boards are relatively inexpensive compared to other microcontroller platforms. The least expensive version of the Arduino module can be assembled by hand, and even the pre-assembled Arduino modules cost less than $50.  Cross platform: The Arduino software (IDE) runs on Windows, Macintosh OSX, and Linux operating systems. Most microcontroller systems are limited to Windows.
  • 16. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 16  Simple, clear programming environment: The Arduino software (IDE) is easy-to-use for beginners, at flexible enough for advanced users to take advantage of as well. For teachers, it’s conveniently based on the processing programming environment, so students learning to program in that environment will be familiar with how the Arduino IDE works.  Open source and extensible software: Arduino software is published as open source tools, available for extension by experienced programmers. The language can be expanded through C++ libraries, and people wanting to understand the technical details can make the leap from Arduino to the AVR C programming language on which is based. Similarly, we can add AVR-C code directly into our Arduino programs if we want to.  Open source and extensible hardware: The plans of the Arduino boards are published under a creative commons license, so experienced circuit designers can make their own version of the module, extending it and improving it. Even relatively inexperienced users can build the bread board version of the module in order to understand how it works and save money. 3.4 ARDUINO UNO: The UNO is the best board to get started with electronics and coding. If this is your experience tinkering with the platform, the UNO is the most robust board we can start playing with. The UNO is the most used and documented board of the whole Arduino Genuino family. The Arduino UNO R3 is a microcontroller board based on the “ATmega328”. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz crystal oscillator, 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 (not included) or power it with an AC-to-DC adapter or battery to get started. You can tinker with your UNO without working too much about doing something wrong, worst case scenario we can replace the chip for a few dollars and start over again.
  • 17. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 17 Fig. 3.2: Arduino Uno Board “Uno” means one in Italian and was chosen to mark the release of Arduino software (IDE) 1.0. The Uno board and version 1.0 of Arduino Software (IDE) were the reference versions of Arduino, now evolved to newer releases. The Uno board is the first in a series of USB Arduino boards, and the reference model for the Arduino platform; for an extensive list of current, past or outdated boards see the Arduino index of boards. 3.5 TECHNICAL SPECIFICATIONS: Microcontroller : ATmega328P Operating Voltage : 5V Input Voltage (recommended) : 7-12V
  • 18. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 18 Input Voltage (limit) : 6-20V Digital I/O Pins : 14 (of which 6 provide PWM output) PWM Digital I/O Pins : 6 Analog Input Pins : 6 DC Current per I/O Pin : 20Ma DC Current for 3.3V Pin : 50Ma Flash Memory : 32Kb (ATmega328P) of which 0.5 kB used by bootloader SRAM : 2 kB (ATmega328P) EEPROM : 1 kB (ATmega328P) Clock Speed : 16 MHz Length : 68.6 mm Width : 53.4 mm Weight : 25 g 3.6 PROGRAMMING: The Uno can be programmed with the Arduino Software (IDE). The ATmega328 on the Uno comes preprogrammed with a bootloader 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, C header files). We can also bypass the bootloader and program the microcontroller through the ICSP (In-Circuit Serial Programming) header using Arduino ISP or similar. The ATmega16U2 (or 8U2 in the Rev1 and Rev2 boards) firmware source code is available in the Arduino repository. The ATmega16U2/8U2 is loaded with a DFU bootloader, which can be activated by:  On Rev1 boards: connecting the solder jumper on the back of the board (near the map of Italy) and then resting the 8U2.  On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to
  • 19. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 19 ground, making it easier to put into DFU mode. We can then use Atmel’s FLIP software (Windows) or the DFU programmer (Mac OS X and Linux) to load a new firmware. Or you can use the ISP header with an external programmer (overwriting the DFU bootloader). 3.7 DIFFERENCE WITH OTHER BOARDS: 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. Power: The Uno board 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 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 from 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may become 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 Uno board when it's using an external power source (as opposed to 5V 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 the DC power jack (7 - 12V), the USB connector
  • 20. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 20 (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 advise it.  3V3: A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50mA.  GND: Ground pins.  IOREF: This pin on the Uno board provides the voltage reference with which the microcontroller operates. A properly configured shield can read the IOREF pin voltage and select the appropriate power source or enable voltage translators on the outputs to work with the 5V or 3.3V.  Memory: The ATmega328 has 32 kB (with 0.5 kB occupied by 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: See the mapping between Arduino pins and ATmega328P ports. The mapping for the Atmega8, 168, and 328 is identical. 3.8 PIN MAPPING: Fig. 3.3: Pin Diagram Of Atmega328
  • 21. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 21 3.9ATMEGA328P: Each of the 14 digital pins on the Uno can be used as an input or output, using pin Mode(), digital Write(), and digital Read() functions. They operate at 5 volts. Each pin can provide or receive 20mA as recommended operating condition and has an internal pull-up resistor (disconnected by default) of 20-50k ohm. A maximum of 40mA is the value that must not be exceeded on any I/O pin to avoid permanent damage to the microcontroller. 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 the ATmega8U2 USB-to-TTL Serial chip.  External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. See the attach Interrupt() function for details.  PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analog 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 driven by digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it's off.  TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire library. The Uno has 6 analog inputs, values). By default they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and the analog labeled A0 through A5, each of which provide 10 bits of resolution (i.e. 1024 different Reference() function. There are a couple of other pins on the board.  AREF: Reference voltage for the analog inputs. Used with analog Reference()  Reset: Bring this line LOW to reset the microcontroller.
  • 22. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 22 3.10 COMMUNICATION: The Uno has a number of facilities for communicating with a computer, another Uno board, 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 (IDE) includes a serial monitor which allows simple textual data to be sent to and from the board. The RX and TX LEDs on the board will flash when data is being transmitted via the USB-to-serial chip and USB connection to the computer (but not for serial communication on pins 0 and 1). A Software Serial library allows serial communication on any of the Uno's digital pins. The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino Software (IDE) includes a Wire library to simplify use of the I2C bus; see the documentation for details. For SPI communication, use the SPI library. 3.11 AUTOMATIC (SOFTWARE) RESET: Rather than requiring a physical press of the reset button before an upload, the Uno board is designed in a way that allows it to be reset by software running on a connected computer. One of the hardware flow control lines (DTR) of the ATmega8U2/16U2 is connected to the reset line of the ATmega328 via a 100 nano Farad capacitor. When this line is asserted (taken low), the reset line drops long enough to reset the chip. The Arduino Software (IDE) uses this capability to allow you to upload code by simply pressing the upload button in the interface toolbar. This means that the boot-loader can have a shorter timeout, as the lowering of DTR can be well-coordinated with the start of the upload. This setup has other implications. When the Uno is connected to either a computer running Mac OS X or Linux, it resets each time a connection is made to it from software (via USB). For the following half-second or so, the boot-loader is running on the Uno. While it is
  • 23. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 23 programmed to ignore malformed data (i.e. anything besides an upload of new code), it will intercept the first few bytes of data sent to the board after a connection is opened. If a sketch running on the board receives one-time configuration or other data when it first starts, make sure that the software with which it communicates waits a second after opening the connection and before sending this data. The Uno board 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. 3.12 APPLICATIONS OF ARDUNIO UNO:  DIY project prototyping.  Developing varied varieties of projects that require a code based control.  Automation System development.  Learning AVR programming.  Entry level circuit designing.
  • 24. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 24 CHAPTER 4
  • 25. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 25 CHAPTER-4 GSM MODULE 4.1 GSM: Global System for Mobile Communication (GSM) is a set of ETSI standards specifying the infrastructure for a digital cellular service. The standard is used in approx. 85 countries in the world including such locations as Europe, Japan and Australia. The idea of GSM was developed at Bell Laboratories in 1970. It is widely used mobile communication system in the world. GSM is an open and digital cellular technology used for transmitting mobile voice and data services operates at the 850MHz, 900MHz, 1800MHz and 1900MHz frequency bands. There are various cell sizes in a GSM system such as macro, micro, pico and umbrella cells. Each cell varies as per the implementation domain. There are five different cell sizes in a GSM network macro, micro, pico and umbrella cells. The coverage area of each cell varies according to the implementation environment. 4.2 GSM MODEM: Fig 4.1: GSM modem
  • 26. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 26 A GSM modem is a device which can be either a mobile phone or a modem device which can be used to make a computer or any other processor communicate over a network. A GSM modem requires a SIM card to be operated and operates over a network range subscribed by the network operator. It can be connected to a computer through serial, USB or Bluetooth connection. A GSM modem can also be a standard GSM mobile phone with the appropriate cable and software driver to connect to a serial port or USB port on your computer. GSM modem is usually preferable to a GSM mobile phone. The GSM modem has wide range of applications in transaction terminals, supply chain management, security applications, weather stations and GPRS mode remote data logging. 4.3 WIRELESS MODEM: Wireless MODEMs are the MODEM devices that generate, transmit or decode data from a cellular network, for establishing communication between the cellular network and the computer. These are manufactured for specific cellular network (GSM/UMTS/CDMA) or specific cellular data standard (GSM/UMTS/GPRS/EDGE/HSDPA) or technology (GPS/SIM). Wireless MODEMs like other MODEM devices use serial communication to interface with and need Hayes compatible AT commands for communication with the computer (any microprocessor or microcontroller system). A GSM modem exposes an interface that allows applications such as now SMS to send and receive messages over the modem interface. The mobile operator charges for this message sending and receiving as if it was performed directly on a mobile phone. To perform these tasks, a GSM modem must support an “extended AT commands set “ for sending /receiving SMS messages, as defined in the ETSI GSM 07.05 and 3GPP TS 27.005 specifications. Time Division Multiple Access TDMA technique relies on assigning different time slots to each user on the same frequency.
  • 27. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 27 It can easily adapt to data transmission and voice communication and can carry 64kbps to 120mbps of data rate. Fig 4.2: Types of wireless modems 4.4 GSM ARCHITECTURE: A GSM network is composed of several functional entities, whose functions and interfaces are defined. Figure 4.3 shows the layout of a generic GSM network. The GSM network can be divided into three broad parts. The Mobile Station is carried by the subscriber. The Base Station subsystem controls the radio link with the Mobile Station. The Network Subsystem, the main part of which is the Mobile services Switching Center(MSC), performs the switching of calls between the mobile and fixed network users. The Mobile Station and the Base Station subsystem communicate across the Um interface, also known as the air interface or radio link. The Base Station Subsystem communicates with the Mobile service Switching Center across the interface. The GSM network architecture as defined in the GSM specifications can be grouped into three main areas:  Mobile station (MS)
  • 28. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 28  Base-Station Subsystem (BSS)  Network and Switching Subsystem (NSS) The different elements of the GSM network operate together and the user is not aware of the different entities within the system. Fig 4.3: GSM architecture 4.4.1 Mobile station: Mobile stations (MS), mobile equipment (ME) or as they are most widely known, cell or mobile phones are the section of a GSM cellular network that the user sees and operates. In recent years their size has fallen dramatically while the level of functionality has greatly increased. A further advantage is that the time between charges has significantly increased. There are a number of elements to the cell phone, although the two main elements are the main hardware and the SIM.
  • 29. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 29 The hardware itself contains the main elements of the mobile phone including the display, case, battery, and the electronics used to generate the signal, and process the data receiver and to be transmitted. It also contains a number known as the International Mobile Equipment Identity(IMEI). This is installed in the phone at manufacture and "cannot" be changed. It is accessed by the network during registration to check whether the equipment has been reported as stolen. The SIM or Subscriber Identity Module contains the information that provides the identity of the user to the network. It contains are variety of information including a number known as the International Mobile Subscriber Identity (IMSI). 4.4.2 Base Station Subsystem (BSS): The Base Station Subsystem (BSS) section of the GSM network architecture that is fundamentally associated with communicating with the mobiles on the network. It consists of two elements Base Transceiver Station (BTS): The BTS used in a GSM network comprises the radio transmitter receivers, and their associated antennas that transmit and receive to directly communicate with the mobiles. The BTS is the defining element for each cell. The BTS communicates with the mobiles and the interface between the two is known as the Um interface with its associated protocols. Base Station Controller (BSC): The BSC forms the next stage back into the GSM network. It controls a group of BTSs, and is often co-located with one of the BTSs in its group. It manages the radio resources and controls items such as handover within the group of BTSs, allocates channels and the like. It communicates with the BTSs over what is termed the Abis interface.
  • 30. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 30 4.4.3 Network Switching Subsystem (NSS): The GSM system architecture contains a variety of different elements, and is often termed the core network. It provides the main control and interfacing for the whole mobile network. The major elements within the core network include. Mobile Services Switching Centre (MSC): The main element within the core network area of the overall GSM network architecture is the Mobile switching Services Centre (MSC). The MSC acts like a normal switching node within a PSTN or ISDN, but also provides additional functionality to enable the requirements of a mobile user to be supported. These include registration, authentication, call location, inter-MSC handovers and call routing to a mobile subscriber. It also provides an interface to the PSTN so that calls can be routed from the mobile network to a phone connected to a landline. Interfaces to other MSCs are provided to enable calls to be made to mobiles on different networks.  Mobile switch center (MSC)  Home location register (HLR)  Visitor location Register (VLR)  Authentications center (Auc)  Equipment Identity Register (EIR)  Interworking Functions (IWF) Home Location Register (HLR): This database contains all the administrative information about each subscriber along with their last known location. In this way, the GSM network is able to route calls to the relevant base station for the MS. When a user switches on their phone, the phone registers with the network and from this it is possible to determine which BTS it communicates with so that incoming calls can be routed appropriately. Even when the phone is not active (but switched on) it re-registers periodically to ensure that the network (HLR) is aware of its latest position.
  • 31. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 31 There is one HLR per network, although it may be distributed across various sub- centres to for operational reasons. Visitor Location Register (VLR): This contains selected information from the HLR that enables the selected services for the individual subscriber to be provided. The VLR can be implemented as a separate entity, but it is commonly realised as an integral part of the MSC, rather than a separate entity. In this way access is made faster and more convenient. Equipment Identity Register (EIR): The EIR is the entity that decides whether a given mobile equipment may be allowed onto the network. Each mobile equipment has a number known as the International Mobile Equipment Identity. This number, as mentioned above, is installed in the equipment and is checked by the network during registration. Dependent upon the information held in the EIR, the mobile may be allocated one of three states - allowed onto the network, barred access, or monitored in case its problems. White list: This list contains the IMEI of the phones who are allowed to enter in the network. Black list: This list on the contrary contains the IMEI of the phones who are not allowed to enter in the network, for example because they are stolen. Grey list: This list contains the IMEI of the phones momentarily not allowed to enter in the network, for example because the software version is too old or because they are in repair. Authentication Centre (AuC): The AuC database holds different algorithms that are used for authentication and encryptions of the mobile subscribers that verify the mobile user’s identity and ensure the confidentiality of each call.
  • 32. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 32 The AuC holds the authentication and encryption keys for all the subscribers in both the home and visitor location register. Gateway Mobile Switching Centre (GMSC): The GMSC is the point to which a ME terminating call is initially routed, without any knowledge of the MS's location. The GMSC is thus in charge of obtaining the MSRN (Mobile Station Roaming Number) from the HLR based on the MSISDN (Mobile Station ISDN number, the "directory number" of a MS) and routing the call to the correct visited MSC. The "MSC" part of the term GMSC is misleading, since the gateway operation does not require any linking to an MSC. SMS Gateway (SMS-G): The SMS-G or SMS gateway is the term that is used to collectively describe the two Short Message Services Gateways defined in the GSM standards. The two gateways handle messages directed in different directions. The SMS-GMSC (Short Message Service Gateway Mobile Switching Centre) is for short messages being sent to an ME. The SMS-IWMSC (Short Message Service Inter-Working Mobile Switching Centre) is used for short messages originated with a mobile on that network. The SMS-GMSC role is similar to that of the GMSC, whereas the SMS-IWMSC provides a fixed access point to the Short Message Service Centre. 4.5 FEATURES OF GSM MODULE:  Improved spectrum efficiency  International roaming  Compatibility with integrated services digital network (ISDN)  Support for new services.  SIM phonebook management  Fixed dialing number (FDN)  Real time clock with alarm management  High-quality speech  Uses encryption to make phone calls more secure
  • 33. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 33  Short message service (SMS) The security strategies standardized for the GSM system make it the most secure telecommunications standard currently accessible. Although the confidentiality of a call and secrecy of the GSM subscriber is just ensured on the radio channel, this is a major step in achieving end-to- end security. 4.6 GSM CHARACTERISTICS:  TDMA over radio carriers(200Khz carrier spacing)  8 full rate or 16 half rate TDMA channels per carrier  User or terminal authentication for fraud control  Encryption of speech and data transmission over the radio path  Low speed data services (up to 9.6 Kb/s)  Support of short message service(SMS) 4.7 ADVANTAGES OF GSM:  Capacity increases  Reduced RF transmission power and longer battery life  International roaming capability  Better security against fraud  Encryption capability for information security and privacy  Compatibility with ISDN, leading to wider range of services 4.8 AT COMMANDS: These are used to control MODEMs. AT is the abbreviation for Attention. These commands come from Hayes commands that were used by Hayes smart modems. The Hayes commands started with AT to indicate the attention from the MODEM. The dial up and wireless MODEMs (device that involve machine to machine communication) needs AT commands to interact with a computer. These includes the Hayes command set as a subset, along with other extended AT commands.
  • 34. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 34 AT commands with a GSM/GPRS MODEM or mobile phone can be used to access following information and services: 1. Information and configuration pertaining to mobile device or MODEM and SIM card. 2. SMS services. 3. MMS services. 4. Fax services. 5. Data and voice link over mobile network. AT commands are instructions used to control a modem. AT is the abbreviation of ATtention. Every command line starts with "AT" or "at". That's why modem commands are called AT commands. Many of the commands that are used to control wired dial-up modems, such as ATD (Dial), ATA (Answer), ATH (Hook control) and ATO (Return to online data state), are also supported by GSM/GPRS modems and mobile phones. Besides this common AT command set, GSM/GPRS modems and mobile phones support an AT command set that is specific to the GSM technology, which includes SMS-related commands like AT+CMGS (Send SMS message), AT+CMSS (Send SMS message from storage), AT+CMGL (List SMS messages) and AT+CMGR (Read SMS messages). Note that the starting "AT" is the prefix that informs the modem about the start of a command line. It is not part of the AT command name. For example, D is the actual AT command name in ATD and +CMGS is the actual AT command name in AT+CMGS. However, some books and web sites use them interchangeably as the name of an AT command. Here are some of the tasks that can be done using AT commands with a GSM/GPRS modem or mobile phone:  Get basic information about the mobile phone or GSM/GPRS modem. For example, name of manufacturer (AT+CGMI), model number (AT+CGMM), IMEI number (International Mobile Equipment Identity) (AT+CGSN) and software version (AT+CGMR).
  • 35. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 35  Get basic information about the subscriber. For example, MSISDN (AT+CNUM) and IMSI number (International Mobile Subscriber Identity) (AT+CIMI).  Get the current status of the mobile phone or GSM/GPRS modem. For example, mobile phone activity status (AT+CPAS), mobile network registration status (AT+CREG), radio signal strength (AT+CSQ), battery charge level and battery charging status (AT+CBC).  Establish a data connection or voice connection to a remote modem (ATD, ATA, etc).  Send and receive fax (ATD, ATA, AT+F*).  Send (AT+CMGS, AT+CMSS), read (AT+CMGR, AT+CMGL), write (AT+CMGW) or delete (AT+CMGD) SMS messages and obtain notifications of newly received SMS messages (AT+CNMI).  Read (AT+CPBR), write (AT+CPBW) or search (AT+CPBF) phonebook entries.  Perform security-related tasks, such as opening or closing facility locks (AT+CLCK), checking whether a facility is locked (AT+CLCK) and changing passwords (AT+CPWD). (Facility lock examples: SIM lock [a password must be given to the SIM card every time the mobile phone is switched on] and PH-SIM lock [a certain SIM card is associated with the mobile phone. To use other SIM cards with the mobile phone, a password must be entered.])  Control the presentation of result codes / error messages of AT commands. For example, you can control whether to enable certain error messages (AT+CMEE) and whether error messages should be displayed in numeric format or verbose format (AT+CMEE=1 or AT+CMEE=2).  Get or change the configurations of the mobile phone or GSM/GPRS modem. For example, change the GSM network (AT+COPS), bearer service type (AT+CBST), radio link protocol parameters (AT+CRLP), SMS center address (AT+CSCA) and storage of SMS messages (AT+CPMS).  Save and restore configurations of the mobile phone or GSM/GPRS modem. For example, save (AT+CSAS) and restore (AT+CRES) settings related to SMS messaging such as the SMS center address.
  • 36. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 36  Note that mobile phone manufacturers usually do not implement all AT commands, command parameters and parameter values in their mobile phones. Also, the behavior of the implemented AT commands may be different from that defined in the standard. In general, GSM/GPRS modems designed for wireless applications have better support of AT commands than ordinary mobile phones. In addition, some AT commands require the support of mobile network operators. For example, SMS over GPRS can be enabled on some GPRS mobile phones and GPRS modems with the +CGSMS command (command name in text: Select Service for MO SMS Messages). But if the mobile network operator does not support the transmission of SMS over GPRS, you cannot use this feature. Basic Commands and Extended Commands There are two types of AT commands: basic commands and extended commands.  Basic commands are AT commands that do not start with "+". For example, D (Dial), A (Answer), H (Hook control) and O (Return to online data state) are basic commands.  Extended commands are AT commands that start with "+". All GSM AT commands are extended commands. For example, +CMGS (Send SMS message), +CMSS (Send SMS message from storage), +CMGL (List SMS messages) and +CMGR (Read SMS messages) are extended commands.
  • 37. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 37 CHAPTER 5
  • 38. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 38 CHAPTER-5 HARDWARE DESIGN CONSIDERATIONS The Hardware components used in this project are:  Flow Sensor.  Solenoid valve.  JHD 162A LCD Module.  Power Supply.  Voltage Regulator. 5.1 FLOW SENSOR: 5.1.1 PRINCIPLE OF OPERATION: The Water Flow sensor measures the rate of a liquid flowing through it. The YF-S201 water flow sensor consists of a plastic valve body, flow rotor and hall effect sensor. It is usually used at the inlet end to detect the amount of flow. When liquid flows through the sensor, a magnetic rotor will rotate and the rate of rotation will vary with the rate of flow. The hall effect sensor will then output a pulse width signal. Connect it to a microcontroller and you can monitor multiple devices such as your coffee maker, sprinkler or anything else, and control the water flow rate to suit your needs!  A 20 mm rifled pipe is recommended  Avoid unit contact with corrosive chemicals  The unit must be installed vertically, tilted no more than 5 degrees  Liquid temperature should be less than 120 C to avoid damage to unit
  • 39. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 39 5.1.2 SPECIFICATIONS: Table no-1: Specifications NO ITEM EXAMINATION REQUIREMENT 1 Water pressure Resistance performance 1.75 MPa pressure has no slack phenomenon, and parts no crack, relaxation, inflation, and deformation anomaly 2 Operating voltage range DC3-18V 3 Maximum operating current 15mA 4 The output pulse high level In 5 V rated voltage, the output of the high level requirements in 4.5 V above 5 The output pulse duty ratio In the rated voltage, the output pulse occupies empties compared to 50%-10% 6 Flow pulse characteristics [4.1Q]±10% 7 Insulating property Dielectric resistance>100MΩ 8 Electrical strength AC500V 50Hz(Don't breakdown or flash winding) 9 Electrical strength(100℃) In 100 ℃ temperature placed in 72 hours, in the environmental temperature back after 1 hour the accuracy of measurement requirements within the plus or minus 5% 10 Cold resistance(-20℃) In 20 ℃ temperature placed in-72 hours, in the environmental temperature back after 1 hour the accuracy of measurement requirements within the plus or minus 5% 11 Mode of connection Red: the positive, black: negative, yellow: pulse signal
  • 40. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 40 Fig 5.1: Flow Sensor 5.2 SOLENOID VALVE: A solenoid valve is an electromechanically operated valve. The valve is controlled by an electric current through a solenoid: in the case of a two-port valve the flow is switched on or off; in the case of a three-port valve, the outflow is switched between the two outlet ports. Solenoid valves are the most frequently used control elements in fluidics. Their tasks are to shut off, release, dose, distribute or mix fluids. They are found in many application areas. Solenoids offer fast and safe switching, high reliability, long service life, good medium compatibility of the materials used, low control power and compact design. A solenoid valve has two main parts: the solenoid and the valve. The solenoid converts electrical energy into mechanical energy which, in turn, opens or closes the valve mechanically. A solenoid valve employs magnets and electrical current to effect operations at expense of very little electrical power. When electrical current is applied
  • 41. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 41 to coil, based on polarity of magnet and direction of current flow valve is latched or delatched. When current polarity is reversed, valve latches if in delatched position and vice versa. Fig 5.2: Basic operation of Solenoid The plunger is being held about halfway out of the coil by a spring. When the coil is energized, the resulting magnetic field pulls the plunger to the middle of the coil. The magnetic force is unidirectional -a spring is required to return the plunger to its unenergized position. 5.2.1 PRINCIPLE OF WORKING: Solenoid valve may use metal seals or rubber seals, and may also have electrical interfaces to allow for easy control. A spring may be used to hold the valve opened or closed while the valve is not activated. A solenoid valve is the combination of a basic solenoid and mechanical valve. So a solenoid valve has two parts namely-  Electrical solenoid  Mechanical valve.
  • 42. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 42 Fig 5.3: Solenoid valve operation A-Input side B-Diaphragm C-Pressure chamber D-Pressure relief conduit E-Solenoid F-Output side The diagram to the right shows the design of a basic valve. If we look at the top figure we can see the valve in its closed state. The water under pressure enters at A. B is an elastic diaphragm and above it is a weak spring pushing it down. The function of this spring is irrelevant for now as the valve would stay closed even without it. The diaphragm has a
  • 43. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 43 pinhole through its center which allows a very small amount of water to flow through it. This water fills the cavity C on the other side of the diaphragm so that pressure is equal on both sides of the diaphragm. While the pressure is the same on both sides of the diaphragm, the force is greater on the upper side which forces the valve shut against the incoming pressure. By looking at the figure we can see the surface being acted upon is greater on the upper side which results in greater force. On the upper side the pressure is acting on the entire surface of the diaphragm while on the lower side it is only acting on the incoming pipe. This results in the valve being securely shut to any flow and, the greater the input pressure, the greater the shutting force will be. Now let us turn our attention to the small conduit D. Until now it was blocked by a pin which is the armature of the solenoid E and which is pushed down by a spring. If we now activate the solenoid drawing the pin upwards via magnetic force from the solenoid current, the water in chamber C will flow through this conduit D to the output side of the valve. The pressure in chamber C will drop and the incoming pressure will lift the diaphragm thus opening the main valve. Water now flows directly from A to F. When the solenoid is again deactivated and the conduit D is closed again, the spring needs very little force to push the diaphragm down again and the main valve closes. In practice there is often no separate spring, the elastomer diaphragm is moulded so that it functions as its own spring, preferring to be in the closed shape. From this explanation it can be seen that this type of valve relies on a differential of pressure between input and output as the pressure at the input must always be greater than the pressure at the output for it to work. Should the pressure at the output, for any reason, rise above that of the input then the valve would open regardless of the state of the solenoid and pilot valve. In some solenoid valves the solenoid acts directly on the main valve. Others use a small, complete solenoid valve, known as a pilot, to actuate a larger valve. While the second
  • 44. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 44 type is actually a solenoid valve combined with a pneumatically actuated valve, they are sold and packaged as a single unit referred to as a solenoid valve. Piloted valves require much less power to control, but they are noticeably slower. Piloted solenoids usually need full power at all times to open and stay open, where a direct acting solenoid may only need full power for a short period of time to open it, and only low power to hold it. 5.2.2 TYPES OF SOLENOID VALVE: Solenoid valves generally have two ports: an inlet and an outlet port. There are several types of solenoid valves that include three or more ports. Three-way solenoids are used to operate single-acting actuators, such as diaphragm actuators. They are designed to only send air to one chamber of an actuator. Three way solenoids are used to interrupt or override an instrument signal for double-acting actuators with a pneumatic positioner. Four-way solenoids provide a positive two directional action. They can be used instead of positioners to provide on-off operation of double-acting valves. When the solenoid is de- energized, it sends the full air supply to one side of the actuator and exhausts the other side to the atmosphere. Fig 5.4: two and three way, normally open and normally closed solenoids.
  • 45. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 45 The effective size of a solenoid valve can be increased by servo or pilot operation. The term servo-operated applies to solenoid valves to indicate the main valve is fluid- powered and actuated by a small valve in a servo or pilot circuit. 5.3 JHD162A LCD MODULE (16×2): Alphanumeric displays are used in a wide range of applications, including palmtop computers, word processors, photocopiers, point of sale terminals, medical instruments, cellular phones, etc. The 16x2 intelligent alphanumeric dot matrix displays is capable of displaying 224 different characters and symbols. Serial LCD firmware allows serial control of the display. This option provides much easier connection and use of the LCD module. The firmware enables microcontrollers (and microcontroller based systems such as the PICAXE) to visually output user instructions or readings onto an LCD module. All LCD commands are transmitted serially via a single microcontroller pin. 5.3.1 PIN DIAGRAM: Fig. 5.5: LCD Module (JHD162A)
  • 46. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 46 The function of each pin of the JHD162A LCD module is given below.  Pin1 (GND): Ground pin of the LCD module.  Pin2 (VCC): +5V power supply is given to this pin  Pin3 (VEE): Contrast adjustment pin. This is done by connecting the ends of a 10K potentiometer to +5V and ground and then connecting the slider pin to the VEE pin. The voltage at the VEE pin defines the contrast. The normal setting is between 0.4 and 0.9V.  Pin4 (RS): Register select pin. The JHD162A has two registers namely command register and data register. Logic HIGH at RS pin selects data register and logic LOW at RS pin will select command register. If we make the RS pin HIGH and put a data on the data lines (DB0 to DB7) it will be recognized as a data. If we make the RS pin LOW and put a data on the data lines, then it will be taken as a command.  Pin5(R/W): Read/Write modes. This pin is used for selecting between read and write modes. Logic HIGH at this pin activates read mode and logic LOW at this pin activates write mode.  Pin6 (E): This pin is meant for enabling the LCD module. A HIGH to LOW signal at this pin will enable the module.  Pin7 (DB0) to Pin14 (DB7): These are data pins. The commands and data are put on these pins.  Pin15 (LED+): Anode of the back light LED. When operated on 5V, a 560 ohm resistor should be connected in series to this pin.  Pin16 (LED-): Cathode of the back light LED. 5.3.2 FEATURES: The JHD162A has 16 pins and can be operated in 4-bit mode or 8-bit mode. Here we are using the LCD module in 4-bit mode.
  • 47. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 47  If interface data is 4 bit long: Data transfer are made through 4 bus lines DB4 to DB7 (while the rest of 4 bus lines from DB0 to DB3 are not used).Data transfer with MPU are completed when 4-bit data are transferred in twice.  If interface data is 8 bit long: Data transfer is made through all of 8 bus lines from DB0 to DB7.  192 kinds of alphabets, numerals, symbols and special characters can be displayed by built-in character generator (ROM) and other preferred characters can be displayed by RAM.  Low power consumption.  Compact and light weight design which can be easily assembled in devices. 5.4 POWER SUPPLY: Fig. 5.6: Power Supply Circuit Every electrical and electronic device that we use in our day-to-day life will require a power supply. In general, we use an AC supply of 230V 50Hz, but this power has to be changed into the required form with required values or voltage range for providing power supply to different types of devices. There are various types of power electronic converters such as step-down converter, step-up converter, voltage stabilizer, AC to DC converter, DC to DC converter, DC to AC converter, and so on. For example, consider the microcontrollers that are used frequently for developing many embedded systems’ based projects and kits
  • 48. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 48 used in real-time applications. These microcontrollers require a 5V DC supply, so the AC 230V needs to be converted into 5V DC using the step-down converter in their power supply circuit. 5.4.1 CENTER TAPPED TRANSFORMER: In this circuit, we are using a center tapped transformer. The transformer isused to step down the 230 ac to 5V dc supply. The main difference of using center tapped transformer instead of normal transformer is normal transformer gives single output voltage where center tapped transformer gives two individual voltages to drive individual two loads. The alternating voltage from secondary terminal of the transformer is given to a bridge rectifier. Fig. 5.7: Center Tapped Transformer 5.4.2 BRIDGE RECTIFIER: In this circuit, we are using bridge rectifier. A bridge rectifier makes use of four diodes which are connected in the form a bridge. This is a widely used configuration, both with individual diodes wired and with single component bridges where the diode bridge is wired internally. The bridge rectifier converts alternating voltage to unidirectional voltage with the switching action of diodes.
  • 49. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 49 For many applications especially with single phase AC where the full-wave bridge serves to convert an AC input into a DC output, the addition of a capacitor may be desired because the bridge alone supplies an output of fixed polarity but continuously varying or pulsating magnitude. The function of this capacitor, known as a reservoir capacitor is to lessen the variation in the rectified AC output voltage waveform from the bridge. One explanation of smoothing is that the capacitor provides a low impedance path to the AC component of the output, reducing the AC voltage across, and AC current through, the resistive load. In less technical terms, any drop in the output voltage and current of the bridge tends to be cancelled by loss of charge in the capacitor. This charge flows out as additional current through the load. Fig. 5.8: Bridge Rectifier Thus the change of load current and voltage is reduced relative to what would occur without the capacitor. Increases of voltage correspondingly store access charge in the capacitor, thus moderating the change in the output voltage/current. The simplified circuit shown as a well- deserved reputation for being dangerous, because, in some applications, the capacitor can retain a lethal charge after the AC power source is removed. If supplying a
  • 50. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 50 dangerous voltage, a practical circuit should include a reliable way to safely discharge the capacitor. The circuit should include a bleeder resistor connected as close as practical across the capacitor. This resistor should consume a current large enough to discharge the capacitor in a reasonable time, but small enough to minimize unnecessary power waste,. Because a bleeder sets a minimum current drain, the regulation of the circuit, defined as percentage voltage change from minimum to maximum load, is improved. However in many cases the improvement is of in significant magnitude. Capacitor and the load resistance have a typical time constant t=RC where C and R are capacitance and load resistance respectively. As long as the load resistor is large enough so that this time constant is much longer than the time of one ripple cycle, the above configuration will produce a smoothed DC voltage across the load. 5.4.3 FILTER: A filter is a device, which removes the AC component of rectifier output but allows the DC component to reach the load. Capacitor filter: we have seen that the ripple content in the rectified output of half- wave rectifier is 121% or that of full-wave or bridge rectifier or bridge rectifier is 48% such high percentages of ripples is not acceptable for most of the applications. Fig. 5.9: capacitive filter
  • 51. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 51 Filtering is performed by a large value electrolytic capacitor connected across the DC supply to act as a reservoir, supplying current to the output when the varying DC voltage from the rectifier is falling. The capacitor charges quickly near the peak of the varying DC, and then discharges as it supplies current to the output. Filtering significantly increase the average DC voltage to almost the peak value(1.4 x RMS value) 5.5 VOLTAGE REGULATOR IC: In this circuit, we are using 7805 VOLTAGE REGULATOR. The voltage regulator IC maintains the output voltage at a constant value. Regulators are designed to supply required voltage without fluctuations. Capacitors of suitable values can be connected at input and output pins depending upon the respective voltage levels which are used to eliminate the ripples and make the output stable. After regulation we get a 5V DC voltage at the output of 7805 IC which is needed to give supply to our controller. Fig. 5.10: Voltage Regulator The LM7805, like most other regulators, is a three-pin IC.  Pin1 (Input Pin): The Input pin is the pin that accepts the incoming DC voltage, which the voltage regulator will eventually regulate down to 5 volts.  Pin2 (Ground): Ground pin establishes the ground for the regulator.  Pin3 (Output Pin): The Output pin is the regulated 5 volts DC.
  • 52. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 52 The maximum value for input to the voltage regulator is 35V. It can provide a constant steady voltage flow of 5V for higher voltage input till the threshold limit of 35V. If the voltage is near to 7.5V then it does not produce any heat and hence no need for heat sink. If the voltage input is more, then excess electricity is liberated as heat from 7805.If adequate heat sinking is provided, they can deliver over 1A output current. 5.5.1 CIRCUIT DIAGRAM: Normally we get fixed output by connecting the voltage regulator at the output of the filtered DC see in above diagram. It can also be used in circuits to get a low DC voltage from a high DC voltage for example we use 7805 to get 5v from 12v. There are two types of voltage regulators. 1. Fixed voltage regulators 78xx, 79xx. 2. Variable voltage regulators. Fig. 5.11: Circuit Diagram Of Regulator IC7805 In fixed voltage regulators there is another classification. 1. Positive voltage regulators. 2. Negative voltage regulators.
  • 53. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 53 Positive voltage regulators include 78xx voltage regulators. The most commonly used ones are 7805 and 7812. 7805 gives fixed 5v DC voltage if input voltage is in 7.5v, 20v. 7805 is a voltage regulator integrated circuit. It is a member of 78xx series of fixed linear voltage regulator ICs. The voltage source in a circuit may have fluctuations and would not give the fixed voltage output. The voltage regulator IC maintains the output voltage at a constant value. The xx in 78xx indicates the fixed output voltage it is designed to provide. 7805 provides +5v regulated power supply. 5.5.2 APPLICATIONS:  Load Regulation.  Ripple Rejection.  Fixed Output Regulator.  Constant Current Regulator.  Switching Regulator.
  • 54. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 54 CHAPTER-6
  • 55. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 55 CHAPTER-6 SOFTWARE TOOLS 6.1 EMBEDDED C: Historically embedded C programming requires non-standard extensions to the C language in order to support exotic features such as fixed point arithmetic, multiple distinct memory banks, and basic I/O operations. In 2008, the C standards committee published a technical report extending the C language to address these issues by providing a common standard for all implementations to adhere to. It includes a number of features not available in normal C, such as fixed point arithmetic, named address and basic I/O hardware addressing. It is a set of language extensions for the C programming language by the C standards committee to address commonality issues that exists between c extensions for different embedded systems. Embedded C uses most of the syntax and semantics of standard c, e.g., main() function, variable definition, data type declaration, conditional statements(if, switch, case), loops( while, for), functions, arrays and strings, structures and union, bit operation, macros. 6.1.1 EMBEDDED “C” COMPILER:  ANSI C - full featured and portable  Reliable - mature, field-proven technology  Multiple C optimization levels  An optimizing assembler  Full linker, with overlaying of local variables to minimize RAM usage  Comprehensive C library with all source code provided  Includes support for 24-bit and 32-bit IEEE floating point and 32-bit long data types  Mixed C and assembler programming
  • 56. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 56  Unlimited number of source files  Listings showing generated assembler  Compatible - integrates into the MPLAB IDE, MPLAB ICD and most 3rd-party development tools  Runs on multiple platforms: Windows, Linux, UNIX, Mac OS X, Solaris 6.2 ARDUINO PROGRAMMING ENVIRONMENT (IDE): Arduino is an open-source computer hardware and software company, project and user community that designs and manufactures microcontroller-based kits for building digital devices and interactive objects that can sense and control the physical world. The project is based on a family of microcontroller board designs manufactured primarily by Smart Projects in Italy, and also by several other vendors, using various 8-bit Atmel AVR microcontrollers or 32-bit Atmel ARM processors. These systems provide sets of digital and analog I/O pins that can be interfaced to various expansion boards ("shields") and other circuits. The boards feature serial communications interfaces, including USB on some models, for loading programs from personal computers. For programming the microcontrollers, the Arduino platform provides an integrated development environment (IDE) based on the Processing project, which includes support for C, C++ and Java programming languages. The first Arduino was introduced in 2005, aiming to provide an inexpensive and easy way for novices and professionals to create devices that interact with their environment using sensors and actuators. Common examples of such devices intended for beginner hobbyists include simple robots, thermostats, and motion detectors. The Arduino integrated development environment (IDE) is a cross- platform application written in Java, and derives 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
  • 57. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 57 also capable of compiling and uploading programs to the board with a single click. A program or code written for Arduino is called a "sketch". 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. The users need only to define two functions to make an executable cyclic executive program:  setup():A function that runs once at the start of a program and that can initialize settings.  loop(): A function called repeatedly until the board powers off. Fig. 6.1: Arduino software page The Arduino Integrated Development Environment - or Arduino Software (IDE) - contains a text editor for writing code, a message area, a text console, a toolbar with buttons for common functions and a series of menus. It connects to the Arduino and Genuino hardware to upload programs and communicate with them.
  • 58. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 58 The arduino has two stages of execution one is the setup and the second was the loop. In set up there was no iteration i.e. the whole function will run only once. The arduino waits for serial initialization with a respective baud rate. If there was no signal from the serial communication through i2c,then its waits there only until there was signal. Once there was signal then it shows "DS1307RTC Read Test". Before going to start the serial communication first of all we have to add the real time clock program to the main program to get uploaded by clicking on file menu of the main program window and from that menu click on examples and click on DS1037RTC and then set time and upload the both files so that the RTC will get compiled with the pc time. In order to view the above statement we have to upload the program and it click on the search monitor key which was present on right most corners on the main program. After clicking on this key the above statement"DS1307RTC Read Test" will be shown and in this setup function we are assigning the port registers of the arduino to the loads we are connecting .initially all the loads are in off state by giving the statement is equal to LOW of the respective loads.
  • 59. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 59 CHAPTER-7
  • 60. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 60 CHAPTER-7 RESULT, CONCLUSION & FUTURE SCOPE 7.1 RESULT: Hence finally the output of project “AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM” that is to avoid the scarcity of fresh and drinking water. Fig 7.1: Hardware Kit
  • 61. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 61 Fig 7.2(a): System Ready is displayed Fig 7.2(b): Message Received by the Customer Fig 7.3(a): System is Recharged by the Customer Fig 7.3(b): Recharge message is displayed
  • 62. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 62 Fig 7.4(a): Successfully Recharged Message Fig 7.4(b): Updated units is displayed Fig 7.5(a): Low balance is displayed Fig 7.5(b): Low balance message alert
  • 63. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 63 7.2CONCLUSION: We hereby are stating from our project that we have implemented prepaid water metering system. In this, it demands a house hold water metering system to save the drinking water.  In the present work wireless meter reading system is designed to measure the amount of water used and to shut down the power supply remotely whenever the consumer did not renew the purchase of water.  Automatic water Meter reading avoids the human intervention, provides efficient meter reading, avoid the billing error and reduce the maintenance cost. It displays the corresponding information on LCD for user notification.  Hence we introduced a low cost pre-paid embedded system that incorporates features of remote monitoring and control of the water supply. 7.2 FUTURE SCOPE: The scope of future work is this system can be further modified to incorporate security aspect regarding tempering of the water meter finding leakage and location of the leakage.
  • 64. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 64 APPENDIX-A
  • 65. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 65 APPENDIX-A SOURCE CODE #include<EEPROM.h> #include <LiquidCrystal.h> LiquidCrystal lcd(7, 6, 5, 4, 3, 2); int led = 13; #define pulsein 8 #define relay 12 unsigned int pusle_count = 0; float units = 0; unsigned int rupees = 0; float water_factor = 0.00046; unsigned int temp = 0, i = 0, x = 0, k = 0; char str[70], flag1 = 0, flag2 = 0; String bal = ""; int count = 0; void setup() { lcd.begin(16, 2); Serial.begin(9600); pinMode(led, OUTPUT); pinMode(pulsein, INPUT); pinMode(relay, OUTPUT); digitalWrite(pulsein, HIGH); lcd.setCursor(0, 0); lcd.print("PREPAID water"); lcd.setCursor(0, 1); lcd.print(" METER "); delay(2000); lcd.clear();
  • 66. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 66 lcd.print("BVCITS ECE"); delay(2000); lcd.clear(); lcd.print("GSM Initilizing..."); gsm_init(); lcd.clear(); lcd.print("System Ready"); Serial.println("AT+CNMI=2,2,0,0,0"); init_sms(); send_data("System Ready"); send_sms(); delay(1000); digitalWrite(led, LOW); lcd.clear(); EEPROM.write(1, 0); rupees = EEPROM.read(1); } void loop() { tds = analogRead(A5); serialEvent(); rupees = EEPROM.read(1); units = rupees / 0.2; lcd.setCursor(0, 0); lcd.print("Units:"); lcd.print(units); lcd.print(" "); lcd.setCursor(0, 1); if (rupees < 15) lcd.print("LOW Balance:");
  • 67. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 67 else lcd.print("Balance:"); lcd.print(rupees); lcd.print(" "); read_pulse(); check_status(); if (temp == 1) { decode_message(); send_confirmation_sms(); } } void serialEvent() { while (Serial.available()) { char ch = (char)Serial.read(); str[i++] = ch; if (ch == '*') { temp = 1; lcd.clear(); lcd.print("Message Received"); delay(500); break; } } } void init_sms() {
  • 68. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 68 Serial.println("AT+CMGF=1"); delay(200); Serial.println("AT+CMGS="+91XXXXXXXXX""); delay(200); } void send_data(String message) { Serial.println(message); delay(200); } void send_sms() { Serial.write(26); } void read_pulse() { if (!digitalRead(pulsein)) { digitalWrite(led, HIGH); count++; units = water_factor * count / 1000; if (units < 1) { } else units--; rupees = units * 2; EEPROM.write(1, rupees); while (!digitalRead(pulsein)); digitalWrite(led, LOW);
  • 69. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 69 // delay(2000); } } void check_status() { if (rupees > 15) { digitalWrite(relay, HIGH); flag1 = 0; flag2 = 0; } if (rupees < 15 && flag1 == 0) { lcd.setCursor(0, 1); lcd.print("LOW Balance "); init_sms(); send_data("water Meter Alert:"); send_data("Low Balancen"); Serial.println(rupees); delay(200); send_data("Please recharge your water meter.n Thank you"); send_sms(); message_sent(); flag1 = 1; } if (rupees < 5 && flag2 == 0) { digitalWrite(relay, LOW); lcd.clear(); lcd.print("water disc to");
  • 70. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 70 lcd.setCursor(0, 1); lcd.print("Low Balance"); delay(2000); lcd.clear(); lcd.print("Please Recharge "); lcd.setCursor(0, 1); lcd.print("UR water Meter "); init_sms(); send_data("water Meter Balance Alert:n water cut due to low Balancen Please recharge your water meter soon.n Thank you"); send_sms(); message_sent(); flag2 = 1; } if (tds >= 200) { digitalWrite(relay, LOW); } } void decode_message() { x = 0, k = 0, temp = 0; while (x < i) { while (str[x] == '#') { x++; bal = ""; while (str[x] != '*') {
  • 71. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 71 bal += str[x++]; } } x++; } bal += '0'; } void send_confirmation_sms() { int recharge_amount = bal.toInt(); rupees += recharge_amount; EEPROM.write(1, rupees); lcd.clear(); lcd.print("water Meter "); lcd.setCursor(0, 1); lcd.print("Recharged:"); lcd.print(recharge_amount); init_sms(); send_data("water Meter Balance Alert:nYour water meter has been recharged Rs:"); send_data(bal); send_data("Total Balance:"); Serial.println(rupees); delay(200); send_data("water connection disconnectednThank you"); send_sms(); temp = 0; i = 0; x = 0; k = 0; delay(1000);
  • 72. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 72 message_sent(); } void message_sent() { lcd.clear(); lcd.print("Message Sent."); delay(1000); } void gsm_init() { lcd.clear(); lcd.print("Finding Module.."); boolean at_flag = 1; while (at_flag) { Serial.println("AT"); while (Serial.available() > 0) { if (Serial.find("OK")) at_flag = 0; } delay(1000); } lcd.clear(); lcd.print("Module Connected.."); delay(1000); lcd.clear(); lcd.print("Disabling ECHO"); boolean echo_flag = 1; while (echo_flag)
  • 73. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 73 { Serial.println("ATE0"); while (Serial.available() > 0) { if (Serial.find("OK")) echo_flag = 0; } delay(1000); } lcd.clear(); lcd.print("Echo OFF"); delay(1000); lcd.clear(); lcd.print("Finding Network.."); boolean net_flag = 1; while (net_flag) { Serial.println("AT+CPIN?"); while (Serial.available() > 0) { if (Serial.find("+CPIN: READY")) net_flag = 0; } delay(1000); } lcd.clear(); lcd.print("Network Found.."); delay(1000); lcd.clear(); }
  • 74. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 74 APPENDIX-B
  • 75. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 75 APPENDIX-B REFERENCES  https://www.arduino.cc/  https://en.wikipedia.org/wiki/GSM  http://www.ijtrd.com/papers/IJTRD4034.pdf  https://pdfs.semanticscholar.org
  • 76. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 76 APPENDIX-C
  • 77. AN INTELLIGENT SMS BASED PREPAID WATER METERING SYSTEM BY LAKSHMI PADMA Page 77 APPENDIX-C BIBLIOGRAPHY  NusratSharmin Islam and Md. Wasi-ur-Rahman,”An Intelligent SMS-Based Remote Water Metering System”,Proceedings of 2009 12thInternational Conference on Computer and Information Technology (ICCIT 2009), Dhaka, Bangladesh.  L. Cao, J. Tianand D. Zhang, "Networked Remote Meter Reading System based on Wireless Commu-nication Technology", proc. Of IEEE InternationalConference on Information Acquisition, China,August 2006.  X. Zhaoyin and H. Shiyong, "Automatic Remote Meter Reading System using Bluetooth", Journal of Transducer Technology, vol. 23, no.7, pp. 68 70,2004.  Q. Hao and Z. Song. "The Status and Development of the Intelligent Automatic Meter Reading Sys-tem", proc of China Science andTechnology In-formation, no.19, pp.72, October 2005.