DESIGN AND IMPLEMENTATION OF HEATED SYSTEM WITH MONITORING BASED ON BLUETOOTH TECHNOLOGY

In homes and any processes industry, the main processes that need to be controlled are temperature and level of the water. This paper is focused on the design and implementation of an Electric Heated System that connects with their environment using actuators and sensors for sensing and control the temperature and level of the water. Also, the mathematical models for operation principle are presented. The system used the arduino UNO card which is a microcontroller board for controls 'ON’ and ‘OFF’ conditions of the heater and motor depending upon the temperature and level of the water in the tank. There are three sensors used with arduino, First: the Ultrasonic sensor (HC-SR04) is used to measure the distance between the sensor and the object, and this distance is proportional to the level of the water. Second: Infrared sensor (KY-032) is used to control the drain of water by opened and closed of solenoid valve. Third: The sensor (DS18B20) is used to sense the temperature to prevent excessive in temperature that can lead to serious accidents. The Android device communicating with a Bluetooth module connected to an arduino Uno microcontroller. The andriod application is used for two tasks. First monitoring the value of the temperature and water level in the tank during the operation of the system, second the wireless communications technique is used to turn ON and OFF the system.


Introduction
The control of the level and flow of water is very important to avoid it wasted.The automatic water level controller helps the human being to manage the water in their life.Also, if the water in the tank is cold it has to be heated up, so a good control strategy is needed to maintain exact temperature of water in tank.The control objective is to maintain the water level and temperature at desired set point values using closed loop feedback control strategies.The system is very useful in house and the factory.There are different types of controllers for water level and temperature.There are several studies that have been done previously associated with the design of control system as following researches: Sharma et al [1] have been presents the simulation of interacting and non-interacting coupled tank system in MATLAB using Proportional-Integral-Derivative (PID) & Fuzzy logic controller (FLC) types of control for controlling the level in process industries.
Mounika et al [2] are present the idea of water level control by using microcontroller in a wired and remote environment, and administration inside of the connection of electrical conductivity of the water.Kumar and Reddy [3] are present the control of the level in two tanks using different controllers, PID and fuzzy logic Controller.The design of PID Controller based on Internal Model Control (IMC) Method, and the FLC based on six rules with triangular fuzzy sets and Gaussian.
Surya and Chauhan [4] are designed an automated water level indicator which monitors all the levels of water to be fed into the crucible for heating water.The temperature sensor (LM35) is used to monitor the specified limit of temperature].
Rathore et al [5] are present the temperature, flow and level system controller using the PLC with some Analog cards.The controlling of PID controller is performed by using ladder diagram in PLC software.
Parvat et al [6] are determining the mathematical model of a coupled tank system.They presents two types of controller,a PID and using a fuzzy logic technique.The simulation is being carried out using the Mat Lab/ Simulink Toolbox.
Thakur et al [7] are use the MATLAB to design FLC for control the level water.They study the control effect of this technique and compare with PID controller [7].
Sabri and Ahmed [8] are designed and applied a fuzzy and PID controller to the Water level system.Then the fuzzy controller is used to make the system fast and stable.A comparison between two controllers was presented.
Omijeh et al [9] are implemented the modeling and simulation of a water tank level controller using fuzzy logic Toolbox package and SIMULINK environment.The controller was simulated using a variety of rules to test the effect of it on the fuzzy logic controller.
Barman et al [10] are determine the mathematical model of interacting and noninteracting tank with disturbance and also design of PID controller.
Pudasaini et al [11] are present an automatic water level control system with Short Messaging Service (SMS) notification.The program was developed in Arduino program uploaded to the Microcontroller.
Band and Anyasi [12] are present the design of an automatic water level controller.The system incorporates two mains contactor, an over load relay and a mercury flood switch [12].
Mani et al [13] present a programmed ATmega 32A microcontroller as the basic component for the water level indicator to indicate the level of water.A liquid level sensor detects the present level of the water in the tank.This paper is focused on the design and implementation of automatic control electric heated system by using the Arduino UNO card.The system is used for control the temperature and level of the water.There are three sensors used with arduino, it is ultrasonic, infrared and waterproof temperature sensors to sense and control the level, temperature and flow of the water.The paper presents the mathematical model of the temperature and level of the water tank.The mobile phone based on Android software is used to monitor the value of the temperature and water level in the tank during the operation of the system.
The design is depend on a new hardware implementation of the controller by using three different sensors, connecting the microcontroller UNO for sensing and controlling the level and temperature of the water.Smartphone based on android software are used to monitor the value of the temperature and water level in the tank during the operation of the system.In addition, using the Bluetooth technique avail the wireless communication between the smartphone and arduino which is used for switching ON/OFF the system.

System Model
An brief introduction about arduino, sensors, Bluetooth and android is presented.These components are the main parts of the proposed system design.

