Water Level Detection System Based on Ultrasonic Sensors HC-SR04 and ESP8266-12 Modules with Telegram and Buzzer Communication Media

Water Level Detection System Based on Ultrasonic Sensors HC-SR04 and ESP8266-12 Modules with Telegram and Buzzer Communication Media

HananAnak Agung Ngurah Gunawan Made Sumadiyasa 

Department of Physics, University of Udayana at Bali, Indonesia

Corresponding Author Email: 
a.a.n.gunawan.unud@gmail.com
Page: 
305-309
|
DOI: 
https://doi.org/10.18280/i2m.180311
Received: 
10 March 2019
|
Revised: 
17 May 2019
|
Accepted: 
25 May 2019
|
Available online: 
30 August 2019
| Citation

OPEN ACCESS

Abstract: 

Detection of water surface altitude is an indicator for early detection of flood disasters. The research aims to design a water surface-level detection system by using ultrasonic sensors and the ESP8266-12E module. The tools and materials used during the design are: Ultrasonic sensors HC-SR04, module ESP8266-12E, and buzzer a water container with a varied water height, the detection data will be sent to the ESP8266-12E module, then the system will send the information an output to sound the alarm. The ultrasonic HC-SR04 sensor will detect the mation in the form of a message through telegram and buzzer application. The messages delivered are several stages including standby, alert, and danger. The methods used in this design are planning, study libraries, collection of tools and materials, hardware plan, and program creation on the software. The final result is a system capable of detecting water surface level based on the ultrasonic sensor HC-SR04 and the ESP8266-12E module through telegram and buzzer communication media.

Keywords: 

HC-SR04, ESP8266-12E, buzzer, telegram

1. Introduction

Flooding is a natural phenomenon in the form of land-setting by water due to overflow or puddle that exceeds the normal limit of water altitude somewhere. This can be due to excessive rainfall, melting snow, or the inability of the river to accommodate and distribute the water it receives. Floods are sometimes coming in the evening when the citizens are asleep in a slumber making the citizens cannot standby when the disaster comes. Of course, this makes the citizens not only suffer the loss of property and objects but can lose the lives of loved ones because of stuck flooding that came suddenly. For this reason it is necessary to designed a remote flood detection tool, not only to increase the accuracy of the detection in the flood but can be monitored in real time so as to provide flood standby at the precise moment.  Nowadays, people especially in Indonesia Internet users are very high, besides simple internet era is very easy to reach by all walks of life. As a preliminary study the authors will design a flood detection system based on the ultrasonic sensors HC-SR04 and the ESP8266-12E module with Telegram and buzzer communication media, a detection system that can be monitored using Telegram (Internet).

1.1 Ultrasonic sensors HC-SR04

HC-SR04 is an ultrasonic ranging module designed for embedded system projects. Ultrasonic ranging module HC-SR04 provides 2 cm - 400 cm non-contact measurement function, the ranging accuracy can reach to 3 mm. The modules includes ultrasonic transmitters, receiver and control circuit [1].

Ultrasonic Sensing/manipulate basics Ultrasonic alerts are like audible sound waves, except the frequencies are plenty higher. Our ultrasonic transducers have piezoelectric crystals which resonate to a desired frequency and convert electric power into acoustic power and vice versa [2]. The trigger pin is given a supply of 5V i.e. high for about 10us to initiate the sensor module. A burst of 8 cycles of 40 kHz is transmitted and wait for the echo signal. [3].

