Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
20 views

An Embedded Approach For Controlling Automatic Water Pump and Monitoring Real-Time Remote Data On Desktop, Android, and Web-Based Application

Uploaded by

Kamfret 88
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

An Embedded Approach For Controlling Automatic Water Pump and Monitoring Real-Time Remote Data On Desktop, Android, and Web-Based Application

Uploaded by

Kamfret 88
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Int'l Conf.

Embedded Systems, Cyber-physical Systems, & Applications | ESCS'18 | 33

An Embedded Approach for Controlling Automatic


Water Pump and Monitoring Real-Time Remote Data on
Desktop, Android, and Web-based Application
A. A. Bashit1, and D. Valles1
1
Ingram School of Engineering, Texas State University, San Marcos, Texas, USA

The effect of this embedded design will help reduce


Abstract - Over the past few years, the advancement of
water utilization and improve conservation. The aim is to
microcontroller has opened the door to work it as a real-
generate a proof-of-concept design that can help users
time data acquisition kit for a low-cost alternative. In this
automate water-level usage and control. Expansion of this
paper, an ultrasonic sensor is proposed as an input to NXP
idea is to provide a cost-effective solution to areas that deal
LCP1768 microcontroller which receives water-level from a
with water shortages with minimal human interaction. At
water tank and sends data wirelessly over Wi-Fi. Another
home and industries, where water or any other liquid
remotely placed Arduino microcontroller is used to display
reservoir tank and pump involved to fill the tank; there is
and to configure minimum and maximum water threshold
an opportunity to automated water-level control solution.
level to automate pump control which is also Wi-Fi
To accomplish the embedded design, the user can define
connected to the same Local Area Network (LAN). The NXP
the desired water-level using the microcontroller connected
microcontroller can be accessed locally by an Android app,
touch screen graphic display for automated pump switches
web browser and python application for monitoring real-
on or off without any manual labor.
time data and to control the pump connected to the relay of
Arduino.
2 Background
Keywords: real-time data, IoT, Wi-Fi, python, water- Internet-of-Things (IoT) has become a technological
level approach to monitor and manage a variety of networked
devices. In our proposed embedded solution, we approach
our devices connected to internet modules without
1 Introduction and Motivation trafficking data through the Internet. Our approach is to
Water is essential for our life, and we cannot live use Internet modules that utilize Transmission Control
without water. It makes us think about how to conserve Protocol/Internet Protocol (TCP/IP) protocols to
water efficiently; do not waste it and save energy as much communicate between devices. In [1], they propose a web-
as possible. Houses used to conserve water in an overhead based real-time monitoring of electrical quantities such as
tank for their daily necessities. To fill the overhead tank power, frequency, and voltage without transmitting through
with water, there is in need of a pump. However human the Internet. In [2], they implemented an IoT with web
effort is involved here to check when the tank gets empty. services and cloud computing for measuring home
Sometimes the person who operates pump uses his intuition conditions, monitoring home appliances, and controlling
of tank water-level when to switch the pump on or off. It is home access. Although in [3] and [4], they proposed an
quite a common scenario in developing countries like Arduino Mega 2560 implements smart home and irritation
Bangladesh where the major duty of a caretaker in an system respectively using Local Area Network (LAN)
apartment complex is to make sure people do not run out of based. However, this paper did not show real-time data
water. without refreshing the web page. Our design reflects the
efforts found in [1] and it is implemented using the NXP
We propose an embedded solution that implements microcontroller.
the NXP LPC1768 Cortex M3 microcontroller with an
ultrasonic sensor, and Wi-Fi module to capture and We found in [5] that the water-level was detected
transmit data to a remotely placed Arduino microcontroller using ultrasonic sensor and it is considered for our design
that uses touchscreen display, Wi-Fi module, and relay as well. In our proposed work, we introduce a real-time
connected water pump to monitor water-level and reading of the water-level data on a display that helps the
automation of the pump. Our captured data is monitored user see changes in water-level and configuration panel for
and controlled and by Personal Computer, Web- customization. This configuration panel is an LCD touch
Application or Android app. The goal is to personalize the screen that will be interfaced with the Arduino
application to user configuration. microcontroller.

ISBN: 1-60132-475-8, CSREA Press ©


34 Int'l Conf. Embedded Systems, Cyber-physical Systems, & Applications | ESCS'18 |