Arduino Platform
Arduino is a microcontroller that can sense and control the devices connected with their environment using actuators and sensors.The heart of the arduino Uno is the ATmega328 microcontroller.It has 6 analog input pins and 14 digital input/output pins.There is a USB connector for connecting to any computer.The clock speed is 16 MHz.It has a power jack to power the board, an In-Circuit Serial Programming (ICSP) header to program the processor and a reset button.It contains all facilities needed to program the microcontroller and attached with specific components to enable and interact it with real world [14] as illustrated in figure (1).

Sensors
Three sensors are used in this application, the first type is a 1-wire digital sensor DS18B20 which is used for temperature measurement, and it is easy to use and inexpensive.That means they can be used to read the temperature directly with simple circuit design.Only one wire is used to read the temperature, other two wires are connected with 3.0-5.5Vpower and ground in the system.The temperature sensor can be placed in different spaces in the tank.Analyzing the temperature in real time can be obtained based on a computer which is connected with the sensor.Practice has proved that, the DS18B20 sensor has high detection speed, small measurement error, and good stability [15].The second type is Ultrasonic sensor which has 4 pins connecting with peripheral device.The 4 pins related Power, Ground, Trigger and Echo respectively.Figure (3) shows a HC-SR04 ultrasonic sensor module used in this application.The distance from the sensor to the object can be measured by using the ultrasonic sensor with arduino.

Figure (3): HC-SR04 Ultrasonic Sensor Module
The ultrasonic sensor is constructed from transmitter and receiver.The timing diagram of operation is shown in figure (4) below [16].The microcontroller sends a short pulse in microsecond to TRIGGER pin to activate the sensor, and then the sensor will send a positive pulse through the ECHO pin.The pulse width is a distance object that can be calculated, The third type of sensors is KY-032 infrared sensor which is used an infrared beam to detect the objects.The sensor uses a4 pins.The pins are: Enable Output, Positive Power and Ground.There are two potentiometers to adjust sensitivity.There is an NE555 chip to generate a 38 KHz square wave which is used to illuminate an Infra Red LED.A certain frequency is transmitted to the object, then the reflected signal is back when detecting the object, the effective distance from 2 to 40 cm and the working voltage range is 3.3V to 5V [17].

HC-05 Serial Bluetooth Module
Bluetooth is a wireless communications protocol running at ISM band 2.4 GHz.It is designed for low power devices.Bluetooth Low Energy (BLE) is available in all Smartphone running on android and computers.Smartphone is easy to connect to the devices in the environment by using this technique.HC-05 module is a Serial Bluetooth module which is designed to use short wavelength for exchanging data wireless in serial connection over short distances (10-100m).The model is shown in figure (6).Its serial communication makes an easy way to connect with computer.It provides switching mode which able to use neither receiving nor transmitting data (sleep mode).HC-05 is fully qualified Bluetooth 3Mbps Modulation plus Enhanced Data Rate with 2.4GHz radio transceiver and baseband [18].HC-05 module has 38400 default Baud rate, and supported baud rates are 9600, 19200, 38400, 57600, 115200, 230400, 460800.

Android
Android is an open source and Linux-based Operating System (OS) for mobile devices such as smart phones and tablet computers.Since Android is an open source it has become the fastest growing mobile operating system.By using the Android software development kit (SDK), its applications are written in Java programming language and run in virtual machines [19].Android OS for mobile devices is developed by the Open Handset Alliance, which is led by Google.It is a software stack for mobile devices.It's reference to a set of application programs that form a complete system.Android Software Stack contains four Layers: application layer, application framework layer, Libraries, Linux kernel [20].The ATMega328P Microcontroller is communicated to Android application by using wireless technique.

Fluid Systems Model
Fluid systems are used in many commercial and industrial applications.It can be divided to Hydraulic and Thermal System.

Hydraulic Systems
The hydraulic systems can be divided to two subcategories, hydraulic resistance and hydraulic capacitance.

Hydraulic resistance
If the liquid flowing from a pipe of specific diameter to another of a different diameter there is a pressure difference is occurs, then hydraulic resistance is generated.If the pressures at either side are p 1 and p 2 , then the hydraulic resistance R is defined as [21]:

Where
is the flow rate of the fluid.By using Bluetooth wireless protocol, ON/OFF the system is controlled by using the wireless communication technique based on serial data transmission, the switch relay connected to arduino is used for this purpose by receiving the command from android. Figure (10) shows the connections of arduino board between these appliances and Bluetooth module.The system is constructed by using arduino Uno microcontroller board, a HC-05 Bluetooth module, android device, Sensors and relays modules.The status of pin (on/off) depending on the sensing the obstacle, pin 4 is enabling.For actuators, connect the Heater to the normally open port in the relay module, the input port of the same relay module is connected to the arduino Uno port.The same way of connection is used to connect the pump and solenoid valve with other different arduino Uno Ports.The relay (switch) is connected to pin 13 in arduino, the power supply VCC (+5V) of the system is connect to the normally closed port in the relay; this linkage prepares to control ON/OFF the system by receiving the command from android.
For the operation circuit, connect the arduino UNO board to the computer with the support of USB cable, then write the program in code section of C++ program window, and uploading the program to the arduino.The Bluetooth module HC-05 connect to the arduino enabling the android to control the arduino Uno.
Figure (11) shows the system architecture of the proposed system which indicates the connection between the arduino card and the peripheral devices.Figure (12) shows the control board which consist of connections between the arduino UNO and sensors and relays.When the system switch is ON, the pump is working directly and push the water to the tank until it is reached to setting high level, then ultrasonic sensor sends the signal to microcontroller to switch the pump OFF, and the level of water is displayed on the smart phone.At the same time, the heater is switch ON, and the temperature is rising to high degree, then it is switched OFF.The DS18B20 is used for this purpose.If the infrared optical sensor detects any object, it transmits the signal to solenoid valve to open, and the water is flow from the system, then the water in the tank is decreased.The distance between the ultrasonic sensor and level of the water is calculated by the microcontroller.If the water reached the minimum value, the pump is switched ON again and push the water to fill the tank.At the same time, if the temperature is decreased, the heater becomes ON and the temperature rises again.
Figure (13) illustrates a mobile phone that using the android application to displays the value of the temperature and water level in the tank during the operation of the system.

Program Flow Chart
The program flow chart of the system is shown in figure (13).Before running the system, it must be programmed the microcontroller within the arduino board by using C++ Language.The computer is connected to system through USB bus.The microcontroller is used for automatically control that the status of actuators (pump, heater, solenoid valve) depending on the data takes from the sensors.First setting up Bluetooth (HC-05), then scan it to detect the devices connecting to the system for our appliance.Switch ON the system, the microcontroller send the signal to motor to fill the tank with water.
When the water reach at the high level the sensor send the signal to microcontroller to switch the motor in OFF condition.Also the Heater is switch ON and the temperature is rising to high degree, then switch OFF.
If the water is flow from the tank and the level of the water is decreased to minimum level, the pump is work again and push the water to the tank.The same thing is happened if the temperature is decreased to minimum; the heater is work to rise the temperature to high degree.

Results and Discussion
After running the program, the motor became ON and the motor push the water to the tank and continuously increased to high level, then the motor is stopped after approximately 22 second and the level at 15 cm as shown in figure (14).
If the water is flow from the tank, the optical sensor is sense and solenoid valve is open when any one is wanted to use the water for washing or anything else, then the water is decreased as shown in figure (15).The motor became ON when the level is reached to minimum, and the water increased again to high level, and so on.
The signal is not smooth as it contains ripples in it, because the surface of the water level inside the tank is wavy as the water moves up and down in the tank.For the same reason, when the sol.valve operating and the water flow out the tank, and because of The instability of the surface level of water during the flow of water to down to the lowest level , the ripples is happened as shown in the signal in figures (14,15).
Figure (16) shows that when the heater is ON, the temperature is rising to 601 sec, then if the heater is OFF, the temperature decreased to minimum.Practically, the response of increasing the temperature of water with time is good, and when the heater is switched off and the water tank is not used, the drop in water temperature depends on the atmosphere surrounding the tank.The signal shows that the temperature drop is gradual.
Figure (17) shows the relationship between the Temperature, Heater, Level and pump for all probabilities.
The curve shows that there is a correlation between high water level and high temperature with the operation of the pump and the heater from the beginning until stability.Here, the level of water remains constant, but the temperature continues to rise until reaching the required temperature depending on the previous temperature of water as well as the outer perimeter of the tank.If the system is turned ON and OFF, the behavior of the actuators are shown in figure (18).The response of heater and pump is the identical.It works from the start and stop when the level and temperature reaches the required values in the application.The response of optical sensor will be different, it sends the signal to sol.valve to open, when it senses any object in front of it, whereas the pump is work when the water decreased to minimum set value.

Conclusions
The economical automated electric heated system using arduino UNO microcontroller to automatically control the temperature and water level is design and implemented.
The Programmable arduino UNO microcontroller is used for controlling.Three sensors are implemented and successively operated in the system.The ultrasonic sensor is used to control the level of the water tank to prevent the water shortage or overflow.The waterproof temperature sensor is used to measure the safety limit temperature to prevent excessive temperature and pressure development in the tank that can lead to serious accidents.The infrared sensor is used to control the solenoid Valve to control the flow of water from the system.The minimum and maximum setting of the temperature and level of the water can be altered programmatically.
Android software presents a wireless communication with a microcontroller for sending and receiving data serially.It is used to monitor the value of the temperature and water level in the tank during the operation of the system.The program is used to turn the system ON and OFF.
Figure (2) shows this type of sensor.
Figure (5)  shows the type of this sensor.

Figure ( 9 )
Figure (9): The block diagram of a liquid level and temperature control system.

Figure ( 14 )
Figure(14): The relationship between the water level and pump.

Figure ( 15
Figure(15): The relationship between the water level and solenoid valve.

Figure ( 16 )
Figure(16): The relationship between the water temperature and heater.