The ultrasonic sensor works using trigger and echo method. The transceiver module triggers and sends the signal to the water the water sends back an echo signal which is read by the echo i.e. the receiver module. The Ultra sonic sensor calculated distance of the signal and returns the level of the water. The travel time value and the speed value allow the sensor to calculate the level of the water [4]. The sensor works by emitting ultrasonic wave through the transmitter and then reads the wave reflection using the receiver when there is no object detected. The ultrasonic wave is emitted by the transmitter via pin Trigger that is given the pulse signal by the microcontroller. Then, the reflected wave received by the receiver is forwarded to the microcontroller via pins Echo. From the concept, it can be seen that the ultrasonic wave is emitted when the sensor is given a pulse signal with a period of 10 µs via pin Trigger. The ultrasonic wave emitted and reflected has a frequency of 40 KHz. The resulting lag time between the transmission and reflection wave is used as a reference to calculate the distance of the sensor to the object [5].

1.2 ESP8266-12E

ESP8266 is a low-cost Wi-Fi chip with full TCP/IP stack and microcontroller capability produced by Espressif. This small module allows microcontrollers to connect to a Wi-Fi network and make simple TCP/IP connections using AT commands. The very low price and the fact that there were very little external components on the module which suggests that it could eventually be very inexpensive in volume make it the component of choice for our needs [6].

ESP8266-12E is a chip component designed for today's all-purpose world. This Chip has a complete and unified Wi-Fi networking solution, which can be used as an application provider or to separate all Wi-Fi networking functions into other application processes. ESP8266-12E has the capability of on-board processing and storage that allows such chips to be integrated with sensors or by application of certain tools via a pin input output with just a short programming [7]. The most basic board, the ESP8266-01 consist of 2 GPIO pins, UART communication, low powered 32-bit CPU and a PCB antenna. Other modules also have ADC input capabilities, SPI, I2C and more GPIO pins [8].

ESP8266 is a Wi-Fi module which is also working as a transmitter in our system. ESP8266 plays very important role in reducing the hardware of the system. It replaces the Raspberry-Pi module. As our system is IOT based, the alerting will get taking place with the help of IOT [9].

In ESP8266-12E There is a processor, memory and also access to the GPIO. This causes ESP8266-12E to directly replace the Arduino and coupled with its ability to support the WiFi connection directly. There are several types of ESP8266-12E that can be found in the market, but the most easily obtained in Indonesia is the type ESP-01,07, and 12 [10].

In the development of the world of IT, Arduino and Telecommunication, is one of the popular buzzword that is IOT (Internet Of Things). ESP8266-12E is one of the most used chips in the IOT system. The Internet of Things is a concept aimed at extending the benefits of continuous connected Internet connectivity. Basically IoT (Internet of Things) refers to an object that can be uniquely identified as a virtual representative in an Internet-based structure. The way IoT (Internet of Things) works is the interaction between your fellow machines that are automatically connected without user intervention and at any distance. In order to achieve the operation of Internet of Things (IoT) which is a liaison between the two interactions of the machine, while the user only serves as the regulator and supervisor of the work of the tool directly. The benefits derived from the concept of IoT (Internet of Things) itself is the work done can be faster, easier and efficient [11].

1.3 Arduino IDE

The Arduino IDE is an editor used to write programs, compile, and upload to the Arduino board. The Arduino development environment consists of a text editor for writing code, a message area, a text console, a toolbar with buttons for common functions, and an array of menus [12].

Software written using Arduino is called sketches. This Sketches is written in a text editor and saved with a file that has an extension. ino. The text Editor has the facilities to cut/paste and search/replace. The message Area contains feedback when saving and uploading files, and also indicates if an error occurs. Arduino IDE Arduino consists of:

a) The program Editor, is a window that allows users to write and edit programs in the Processing language.

b) Compiler, is a feature to change the program code (language Processing) into binary code. Serves to compose the Arduino C language also to upload the program of the composition (hex file) to the Arduino module.

c) Uploader, is a feature to load binary code from a computer that is forwarded to memory on the Arduino board [13].

1.4 Telegram

The Telegram app was initiated by two brothers, Nikolai and Pavel Durov. Both shared tasks, Nikolai Durov focused on developing the application by creating a MTProto protocol that became a motor for Telegram. While Pavel is responsible in terms of funding and infrastructure through the funding of Digital Fortress. There are some telegram fiture;

