hot water monitoring system - heim | skemmanframkallaðar á lokaða kerfið til þess að reyna...
TRANSCRIPT
Hot water monitoring system
Kristján Guðmundur Birgisson
Final thesis for B.Sc. degree
Keilir Institute of Technology
University of Iceland
School of Engineering and Natural Sciences
Hot water monitoring system
Kristján Guðmundur Birgisson
24 ECTS thesis submitted in partial fulfilment of a Baccalaureus Scientiarum degree in Mechatronic Engineering Technology
Advisors Burkni Pálsson
Guðmundur Borgþórsson
Keilir Institute of Technology
University of Iceland
School of Engineering and Natural Sciences
Reykjanesbær, September 2015
Hot water monitoring system 24 ECTS thesis submitted in partial fulfilment of a Baccalaureus Scientiarum degree in Mechatronic Engineering Technology Copyright © 2015 Kristján Guðmundur Birgisson All rights reserved Keilir Institute of Technology School of Engineering and Natural Sciences University of Iceland Grænásbraut 910 235 Reykjanesbær Sími: 578 4000 Bibliographic information: Kristján Guðmundur Birgisson, 2015, Hot water monitoring system, BSc thesis, Keilir Institute of Technology, University of Iceland, pp. 92. Printing: Háskólaprent ehf., Fálkagata 2, 107 Reykjavík Reykjanesbær, September 2015
v
Abstract
One of the main uses of geothermal water is for heating. About 98% of buildings in
Iceland use geothermal water for heat. In residence buildings, a flow control frame
distributes the water between the potable water and heating. In the entire flow control
frame there are optical gauges that have to be read manually, which is not optimal way for
the homeowner to check his usage.
This project is to set up a way to monitor the hot water usage by implementing electronic
sensors to measure temperature, flow and pressure. The sensors are connected to a
microcontroller that send the values from the sensors to a database via the internet. A
website will display the values that are stored in the database with charts and gauges.
To test the concept of using electronic sensors and controller, a closed system was
constructed, to have control of the flow, temperature and pressure. Simulated malfunctions
were used to test the system. The system successfully detected the malfunctions and a led
light lit up to indicate what type of problem occurred.
A prototype of the monitoring system was installed into a real flow control frame in a
residential house. The system runs autonomously by sending values at even intervals to a
database that displays the readings on a website for the user of the system to monitor the
hot water usage.
vii
Útdráttur
Eitt af aðalnotagildum jarðvarmans er til kyndingar. Á Íslandi er jarðvarmi notaður til
upphitunar á um það bil 98% af húsum. Í íbúðar húsum er flæði heitavatnsins stjórnað í
sérhönnuðum röraramma (kallað grindin). Í grind þessari fer fram deiling á notkun vatnsins
annars vegar til húsahitunar og hins vegar til neyslu á vatninu (þvotta og fleira). Í
flæðirammanum eru skynjarar, sem þarf að lesa af til að fylgjast með notkuninni sem er
ekki ákjósanleg leið.
Verkefnið fjallar um að koma upp eftirlitskerfi fyrir notkunina á heitu vatni og nýtingu
þess með því að setja rafmagns skynjara í mælagrindina sem mæla á hita, flæði og þrýsting
á vökvanum. Skynjararnir eru tengdir örtölvu, ásamt búnaði til að gefa viðvörunarljós ef
ekki er allt eðlilegt, sem sendir svo gögnin yfir til gagnagruns í gegnum internetið. Vefsíða
er síðan notuð til þess að sýna gildin sem geymd eru í gagnagrunninum með línuriti og
skífumálum.
Til að prófa hugmyndina, við að nota rafmagns skynjara og örtölvu, var smíðað lokað kerfi
til þess að hafa betri stjórn á flæðinu, hitanum og þrýstingum til prófunar. Bilanir voru
framkallaðar á lokaða kerfið til þess að reyna virkni eftirlitskerfisins. Eftirlits kerfið náði
góðum árangri að skynja bilanirnar og að kveikja á ljósi til þess að gefa til kynna hvaða
bilun var um að ræða.
Frumgerð af eftirlitskerfinu var komið fyrir á raunverulegu heitavatns kerfi í íbúðar
húsnæði. Kerfið sendir gögn með jöfnu tímabili til gagnagruns sem er síðan sýnt á vefsíðu
þar sem notandi kerfisins getur fylgst með notkuninni á heitavatninu og nýtingu þess.
ix
Table of Contents
List of figures ...................................................................................................................... xi
List of Tables ..................................................................................................................... xiii
Abbreviations ..................................................................................................................... xv
Acknowledgements .......................................................................................................... xvii
1 Introduction ..................................................................................................................... 1 1.1 Water monitoring systems ....................................................................................... 2
1.2 Solution ................................................................................................................... 3
2 Background ..................................................................................................................... 5 2.1 Embedded systems .................................................................................................. 5
2.1.1 Microcontrollers ............................................................................................. 6 2.1.2 Processors ...................................................................................................... 7 2.1.3 How processors works ................................................................................... 7
2.2 Information distribution and holding ...................................................................... 9
2.2.1 Database ......................................................................................................... 9 2.2.2 Distribution .................................................................................................. 10
2.3 Water monitoring systems ..................................................................................... 11
3 Analysis .......................................................................................................................... 15 3.1 Controller Systems ................................................................................................ 16
3.2 Sensors................................................................................................................... 18 3.2.1 Temperature sensors .................................................................................... 18 3.2.2 Pressure sensor ............................................................................................. 21 3.2.3 Flow sensor .................................................................................................. 23
4 Build ............................................................................................................................... 25 4.1 Measurements ........................................................................................................ 25
4.2 Prototype ............................................................................................................... 27 4.3 Programming ......................................................................................................... 28
4.3.1 Arduino Yún ................................................................................................ 29 4.3.2 Database and Website .................................................................................. 31
4.4 Cost ........................................................................................................................ 32
5 Result .............................................................................................................................. 35 5.1 Alarm System ........................................................................................................ 36 5.2 Testing the system ................................................................................................. 37
6 Addition ......................................................................................................................... 41 6.1 Setting up the Sensors ........................................................................................... 42
6.1.1 Adding the sensors to the heat frame ........................................................... 44 6.2 Connections from sensors to Arduino Yún ........................................................... 45
x
6.3 Database and Webpage .......................................................................................... 46 6.3.1 Database ....................................................................................................... 46 6.3.2 Calculation from the database ..................................................................... 47 6.3.3 Webpage ...................................................................................................... 49
6.4 The working of the system ..................................................................................... 52 6.5 Cost after addition to project .................................................................................. 53
7 Conclusion ...................................................................................................................... 55
8 Discussion ....................................................................................................................... 57 8.1 First test .................................................................................................................. 57
8.2 Second test ............................................................................................................. 57
9 Future Work .................................................................................................................. 59
Reference ............................................................................................................................. 61
Appendix A: Specification of Arduino Ýun Development Board .................................. 63
Appendix B: Arduino Yún electrical schematic .............................................................. 65
Appendix C: Specification of the DS18B20 temperature sensor ................................... 67
Appendix D: Specification of the flow sensor .................................................................. 69
Appendix E: Specification of the pressure sensor ........................................................... 71
Appendix: Time Schedules ................................................................................................ 73
xi
List of figures
Figure 1 Hot Water Supply System for the Greater Reykjavík Area .................................... 1
Figure 2 Examples of Embedded Systems ............................................................................ 5
Figure 3 Basic Structure and Block Diagram of a Microcontroller ...................................... 6
Figure 4 Main Hardware Components of a Processor ........................................................... 8
Figure 5 Basic Platform for a Working Website ................................................................. 11
Figure 6 Flow Controller Frame from HS Veitur HF .......................................................... 12
Figure 7 PIN Layout For DS18B20 Temperature Sensor ................................................... 20
Figure 8 Multiple DS18B20 Temperature Sensors Connected to the Same Data Line ...... 21
Figure 9 Multiple DS18B20 Temperature Sensors Connected to the Same Data Line
with Pins One and Three Shorted ..................................................................... 21
Figure 10 Explanation of Magnetic Flow ............................................................................ 23
Figure 11 The Closed System that Tests the Chosen Equipment and Idea ......................... 27
Figure 12 Communication Between Both Processors ......................................................... 29
Figure 13 Input and Output Pins from the Arduino Yún ..................................................... 30
Figure 14 Values from the Sensors to MySQL Database .................................................... 31
Figure 15 Graphical Visualization of the Data from the Database Shown in Website. ...... 32
Figure 16 Values from the Sensors Shown in Webpage ..................................................... 35
Figure 17 Work Diagram for the Values from the Sensors to the Database and from
the Database to the Webpage ............................................................................ 36
Figure 18 Water Temperature Anomaly .............................................................................. 37
Figure 19 Yellow Warning Light Turns On when the Temperature in not within the
Limit Range ...................................................................................................... 37
Figure 20 Pressure in the System Falls Down ..................................................................... 38
Figure 21 Green Warning Light Turns On when the Pressure in not within the Limit
Range ................................................................................................................ 38
xii
Figure 22 Flow in the System Falls Down .......................................................................... 39
Figure 23 Red Warning Light Turns On when the Flow in not within the Limit Range .... 39
Figure 24 Before Implementing Cross Fittings in to the Flow Controller Frame A)
Figure on Right Shows Where the Water Enters Into the Frame. B)
Figure on Left Shows When the Water Enters the Snow Melting System
and Exits the Frame .......................................................................................... 42
Figure 25 After Implementing Cross Fittings to the Flow Controller Frame. A) Left.
B) Right ............................................................................................................ 43
Figure 26 Pipe Assembly when the Cross Fittings are Inserted into .................................. 43
Figure 27 Thread Fittings and Insulation for the Temperature Sensor ............................... 44
Figure 28 Sensors Connected to the Flow Controller Frame .............................................. 44
Figure 29 Electrical Box with Arduino Yún and Connection with Sensor with PCB ........ 45
Figure 30 Login Page for the Website ................................................................................ 49
Figure 31 Facebook Login Page .......................................................................................... 50
Figure 32 The Main Web page for the Monitoring System ................................................ 50
Figure 33 Web Page that Displays all the Temperature Measurements ............................. 51
Figure 34 Working of the Monitoring System .................................................................... 52
Figure 35 Appendix B-1 Block Diagram of Arduino Yún .................................................. 65
Figure 36 Appendix B-2 Power Block Diagram ................................................................. 66
Figure 37 Original Time Schedule ...................................................................................... 73
Figure 38 New Time Schedual ............................................................................................ 74
xiii
List of Tables
Table 1 Incidents that exceed one million krónur ................................................................. 2
Table 2 Difference Between the First Processor to the Latest Model From Intel ................. 7
Table 3 Characteristics of RISK/CISC Instruction Set Architecture .................................... 9
Table 4 Material of Flow Controller Frame from HS Veitur HF ........................................ 12
Table 5 Comparisons of Specifications for the Development Boards................................. 16
Table 6 Comparisons for I/O for the Development Boards................................................. 17
Table 7 Typical Temperature Sensor Characteristics .......................................................... 19
Table 8 Comparisons of Temperature Sensors Models ....................................................... 20
Table 9 Notes and Terminology for Pressure Sensors ........................................................ 22
Table 10 Comparisons of Pressure Sensors Models ............................................................ 23
Table 11 Comparisons of Flow Sensors Models ................................................................. 24
Table 12 Flow Measurements Taken on a Real Controller Flow Frame............................. 25
Table 13 Temperature Measurements ................................................................................. 26
Table 14 Pressure Measurements ........................................................................................ 26
Table 15 Bill of Material ..................................................................................................... 27
Table 16 Cost of Material and Work ................................................................................... 33
Table 17 Calculation of the Temperature for 13 Days of Data Points ................................ 47
Table 18 Calculation of the Pressure for 13 Days of Data Points ....................................... 48
Table 19 Cost after Modifacations of Project ...................................................................... 53
xv
Abbreviations
ARM Advanced RISC Machine, Acorn RISC Machine
ADC Analog to Digital Converter
ALU Arithmetic and Logic Unit
BSD Berkeley Software Distribution
CISK Complex Instruction Set Computer
CPU Central Processing Unit
CSS Cascading Style Sheet
DAC Digital to Analog Converter
DBMS Database Management Systems
DSP Digital Signal Processor
EEPROM Electrically Erasable Programmable Read Only Memory
GPU Graphics Processing Unit
HTML Hyper Text Markup Language
I/O Input and Output
IR Instruction Register
ISA Instruction set Architecture.
PCB Printed Circuit Board
PDF Portable Document Format
PHP Hypertext Preprocessor
PLC Programmable Logic Controller
PC Program Counter
RAM Random Access Memory
RISK Reduced Instruction Set Computing
ROM Read Only Memory
xvi
SSH Secure Shell
UART Universal Asynchronous Receiver/Transmitter
URL Uniform Resource Locator
xvii
Acknowledgements
I want to thank
Kjartan Birgisson, Sigríður Andrea Ásgeirsdóttir for their help.
Magni Þór Birgisson for his help and use of dataserver and web site storage.
Guðrún Þorbjörg Kristjánsdóttir for help in making figures in this thesis.
Birgir Óskarsson for use of the tank and drill that was used in testing.
Birgir and Guðrún for allowing to implement the monitoring system to their house for
testing.
Orkuveita Reykjavíkur for lending of a regulated flow sensor.
1
1 Introduction
One of Iceland´s most valuable resources is its plentiful geothermal water. The hot water
is either used directly or indirectly. In some places hot water is pumped from the ground
into pipes and then flows through pipes towards the customers and their houses. The
other way is to heat cold ground water through geothermal energy plants and used that
through same system pipes to heat houses. These methods are both used in the Reykjavik
area Figure 11.
Figure 1 Hot Water Supply System for the Greater Reykjavík Area
About 98% of houses in Iceland use the hot water for heating2. This kind of heating is
used in all types and kinds of facilities, for example business, department buildings,
administrative buildings, and residential buildings.
Many Icelanders own summerhouses as a second home, that are only used irregularly and
a lot of them are heated with hot water. That means that they are empty for quite some
1 Source: https://www.or.is/vorur-thjonusta/heitt-vatn#hitaveita_a_hofudborgarsvaedinu Accessed:
14.9.2015 2 Source: https://www.hsveitur.is/images/mv_hitamenning.pdf Accsessed: 12.05.2015
2
time and no one is there to regulate or monitor the use of the hot water or the condition of
the heating system3.
About 90% of all hot water usage is for heating purposes4 and the rest is used for washing,
cleaning and personal hygiene. The main suppliers of hot water are either state or county.
1.1 Water monitoring systems
There are not many water monitoring systems that are generally installed in buildings
other than those installed to the flow controller frame by the supplier. The only two
companies in Iceland that offers a package that includes a water leakage detector is
Securitas5 and Öryggismiðstöðin
6. The water leakage detector is only one sensor, which
means that there could be massive water damage before the sensor indicates leakage.
Mannvirkjastofnun7 announced in the year 2014 that the number of reported water
damages was 7.387. Of 7.387 incidents, 1.442 were not liable and therefore the owner had
to pay for the damages. In 418 incidents, the cost was equal to or exceeded one million
krónur:
Table 1 Incidents that exceed one million krónur
Cost (million Kr) Incedence
4 < 22
3 - 4 24
2 - 3 56
1 - 2 316
The total cost of water damage was close to 2.4 billion krónur. The insurance companies
payed out about 1.7 billion krónur. The average cost of damage that was not liable is
about 430 million krónur. The own risk policy of the insurance company had the home
owners pay over 700 million krónur.
These numbers show how massive the cost can be when dealing with water damages and
how the homeowners had to frequently cover big financial costs. In some instances they
had to abandon their homes for some days because of repairs.
Water monitoring system is needed that can help prevent some of the damages that occur
to homes and buildings.
The audience of this thesis are University students and professional that have at least, a
basic understanding and knowledge of programming and electronic components
3 Source: https://www.vis.is/einstaklingar/forvarnir/fritimi/sumarbustadur/vatnsvarnir/ Accessed: 13.05.2015
4 Source: https://www.or.is/spurningar-og-rad/sparnadarrad/hushitun Accessed: 12.05.2015
5 Source: http://www.securitas.is/Heimavorn/heimavorn.html Accessed: 14.9.2015
6 Source: https://www.oryggi.is/ Accessed: 15.9.2015
7Source: http://www.mbl.is/frettir/innlent/2015/05/21/tjon_vegna_vatnsleka_2_4_milljardar/
Accessed:10.9.2015
3
1.2 Solution
The main problem with monitoring the flow controller frame is that all the sensors are
optical gauges which means that they have to be read manually. To maintain the flow
system and check if operations are running normal the sensor have to be regularly
monitored and written down to check for anomalies.
In this thesis there will be used another way of monitoring the usage by using electronic
sensors that are connected to a controller. The controller is connected to a database that
will collect and hold all values and then displayed for the user.
5
2 Background
The idea was to construct and set up a device that could monitor and measure the usage of
hot water for heating houses. This device would be used to monitor the usage, fluctuations
in flow, heat and pressure, and send the readings to a server. The device will include
sensors located within the hot water pipes and a microcontroller to assemble the readings
and transmit the results. Each step is documented to include what kind of equipment is
needed to accomplish those measurements.
In order to take measurements the sensors are located at strategic points in the heat frame
and they send signal to a microcontroller. The processor´s functions are to interpret and
convert the signals from the sensors to an understandable format.
The measurements are then automatically sent to a database that will store the information.
The information is set up in a table and collected from the server, and the information can
be shown on a website. The website is set up for the user to easily read the information
from the sensors.
2.1 Embedded systems
Embedded systems consist of some sort of controlling mechanism such as a
microcontroller or microprocessor. In other words “A physical system that employs
computer control for a specific purpose, rather than for a general-purpose computation, is
referred to as an embedded system” [1,386].
Figure 2 Examples of Embedded Systems
6
Figure 28 shows examples of embedded systems as they are used in remote controllers, cd
players/radios, watches and satellites that have a specific purpose for controlling or
monitoring.
The setup for an embedded system must be easily accessible in order to make repairs, for
example, if a part has malfunctioned or the system needs to be replaced by a newer
version.
The purpose for embedded systems for this project is to collect values from multiple
sensors and store them in a database. In order to collect the values the physical system
must be equipped with a processor, I/O ports, analog/digital converter, timer, internal
memory to name a few.
2.1.1 Microcontrollers
“A microcontroller (μC) is a small computer on a single integrated circuit consisting of a
relatively simple central processing unit (CPU) combined with peripheral devices such as
memories, I/O devices and timers” [2,179]. Figure 39 shows a block diagram of the basic
structure for microcontrollers.
The main part is a CPU that is responsible for fetching the instructions and it decodes
them to usable functions so they can be executed. The CPU connects every part of the
microcontroller into a single system.
The memory is split up in two different groups: RAM and ROM memory. The RAM
holds the data that changes during computations. The ROM holds the pre-programmed
instructions for the CPU. Popular choices for ROM memory are EEPROM and Flash
memory as they can be reprogrammed over and over again [1,390].
8 Source: http://www.rrsg.uct.ac.za/courses/EEE3074W/EmbeddedSystems.html Accessed 11.06.2015
9 Source: http://www.circuitstoday.com/basics-of-microcontrollers Accessed 30.5.2015
Figure 3 Basic Structure and Block Diagram of a Microcontroller
7
For the microcontrollers to work proficiently it can be necessary to have both parallel and
serial interfaces. To make the implementation easier in standard I/O connection the
common practices is to provide several I/O ports for both serial and parallel interfaces
[1,391]. Parallel ports may be configured as inputs or outputs which can help keep the
system smaller when only a few ports are needed. A serial port interface provides UART
capabilities. Double buffering is used in the transmit - and receive paths [1,395].
The counter for microcontroller can be either an internal clock or an external one and is
responsible for the correct sequence of actions the microcontroller must make.
2.1.2 Processors
Since the first microprocessor was released in 197110
, the Intel 4004, there has been a lot
of development in processors. The technology continues to evolve each year which leaves
processors with more capabilities and computing power.
Table 2 Difference Between the First Processor to the Latest Model From Intel
Name 1971 Intel
4004
processor
1982 Intel
286 Processor
1993 Intel
Pentium
processor
2003
Intel
Pentium
M
processor
2012 3rd
gen Intel
core
processor
Initial clock
speed
108 kHz 6 MHz 66 MHz 1.7 GHz 2.9GHz
Transistors 2300 134.000 3.1 million 55
million
1.4
billion
Manufactory
Technology
10 μm 1.5 μm 0.8 μm 90 nm 22 nm
Table 2 shows that the processors have gotten smaller, the number of transistors has
increased exponentially along with the initial clock speed.
2.1.3 How processors works
The CPU executes machine language instructions and coordinates activities of other units
[1,152]. The operations of a processor can be carried out as follows
- Read contents of a given memory location and load them into a processor register
- Read data from one or more processor register
- Perform an arithmetic or logic operation and place the result into a processor register
- Store data from a processor register into a given memory location11
10Source: http://www.intel.com/content/www/us/en/history/history-intel-chips-timeline-poster.html
Accessed 12.6.2015
8
The main hardware components of the processor should and could be able to perform
these operations as can be seen in Figure 412
. The processor conveys with the memory
with the processor memory interface that moves the data to and from the memory during
read and write operations. The instruction address generator then updates the contents of
the PC when the instructions are fetched. The processor´s general purpose register, is
formed by organization of storage location from the register´s file. All contents
instruction that require computing are sent to the ALU unit and all the results are then
stored in the register file [1,153-154].
11 [1,153]
12 [1,153]
Figure 4 Main Hardware Components of a
Processor
9
There are two very different approaches of the design of instruction sets for computers and
that are RISK or CISC instruction set [1, 34]. See Table 313
for difference in
characteristics for both types.
Table 3 Characteristics of RISK/CISC Instruction Set Architecture
RISC CISC
General Very fast, fixed length instruction
decode, high execution rate
Fewer instructions, size of code is
smaller
# of instruction <100 >200
# of address modes 1-2 5-50
Instruction formats average 1-2 3+
Cycles/Instructions ≈1 3-10
Memory access Load/store instructions Most CPU instructions
Registers 32+ 2-16
Control unit Hardwires Microcoded
Instruction decode area(% of
overall die area)
10% >50%
RISC has instructions that fit into a single word and a load/store architecture is used where
all operands are accessed. The number of instructions can exceed over 100 overall and it
takes about one cycle to execute each instruction.
CICS instructions are not constrained to the load/store architecture where arithmetic and
logics operations can be performed on operands in the processor register [1, 74]. The
number of instructions are fewer than 200 and it takes three to ten cycles for one
instruction to complete.
2.2 Information distribution and holding
Distributing and storing information is a key element when building a monitoring system.
The information will be stored in a database and displayed on a website.
2.2.1 Database
A database is a collection of software that can be used in almost all operating systems such
as Windows, OSX, Linux and BSD.
13 [3,8]
10
DBMS provide more functions to a simple file management:14
Allow concurrency
Control security
Maintain data integrity
Provide for backup and recovery
Control redundancy
Allow data independence
Provide non-procedural query language
Perform automatic query optimization
There are multiple versions of databases available but there will be only overview on
relational type database. “Relation database is a database that treats all of its data as a
collection of relations” [4, 7]. An essential attribute of a relational database is that every
tuple or record must be unique. They are identifying values that are known as key or key
values.
For this project two databases types MySQL and SQLite will be used and explained in
chapter 4.
2.2.2 Distribution
When presenting information from a database there are several things that have to be
considered. Ease of access for the database and the user are the main focus points and also
the way the information is presented. Therefore the three main components for the
distribution are:
Web page setup
Relevant Information
Presentation of information
For the webpage setup there are several programming languages that work together.
HTML is the main building block for the webpage. HTML format tells the computer how
to display the contents on the web page which is plain text with special tags that a web
browser uses to display the information15
. “The syntax and placement of special
instructions (tags) that aren’t displayed, but tells the browser how to display the
documents contents.”[5, 67]. In order to have more control on displaying the information
the CSS is used. CSS can specify the page element of the web page setup, such as the
font, size of the text and keeps it in place throughout the webpage. Figure 5 shows how
the setup is when using JavaScript, PHP, CSS and HTML. JavaScript and PHP control the
action that is displayed, CSS controls where and how it is shown. HTML is the page that
shows the contents.
14 [4, 4]
15 Source: http://www.austincc.edu/hr/profdev/eworkshops/docs/HTML_Basics.pdf Accessed 18.06.2015
11
For this project there are communications between data server and the HTML website.
The PHP programming language is used for that communication and is open source. PHP
has support for most web servers and all major operating systems.16
PHP has the abilities
to output images, PDF files and Flash videos. JavaScript is used to show the data from the
data server with graphs and gauges. CSS controls where on the web page the graphs and
gauges are and HTML is the webpage that shows the graphs and gauges.
2.3 Water monitoring systems
The standard monitoring systems for buildings that is provided by the utility that supplies
the water to them can be seen in Figure 617
. This setup is owned by HS Veitur HF. The
only sensors that are included are optical gauge sensors and the sensors are read manually.
A worker from the company has to go to every building/structure, read the values and
write them down and this is done at least once every year. Not many customers are known
to go regularly and check the sensors for themselves.
After a company worker has checked the gauges, the company sends a bill that gives
indication to the customer if he has used more or less than estimated water usage for that
fiscal year. This is the only indication to the customer that everything is all right with the
system if the usage is not monitored regularly throughout the year.
16 Source: http://php.net/manual/en/intro-whatcando.php Accessed 18.06.2015
17 Source: http://www.hsveitur.is/english/HSAdvice/HSAdviceFrame.aspx Accessed: 22.6.2015
Figure 5 Basic Platform for a Working Website
12
Figure 6 Flow Controller Frame from HS Veitur HF
The content of the heat frame in Figure 6 is listed in Table 4.
Table 4 Material of Flow Controller Frame from HS Veitur HF
NR Material
1 Inlet valve hot water
2 Filter
3 Flow meter, sales meter HS Veitur hf
4 Main valve heating system
5 Main valve potable water
6 Pressure meter
7 Pressure control valve, type Danfoss AVD
8 Temperature and pressure meter
9 Non-return valve
10 Flow control valve*
11 Safety valve
13
*Flow meter valve is a choice to put in, to limit the maximum flow of hot water through
the heating system.
The inlet valve (1) controls whether hot water enters the flow controller frame, and is
usually open except when maintenance is being done on the system. The flow meter (3)
measures the volume of all the water usage in cubic meters. There are then two valves,
one that controls the heating system (4) and then the potable water or drinking water (5).
The potable water is used for domestic uses such as bath, showers and cleaning. The rest
goes to the radiators for heating. The hot water goes through the radiator flow limiting
valve (12) and from there to every radiators that are connected to the system. There is
usually one pressure meter (6), one flow meter (3) and two temperature and pressure
meters in one (8, 15) that are on each flow controller frame. The temperature meters show
the temperature drop from when the water enters the radiators and when it exits them.
Some flow controller frames, have extra input valve for a snow melting system that is
connected between the radiator return valve (13) and drain (18) and uses the excess heat
when the water has gone through the radiators. If the system needs maintenance then the
inlet valve (1) is closed and the filter and drain valve (16) are opened to take the pressure
and water from the system to prevent damages and injuries.
12 Radiator flow limiting valve
13 Radiator return valve
14 Maintenance valve
15 Temperature and pressure meter
16 Filter and drain valve
17 Back pressure valve, type Danfoss AVD
18 Drain
15
3 Analysis
During the design process several variables needed to be considered when choosing the
right equipment for this project. The device needs to be compact so it is easily installed
near the heat frame for easy access in order to maintain the device and the heat frame.
It is preferable to have continuous electricity for the device from an electrical outlet, either
battery power source or main house electricity. An external power source can be difficult
to install near the heat frame due to tight spaces. The device´s power consumption is
relatively small as it will not affect the consumer´s electrical bill.
The water temperature from the supplier is usually around 80°C and the pressure is from
two bar to maximum eight bar18
.
Requirements for the temperature sensor:
Needs to be reliable so that error measurements are low over time.
Easily connected to device
Easily installed to heat frame
Maximum temperature range over 100°C.
Requirements for the pressure sensor:
Needs to be reliable so that error measurements are low over time.
Easily connected to device
Easily installed to heat frame
Maximum pressure range over eight bar pressure.
Handle the water temperature in the heat frame.
Requirements for the flow sensor:
Needs to be reliable so that error measurements are low over time.
Needs to handle the flow of water.
Needs to handle the water temperature.
Easily connected to device
Easily installed to heat frame
Requirements for the controller system
Easy in software programming.
Needs to handle the heat from the heat frame.
Can read analog and digital inputs
Can connect to the internet
18 Source: https://www.or.is/spurningar-og-rad/ertu-ad-byggja/tenging-vid-hitaveitu Accessed 22.6.2015
16
3.1 Controller Systems
A few development boards were examined, in order to choose one that would qualify
according to the stated requirements of this project. The choice was also between buying
a development board and making one from individual parts.
A Linux based development board was chosen as Linux is an open source operating
system that only uses a small amount of memory and is easily programmable. It also has
the ability to be programmed over the internet with an SSH connection.
The four development boards that were looked at are:
Arduino Yún
Beaglebone Black
Intel Galileo
Raspberry Pi
Comparisons of the development boards can be seen on the Table 5 and Table 619
.
Table 5 Comparisons of Specifications for the Development Boards
Arduino Yun Beaglebone
Black Intel Galileo Raspberry Pi
SoC Atheros AR9331 Texas Instruments
AM3358 Intel Quark X1000
Broadcom
BCM2835
CPU MIPS32 24K and
ATmega32U4 ARM Cortex-A8 Intel X1000 ARM1176
Architecture MIPS and AVR ARMv7 i586 ARMv6
Speed 400mhz (AR9331)
and 16mhz
(ATmega)
1ghz 400mhz 700mhz
Memory 64MB (AR9331)
and 2.5KB
(ATmega)
512MB 256MB
256MB (model A)
or 512MB (model
B)
FPU None (Software) Hardware Hardware Hardware
GPU None PowerVR SGX530 None Broadcom
VideoCore IV
Internal
Storage
16MB (AR9331)
and 32KB
(ATmega)
2GB (rev B) or 4GB
(rev C) 8MB None
External
Storage MicroSD (AR9331) MicroSD MicroSD SD card
Networking 10/100Mbit Ethernet
and 802.11b/g/n Wi-
Fi
10/100Mbit Ethernet 10/100Mbit
Ethernet
None (model A) or
10/100Mbit Ethernet
19 [2]
17
Power Source 5V from USB micro
B connector, or
header pin.
5V from USB mini
B connector, 2.1mm
jack, or header pin.
5V from 2.1mm
jack, or header pin.
5V from USB micro
B connector, or
header pin.
Dimensions 2.7in x 2.1in
(68.6mm x 53.3mm)
3.4in x 2.1in
(86.4mm x 53.3mm)
4.2in x 2.8in
(106.7mm x
71.1mm)
3.4in x 2.2in
(85.6mm x 56mm)
Weight 1.4oz (41g) 1.4oz (40g) 1.8oz (50g) 1.6oz (45g)
Approximate
Price $75
$55 (rev C), $45 (rev
B) $80
$25 (model A), $35
(model B)
Documentation Open source Open source Open source Open source
Table 6 Comparisons for I/O for the Development Boards
Arduino Yun Beaglebone
Black Intel Galileo Raspberry Pi
Digital I/O
Pins 20 65 14 17
Digital I/O
Power 5V 3.3V
3.3V or 5V (switched
with jumper) 3.3V
Analog Input
12 with 10-bit ADC,
0-5V (supports
external reference
input)
7 with 12-bit ADC,
0-1.8V (no external
reference input)
6 with 12-bit ADC,
0-5V (no external
reference input)
None
PWM Output 7 8
6 (limited speeds
prevent fine servo
control)
1
UART 2 (1 wired
to AR9331) 4
2 (1 exposed through
3.5mm jack) 1
SPI 1 2 1 2
I2C 1 2 1 1
USB Host 1 standard A
connector (AR9331)
1 standard A
connector
1 micro AB
connector
1 (Model A) or 2
(Model B) standard
A connector
USB Client 1 micro B
connector (ATmega) 1 mini B connector 1 micro B connector None
Video Output None Micro HDMI None HDMI, Composite
RCA, DSI
Video Input None None None CSI (camera)
18
Audio Output None Micro HDMI None HDMI, 3.5mm jack
Power Output 3.3V up to 50mA, 5V 3.3V up to 250mA,
5V up to 1A
3.3V up to 800mA,
5V up to 800mA
3.3V up to 50mA, 5V
up to 300-500mA
Other
- All I/O routed to
ATmega processor
unless noted
otherwise.
- Real-time support
with programmable
real-time units.
- Mini-PCI Express
slot.
- Real-time clock
with optional battery.
- Hardware
compatibility with
most Arduino
Leonardo compatible
shields.
- Many pins have
multiple functions
such as I2S audio,
CAN bus, etc.
- Mixed compatibility
with Arduino shields.
Regarding a controller system, it was decided to choose a development board instead of
setting up the embedded system from scratch, in order to save time and make testing easier
The development board that was chosen was the Arduino Yún. It has two processors
Atheros AR9331 and ATmega32U4. The first is Linux based and the second one uses the
Arduino software that is open source. It is easy to program and has a strong programming
debug capabilities. It is the only development board that has internal Wi-Fi connection
and can read 5V analog inputs without extra equipment or circuitry. It can support
external reference inputs and has 5V digital power. All I/O ports are routed to the
ATmega processor, which leaves the AR9331 processor to work simultaneously with the
ATmega.
3.2 Sensors
The analyses of the different types of sensors are shown in the beginning of the chapter
and those qualifications were used to make a decision of which sensors were chosen. The
specifications were compared for different sensors and then a sensor was chosen that could
fulfil the requirements and by the score they received. The sensors that were chosen for
this project did not need complicated circuitry to connect with the chosen controller
system.
The sensors were also chosen to test the idea of measuring changes in the heat frame. The
cost of the sensors was also a factor and was kept as low as possible. The chosen sensors
do not necessarily represent what sensors would be used in real applications.
3.2.1 Temperature sensors
There were several different sensors that could fulfil the requirements. Comparisons of
temperature sensors can be seen in Table 7
19
Table 7 Typical Temperature Sensor Characteristics
Typical Characteristics
Thermistors General Purpose
Resistance Temperature
Device Thermocouples
Semiconductor Temperature
Sensors
Temperature Range
-55°C to +125°C
-200°C to 850°C
-600°C to +2000°C
-50°C to +150°C
Linearity ex Fairly linear Fairly linear Best
Sensitivity High Low Medium Highest
Response Time
Fast Slow Fast to slow (depends on construction)
Slow
Excitation of power
Needed Needed Not Needed Needed
Long-Term Stability
Low High High Medium
Self-heating Yes Yes No Yes
Cost Low
Low (film)
High (wire wound)
Moderate to High
(depends on construction)
Low to Moderate
According to Table 7 the Semiconductor and Thermistors sensors are the best choices
since the temperature range is closest to the requirements. The Semiconductor sensors are
the better choice since they have better sensitivity, and linearity. They also have better
long term stability and that is a crucial requirement in order to make the need of
maintenance low. The response time is not required to be fast since the change in water
temperature after it goes through the radiator system and exits takes time and depends on
how many radiators are connected and how big the system is.
20
Table 8 Comparisons of Temperature Sensors Models
Temperature sensors
Model Tmp3620
DS18B2021
W1701 switch +
b25 thermistor22
Voltage input (V) 2.7 - 5.5 3 - 5.5 12
Output 10mV/°C Binary 277.2 - 0.0619 k-ohm
Accuracy ±2% ± 0.5°C ±0.1°C
Digital/Analog Analog Digital Analog
Temperature range (°C)
-40 to +125 -55 to +125 +20 to +90
Extra
Waterproof Waterproof
Cost (dollars) 1.50 1.65 3.99
The selected sensor was the DS18B20 which is accurate and also within the temperature
range of this project. The sensor does not need complicated circuitry to connect to the
controller. The sensor comes in a waterproof casing and has accuracy of a half a degree.
It has the best accuracy and cost ratio.
This temperature sensor has the ability to have multiple
sensors connected on the same data line to the controller.
Each sensor has a unique serial number that the controller
reads and can identify which sensor is sending the data.
The sensor has three pins see Figure 7:
GND
DQ
VDD
20 Source: https://www.sparkfun.com/products/10988 Accessed 15.5.2015
21 Source: http://www.ebay.com/itm/1pcs-Waterproof-DS18B20-Digital-Thermal-Probe-or-Sensor-
/201335507714?pt=LH_DefaultDomain_0&hash=item2ee0880b02 Accessed 15.5.2015 22
http://www.ebay.com/itm/New-20-90-Precision-Temperature-Difference-Adjustable-Control-Switch-DC-
12V/111450300007?_trksid=p2047675.c100005.m1851&_trkparms=aid%3D222007%26algo%3DSIC.MB
E%26ao%3D1%26asc%3D32022%26meid%3D86349e6d7d0d457d93f91e268713b536%26pid%3D100005
%26rk%3D1%26rkt%3D6%26sd%3D251722971921&rt=nc Accessed 15.5.2015
Figure 7 PIN Layout For
DS18B20 Temperature Sensor
21
The VDD is connected to the power either three volts or five volts, DQ is the data line
which sends the temperature readings to the controller and GD is the ground wire. There
needs to be 4,7 Kohm pull up resistor shorted between the VDD line and DQ line.
There are two ways of connecting the ds18b20 sensors to the controller. One way can be
seen in Figure 823
that is called normal power mode or connect pin one and three to the
ground, which is called parasite power mode see Figure 924
.
For best uses of the sensor the normal power mode works best and ensures that all data
from the sensors can be delivered to the controller.
3.2.2 Pressure sensor
Pressures sensors can be categorized depending on the characteristics of individual
projects. The best way to choose a pressure sensor is to define its use and compare it to
the definition in Table 925
23 Source: http://www.tweaking4all.com/hardware/arduino/arduino-ds18b20-temperature-sensor/ Accessed:
29.8.2015 24
See reference 16 25
[7, 11 - 12]
Figure 8 Multiple DS18B20 Temperature Sensors Connected to the
Same Data Line
Figure 9 Multiple DS18B20 Temperature Sensors Connected to the
Same Data Line with Pins One and Three Shorted
22
Table 9 Notes and Terminology for Pressure Sensors
Sensor Categories
Definition
Pressure Sensor
Refer to a basic device that includes a diaphragm, bellows, or bourdon tube that is in contact with the process fluid and strain or deflection measuring devices but not with the circuitry needed to convert strain-produced resistance changes to a change in electrical current, or the equivalent devices in other form of pressure-measuring apparatus
Pressure Transducer
Includes the functions of the sensor and in addition, a signal processor or means for converting the change in pressure to a change in electrical, hydraulic, pneumatic, or optical quantity that can be quantified over a range of values
Pressure Switch Is equivalent to a pressure transducer except that the change in pressure is converted to a bistable quantity that is either ‘on’ or ‘off’
Pressure Transmitter Is a pressure transducer to which are added power supply, temperature compensation, and output signal conditioning so that a signal can be transmitted to a remote pressure indicator or process controller
Pressure Gauge Is a generic term that denotes a device that measures pressure, which might include manometers, dead weight testers, mechanical gauges, and any other direct means for measuring pressure.
According to Table 9 the chosen sensor categories are pressure transducer and pressure
transmitter which has the means to convert the change in pressure to a change in electrical
quantity that can be quantified over range of values. The sensor measures the pressure and
then sends electrical change to the controller. Then the controller calculates the electrical
signal to a pressure value that can be read.
23
Table 10 Comparisons of Pressure Sensors Models
Pressure Sensor
Model HK1100C26 HK1100C27 HK1100C28
Input voltage (V) 5 6 7
Output (V) 0.5 to 4.5 0.5 to 4.5 0.5 to 4.5
Accuracy ±1.5% ±1% ±1.5%
Digital/Analog Analog Analog Analog
Work range (MPa) 0 to 1.2 0 to 0.5 0 to 0.8
Extra Water-, dustproof Water-, dustproof Water-, dustproof
Cost (dollars) 11.49 14.39 16.50
Table 10 shows the pressure sensors that fulfil the requirements for measuring the pressure
inside the heat frame. The pressure sensors that were inspected are all in the same model
family and the only difference is work range. The chosen pressure sensor is HK1100C
pressure transmitter that has working range from 0 – 1.2 MPa.
3.2.3 Flow sensor
A flow sensor measures flow of liquid or gas regardless of type. The flow meter is
designed so that a wheel is inside a tube with a magnet that gives pulses when the magnet
goes past the coil as seen in Figure 1029
.
26 http://www.ebay.com/itm/G1-4-inch-5V-0-1-2-MPa-Pressure-Transducer-Sensor-Oil-Fuel-Diesel-Gas-
Water-Air-/321801631422?pt=LH_DefaultDomain_0&hash=item4aecdf36be Accessed 15.5.2015 27
http://www.ebay.com/itm/G1-4-inch-5V-0-0-5-MPa-Pressure-Transducer-Sensor-Oil-Fuel-Diesel-Gas-
Water-Air-/311233888623?pt=LH_DefaultDomain_0&hash=item4876fc416f Accessed 15.5.2015 28
http://www.ebay.com/itm/G1-4-inch-5V-0-0-8-MPa-Pressure-Transducer-Sensor-Oil-Fuel-Diesel-Gas-
Water-
Air/251773562411?_trksid=p2047675.c100005.m1851&_trkparms=aid%3D222007%26algo%3DSIC.MBE
%26ao%3D1%26asc%3D32022%26meid%3D5656f653e244403b9f7b73933a54b337%26pid%3D100005%
26rk%3D2%26rkt%3D6%26sd%3D311233888623&rt=nc Accessed 15.5.2015 29
Source: http://www.cyberphysics.co.uk/Q&A/KS4/magnetism/EMI/Q1.html Accessed 8.7.2015
Figure 10 Explanation of Magnetic Flow
24
Table 11 Comparisons of Flow Sensors Models
Flow Sensors
Model YF-520130 SEN-HZ43WB31 YF-DN5032
Sensor Hall Hall Hall
Input voltage (V) 5 to 18 3 to 18 5
Accuracy ±10% ±2% ±3%
Temperature (°C) -25 to 80 -25 to 80 < 80
Max pressure (MPa)
2 1.75 1.75
Digital/Analog Analog Analog Analog
Work range (L/min)
1 to 30 1 to 30 10 to 200
Cost ( dollars) 5.98 12.88 24.80
The chosen sensor is SEN-HZ43WB because it was the best to fit the requirements it can
handle the pressure inside the flow controller frame, the housing is made out of copper and
is the most accurate. The working voltage is between three volts and eighteen volts and
the chosen controller sends five volts.
30 Source: http://www.ebay.com/itm/1-30L-min-1-2MPa-1-2-Hall-Effect-Flowmeter-Control-Water-Flow-
Sensor-Arduino-/161129523876 Accessed 15.5.2015 31
Source: http://www.ebay.com/itm/SEN-HZ43WB-G3-4-Male-1-30L-min-Water-Flow-Hall-Effect-
Sensor-Switch-Flowmeter-/291179227359?pt=LH_DefaultDomain_3&hash=item43cba268df Accessed
15.5.2015 32
Source: http://www.ebay.com/itm/Hall-effect-water-Flow-Counter-Sensor-DC3-18V-2-DN50-
/121685535933?pt=LH_DefaultDomain_0&hash=item1c5505ecbd Accessed 15.5.2015
25
4 Build
A closed system was built to test the equipment in an easy and secure way. That was done
in order to be able to check the system and adapt when needed.
To be able to test the closed system, measurements were taken from a live system. The
measurements were taken from a 234 m2 house in order to get real data on water usage.
Then the measurements were duplicated and malfunctions were inserted to the closed
system.
Three led lights, each with different colour, are used to show which failure has happened
within the closed system.
Temperature is under or over the given range
Flow is under or over the given range
Pressure is too low or too high.
4.1 Measurements
The measurements were taken from the heat frame six times with 30 minutes intervals in
order to find the average usage. Pressure, temperature and flow measurements were taken
from the heat frame through the sensors that are already in place from the company that
supplies the water.
Table 12 Flow Measurements Taken on a Real Controller Flow Frame
Flow
0.0001 0.001 0.01 0.1 m3
1. Measurement 7.5 6.7 8.7 2.5 0.34445
2. Measurement 7.5 0.8 3 3.2 0.35155
3. Measurement 8 8.9 9 3.4 0.4397
4. Measurement 9.2 1.9 3.1 4.1 0.44382
5. Measurement 4.1 8.3 7.8 4.4 0.52671
6. Measurement 6.1 5.5 2.5 5 0.53111
Table 12 shows those measurements from the flowmeter which is connected to the water
intake to the heat frame. The measurement entries in the table show the change from each
measurement and how many m3 of water have been pumped into the house. A simple
calculation using the figures in Table 12 shows that 0.037332 m3 of water flows into the
26
house every half hour or 0.074 m3 (74 L/Hour) hour. About 90% of hot water is used for
space heating and 10% used for other means33
.
Table 13 Temperature Measurements
Table 13 shows the temperature readings in the heat frame when the water enters the
house and when it exits the house. The temperature holds steady through the
measurements at each end but has a 39°C drop in temperature from entering the house and
exiting.
Table 14 Pressure Measurements
Table 14 shows the pressure in the heat frame to be steady at four bars. Pressure
measurements were taken when only radiators where active and everything else was shut
off. When a faucet was turned on the pressure fell down but these measurements are only
to test the radiator system water usage.
33 Source https://www.hsveitur.is/images/mv_hitamenning.pdf Accessed: 20.04.2015
Temperature (°C)
Temp in Temp out
1. Measurement 69 30
2. Measurement 69 30
3. Measurement 69 30
4. Measurement 68.9 30
5. Measurement 69 30
6. Measurement 69 30
Pressure (bar)
Pressure in
1. Measurement 4
2. Measurement 4
3. Measurement 4
4. Measurement 4
5. Measurement 4
6. Measurement 4
27
4.2 Prototype
A closed system was built to test the idea and equipment that was chosen in chapter 3.
Figure 11 The Closed System that Tests the Chosen Equipment and Idea
Table 15 Bill of Material
To test the equipment safely a closed
system was built (see Figure 11 and Table
15 for the material list). Controlling the
flow, temperature and pressure of the
system is crucial for a test of the equipment
and to see if it works. A pressure tank was
used (5) that could withstand the pressure
which is in a regular heat frame. The tank
can withstand pressure up to ten bars and
the measurement shows that it only needs to
handle four bars. There are six holes in the
tank which makes it perfect to hold all the
electronic sensors for the test and extra non
electronic sensors that were used to test the
output value of the electronic sensors.
Water pump (2) was used to simulate water
circulation and the drill (1) was used for
turning the water pump to control the speed
of the water flow.
No Part
1 Drill and drill holder
2 Water pump
3 Pressure gauge
4 DS18S20 temperature sensor
5 2.5 gallon tank
6 Breadboard connected to Yún
7 Arduino Yún
8 SEN flow sensor
9 HK pressure sensor
10 Power supply for Yún
11 Flowmeter from Orkuveitu
Reykjavíkur
12 Exit nozzle
28
An accurate flow meter (11) was borrowed from Orkuveita Reykjavíkur. That is the
company that supplies all houses with water in the greater Reykjavík area. This flow meter
was used for comparison of the output value from the SEN flow sensor (8).
A pressure gauge (3) was used to compare the output value from the HK pressure sensor
(9).
All the electronic sensors were connected to the Arduino Yún (7). The Arduino Yún was
connected to a database and sent the results from the sensors to that database. The values
from the database were then sent to a webpage that showed the values from each sensor.
A regular garden hose was used to connect the exits and nozzle (12) that were connected
to the tank and accessories.
4.3 Programming
The programming was done in several different programming languages. Each language
has a specific purpose and all interact differently which will be explained along with the
communication between programming languages. Also the analyses on the values from
the sensors to the Arduino Yún that sends them to a database and then the results are
shown on a website.
The programming languages that are used in this project are:
C/C++
Python
PHP
HTML
CSS
JavaScript
SQL
The following programming languages are used to make the system work as whole. This
programming chapter can be divided into two categories, first the microcontroller
programming and the second one for the database and website.
C is used to program the Arduino Yún to read the signals from the sensors. The values are
then calculated from the results and sent to the Linux core in the Arduino Yún.
Python is used to program the Arduino Yún´s Linux side to send the data to a database
which was installed in the Arduino Yún. It is also used to send the data to a web server
through the internet connection in the Arduino Yún.
PHP is the programming language that receives and reads the data from Python and sends
and writes it into the SQL database. It also reads and sends the values from the database
to a web server.
HTML and HTML5 are the programming languages that are used to build websites.
29
CSS is the building block for website designing and can control the appearance of the
website.
JavaScript is a programming language which is used to display the data from the database
graphically, as for example as line charts, pie charts and gauges.
MySQL software was set up on a web server that holds all the data from the Arduino Yún.
SQLite software was set up on the Arduino Yún as a precaution if the internet connection
would fail. Then the data from the Arduino Yún would not be lost, and the data would be
kept intact until the connection would be restored. Then the data would be safely sent to
the MySQL data server.
4.3.1 Arduino Yún
The first steps to program the Arduino Yún included downloading the software that was
designed for the Arduino Yún microcomputer. The software is “Arduino Yún Software
(IDE)” 34
.
To program the Arduino Yún, an older version of the software was required, the IDE 1.5.3
that was made for the Arduino Yún.
The Arduino Yún can connect to the internet by Wi-Fi, so programming the Arduino Yún
does not require it to be plugged into a computer but it must be connected through the
same internet network. The Atmega32U4 processor is programmed with the IDE software.
This processor controls the I/O ports of the microcontroller.
The ATmega processor is not directly connected to the internet interface and the SD
reader. To link both the ATmega and the AR 9331 processors a “BRIGDE” library is used
as seen in Figure 12.35
34 Source: http://www.arduino.cc/en/Main/Software[Online] Accessed: 30.04.2015
35
Source http://www.arduino.cc/en/Guide/ArduinoYun Accessed 30.04.2015
Figure 12 Communication Between Both Processors
30
The Bridge library code from the ATmega is translated to Python and vice versa. Its
purpose is to run programs on both sides, if and when the Arduino Yún asks for it. It also
shares the readings from the Arduino Yún sensors through the internet to the database. If
the readings fluctuate more than normal the database sends signals to the controllers in
order to turn on warning signals
The Arduino designers have developed the software “Open Wrt-Yun” which can program
the AR 9331 processor and connect through the internet with SSH connection that allows
the programmers who uses this, monitor and change the activity of the processor.
The I/O pins of the Arduino Yún breadboard can be seen in Figure 1336
.
There are three ways to power up the device. One is using a micro power plug that
connects to an electrical outlet. Another way is through power pins Vin with five volts
DC and GND. Because the Arduino Yún does not have a built-in power regulator caution
36 Guðrún Þorbjörg Kristjánsdóttir adapted this figure from the Arduino Yún breadboard Source:
https://www.arduino.cc/en/Main/ArduinoBoardYun Accessed 30.04.2015
Figure 13 Input and Output Pins from the Arduino Yún
31
must be taken when using this method so the board does not get damaged. The third way
is to use PoE, by getting the power straight from the Internet LAN cable 37
.
4.3.2 Database and Website
There are two different databases used in this project, MySQL for the data server and
SQLite for the Arduino Yún. The same principle is used for both but more details will be
put into the MySQL since that server is used for both receiving data from the Arduino Yún
and sending it to the web site.
The connection between the Arduino Yún and the server is through the internet and the
PHP programming which is used for retrieving data from the Arduino Yún and JavaScript
for visualization on the website.
For this project an Apache38
http server project is used to host the website. That is mainly
to keep down cost as it is open source and compatible with Linux operating system.
The setup for the MySQL database was used as a simple table for holding all the
information that the Arduino Yún sends and the website receives. The table holds the
information from all three sensors and a timestamp, for when the values from the Arduino
Yún are sent. Four columns are used to keep the values from the sensors separated for
better handling of data.
Figure 14 shows how the data is kept in the database. The first column is used for a
timestamp to know when each value is gathered to the database. It shows that every new
entry is at a seven second interval and the flow is at zero which means that the drill was
not in operation and the temperature and pressure are at normal values.
For every entry in the server’s database the server forwards the data to the website. The
inspiration for the website set up is from http://fermentationriot.com/arduinopid.php. It
uses open source Google script to display the values from the Arduino Yún that uses
JavaScript and PHP languages that work together to show the information graphically.
37 Source: https://www.arduino.cc/en/Main/ArduinoBoardYun?from=Products.ArduinoYUN
Accessed 25.08.2015 38
Source: http://httpd.apache.org/ Accessed 2.06.2015
Figure 14 Values from the Sensors to MySQL Database
32
The web page uses line chart and gauges for every sensor as can be seen in Figure 1539
.
100 data points are shown in each line chart which cover 700 seconds or 11.6 minutes and
the latest value is shown in the gauges. The drill was stopped and therefore the flow show
zero L/Hour. The tank is airtight and holds the pressure steady at three bar and water
temperature at nineteen degrees.
In real life application, the data points would be every half hour since the change in the
flow controller frame is slow.
4.4 Cost
The cost is summed up with all the material that was bought to test the idea of monitoring
the flow, pressure and temperature of water. The material is the controller, sensors and
wire connections that is used.
Table 16 show all the material that was bought and the work that was involved with
setting up the closed system and programming for the controller, database and website.
39 Source: stjani.strumpur.net/test.php Accessed 18.05.2015
Figure 15 Graphical Visualization of the Data from the Database Shown in Website.
33
Table 16 Cost of Material and Work
Name Cost/pcs Nb of pcs Total cost (dollors)
BB400 breadboard 3,96 1 3,96
Jumper Wires 5 1 5
Arduino Yún 70,30 1 70,3
Sparkfun resistor kit 11,95 1 11,95
DS18B20 Temperature Sensor
8,50 1 8,5
SEN-HZ43WB flow sensor 16,91 1 16,91
HK1100C pressure sensor 13,41 1 13,41
Work 54,33 180 9779,4
Total cost 9909
35
5 Result
Experiments were made on the closed system (see chapter 4.2) and the results of the
measurements can be seen below. Since this is a closed system, a drill was used to
circulate the water and therefore actual water usage quantity cannot be achieved but close
enough. The heat, flow and pressure take precedence within the closed system.
The measurements show even temperature in the closed system, so it circulates the same
water and no outside water entered the system. The pressure was almost constant as the
drill was locked at the same speed.
The flow shows fluctuations since the water pump and drill have frictions and cannot keep
the flow speed constant. A real heat frame usage has a more constant flow.
The webpage in Figure 16 shows values from all sensor in real time and how the user
would see when the webpage would be entered.
Figure 16 Values from the Sensors Shown in Webpage
36
5.1 Alarm System
The main purpose of the system is to make a warning system for the heat frame. In case
of a malfunction there have to be indicators to show what has gone wrong. For that
purpose, three led lights were used on the breadboard that the Arduino Yún controls. They
are to light up in case of major anomalies. The anomalies are set as extremes, outside
ordinary fluctuations that have been calculated for the system. The user of the system
would get different lights for different malfunctions, so it would be easier to recognize and
fix problems.
Figure 17 shows the work progress of the equipment when the values from the sensors are
sent to the Arduino Yún. The Arduino Yún checks if the values are within acceptable
limits and if it is not a light would be turned on to indicate the problem. The Arduino Yún
tries to connect to the internet and send the data to a SQL database. To back up the values
from the sensors an SD card is used to store the data if connection fails. The SD card
holds all the information and when the Arduino Yún connects to the database, it sends all
the information from since the connection failed and to the time it connected again. The
SQL server forwards the data to the webpage and displays it as graphs and gauges see
Figure 16.
Malfunctions have independent colours of light to show the user which malfunction has
occurred.
If flow anomaly occurs then the red led light is turned on;
If pressure anomaly occurs then the green led light is turned on;
If temperature anomaly occurs then the yellow led light is turned on;
Figure 17 Work Diagram for the Values from the Sensors to the Database and from the Database to
the Webpage
37
5.2 Testing the system
The equipment was tested on the closed system in such a way that malfunctions were
introduced to the system to simulate what could happen to a real heat frame system. By
changing the temperature, increase/decrease flow and pressure values in the heat frame.
The first test of the equipment was to change the water temperature so that the water
temperature would go over the limit see Figure 18. For testing purposes the temperature
limit is set at 40°C. The malfunction was simulated by pouring hot water into the tank.
Figure 18 Water Temperature Anomaly
When the temperature changed, the values in the webpage changed immediately and the
temperature went over 40°C and the yellow light got turned on, see Figure 19.
Figure 19 Yellow Warning Light Turns On when the Temperature in not within the Limit Range
38
The second test was to let the pressure within the closed system malfunction. For security
reasons the pressure was made to decrease instead of increase. That situation was
simulated by loosening a screw on the tank. The pressure immediately fell as seen on
Figure 20
Figure 20 Pressure in the System Falls Down
After the pressure fell to zero, the green led light turned on see Figure 21.
Figure 21 Green Warning Light Turns On when the Pressure in not within the Limit Range
39
The third test was to make a flow failure. To make a flow failure is possible by making
the drill stop or go on full speed. In this test, the drill was stopped and therefore the water
flow stopped.
Figure 22 Flow in the System Falls Down
When the drill was stopped the water flow stopped as seen in Figure 22. When the flow
stopped, the red light turned on see Figure 23.
Figure 23 Red Warning Light Turns On when the Flow in not within the Limit Range
40
Malfunctions that were simulated in the trials, are just a few of the possibilities that could
happen within the water controller frame system. If a pipeline or an intersection in the
pipeline starts to leak and the leakage is not noticed early enough then it could slowly
build up to massive damages.
If hot water is leaking slowly then the possibilities of damages are:
Water damage to any surface that the water leaks on to or in to
Steam damage to the surroundings of the leak
Mold can start to grow in the surroundings
Corrosion can cause the pipeline to break
When hot water leaks it can damage all that it touches, e.g., if the floor has carpets or tiles
then the section that the water leaks to may need replacement. The steam from the water
can ruin objects made from wood or water absorbent material, electrical items, and lead to
rusting of iron. A water leak can lead to mold growth within 24 – 48 hours40
. Mold can
cause severe damages to a house, be a major health risk factor and cause a high repair bill.
Houses that have a high risk factor of leak damages are houses that are empty for a long
time such as summerhouses which are used mostly during the summer and left alone in the
winter.
To see indication of a leak the pressure in the system would be lower than normal and or
flow increase.
If water temperature increases in the flow controller system, it could mean one or more of
the following:
Radiator/s are turned too high
Radiator valves have malfunctioned
A faucet is opened and is letting hot water through
A pipe is leaking or broken
If water temperature is too high then there is a possibility that the flow in the heat
controller system is high. It could lead to severe burns if too hot water goes through the
potable water pipeline. If these matters are not monitored then it could lead to injuries and
an excessively high water bill for the consumer.
The conclusion is that if the flow controller system is not properly maintained and
monitored regularly it could lead to severe damages to housing, people’s health and to a
very high repair bill to fix what was damaged or replaced.
40 Source: http://www.epa.gov/mold/moldguide.html Accessed: 13.9.2015
41
6 Addition
The closed system test was successful. The next step was to implement it on a regular
flow controller frame in an ordinary house. A permission was granted to implement it on
a 234 m2 single family home. The house has fifteen radiators and snow melting system for
the entrance and drive way. It was decided to add heat sensors where hot water enters the
flow controller frame, before and after the snow melting system. Pressure sensors were
installed where the water comes in to the heat frame and before snow melting system.
Flow sensor was to be added where the water exits the heat frame.
Temperature measurements are taken:
When the water enters the heat frame from the supplier.
Before the water enters the snow melting system.
After the water leaves the snow melting system and heat frame.
These measurements show the temperature change when the water enters the heat frame
and goes through the radiators before it enters the snow melting system. Then it shows the
temperature change when the water leaves the system and the change when it exits the
snow melting system.
Pressure measurements are taken:
When the water enters the heat frame from the supplier.
After the water enters the snow melting system.
These measurements show the pressure changes when the water enters the heat frame and
when it leaves the system.
Flow measurements are taken when the water leaves the heat frame.
These measurements show the flow of water that leaves the system.
The closed system was disassembled and the sensors removed to be used again. The heat
frame was analysed and it was decided to use cross pipe fittings at points in the heat frame
where every sensors was to be installed.
Two additional temperature- and one pressure sensors were added to the system.
For some reason the flow sensor malfunctioned during the installation and through out this
test, flow measurements will be at zero.
42
6.1 Setting up the Sensors
To set up the sensors in the heat frame several changes had to be made. To insert the cross
fittings in to the flow controller frame the old piping had to be taken apart and
reassembled.
Figure 24 shows how the heat frame looked before the cross fittings were placed. Figure
24 A) shows the pipeline in the flow controller frame where the water enters into the
system from the water supplier and a pressure gauge on the bottom pipeline that shows
four bar pressure. On the top pipeline is volume flow controller and external temperature
sensors that measure the temperature on the pipeline and shows little over 40°C.
Figure 24 B) shows the pipeline in the middle where the water enters the snow melting
system and exits the frame to the drain. The second temperature sensor that is in the frame
shows the temperature of the water when it has circulated through the radiators. Two
black pipes go into the floor that show where the water enters the snow melting system (on
left) and exits (on right). The wheel in the middle of the pipes is used for shorting over the
snow melting system and straight to the drain. Bottom pipeline on the left is for the cold
water.
Figure 24 Before Implementing Cross Fittings in to the Flow Controller Frame
A) Figure on Right Shows Where the Water Enters Into the Frame. B) Figure
on Left Shows When the Water Enters the Snow Melting System and Exits the
Frame
43
Figure 25 shows the change after the cross fittings had been inserted to the frame. Four
cross fittings were used that could hold six sensors. Figure 25 A) displays the cross fitting
that will hold one temperature – and pressure sensor to get measurements when the hot
water enters the frame system. Figure 25 B) displays three cross fittings and one flow
sensor. From the temperature sensor on the left the first cross fitting has a place for one
sensor and is connected to the drain valve. The second cross fitting has a place for one
sensor and is connected to the snow melting system. The last cross fitting has a place for
two sensors and is connected to the flow sensor see Figure 26.
After the cross fittings were inserted and the pipes were inserted to the flow controller
system the flow of water was turned on to check for leaks.
Figure 25 After Implementing Cross Fittings to the Flow Controller Frame.
A) Left. B) Right
Figure 26 Pipe Assembly when the Cross Fittings are Inserted into
44
6.1.1 Adding the sensors to the heat frame
As there were no leaks found in the new instalment to the frame the sensors were added.
The flow sensor was added when the pipe was assembled (see Figure 26) and no changes
were needed for the sensor. The flow sensor has male port thread G3/4 of inch and was
connected to the cross fittings.
The pressure sensor needed adjustments to be able to fit into the cross fittings since it
thread is G1/4 and needed G1/4 female to G3/4 male fittings to be able to connect to the
cross fittings.
The temperature sensor needed more implementation to be able to connect to the cross
fittings. The temperature sensor did not have thread housing so it needed to be installed
and waterproofed.
Figure 27 shows how a thread housing with insulation is implemented to the temperature
sensor. The middle part is the insulation that prevents the water to flow through the
housing. The thread fitting goes from G1/4 male to G3/4 male. After all three
temperature sensor had the thread housing fitted, they were connected to the flow
controller frame.
Figure 27 Thread Fittings and Insulation for the Temperature
Sensor
Figure 28 Sensors Connected to the Flow Controller Frame
45
Figure 28 show how the sensors are connected to the flow controller frame and one place
left for a pressure sensor in the cross fitting after the snow melting system.
6.2 Connections from sensors to Arduino Yún
The next step of connecting the sensors to the Arduino Yún controller was to make a more
permanent set up. Since there are no shelves see Figure 28 there was a need to make the
set up attached to the wall. For easy implementation an electrical box was used to keep
the controller and connections in one place see Figure 29.
For better connection a PCB was used and multiple screw terminal blocks as can be seen
in Figure 29. Holes were drilled into the sides of the box for the sensor wires and power
wire for the controller. The screw terminal blocks were used to hold the wires and prevent
the wires to loosen and loose connection to the Arduino Yún and for easier maintenance of
sensors. One terminal block is not connected and is for installation of LCD screen that the
user can see on the lid of the box. Three led lights are in the middle of the PCB that have
the same functions as in chapter 5 but malfunctions were not implemented on the system
since the close controlled test showed they worked.
Figure 29 Electrical Box with
Arduino Yún and Connection with
Sensor with PCB
46
The sensor connection to the terminal blocks in the box, six terminal blocks on the left of
the PCB are.
From top to bottom:
Temperature sensor from the beginning of the frame
Temperature sensor from the end of the frame
Temperature sensor before the snow melt
Pressure sensor from the beginning of the frame
Pressure sensor before the snow melt
Flow sensor from the end of the frame
The unique ability of the temperature sensor they are connected to the same I/O port of the
Arduino Yún. The pressure sensor are connected to a separate port and same for the flow
sensor.
The box is attached to the wall with a strong adhesive double sided Velcro strap for easy
installation of the box.
6.3 Database and Webpage
The setup for the database was changed to a relational one to be able to have better
handling of the data and user of the system. Changes were made to the web page and a
login page which is controlled by Facebook login was added. It was decided to use
Facebook login as is free to use from the developers of Facebook41
. It is secure and easy
to use.
6.3.1 Database
Two tables were added to the database to make it a relational database:
Table one contains:
Id – The user id number
email – The user email to be able to contact the user
name – The name of the user 1
address – To know the address of the user
sizeOfHouse – To know the size of the house
countOfRadiators – To know the numbers of radiators in the house
snowMelt – To know if there is a snow melt system
facebookId – So the user can log in and see his values
41 Source: https://developers.facebook.com/docs/facebook-login Accessed: 28.08.2015
47
Table two contains:
Time – Stamps the date and time when values are inserted to the database
UserId – The same id number as in table one
Temperature1 – Holds the values from temperature sensor
Temperature2 – Holds the values from temperature sensor
Temperature3 – Holds the values from temperature sensor
Pressure1 – Holds the values from pressure sensor
Pressure2 – Holds the values from pressure sensor
Flow – Holds the values from flow sensor
The two tables are linked by the same id number. The id number tells the system who the
user is and what values from the sensors to show. When the user logs in to the website he
is redirected to a Facebook login page. Each Facebook user has a unique identification
number and that number is registered to the database. The database compares the
Facebook number to the registered number and if it is the same then the user continues to
the main webpage.
The main webpage contains three flowcharts for each type of measurements and six
gauges to see the newest values that is inserted to the database. The first entry to the
database is 15:58:31 29.8.2015 that is used for comparisons of data from the monitoring
system.
For testing purposes, every entry into the database is eleven seconds apart to get viable
data from the flow controlling frame system, to see the fluctuation of temperature and
pressure.
6.3.2 Calculation from the database
Calculations of the temperature and pressure were made to establish the usage of water
from the time the first entry was made 29.8.2015 and to 11.9.2015 or thirteen days of data
which is about 4254 data points from every sensor.
Table 17 Calculation of the Temperature for 13 Days of Data Points
Temperature enters the flow controller
frame (°C)
Temperature before de-icing system (°C)
Temperature when leaving the flow
controller frame (°C)
Max temperature 78.25 33.81 18.38
Average temperature 74.41 27.59 16.29
Min temperature 71.69 25.94 14.19
Standard deviation 0.76 0.38 0.83
48
The calculation from the temperature data in Table 17 shows that the temperature
fluctuates. When the hot water enters the flow control frame it has average temperature
74.41 °C and when it has circulated through the radiator system is has dropped to 46.82 °C
on average. After the water goes through the de-icing, it has dropped another 11.30 °C on
average. The water has a 58.12 °C temperature change on average when entering the flow
controlling frame and leaving.
The temperature when the water enters the frame has a 6.56 °C temperature difference
from max to min. The standard deviation shows that the temperature is mostly around
74.41 °C ± 0.76 °C during the thirteen days and the water usage is steady and does not
fluctuate much.
The temperature before de-icing has 7.87 °C difference from max to min that shows that
there are more changes in temperature when the water has circulated through the radiators.
The standard deviation shows that the temperature fluctuates less than the water that enters
the frame but has higher spikes.
The temperature when the water has gone through de-icing has a 4.19 °C temperature
difference from max and min, which is the lowest difference in the system. It has the most
fluctuation as it is dependent on the outside temperature.
Table 18 Calculation of the Pressure for 13 Days of Data Points
Pressure entert the flow controller frame (Bar)
Pressure before de-icing system (Bar)
Max pressure 4.78 3.49
Average pressure 3.78 2.86
Min pressure 1.36 1.49
Standard deviation 0.12 0.09
The calculation from the pressure in Table 18 shows that the fluctuation between the
sensors is not high. The pressure when the water enters the flow controller frame is on
average 3.78 Bar. The pressure drops 0.92 Bar on average when the water has circulated
through the radiator system.
When the water enters the flow controller frame there is a 3.42 Bar difference in pressure
in max and min measurements. The standard deviation shows that the pressure is close to
the 3.78 Bar most of the time. The pressure drops significantly because the potable water
system is connected parallel with the radiator system and therefore has influence on the
pressure when a faucet is opened.
When the water has circulated through the radiator system there is a 2 Bar difference in
max and min measurements. The standard deviations shows that the fluctuation in
pressure after the radiator system is small and hold on average 2.86 Bar most of the time.
49
At 15:15:30 13.9.2015 the timing of data point entry to the database was changed from
eleven seconds interval to every 20 minutes since the changes in measurements are small
and consistent.
6.3.3 Webpage
The webpage has the function of showing the data from the database in an understandable
and readable format such as graphs, gauges and lists. Several changes were made to the
website. The website has the same front page that shows three graphs and six gauges.
Five extra pages were added so now the website has:
Login page
Main page
Displays only temperature measurements in more detail
Displays only pressure measurements in more detail
Shows all the temperature values in a list
Shows all the pressure values in a list
When entering the website URL stjani.strumpur.net the webpage redirects to
stjani.stumpur.net/login.php and a line appears that says “Login with Facebook” in blue
hyperlink text see Figure 3042
Figure 30 Login Page for the Website
When the text is clicked, another redirection is to a Facebook login page see Figure 31.
42 Source: stjani.strumpur.net/login.php Accessed: 13.9.2015
50
Figure 31 Facebook Login Page
When the Facebook login page appears, it requests the Facebook username and password.
If the Facebook id number is the same as is in the database then another redirection is
made to the main web page.
Figure 32 The Main Web page for the Monitoring System
The main web page has the same overall look as in test one of this project, but there are
small differences. The name has changed from “Eftirlitskerfi Ofna” see Figure 15 to “Hot
Water Monitoring system” and two extra buttons are in the top left corner. They are “Heat
Temp” and “Pressure”. They redirect to more detailed visualization of the named
measurements.
When the “Heat Temp” button is clicked then a new web page appears that shows the
temperature measurements.
51
Figure 33 Web Page that Displays all the Temperature Measurements
Figure 33 shows three graphs which displays the temperature measurements from all the
sensor on a separate graphs for more detailed information. The top graph shows the water
temperature when the water enters the flow controller frame. The graph in the middle
shows the water temperature when the water has circulated the radiator system. The graph
on the bottom shows the water temperature when the water has gone through the de-icing
system and is leaving the flow controller frame and into the drain. To the right of every
graph are two text boxes that show “Max Temp:” and “Min Temp” of every graph to show
the corresponding max and min value.
In the top left corner of the web page there are three buttons. One to redirect to the home
page, redirect to the temperature list that shows every value from the database in a list and
a submit button. The submit button works with the two input text boxes that show “From”
and “To”. They have the function to allow the user to choose a specific date to see the
values from one date to another. Precautions were made by only showing max 15.000
data points in a graph for saving time of displaying the data. If the timeframe that was
chosen were is too big then the web page could not handle displaying all the data and
crash or would take long time to display the data to the graph.
The pressure page has the same function as the temperature page and shows only the
pressure measurements in two graphs since there are only two sensors.
There is a security measures in the web page that only lets the user that logged in to see
that specific data. If multiple users were using this system then no one could see each
other values and usage. Another is if a user is not logged in and tried to go directly to a
page for example in Figure 33 then the user would be redirected to the login page see
Figure 30.
52
6.4 The working of the system
The main working of the monitoring system is to measure data from the flow controller
frame system Figure 3443
. The sensors are strategically position at the frame to measure
valuable data that shows the difference in temperature and pressure when the water flows
through the system. The sensors are connected to the Arduino Yún controller which
calculates the signals from the sensors to know values such as Celsius, Bars and L/hours if
the flow sensor were operational. The Arduino Yún is connected to the data server
through the internet and sends all the data from the sensors. The data base then collects all
the data and inserts the data to a table that isolates the values for better handling. The data
server than sends the data from the sensors to a web site for display.
43 Assambled by Guðrún Þ. Kristjánsdóttir with flow control frame from HS Veitur and Arduino Yún from
Arduino developers.
Figure 34 Working of the Monitoring System
53
6.5 Cost after addition to project
The cost after project addition does not include the cost in chapter 4.4. Added were two
temperature sensors and one pressure sensor that were installed, with the sensors that were
already acquired, to the flow controller frame. To install the sensors to the frame, then
made were changes to the frame so that the sensors could be installed.
Table 19 Cost after Modifacations of Project
Name Cost/pcs Nb of pcs Total cost
1/2" cross fittings 3,03 2 6,06
3/4" cross fittings 4,35 3 13,05
3/4" to 1/2" fittings 1,16 6 6,96
3/4" bolt thread 1,13 3 3,39
1/2" bolt thread 0,9 9 8,1
1/2" knee fittings 1,08 2 2,16
1/2" to 1/4" cylenders 0,8 8 6,4
UNIONAR 1/2" 3,34 2 6,68
Valve 1/2" 0,74 2 1,48
Electrical Box 23,28 1 23,28
electrical wire tubes 1,12 3 3,36
Heat sink insulation 21,14 1 21,14
Valve for sensor 4,14 3 12,42
DS18B20 Temperature Sensor
8,50 2 17
HK1100C pressure sensor 13,41 1 13,41
Work 54,33 270 14669,1
Total cost
14813,99
The cost of this project is total cost from Table 16 and Table 19 and that is 24722 dollars,
which includes all material and work hours that went to the completion of this project.
55
7 Conclusion
Sensors and controller were analysed to meet certain requirements to be able to measure
usage of hot water in flow controller frame. The Arduino Yún, was chosen for the best
code debug for prototype testing and internal Ethernet and Wi-Fi module. Sensors for
temperature, pressure and flow were used to measure the usage of hot water inside the
flow controller frame.
The first test with one of each sensor was within a closed system. Failures for each sensor
were simulated to test reaction of each sensor. In each case the warning light lit up to
show what failure had occurred. The website displayed the values from the sensors in real
time. Test on the closed system was successful.
After the first test was successful and showed that the sensors could monitor the water
usage further application was tried. The next step was to install the sensors to a real flow
controller frame. Two temperature sensor were added and one pressure sensor to the
frame. The flow sensor malfunctioned when moved so only the results from the other
sensors were used. One temperature sensors were installed where the water enters the
frame. The second one after the radiator system and the third one after snow melt system
before the water goes to the drain. One pressure sensor was installed at the entrance point
in the frame and another one after the radiator system. The website shows the values from
the sensors in three different ways. Using charts, gauges and table lists. The test of
installing sensors inside the flow frame was successful except the flow sensor. The
prototype monitor system runs autonomously and sends data from the sensors to a
database and then on to a website.
57
8 Discussion
The goal of this project was to test the idea of using electronic sensors to measure water
usage where the sensors need to be able to withstand pressure, flow and temperature that
are in the flow controller frame.
8.1 First test
A closed system was constructed to test a monitoring system that uses sensors which are
connected to a controller. The controller sends the sensors data through the internet and to
a database. A website then displays the data.
Malfunctions to the system were simulated and the monitor system responded by lighting
one of three led lights that indicate what malfunctioned as each light has a different colour.
The test was successful in all instances.
8.2 Second test
Thirteen days after installation of the monitoring system in the flow controller frame the
average temperature after the water had circulated the radiators was 27,59 °C (see Table
17). The temperature was considered to be in the higher range and all the radiators were
inspected to see if their settings were set too high. Two radiators in the house had too high
settings and were lowered and the average temperature dropped to 25,69 °C (number
calculated from database).
The monitor system showed that the water temperature was too high after it left the
radiator system. When the radiator settings were adjusted the flow and temperature
decreased which shows correlation between temperature and flow of the water.
59
9 Future Work
The result of the tests that show that the usage of a monitoring system is feasible and more
additions to the project can make the system work better.
Here is a list of possible future work:
Making a controller from scratch by using minimum components.
Researching better sensor that do not need any modifications to be installed to a flow
controller system.
Changing the communications from the controller to the database by using phone
network.
Making Android and Apple compatible application to show the data from the
sensors
Change the warning system by sending email and/or calling to notify the user
Make a better website to display the data from the sensors
Add monitoring system to the cold water usage
61
Reference
[1] C.Hamacher , Z.Vranesic, S.Zaky, N.Manjikian, Computer Orginazation and
Embedded Systems, NY: McGraw-Hill, 2012.
[2] E. A. Lee and S. A. Seshia, Introduction to Embedded Systems - A Cyber-Physical
Systems Approach, LeeSeshia.org, 2011 [Online]. Available:
http://leeseshia.org/releases/LeeSeshia_DigitalV1_08.pdf
[3] F.Merat, (1996). RISC/CISC Characteristics [Online]. Available:
http://engr.case.edu/merat_francis/eeap282f97/lectures/28_RISC%20&%20PowerPC.pdf
[4] Robbert J. Robbins, (1995) Database Fundamentals [Online]. Available:
http://www.esp.org/db-fund.pdf
[5] O’Reilly,(2000),Web Design in a Nutshell [Online]. Available:
http://www.ntslibrary.com/PDF%20Books/A%20Complete%20Guide%20to%20Web%20
Design.pdf
[6] T. DiCola, 26.09.2014 Embedded Linux Board Comparison [Online]. Available:
https://learn.adafruit.com/downloads/pdf/embedded-linux-board-comparison.pdf
[7] R.L. Shepard , L.H. Thacker (1993) Evaluations of Pressure Sensing Concepts: A
Technology Assessment [Online]. Avilable:
http://web.ornl.gov/info/reports/1993/3445603770391.pdf
63
Appendix A: Specification of Arduino
Ýun Development Board
Following information is from Arduino developers acquired at
https://www.arduino.cc/en/Main/ArduinoBoardYun, accessed on 30.04.2015
The Arduino Yún is a microcontroller board based on the Atmega32u4 and the Atheros
AR9331. The Atheros processor supports a Linux distribution based on OpenWrt named
OpenWrt-Yun. The board has built-in Ethernet and WiFi support, a USB-A port, micro-
SD card slot, 20 digital I/O pins ( of which 7 can be used as PWM outputs and 12 as
analog inputs), a 16 MHz crystal oscillator, a micro USB connection, an ICSP header, and
a 3 reset buttons.
Technical specifications of the Arduino Y
AVR Arduino microcontroller
Microcontroller ATmega32U4
Operating Voltage 5V
Input Voltage 5
Digital I/O Pins 20
PWM Channels 7
Analog Input Pins 12
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32 KB (of which 4 KB
used by bootloader)
SRAM 2.5 KB
EEPROM 1 KB
Clock Speed 16 MHz
Linux Microprocessor
Processor Atheros AR9331
Architecture MIPS @400MHz
Operating Voltage 3.3V
Ethernet IEEE 802.3
10/100Mbit/s
WiFi IEEE 802.11b/g/n
USB Type-A 2.0 Host
Card Reader Micro-SD only
RAM 64 MB DDR2
Flash Memory 16 MB
SRAM 2.5 KB
EEPROM 1 KB
Clock Speed 16 MHz
64
PoE compatible 802.3af card support See Power
Power:
It is recommended to power the board via the micro-USB connection with 5VDC
If you are powering the board though the Vin pin, you must supply a regulated 5VDC.
There is no on-board voltage regulator for higher voltage, which will damage the board.
The Yún is also compatible with PoE power supply but in order to use this feature you
need to mount a PoE module on the board or buy a preassembled board.
65
Appendix B: Arduino Yún electrical
schematic
Figure 35 Appendix B-1 Block Diagram of Arduino Yún
66
Figure 36 Appendix B-2 Power Block Diagram
67
Appendix C: Specification of the
DS18B20 temperature sensor
Features Unique 1-Wire interface requires only one port pin for communication
Multidrop capability simplifies distributed temperature sensing application
Requires no external components
Can be powered from data line. Power supply range is 3.0V to 5.5V
Zero stand by power required
Measures temperatures from -55°C to +125°C
± 0,5°C accuracy from -10°C to +85°C
Temperature is read as a 9-bit digital value
Converts temperature to digital word in 750 ms (max.)
User-definable, non-volatile temperature alarm settings
Alarm search commands identifies and addresses devices whose
temperature is outside of programmed limits (temperature alarm conditions)
Functionally compatible with DS1820 1-Wire digital thermometer
Application include thermostatic controls, industrial systems, consumer
products, thermometers, or any thermally sensitive system
Temperature sensor
Following are excerpts from DS18B20 datasheet
General description
The DS18B20 digital thermometer provides 9-bit temperature readings which
indicate the temperature of the device.
Information is sent to/from the DS18B20 over a 1-Wire interface, so that only
one wire (and ground) needs to be connected from a central microprocessor to
a DS18B20. Power for reading, writing and performing temperature
conversion can be derived from the data line itself with no need for an external
power source.
Because each DS18B20 contains a unique silicon serial number, multiple
DS18B20s can exist on the same 1-Wire bus. This allows for placing
temperature sensors in many different places. Applications where this feature
is useful include HVAC environmental controls, sensing temperatures inside
buildings, equipment or machinery, and process monitoring and control.
69
Appendix D: Specification of the
flow sensor
Following are excerpts from SEN-HZ43WB datasheet.
General description
When magnetic material is close with the sensor, its characteristics my vary
In order to avoid particle debris, the sensor must be installed after a filter
The flow sensor installation has to avoid strong vibration and shaking of the
environment, so as not to affect the sensor’s measurements accuracy
Widely used in water industrial field, such as thermostatic water heater, water
purifier, water dispenser, smart card equipment, coffee machine etc.
Wiring: Black: Power Negative, Red: Power Positive, Yellow: Signal
Formula F=8,1 * Q – 3 ±10% 1L Water = 477 HZ ±10%
Specification
Product Name Water Flow Sensor Switch
Model SEN-HZ43WB
Type Hall Effect
Max Switch Current & Voltage 10 mA, DC 3-18V
Working Range 1 - 30 L/min
Male Port Thread Dia (Each End) G3/4
Max. Pressure 1.75Mpa
Insulation Resistance 100M Ohm(Min)
Total Size 60 x 32mm (L*Max.W)
Cable Lenght 34 cm
Main Material Copper
Color Gold Tone, Black
Weight 153g
71
Appendix E: Specification of the
pressure sensor
Following are excerpts from HK1100C datasheet.
Features:
Easy removal
Carbon steel connection more firmly
Stainless steel is durable
Sealed waterproof line
Imported chips
Wiring: Red +, Black -, Yellow: output
Specification
Working Voltage 5VDC
Output Voltage 0.5-4.5 VDC
Sensor material Carbon steel alloy
Working Current ≤10 mA
Working Pressure Range 0-1.2 Mpa
The Biggest Pressure 2.4 Mpa
Cable length 19 cm
Destroy Pressure 3 Mpa
Working TEMP. Range 0 - 85°C
Storage Temperature Range 0 - 100°C
Measuring Error ±1.5% FSO
Temperature Range Error ±3.5%FSO
Responce Time ≤2.0 ms
Cycle Life 500.000 pcs
Application non-corrosive gas liquid measurement
73
Appendix: Time Schedules
Figure 37 Original Time Schedule
74
Figure 38 New Time Schedual