WIRELESS SENSOR NETWORKS FOR MEASURING THE CONSUMPTION OF SAVE WATER TAPS

Currently, water consumption is on the agenda of mo st organizations around the world. Beyond the environmental benefits for a better use of natural resources there is also a financial motivation to c ontinuously reduce operation costs. This study reports a cost-e ffective solution using a Wireless Sensor Network ( WSN) for measuring the consumption of different types of ave water taps, in a real situation of intense us e. It is also pointed out that WSNs are networks suitable for dat a collection where a wired infrastructure for data transmission does not exist or it is unfeasible to install one. Which was the case of this research, t hat regarded the liquid consumption along with the technical and economic benefits of save water taps. On this prop osed setup network installation should only be sustained during the period of this investigation. Since onc e it was finished, the entire experimental arrangement was s crapped as the structure would have no more utility because the data was already collected and analised nd therefore, was reprocicable.


INTRODUCTION
Water scarcity is a current problem and it has caused a growing concern.To solve this problem, various measures are being taken to rationalize its use (Scare, 2004;Ridoutt and Pfister, 2010).To create solutions to address these problems scientific research plays an important role.This study reports the development of a research funded by FINEP, within the covenant FINEP/CEATEC/HYDRO, the subproject named "development of devices for monitoring water consumption".
The aim of this subproject was to assess the water consumption and the technical and economic benefits of water-saving faucets.To measure water consumption from taps, pulse generators transducers (WFSM, 2012) were selected because they met the requirements with regards to the water flow and has worthy cost/benefit ratio.On the data sheet on the use of these transducers mention is made as to the use of the Arduino microcontroller to be used to capture the pulse and calculate the volume of water released from the taps.
Arduino like any other microcontroller also needs additional resources to record the data, because it works with non-volatile memory.One solution would be to use a data logger (DL, 2014), however, this solution depends on an operator periodically swap memory cards as well as in case of damage or theft of the device, all data will be lost.
Another solution would be the use of a Wireless Sensor Network (WSN), so all the volumes of water captured by the water flow transducers would be immediately sent to a computer.If the computer stopped receiving data, this would be an indication that something wrong had occurred with the system of collecting data, formed by wireless sensor and transducer of water flow.
Thus the second option was the solution chosen and for the assessment of consumption of water, water flow Science Publications AJAS transducers were acquired and the amounts collected were transmitted over a WSN.
WSNs are networks of low cost (Hande et al., 2006;Mwinyi et al., 2014), suitable for collecting data for control and monitoring as well as for scientific research.
The fact of not requiring a wired infrastructure (Chukwuka and Arshad, 2013) makes these networks especially useful for their use in places where the infrastructure for data transmission has not been previously installed, as is the case in this study, which was conducted in two taps sinks, the premises of the bathrooms at the Center for Physical, Environmental Sciences and Technologies (CEATEC), PUC-Campinas.
Basically a WSN works with distributed sensors in an area whose function is to collect data and send them to a central base, to be processed and stored.The sensors, in addition to data collection can act on the remote control of electronic devices such as pumps, lighting systems, relays, among other various uses.In this case, works as actuator and the information to remotely trigger these devices does the reverse path of data collection, i.e., starts from the central base and travels through to reach the WSN sensor, that is connected to the device which needs to be triggered (Pires, 2009).
In this study the central base node makes data requests to the sensor node, that is connected to the flow transducers which measure the taps consumption.The sensor node then responds with the volume collected from two transducers and also with the RSSI (Yano et al., 2013;Yu et al., 2013).The latter figure aims to allow assessment of the communication's conditions between the two nodes.The data received by the base were stored on a computer in order to allow further analysis on the consumption of each of the taps.
The remainder of this study is organized as follows: • Section 2. Materials and Methods, which describes the experimental setup used in this study • Section 3, which presents the programming of data collection by means of digital transducers • Section 4, showing the first results and finally • Section 5, which is the conclusion of this study