a) Secret Chats, Secret Chat features the same look and tools as standard messages, only messages in Secret Chat are encrypted with a client-to-client procedure using the MTProto protocol. The message body cannot be accessed by anyone on any other device, only by the sender and the recipient on the device in use. Next the message body will be deleted with the specified time setting.

b) Mobile Number, Telegram uses the mobile number as an identity and account verification. This way the user can easily find a friend. Numbers can be changed and connected to additional devices to be then accessed from one of them. If you want the user can set a pseudonym so that the phone number will not be exposed to others.

c) Group, most instant messaging apps may already have a group feature. But what makes the group feature in Telegram is different, it can accommodate more than 5,000 people. Messages sent by claimed group members are also encrypted.

d) Bot, Bots are made using telegram-CLI and Lua. The most famous bot is Yago Perez-made telegram-Bot. The telegram-CLI bot works like a personal account we can even login as this telegram-CLI account and do what the normal account can do. Telegram then launches an API bot so that people can build bots using a programming language they master without having to relate to the telegram-CLI or MTProto. Bot API is a bot account, there are certain things that can be done normal accounts that cannot be done bot accounts, e.g. creating groups, inserting people into groups and removing people from the group [14].

1.5 Buzzer

The Alarm is used as a hazard alert system of sound or sound. The alarm system used is a buzzer system. A buzzer or electric bell is a tool to give a distinctive voice signal. In general, electric bells are often used for a series of sensors with controllers and are used as sound markers. Essentially the work principle of buzzer is almost the same as the loud speaker, the buzzer consists of a coil attached to the diaphragm, then the coil is lined with electric current so it becomes electromagnet. The coil will be drawn into or out, depending on the current direction and the polarity of the Magnetnya. Since the coil is mounted on the diaphragm then each coil movement will move the diaphragm back and forth so as to make the air vibrate resulting in sound. The buzzer is used as an indicator that the process is completed or a mistake occurs on a device (alarm) [14].

2. Block Diagrams and Schematic Circuit

A block Diagram design of the water-based level detection system tools of the ultrasonic sensor HC-SR04 and the ESP8266-12E module with Telegram communication media and buzzer are shown in Figure 1.

Figure 1. Water level detection system’s block diagram

The follow of signal response shown in Figure 1 starts the ultrasonic sensor HC-SR04 detects the object, the data received by the ultrasonic HC-SR04 sensor will be forwarded to the receiver module ESP8266-12E. The Data submitted by the sensor will be processed by the ESP8266-12E module already filled by the program. After that the resulting message is sent to the user in the alert and alarm message form. The message conveyed in the text is sent to the telegram application.

The tools used in this research are cell phones, multimeters, tweezers, solder, screwdrivers, hammers, drill PCBS, power supply 5 V 2 A. The materials used to design the tools of the flood detection system are ultrasonic sensors HC-SR04, the module ESP8266-12E, buzzer, cable connector, project board, PCB, nail, water reservoir, almunieum, spacer, tin. For schematic circuit the tool is created using the Eagle app and the schematic of the tool can be viewed as in Figure 2

Figure 2. The schematic of system

3. Result and Discussion

3.1 Result

In this research have made the water level detection system based on the ultrasonic sensor HC-SR04 and the ESP8266-12E module with Telegram and buzzer communication media. A range of tools is created as shown in Figure 3 where the tool consists of several main parts, water level and display on the mobile phone screen.

Figure 3. Water level detection system ultrasonic based sensor HC-SR04 and ESP8266-12E module with Telegram and buzzer communication media

In this research have made the water level detection system based on the ultrasonic sensor HC-SR04 and the ESP8266-12E module with Telegram and buzzer communication media. A range of tools is created as shown in Figure 4.1 where the tool consists of several main parts, water level and display on the mobile phone screen. The way that section titles and other headings are displayed in these instructions, is meant to be followed in your paper.

