Académique Documents
Professionnel Documents
Culture Documents
1. INTRODUCTION
According to recent survey, water has become a big issue because of less rain fall,
increase in population many cities are facing this problem people have to suffer from this
problem they don’t have sufficient amount for their daily needs. Due to lack of monitoring
water can’t be supplied properly, some areas in city get water while other some areas can’t so,
there is a need of continuous monitoring, water supply scheduling and proper distribution
another problems are excessive consumption, overflow of tanks, leakage in pipeline
,interrupted water supply. Water is a basic need of every human being everyone has to save the
water many a times with lack of monitoring ,overflow of these overhead tanks can occur
because of this lots of water get wasted, another thing because of overflow in the pipelines
with more pressure there is possibility of pipeline damage, leakage detection is one more
problem all these problems are because of lack of monitoring, manual work, less man power,
Before implementing this project I have taken a survey of Aurangabad city and field survey to
understand water supply distribution and related problems with the system, after taking a
survey I observe that all the work is manual and need a better technology to make proper
distribution. By focusing on problems in traditional methods our system design and develop a
low cost embedded system device for real time monitoring of water distribution system in
Internet of things (IOT) platform. IOT is a world where billions of objects can sense,
communicate and share information, all interconnected over public or private Internet Protocol
(IP) networks. These interconnected objects have data regularly collected, analysed and used to
initiate action, providing a wealth of intelligence for planning, management and decision
making.
1
As all the cities are working on a smart city concept, our system focus on, Internet of
things which is new scenario to make city as a smart city with different application. Main
objective to implement this project is to design and develop a low cost reliable and efficient
technique to make proper water distribution by continuous monitoring and also controlling it
from a central server so that we can solve water related problems. Proposed system consist of a
Raspberry pi used as microcontroller, different sensors such as flow sensor, and turbidity
sensors are used. Arduino collects the data from sensors and send it. This system solves
problem of Overflow, over consumption, Quality of water and makes a proper distribution.
Continuous monitoring and controlling from a central server is possible using this system.
2
CHAPTER – 2
2. BLOCK DIAGRAM DESCRIPTION
3
2.1 CIRCUIT DIAGRAM
4
2.2 ATMEL 328
The high-performance, low-power Atmel 8-bit AVR RISC-based microcontroller
combines 16KB ISP flash memory, 1KB SRAM, 512B EEPROM, an 8-channel/10-bit A/D
converter (TQFP and QFN/MLF), and debugWIRE for on-chip debugging. The device
supports a throughput of 20 MIPS at 20 MHz and operates between 2.7-5.5 volts.By executing
powerful instructions in a single clock cycle, the device achieves throughputs approaching 1
MIPS per MHz, balancing power consumption and processing speed.
2.3 FEATURES
• High-performance, Low-power Atmel®AVR® 8-bit Microcontroller
Advanced RISC Architecture
130 Powerful Instructions – Most Single-clock Cycle Execution
32 × 8 General Purpose Working Registers
Fully Static Operation
Up to 16MIPS Throughput at 16MHz
On-chip 2-cycle Multiplier
5
8-channel 10-bit ADC in TQFP and QFN/MLF package
6-channel 10-bit ADC in PDIP Package
Programmable serial USART
Master/slave SPI serial interface
Byte-oriented 2-wire serial interface (Philips I2C compatible)
Programmable watchdog timer with separate on-chip oscillator
On-chip analog comparator
Interrupt and wake-up on pin change
6
CHAPTER – 3
3. PIN DIAGRAM OF ATMEGA 328
7
3.3 Port C (PC5:0)P
Port C is a 7-bit bi-directional I/O port with internal pull-up resistors (selected for each bit).
The PC5..0 output buffers have symmetrical drive characteristics with both high sink and
source capability. As inputs, Port C pins that are externally pulled low will source current if
the pull-up resistors are activated. The Port C pins are tri-stated when a reset condition
becomes active,even if the clock is not running.
3.4 PC6/RESET
If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note that the electrical
characteristics of PC6 differ from those of the other pins of Port C.If the RSTDISBL Fuse
is un programmed, PC6 is used as a Reset input. A low level on this pin for longer than the
minimum pulse length will generate a Reset, even if the clock is not running.The minimum
pulse length is given in Table 29-3 on page 307. Shorter pulses are not guaranteed to
generate a Reset.
3.6 AVCC
AVCC is the supply voltage pin for the A/D Converter, PC3:0, and ADC7:6. It should
be externally Connected to VCC, even if the ADC is not used. If the ADC is used, it should be
connected to VCC Through a low-pass filter. Note that PC6..4 use digital supply voltage,
VCCG.
3.7 AREF
AREF is the analog reference pin for the A/D Converter.
8
CHAPTER - 4
4. OVERVIEW OF ATMEGA 168
The Atmel ATmega 168 is a low-power CMOS 8-bit microcontroller based on the
AVR enhanced RISC architecture. By executing powerful instructions in a single clock cycle,
theATmega168 achieves throughputs approaching 1 MIPS per MHz allowing the system
designed to optimize power consumption versus processing speed.
9
4.2 THE ATMEL ATMEGA48/88/168 FEATURES
4K/8K/16K bytes of In-System Programmable Flash with Read-While-Write
capabilities, 256/512/512 bytes EEPROM,512/1K/1K bytes SRAM, 23 general purpose I/O
lines, 32 general purpose working registers, three flexible Timer/Counters with compare
modes, internal and external interrupts, a serial programmable USART, a byte-oriented 2-wire
Serial Interface, an SPI serial port, a 6-channel 10-bit ADC (8 channels in TQFP and
QFN/MLF packages), a programmable Watchdog Timer with internal Oscillator, and five
software selectable power saving modes.
The Idle mode stops the CPU while allowing the SRAM, Timer/Counters, USART, 2-
wire Serial Interface, SPI port, and interrupt system to continue to function. The Power-down
mode saves the register contents but freezes the Oscillator, disabling all other chip functions
until the next interrupt or hardware reset. In Power-save mode, the asynchronous timer
continues to run, allowing the user to maintain a timer base while the rest of the device is
sleeping. The ADC Noise Reduction mode stops the CPU and all I/O modules except
asynchronous timer and ADC, to minimize switching noise during ADC conversions. In
Standby mode, the crystal/resonator Oscillator is running while the rest of the device is
sleeping.
This allows very fast start-up combined with low power consumption. Atmel offers the
QTouch Library for embedding capacitive touch buttons, sliders and wheel functionality into
AVR microcontrollers. The patented charge-transfer signal acquisition offers robust sensing
and includes fully debounced reporting of touch keys and includes Adjacent Key Suppression
technology for unambiguous detection of key events. The easy-to-use QTouch Suite tool chain
allows you to explore, develop and debug your own touch applications. The device is
manufactured using the Atmel high density non-volatile memory technology. The On-chip ISP
Flash allows the program memory to be reprogrammed In-System through an SPI serial
interface, by a conventional non-volatile memory programmer, or by an On-chip Boot program
running on the AVR core.
The Boot program can use any interface to download the application program in the
Application Flash memory. Software in the Boot Flash section will continue to run while the
Application Flash section is updated, providing true Read-While-Write operation. By
combining an 8-bit RISC CPU with In-System Self-Programmable Flash on amonolithic chip,
the Atmel ATmega 168 is a powerful microcontroller that provides a highly flexible and cost
effective solution to many embedded control applications. The ATmega 168 AVR is supported
with a full suite of program and system development tools including: C Compilers, Macro
Assemblers, Program Debugger/Simulators, In-Circuit Emulators, and Evaluation kits.
10
CHAPTER – 5
5. AVR CPU CORE
This section discusses the AVR core architecture in general. The main function of the
CPU core is to ensure correct program execution. The CPU must therefore be able to access
memories, perform calculations, control peripherals, and handle interrupts.
11
Program Flash memory space is divided in two sections, the Boot Program section and
the Application Program section. Both sections have dedicated Lock bits for write and
read/write protection. The SPM instruction that writes into the Application Flash memory
section must reside in the Boot Program section. The memory spaces in the AVR architecture
are all linear and regular memory maps. A flexible interrupt module has its control registers in
the I/O space with an additional Global Interrupt Enable bit in the Status Register. The
interrupts have priority in accordance with their Interrupt Vector position. The I/O memory
space contains 64 addresses for CPU peripheral functions as Control Registers, SPI, and other
I/O functions. The I/O Memory can be accessed directly, or as the Data Space locations
following those of the Register File, 0x20 - 0x5F. In addition, the ATmega48/88/168 has
Extended I/O space from 0x60 - 0xFF in SRAM where only the ST/STS/STD and
LD/LDS/LDD instructions can be used.
12
5.5 GENERAL PURPOSE REGISTER FILE
The register file is optimized for the AVR enhanced RISC instruction set. In order to
achieve the required performance and flexibility, the following input/output schemes are
supported by the register file:
• One 8-bit output operand and one 8-bit result input
• Two 8-bit output operands and one 8-bit result input
• Two 8-bit output operands and one 16-bit result input
• One 16-bit output operand and one 16-bit result input
Most of the instructions operating on the register file have direct access to all registers,
and most of them are single cycle instructions.
13
CHAPTER – 6
6. LCD
LCD stands for Liquid Crystal Display. LCD is finding wide spread use replacing
LEDs (seven segment LEDs or other multi segment LEDs) because of the following reasons:
1. The declining prices of LCDs.
2. The ability to display numbers, characters and graphics. This is in contrast to LEDs,
which are limited to numbers and a few characters.
3. Incorporation of a refreshing controller into the LCD, thereby relieving the CPU of the
task of refreshing the LCD. In contrast, the LED must be refreshed by the CPU to keep
displaying the data.
4. Ease of programming for characters and graphics.
These components are “specialized” for being used with the microcontrollers, which
means that they cannot be activated by standard IC circuits. They are used for writing different
messages on a miniature LCD.
A model described here is for its low price and great possibilities most frequently used
in practice. It is based on the HD44780 microcontroller (Hitachi) and can display messages in
two lines with 16 characters each . It displays all the alphabets, Greek letters, punctuation
marks, mathematical symbols etc. In addition, it is possible to display symbols that user makes
up on its own. Automatic shifting message on display (shift left and right), appearance of the
pointer, backlight etc. are considered as useful characteristics.
14
Table No. 1 PIN FUNCTIONS
6.2 LCD SCREEN
LCD screen consists of two lines with 16 characters each. Each character consists of
5x7 dot matrix. Contrast on display depends on the power supply voltage and whether
messages are displayed in one or two lines. For that reason, variable voltage 0-Vdd is applied
on pin marked as Vee. Trimmer potentiometer is usually used for that purpose. Some versions
of displays have built in backlight (blue or green diodes). When used during operating, a
resistor for current limitation should be used (like with any LE diode).
15
6.3 LCD BASIC COMMANDS
All data transferred to LCD through outputs D0-D7 will be interpreted as commands or
as data, which depends on logic state on pin RS:
RS = 1 - Bits D0 - D7 are addresses of characters that should be displayed. Built in
processor addresses built in “map of characters” and displays corresponding symbols. Displaying
position is determined by DDRAM address. This address is either previously defined or the
address of previously transferred character is automatically incremented.RS = 0 - Bits D0 - D7
are commands which determine display mode. List of commands forlcd:
16
U = 0 Cursor off
B = 0 Cursor blink off
4. Character entry
5. ID = 1 Addresses on display are automatically incremented by 1
S = 0 Display shift off
Automatic reset is mainly performed without any problems. Mainly but not always! If
for any reason power supply voltage does not reach full value in the course of 10mS, display
will start perform completely unpredictably? If voltage supply unit can not meet this condition
or if it is needed to provide completely safe operating, the process of initialization by which a
new reset enabling display to operate normally must be applied.Algorithm according to the
initialization is being performed depends on whether connection to the microcontroller is
through 4- or 8-bit interface. All left over to be done after that is to give basic commands and
of course- to display messages .
17
Reflective twisted nomadic liquid crystal display.
1. Polarizing filter film with a vertical axis to polarize light as it enters.
2. Glass substrate with ITOelectrodes. The shapes of these electrodes will determine the
shapes that will appear when the LCD is turned ON. Vertical ridges etched on the
surface are smooth.
3. Twisted nematic liquid crystal.
4. Glass substrate with common electrode film (ITO) with horizontal ridges to line up
with the horizontal filter.
5. Polarizing filter film with a horizontal axis to block/pass light.
6. Reflective surface to send light back to viewer. (In a backlit LCD, this layer is replaced
with a light source.)
18
6.9 FEATURES
5 x 8 dots with cursor
built-in controller (ks 0066 or equivalent)
+ 5v power supply (also available for + 3v)
1/16 duty cycle
b/l to be driven by pin 1, pin 2 or pin 15, pin 16 or a.k (led)
n.v. optional for + 3v power supply
19
CHAPTER – 7
7. POWER SUPPLY
7.1 INTRODUCTION
The present chapter introduces the operation of power supply circuits built using filters,
rectifiers, and then voltage regulators. Starting with an AC voltage, a steady DC voltage is
obtained by rectifying the AC voltage, then filtering to a DC level, and finally, regulating to
obtain a desired fixed DC voltage. The regulation is usually obtained from an IC voltage
regulator unit, which takes a DC voltage and provides a somewhat lower DC voltage, which
remains the same even if the input DC voltage varies, or the output load connected to the DC
voltage changes.
20
A power supply can be built using a transformer connected to the AC supply line to
step the AC voltage to desired amplitude, then rectifying that AC voltage, filtering with a
capacitor and RC filter, if desired, and finally regulating the DC voltage using an IC regulator.
The regulators can be selected for operation with load currents from hundreds of Milli amperes
to tens of amperes, corresponding to power ratings from milliwatts to tens of watts.
The series 78 regulators provide fixed regulated voltages from 5 to 24 V shows how
one such IC, a 7812, is connected to provide voltage regulation with the output from this unit
of +12V Dec. An unregulated input voltage VI is filtered by capacitor C1 and connected to the
IC’s IN terminal. The IC’s OUT terminal provides a regulated + 12V which is filtered by the
capacitor C2 (mostly for any high-frequency noise). The third IC terminal is connected to
ground (GND).
While the input voltage may vary over some permissible voltage range, and the output
load may vary over some acceptable range, the output voltage remains constant within
specified voltage variation limits. These limitations are spelled out in the manufacturer’s
specification sheets.
21
7.5 BLOCK DIAGRAM
The AC voltage, typically 220V RMS, is connected to a transformer, which steps that
AC voltage down to the level of the desired DC output. A diode rectifier then provides a full-
wave rectified voltage that is initially filtered by a simple capacitor filter to produce a DC
voltage. This resulting DC voltage usually has some ripple or AC voltage variation. A
regulator circuit removes the ripples and also remains the same DC value even if the input DC
voltage varies, or the load connected to the output DC voltage changes. This voltage regulation
is usually obtained using one of the popular voltage regulator IC units.
7.6 TRANSFORMER
The potential transformer will step down the power supply voltage (0-230V) to (0-6V)
level. Then the secondary of the potential transformer will be connected to the precision
rectifier, which is constructed with the help of op–amp. The advantages of using a precision
rectifier are it will give a peak voltage output as DC, the rest of the circuits will give only RMS
output.
22
This path is indicated by the broken arrows. Waveforms (3) and (4) can be observed
across D2 and D4. The current flow through RL is always in the same direction. In flowing
through RL this current develops a voltage corresponding to that shown waveform (5). Since
current flows through the load (RL) during both half cycles of the applied voltage, this bridge
rectifier is a full-wave rectifier. One advantage of a bridge rectifier over a conventional full-
wave rectifier is that with a given transformer the bridge rectifier produces a voltage output
that is nearly twice that of the conventional full-wave circuit.
This may be shown by assigning values to some of the components shown in views A
and B. Assume that the same transformer is used in both circuits. The peak voltage developed
between points X and y is 1000 volts in both circuits. Since only one diode can conduct at any
instant, the maximum voltage that can be rectified at any instant is 500 volts. The maximum
voltage that appears across the load resistor is nearly-but never exceeds-500 v0lts, as a result of
the small voltage drop across the diode. In the bridge rectifier shown in view B, the maximum
voltage that can be rectified is the full secondary voltage, which is 1000 volts. Therefore, the
peak output voltage across the load resistor is nearly 1000 volts. With both circuits using the
same transformer, the bridge rectifier circuit produces a higher output voltage than the
conventional full-wave rectifier circuit.
23
CHAPTER – 8
8. IOT (INTERNET OF THINGS)
8.1 ABSTRACT
The Internet of things refers to a type of network to connect anything with the Internet
based on stipulated protocols through information sensing equipments to conduct information
exchange and communications in order to achieve smart recognitions, positioning, tracing,
monitoring, and administration. In this paper we briefly discussed about what IOT is, how IOT
enables different technologies, about its architecture, characteristics & applications, IOT
functional view & what are the future challenges for IOT.
8.2 INTRODUCTION
This chapter will address state of the art definitions and architectural models for IoT
offered by standardization organizations, IoT projects, academia, national initiatives, white
papers, books and related industries. While we have tried to be thorough, our effort cannot be
said to be exhaustive, given the proliferation of interest in the subject. Different definitions
And architectural models for IoT reflect different perspectives and support different business
interests. Analyzing these different definitions and architectures can help illuminate their
strengths and weaknesses. Still, as stated earlier, we see a need to have a common and non I
biased definition that effectively encompasses the expansive nature of the subject. We believe
the following review of different definitions and architectural models will serve us in
composing that more universal definition.
24
CHAPTER – 9
9. WATER FLOW SENSOR
9.1 INTRODUCTION
Water flow sensor consists of a plastic valve body, a water rotor, and a hall-effect
sensor. When water flows through the rotor, rotor rolls. Its speed changes with different rate of
flow. The hall-effect sensor outputs the corresponding pulse Signal.
9.2 DESCRIPTION
Water flow sensor consists of a plastic valve body, a water rotor, and a hall-effect
sensor. When water flows through the rotor, rotor rolls. Its speed changes with different rate of
flow. The hall-effect sensor outputs the corresponding pulse signal.
This one is suitable to detect flow in water dispenser or coffee machine.
We have a comprehensive line of water flow sensors in different diameters. Check them out to
find the one that meets your need most.
9.3 FEATURES
Compact, Easy to Install
High Sealing Performance
High Quality Hall Effect Sensor
RoHS Compliant
9.4 SPECIFICATIONS
Mini. Wokring Voltage: DC 4.5V
Max. Working Current: 15mA (DC 5V)
Working Voltage: DC 5V~24V
Flow Rate Range: 1~30L/min
25
Load Capacity: ?10mA (DC 5V)
Operating Temperature: ?80?
Liquid Temperature: ?120?
Operating Humidity: 35%~90%RH
Water Pressure: ?1.75MPa
Storage Temperature: -25~+ 80?
Storage Humidity: 25%~95%RH
You will need Arduino, Water Flow Sensor,10K resistor, a breadboard and some
jumper wires. Wiring up the Water Flow Sensor is pretty simple. There are 3 wires: Black,
Red, and Yellow. Black to the Arduino ground pin Red to Arduino 5v pin The yellow wire will
need to be connected to a 10k pull up resistor. and then to pin 2 on the Arduino.
Here is a fritzing diagram I made to show you how to wire it all up. Once you have it
wired up you will need to upload the following code to your Arduino. Once it is uploaded and
you have some fluid flowing through the Water Flow Sensor, you can open the serial monitor
and it will display the flow rate, refreshing every second.
26
CHAPTER – 10
10. PROGRAMME
// reading liquid flow rate using Seeeduino and Water Flow Sensor from hotmcu.com
// Code adapted by Charles Gantt from PC Fan RPM code written by Crenn
@thebestcasescenario.com
// http:/themakersworkbench.com http://thebestcasescenario.com http://hotmcu.com
volatile int NbTopsFan; // measuring the rising edges of the signal
int Calc;
int hallsensor = 2; // The pin location of the sensor
void rpm () // This is the function that the interupt calls
{
NbTopsFan++; // This function measures the rising and falling edge of the
hall effect sensors signal
}
void setup()
{
pinMode(hallsensor, INPUT); // initializes digital pin 2 as an input
Serial.begin(9600); // This is the setup function where the serial port is
initialised,
attachInterrupt(0, rpm, RISING); // and the interrupt is attached
}
void loop ()
{
NbTopsFan = 0; // Set NbTops to 0 ready for calculations
sei(); // Enables interrupts
delay (1000); // Wait 1 second
cli(); // Disable interrupts
Calc = (NbTopsFan * 60 / 4.5); // (Pulse frequency x 60) / 4.5Q, = flow rate in
L/hour
Serial.print (Calc, DEC); // Prints the number calculated above
Serial.print (" L/hour\r\n"); // Prints "L/hour" and returns a new line
}
27
CHAPTER – 11
11. APPLICATIONS
Used to monitor the water supply
Used to find and avoid the water theft
Avoids wastage of water
Reduces time
Reduces man power
28
CHAPTER – 12
12. PHOTOGRAPHY
29
CHAPTER – 13
13. COST OF ESTIMATION
Quantity Amount in
S. No Name of the Equipment
Nos Rs
1 Wifi – IOT 1 1300
4 Transformer 1 500
6 Sensor 1 1300
7 Wire _ 200
8 Others _ 400
30
CHAPTER – 14
14. CONCLUSION
Using this system secure and continuous monitoring is possible No need to go on field
for monitoring so manual work has reduced it makes system more efficient, reliable, low cost
and accurate we can Data monitored from anywhere controlling is possible from a remote
server it is Economical in development and.
31
CHAPTER – 15
15. REFERENCES
15.1 REFERENCE BOOKS
[1] Charles Scribner’s Sons. Nikola Tesla. Complete Dictionary of Scientific Biography,
volume 13. 2008.
[2] H. Meyer. A history of electricity and magnetism. MIT Press, Cambridge, Mass, 1971.
[3] D. C. Miller. Sparks, Lightning, Cosmic Rays: An anecdotal history of electricity.
The Macmillan Company, New York, 1937.
[4] T. H. Bullock. Electroreception. Springer, New York, 2005.
[5] R. Nersesian. Power for the 21st century: a comprehensive guide to conventional and
alternative sources. M.E. Sharpe Inc., 2010.
[6]Britanica: Academic Edition. http://www.britannica.com/EBchecked/topic/227204/Carl-
Friedrich-Gauss.
[7] K. Rice and S. Paul. Carl Friedrich Gauss. Australian Mathematics Teacher, 6:1–4, 2005.
[8] I. Stewart. Gauss. Scientific American offprint’s. W.H. Freeman, 1977.
[9] T. Gower, J. Barrow-Green, and I. Leader. The Princeton Companion to Mathematics.
Princeton University Press, Princeton, NJ, 2009.
[10] MILL MAN J and HAWKIES C.C. “INTEGRATED ELECTRONICS” MCGRAW
HILL, 1972
[11] ROY CHOUDHURY D, SHAIL JAIN, “ LINEAR INTEGRATED CIRCUIT”, New Age
International Publishers, New Delhi,2000
[12] “THE 8051 MICROCONTROLLER AND EMBEDDED SYSTEM” by Mohammad Ali
Mazidi.
32