MATERIALS AND METHODS
The taps used in this evaluation were: "Faucet to table washbasin with auto close-deca brand" (Fig. 1a) and "faucet to table washbasin with auto close-docol brandmodel: Zenit docol tronic chrome" (Fig. 1b).2012).So, it can be programmed in the same Integrated Development Environment (IDE) of the Arduino.The architecture of the RFBee´s microcontroller was one of the reasons for its choice, as it allows easy connectivity with the existing flow transducers on the market.There are solutions (Faludi, 2010) which use the Arduino together with the XBee (XBee, 2013) to achieve the same goal.However, such solutions are more prone to connection problems due to the existence of one more device at the circuit, allied to this, these solutions are more expensive and occupy larger space.
The manner chosen for programming RFBee was using Radiuino (Radiuino, 2012) libraries, whose functions are all compartmentalized into modules to facilitate understanding and application development.The Radiuino is licensed under the terms of the GNU Library or Lesser General Public License version 2.0 (LGPLv2) (GNU, 2012).
The transducer used to collect the flow rate from the taps was Walter G ½ Flow POW110D3B (WFSM, 2012) (Fig. 2).It is a digital transducer that generates pulses every 2.85 mL, which value was obtained through laboratory tests, before the definitive installation of the bathrooms at the CEATEC.
Figure 3 shows the topology of the network consisting of two nodes.The sensor node is connected to the water flow transducers (Fig. 4) and is constantly receiving and storing pulses of water flow transducers as the taps are used.The base node, which is connected to the computer through a USB port, requests water flow rate data to the sensor node, which responds to the total of accumulated pulses, between data requests.The amount of pulses received by the base node is relayed to the computer, which converts them to corresponding values in milliliters.All of these data is saved into text files, along with the date and time they were received (time stamp).Using these data, subsequently, it is possible to get the amount of water consumed by each tap every time they were used and analyze the technical and economic (financial) aspects of them.
Figure 4 shows in detail the connections of the sensor node.In Fig. 4, a 6 V source feeds the whole system.As the RFBee needs a voltage of 3.3 V, the circuit needs a tension reducer represented by LM78L33 component.The water flow transducers can be supplied with voltage between 5 and 24 V, therefore, are fed directly by the source.The digitals outputs, which contain pulses of both transducers are connected to the ports 17 and 18 of RFBee.In order to ensure that the digital signal does not exceed the 3.3 V voltage, which is the maximum value of read ports, that RFBee supports, the output of the water flow transducers is connected to a voltage divider consisting of the resistors R1 and R2.

RFBEE NODES PROGRAMMING
The previous section described the experimental setup for water consumption evaluation of water saving Science Publications AJAS taps, this section describes the programming of the sensor node, base node and computer.
In Radiuino, the programming of the sensors is customized according to their specific function in WSN, i.e., there is a programming for the RFBee Sensor and one for the RFBee Base, these programs can be downloaded directly from the Radiuino website.
On the computer that is connected to the RFBee Base, by a USB port, there is a program named dk101.pywritten in Python, which can also be downloaded from the Radiuino website.This program requests data (polling) (Boonsawat, 2010) to the RFBee Sensor, these requests will travel from the computer through RFBee Base until reach its destination at the RFBee Sensor.The RFBee Sensor then will respond to dk101.pyprogram with the amount of the pulses accumulated.In the sequence the dk101.pyprogram will receive the response of the poll, will concatenate the date and time received, will calculate the volume depending on the amount of pulses captured by the RFBee Sensor and will write all these data in text files.
As described in the previous paragraph RFBee Base is just the communication interface between the computer, where the message exchange begins and RFBee Sensor, which is connected to the water flow transducers and is responsible for the capture of pulses, which correspond the volumes of water released by the taps.
In RFBee Sensor, the digital ports at the pins 17 and 18 (RFB, 2013) were chosen to accumulate the pulses of the two taps, these ports at Radiuino program correspond to IO1 and IO2 ports, respectively.Because the sensor node is connected to the water flow transducers, which is a circuit totaly new, its programming suffered much more modifications than RFBee Base and dk101.pyprograms, when compared to the original versions of these programs that are published on the Radiuino website.
Figure 5 shows the flowchart of RFBee Sensor programming, wherein when the RFBee is in the boot process, the IO1 and IO2 ports are defined as data input ports (pulses) and also associate with these ports a pulse accumulation´s routine.The pulse accumulation´s routine uses the "PCintPort: Attachinterrupt (port, routine, state) command, where the port is the port associated with the interruption, the routine is the function to accumulate the pulses that come from the transducer and the state is the state of the pulse to be associated with the interruption (RISING, FALLING and CHANGE).

AJAS
The PCintPort command can be used after the copy of the PinChangeInt.hlibrary to the libraries directory of the Arduino's IDE installation.Because this handler interruption's function is not native to the Radiuino.The Radiuino program has been developed to analog readout of data, where the program reads the analog port when necessary.For pulses accumulation, the digital transducer emits pulses as the water passes by it and the RFBee port must be associated with an interruption.Every time the interruption occurs, i.e., a new digital pulse happened, the pulse accumulation´s routine is executed.
Once the RFBee Sensor has finished its initialization, the digitals ports IO1 and IO2 will remain awaiting for interrupts, as the interruptions occurs, accumulation's routines will be called, which will accumulate pulses until a request for data come from the microcomputer, whose message came through RFBee Base.Every time, RFBee Sensor receives a request for data, it will respond with the amount of pulses accumulated to the RFBee Base.After the data with the accumulators were completely transferred, the accumulators are zeroed to be able to accumulate new pulses, as new volumes of water pass through the taps.The experimental setup will run for several days or even months, until enough data has been saved and this efficiency survey of these watersaving faucets will be finished.
This section described the programming required for data acquisition for digital transducers, will be presented in the next section the first results of this study.