3.2 Discussion

The operation this tool works is when the tool gets an electrical voltage of 5V then this tool will do scanning or search Wi-Fi to get Internet connection. The system was previously set up using an Internet signal with the name "WiFi" with password 88888888. Once connected to the WiFi then this tool will start to do the detection, the ultrasonic sensor HC-SR04 will detect the water level on the surface, the signal obtained is then sent to ESP8266-12E to be done processing or processed be a message to be sent to the user

The system can connect to Telegram on a smartphone through the Internet network. Any smartphone connected to the Internet will get the IP Public (Internet Protocol). The Public IP will be sent to the network server so that the smartphone can connect to the Internet network. Each bot has a token code. The Token will then access data from the system to the server Telegram bot so bots on Telegram can be accessed according to programming on this system. As shown in Figure 4 there are 3 types of messages delivered to the telegram application, this message adjusts to the level that has been set in the form of standby, alert, and danger, well at the time of danger of this detection tool not only Send the message but also turn on the alarm.

Figure 4. Display the message on the mobile screen when level A.) Standby B.) Alert c.) Danger

To make it easier to analyze the data, the test results of this tool are displayed in the table. Writing on the table is represented by the T and F, the letter T signifies that the output of this tool is logically correct while the F-case indicates that the output of this tool is false.

Table 1. Value output “standby” status

Level Status

“Standby”

Indicator

Message sent

Buzzer

Value Output

T

F

T

F

Number of value

23

7

5

25

Amount of data

30

30

 
Table 2. Value output “alert” status

Level Status

“Alert”

Indicator

Message sent

Buzzer

Value Output

T

F

T

F

Number of value

21

9

8

22

Amount of data

30

30

 

Table 3. Value output “danger” status

Level Status

“Danger”

Indicator

Message sent

Buzzer

Value Output

T

F

T

F

Number of value

25

5

5

25

Amount of data

30

30

 
The intent of this table is at the standby, alert, or danger level if in the value output means that the experiment corresponds to the command, for example in the checkbox in idle field, this tool is sent the standby message, as well as in the and danger columns too. To know the accuration of this tool is required the number of tests that are of correct value, for the standby indicator is correct if sending alert messages and not sounding buzzer, on the indicator KeepI true value if sending a message Alert and not sounding buzzer, while the danger indicator is worth it if it sends hazard message and also sends a buzzer.

Further access to the success of detections at any given water level can then be compared, through the achievement level of each tool level (accuration) that can be demonstrated in the form of percentages based on Calculation using Equation 4.1 namely

$\mathrm{X}=\frac{\mathrm{Y}}{\mathrm{N}} \times 100 \%$

where,

X = Accuration

Y = number of successes (T value on message sent)

N = amount of data

Suppose to test the tool on standby level is done 30 times then gained a lot of error on the tool as much as 7 times from 30 attempts. So the success of the tool is 23 times out of 30 attempts. If the number of success is expressed in the form of accuration, then by using the equation bellow:

Accuration $=\frac{\text { number of successes }}{\text { amount of data }} \times 100 \%$ .

Accuration $=\frac{23}{30} \times 100 \%$

Accuration $=0,77 \times 100 \%$

Accuration $=77 \%$

Accuration = 77%

Thus accuration of the appliance at the standby level is 77 %. In the same way is the accuration for the alert level of 70 %, and the hazard rate of 83 %.

4. Conslusion

Based on the results of testing and discussion on the research on water level detection systems based on ultrasonic sensors HC-SR04 and ESP8266-12E modules with telegram and buzzer communication media can be concluded as follows:

  1. It has been designed a water altitude detection system based on the ultrasonic sensor HC-SR04 and the ESP8266-12E module with Telegram and buzzer communication media.
  2. The system is designed to detect the level of water height by accuration 76.7 %.