In our project, we incorporated forms of real-time water-level data wirelessly from the NXP and to display it
data display. The design integrates a developed Android on an LCD and to control water pump connected to it.
application, an LCD display, a Web-browser display and a
Python application for the real-time monitoring and control The touchscreen will help the user view the current
of the load. The extra feature of the Python application is water-level of the tank. It is the user’s discretion to what
to store and record data to a spreadsheet for data analysis. minimum water-level pump should turn on, and while
Our goal is to obtain higher resolution data through the pump keeps filling the tank to what maximum water-level
NXP microcontroller and overall provide an embedded pump should turn off. We are calling these two values as a
solution that requires minimal human interaction. low threshold and high threshold respectively. These
settings can be configured at 2.4-inch resistive touchscreen
display which uses Nextion Editor to create a graphical
3 Procedures interface. The Nextion instruction set [7] is used to receive
real-time data through the Transmission (TX) pin from the
Our embedded solution consists of two NXP microcontroller over its serial port.
microcontrollers in a system that help users read and
configure water-level data acquisition. The proposed As Arduino needs to wirelessly monitor the captured
solution will be driven by different developed applications data at a distant place, and NXP sends data over Wi-Fi.
that aid users in reading water-level data. These Both of the microcontrollers need to be interfaced with the
applications will have the capacity to display values in Wi-Fi module for wireless communication. The ESP8266
Web-browser form, Android phone capability, and LCD Wi-Fi module was selected to provide the communication
display. Overall project can be summarized in Figure 1 in a cost-effective and small size implementation. These
block diagram. modules will be initialized with our designated TCP socket
port [8] using AT commands [9]. We are using a client-
server architecture where NXP a server, and Arduino is a
client. Right after initializing this configuration, the NXP is
ready to send data, and Arduino gets real-time data. This
wireless connectivity ensures that the Android app and a
desktop computer connected to the router via Wi-Fi or
Ethernet will be collecting data sent by the NXP
microcontroller. Like the Arduino, these applications can
also view real-time water-level data and configure
thresholds values. Operating principle of Ultrasonic sensor
and python, web application, and the Android app are
explained in the following section.
Fig. 1. Design Block Diagram

For this approach, an ultrasonic sensor is used to 3.1 Ultrasonic Sensor (HC-SR04)
measure water-level from the water tank. It is a transducer The ultrasonic sensor detects water-level from a water
that acts as a non-contact water-level measurement sensor. tank. The NXP triggers this module to transmit an
When the NXP sends a trigger pulse to the ultrasonic ultrasonic wave and starts counting the time until the echo
sensor, the sensor generates an ultrasonic sound wave [6]. reaches the receiver [6]. The duration of response is
Then the generated wave reflects back from the water defined as T, the sound in air is measured at 340 m/s, and
surface just like an obstacle for ultrasonic. While sending the water-level distance from the sensor is defined as,
trigger pulse, the NXP also keeps counting the time until it
gets echo signal from ultrasonic sensor [6]. After receiving d = (T 340 m/s)/2 (1)
the echo signal, the NXP calculates the time required to
receive the echo thus the water-level.

Ultrasonic sensor will be located on top of the water


tank so do NXP microcontroller. In the case of home and
industrial application of water pump, a tank is usually
located on the rooftop of a building, and a pump is situated
on the ground floor. By connecting a wire from the rooftop
NXP to ground floor relay to operate pump is inconvenient;
rather wireless communication will ease the need for wire
communication. That is why we have introduced an Fig. 2. Operation of Ultrasonic Sensor
Arduino microcontroller to remotely capture real-time

ISBN: 1-60132-475-8, CSREA Press ©


Int'l Conf. Embedded Systems, Cyber-physical Systems, & Applications | ESCS'18 | 35

The Arduino general purpose input output (GPIO) pin and JavaScript will be implemented to communicate with
is connected to the relay of the water pump; as a result, if the server for dynamic real-time data display. It ensures
the higher threshold desired water-level is reached. The minimal server traffic required between server and client
Arduino will automatically trigger a signal to the relay of [10].
the pump to turn it off and if it reaches the lower threshold
value, it turns the pump off.

3.2 Python Desktop Application


Socket programming and client-server TCP/IP model
[8] are implemented for bidirectional communication
between NXP server and clients running versions of the
application. In our design on the client, Python will display
the real-time data as well as store the data in a spreadsheet
if any further processing required by an end-user. The Fig. 4. Web-Client application
prototype of real-time Python Graphical User Interface
(GUI) can be visualized in Figure 3. Herein, a user will easily visualize real-time water-
level data and operate a pump over the PC or mobile web-
browser by accessing the IP address of the NXP
microcontroller.

3.4 Android App


MIT App Inventor 2 [11] is a web-based tool to
develop an Android application using graphical blocks
rather than conventional scripting. Using this web
application, we will create an Android app that will act as a
client and will connect to the NXP server to monitor and
configure thresholds as well.

A 12V Relay module board [12] will be interfaced