RESULTS
The previous sections presented the materials and methods and also the programming of sensor devices and the computer for collecting water flow rate data, this section describes how the data will be presented to researchers for analysis of water saving taps.
Figure 6 shows the water flow graphics of the taps with a time-period perspective on a given day.
It can be taken from the graphic represented in Fig. 6 that the tap 2 has a higher water consumption in both volume and operating time than tap 1.However, it is early collections and considering that the tap 1 is mechanical, its consumption can be changed as different pressure can be exerted on it.Thus, it is still necessary to gather more data for more conclusive results.
This section presented the first operation results of the data collection system.The next section deals with the conclusion of this study.

CONCLUSION
This study presented a system for collecting data where there wasn´t a prior infrastructure for data transmission, which was implemented through a Wireless Sensor Network.By choosing the immediate data transmission rather than its storage on the collection site by means of a data logger, was due to the need to gather up data for several weeks or months and in the case of failure in the collecting data system, this could be discovered belatedly, harming of the progress of research and especially due to the difficulty of make partial analyzes.
The use of RFBee Sensor was another choice presented in this study, because it was not necessary to include in the circuit an Arduino device for capturing pulses from the digital transducers.Because RFBee has an Arduino microcontroller, which can be used to program both the data collection routine and the routing routine to the transceiver, this last one is responsible for the data transmission to a Central Base.
The first experimental results indicate that it is a viable system.And that it gives the impression to be more economical and therefore, more feasible than a solution based on XBee.
As this experiment proved to be functional, further investigations will be carried out in order to replace the current hydrometer reading done currently manually by a human operator, who needs to physically approach the device to read the measurement.Thus, with a Wireless Sensors Network installed, this reading will be much faster and can be done even on enclosed buildings environments.This initial design described a crucial advance on controlling remotely the liquid consumption and it can be easily applied to any building.

AKNOWLEDGMENT
The researchers thank Prof. Dr. Omar C. Branquinho and Prof. Dr. Eric Alberto de Melo Fagotto for the valuable discussions during the development of this study.

Fig. 1 .
Fig. 1.Save water taps: (a) "Faucet to table washbasin with auto close-deca brand" and (b) "Faucet to table washbasin with auto close-docol brand-model: Zenit docol tronic chrome" RFBee Sensors v.1.1 (SS, 2012)  were used for collecting, transmitting and receiving data.The RFBee is a sensor composed by a transceiver CC1101 (TI, 2012) and a microcontroller ATMega 168 (AT, 2012), which is the same microcontroller used in Arduino(Arduino, 2012).So, it can be programmed in the same Integrated Development Environment (IDE) of the Arduino.The architecture of the RFBee´s microcontroller was one of the reasons for its choice, as it allows easy connectivity with the existing flow transducers on the market.There are solutions(Faludi, 2010) which use the Arduino together with the XBee (XBee, 2013) to achieve the same goal.However, such solutions are more prone to connection problems due to the existence of one more device at the circuit, allied to this, these solutions are more expensive and occupy larger space.The manner chosen for programming RFBee was using Radiuino(Radiuino, 2012) libraries, whose functions are all compartmentalized into modules to facilitate understanding and application development.The Radiuino is licensed under the terms of the GNU Library or Lesser General Public License version 2.0 (LGPLv2)(GNU, 2012).The transducer used to collect the flow rate from the taps was Walter G ½ Flow POW110D3B (WFSM, 2012) (Fig.2).It is a digital transducer that generates pulses every 2.85 mL, which value was obtained through laboratory tests, before the definitive installation of the bathrooms at the CEATEC.Figure3shows the topology of the network consisting of two nodes.The sensor node is connected to the water flow transducers (Fig.4) and is constantly receiving and storing pulses of water flow transducers as the taps are used.The base node, which is connected to the computer through a USB port, requests water flow rate data to the sensor node, which responds to the total of accumulated pulses, between data requests.

Fig. 5 .
Fig. 5. Flowchart of the accumulation of pulses by RFBee Sensor

Fig. 6 .
Fig. 6. Results of the first data collection