An Embedded Approach For Controlling Automatic Water Pump and Monitoring Real-Time Remote Data On Desktop, Android, and Web-Based Application
An Embedded Approach For Controlling Automatic Water Pump and Monitoring Real-Time Remote Data On Desktop, Android, and Web-Based Application
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.
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.
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