with the Arduino to control the water pump. This module
operates in 12V and can handle a maximum load of AC
250V/10A. Thus, this relay can support maximum 2500VA
pump. This board has optocoupler isolation and driving
ability to trigger current of 5mA; in which it is installed via
terminal wiring leads.
Fig. 3. Python Real-Time Data Visualization The NXP and Arduino microcontrollers, the
ultrasonic sensor, Wi-Fi module, touchscreen, and relay are
Each client has to connect with the NXP server and the major components used in this project. A Python
receive data continuously until the user closes the socket program and Android apps were developed to capture real-
connection. If the user does not communicate with the time water-level data monitoring functions and controlling
server within a pre-defined time, the NXP server will close features. Thus, we will implement our proposed design as
the socket. This model is called client-server model [8] and seen in Figure 1.
has been implemented in this design in order to
communicate with the NXP and clients.
4 Expected Outcome
3.3 Web-Client Application Automation of water filling in an overhead tank is
the objective of our project. The NXP calculates time lapse
The NXP will host web page developed using HTML between these transmitted and echo signals from the
and JavaScript. This web page will show real-time water- ultrasonic sensor and finds water-level of the tank. This
level vs time curve, pump condition (on/off) and pump water-level determines whether pump needs to be turned
switching thresholds. on or off. These thresholds are customization by the two
NXP and Arduino touch screens. Testing for the
The NXP hosted web-page prototype is shown in implementation of the two boards is shown in Figure 5.
Figure 4. Here, HTML was used to render static web page and Figure 6.

ISBN: 1-60132-475-8, CSREA Press ©


36 Int'l Conf. Embedded Systems, Cyber-physical Systems, & Applications | ESCS'18 |

In Figure 5, the NXP microcontroller is interfaced control. This ensures a user flexibility to customize the
with the Wi-Fi module to act as a server for sending data configuration of thresholds and real-time water-level data
wirelessly to the remote Arduino. The Arduino displays monitoring and control of pump by mobile, desktop or web
the real-time water-level data and operates pump application services.
automatically by the NXP command as displayed in Figure
6. The user will have the option to control the pump and 6 References
change the water threshold value by means of the Arduino
attached touch screen, web application, Python or the
Android app. In some scenario, if the NXP and Arduino [1] Despa, D., et al. “Web-Based Real Time Monitoring
are in close vicinity in which both of the Wi-Fi modules of Electrical Quantities Measurement.” 2017 International
can connect with each other without the need of a router, Conference on Sustainable Information Engineering and
then it is possible for the NXP connected Wi-Fi module to Technology (SIET), 2017, pp. 464–70.
be reconfigured as an access point. Further, both the NXP [2] Soliman, M., et al. “Smart Home: Integrating Internet
and Arduino will have to be located within the module of Things with Web Services and Cloud Computing.” 2013
range. With the use of IoT hosting web pages like IEEE 5th International Conference on Cloud Computing
ThingSpeak [13], Adafruit, or knowing internet connected Technology and Science, vol. 2, 2013, pp. 317–20.
LAN IP address by registering routers to noip.com, [3] Kusriyanto, M., and B. D. Putra. “Smart Home Using
internet-based real-time water-level data monitoring is also Local Area Network (LAN) Based Arduino Mega 2560.”
possible to implement. 2016 2nd International Conference on Wireless and
Telematics (ICWT), 2016, pp. 127–31.
[4] Singh, P., and S. Saikia. “Arduino-Based Smart
Irrigation Using Water Flow Sensor, Soil Moisture Sensor,
Temperature Sensor and ESP8266 Wi-Fi Module.” 2016
IEEE Region 10 Humanitarian Technology Conference
(R10-HTC), 2016, pp. 1–4.
[5] Mantoro, T., and W. Istiono. “Saving Water with
Water Level Detection in a Smart Home Bathtub Using
Ultrasonic Sensor and Fuzzy Logic.” 2017 Second
International Conference on Informatics and Computing
(ICIC), 2017, pp. 1–5.
[6] “Ultrasonic Sensor,” https://www.sparkfun.com/
products/13959, accessed on 03/21/2018.
[7] “Nextion Instructoin set,” https://www.itead.cc/wiki/
Nextion_Instruction_Set, accessed on 03/21/2018.
[8] “TCP/IP base client-server model”,
https://www.tutorialspoint.com/unix_sockets/client_server_
model.htm, accessed on 03/21/2018
Fig. 5. NXP with Ultrasonic Sensor Measures Obstacle Distance [9] “ESP8266 AT Instruction Set,”
https://www.espressif.com/sites/default/files/documentation
/4a-esp8266_at_instruction_set_en.pdf, accessed on
03/21/2018.
[10] “Javascript,” https://www.tutorialspoint.com/
javascript/javascript_overview.htm, accessed on
03/21/2018.
[11] “MIT App Inventor | Explore MIT App Inventor”,
http://appinventor.mit.edu/explore/front.html, accessed on:
03/21/218
[12] “Relay Module Board Shield with Optocoupler,”
https://www.aliexpress.com/item/One-1-Channel-12V-
Relay-Module-Board-Shield-With-Optocoupler-Support-
High-And-Low-Level-Trigger/32828017897.html, accessed
Fig. 6. Arduino Displays Distance Measurement. on: 03/21/218.
[13] “Thingspeak_mbed,” http://www.frank-
5 Conclusion zhao.com/thingspeak_mbed_tut1/, accessed on: 03/21/218

This project implements a standalone, versatile and


user-friendly embedded solution for automatic water pump

ISBN: 1-60132-475-8, CSREA Press ©

You might also like