For further refine of the tools that have been created in this research there are some suggestions that authors can convey through this paper including; Equipped with LCD display to make the tools more interesting as possible, the alarm sound is set with different models on each level, the water container can be made larger so that the ultrasonic sensor works more accurately, at the moment Conducting experiments is expected to be more cautious in order to get better results, and the system is designed for more users.

Acknowledgment

Mr. Dr. Drs. Anak Agung Ngurah Gunawan, MT as a supervising lecturer who has given basic themes, guidance, support and knowledge about the concept as well as chairman of Physics department, which has endorsed the seminar Results of this final task. Then, to Mr. Drs. Made Sumadiyasa, as the lecturer and academic supervisor who has provided guidance and correction which is very beneficial to the completion of the seminar on the final assignment. All my friends from Physics Department of Mathematics & Natural Sciences Faculty, Udayana University, Ashabul Asmi, and also Ari Kurniawan from Faculty of Fisheries and Marine Sciences’15 and anyone who have accompanied and helped the author.

  References

[1] Kaur, M., Pal, J. (2015). Distance measurement of object by ultrasonic sensor HC-SR04.iJSRD. International Journal for Scientific Research & Development, 3(5): 503-505.

[2] Sunitha, S. (2017). Distance measurement using ultrasonic sensor and NodeMCU. International Research Journal of Engineering and Technology (IRJET), 49(6): 1794-1797.

[3] Garethiya, S., Ujjainiya, L., Dudhwadkar, V. (2015). Predictive vehicle collision avoidance system using raspberry – PI. ARPN Journal of Engineering and Applied Sciences, 10(8): 3656-3659. 

[4] Bochare, A., Mukesh, S. (2017). Short range radar system using arduino uno. International Research Journal of Engineering and Technology (IRJET), 4(6): 335-338. 

[5] Al Tahtawi, A.R. (2018). Kalman filter algorithm design for HC-SR04 ultrasonic sensor data acquisition system. IJITEE, 2(1): 15-19. https://doi.org/10.22146/ijitee.36646

[6] Aziz, D. (2018). Webserver based smart monitoring system using ESP8266 node MCU module. International Journal of Scientific & Engineering Research, 9(6): 801. 

[7] Samanta, S., Khan, K.K., Bhattacharyya, A., Das, S., Barman, A., Mathur, K. (2016). Home automation using arduino and ESP8266. International Journal of Advanced Engineering, Management and Science (IJAEMS), 2(9): 1446-1456.

[8] Tarone, A.V., Katgube, A.A., Shendre, H.H., Ghugal, R.P. (2018). IOT based smart garbage monitoring system using ESP8266 with GPS link. International Research Journal of Engineering and Technology (IRJET), 5(3): 3367-3368. 

[9] Kim, J.H., Yun, S.H., Kim, G.S. (2017). A study on a Wi-Fi system for radon monitoring. IJISET - International Journal of Innovative Science, Engineering & Technology, 4(2): 25-28.

[10] Pasha, S. (2016). Thingspeak based sensing and monitoring system for IoT with matlab analysis. International Journal of New Technology and Research (IJNTR), 2(6): 19-23. 

[11] Artawan, M.D., Gunawan, A.A.N, Sumadiyasa, M. (2018). Use of short message service (SMS) based ATmega328 microcontroller and SIM800L modules as on / off control electronic equipments. Advances in Applied Physics, 6(1): 19-24. https://doi.org/10.12988/app.2018.856 

[12] Abbirame, K.S., Sarveshawaran, V., Charumathi, J., Gunapriya, M., Ilakkiya, P. (2018). Wireless heart attack detection and tracking via GPS & GSM. International Journal of Latest Technology in Engineering, Management & Applied Science (IJLTEMAS), 7(3): 143-145. 

[13] Chima, A.I., Nwobodo, A.N. (2017). Construction and empirical study of electronic Piezzo buzzer mosquito repellent. International Journal of Scientific & Engineering Research, 8(11).