Development of an Automatic Water Saving System with Ultrasonic Sensor for Hand Washing Device

ABSTRACT


INTRODUCTION
While the COVID-19 pandemic is no longer ongoing, it is still vital to emphasize the significance of practicing proper hand hygiene to reduce the potential presence of viruses and bacteria on one's hands.These microorganisms may not be visible, underscoring the ongoing importance of regular handwashing as a critical preventive measure.Because viruses, coronavirus for example have undesirable impacts, ranging from mild symptoms like cough, runny nose, body aches, dizziness, dry throat, diarrhea, and others to high fever, and disease complications that may result in death [1].
In light of such circumstances, measures are needed to protect oneself from this virus.One of the most effective preventive actions to reduce virus transmission is regular and thorough handwashing.The World Health Organization (WHO) and national health organizations recommend washing hands for at least 20 seconds with soap and flowing water [2], [3].Our hands are the primary carriers of all sorts of germs.We often touch our eyes, nose, and mouth without realizing it.Germs from unwashed hands can also get into our food; some of them can even grow on the food, and when we eat it, it can lead to severe illness and organ infections, especially in the digestive and respiratory systems.However, by washing hands with soap, most of the living or clinging viruses on hands can be killed.
Although important, this action can significantly impact water consumption [4].In many parts of the world, clean water resources are scarce, and excessive usage can lead to water scarcity issues.Hence, it becomes crucial to develop innovative methods that allow individuals to maintain hand hygiene without depleting valuable water resources.
In the study "Monitoring Water Level Control Arduino Uno using LCD Lm016l," conducted by STMIK Hang Tuah Pekanbaru, the authors developed a system to monitor and control water levels in a reservoir using ultrasonic sensors.The system effectively addresses issues associated with the limitations of traditional level switches and offers an innovative solution for automatically managing water supply [5].Then, the research about designing an automated water level control system using an ultrasonic sensor and integrating it with Short Message Service (SMS) technology has been conducted.The system utilizes an Arduino UNO ATmega328 microcontroller, an HC-SR04 ultrasonic sensor for water level measurement, an SMS module SIM 800L for communication, a 16 x 2 LCD for display, and a Relay module for automatic control of the water pump.Before testing, the ultrasonic sensor underwent calibration to ensure accuracy.The results demonstrated an impressive precision level of 99.99%, confirming the effective functionality of the device [6].Several previous studies have already utilized ultrasonic sensors for this purpose, and in this research, an ultrasonic sensor is also employed for water control when used for handwashing.Therefore, a system related to handwashing using Arduino UNO, and additional components such as resistors, sensors, LCD, and LED, have been designed.It is expected that with this system, a person can wash their hands for the recommended duration (20 seconds) by following the LCD instructions to wash their hands (keeping their hands within the range of the ultrasonic sensor) until the LED turns green, ensuring more effective germ elimination.This research will combine the need for hand hygiene with the challenges of water availability and sustainability.By developing an efficient system using ultrasonic sensors to control water flow during handwashing, this research will make a positive contribution to maintaining individual hygiene while reducing environmental impact and minimizing the risk of water scarcity.

METHOD
In this research, various experimental tools and materials have been used to design and test a water-saving system using an ultrasonic sensor for handwashing.Some of the components and devices used include Arduino IDE, Arduino UNO, jumper, Arduino UNO cables, LEDs, potentiometer, LCD ultrasonic sensor, 220 Ohm Resistor, Autodesk Tinkercad, and breadboard.
Arduino is an open-source electronic platform based on both hardware and software, designed for ease of use.Arduino boards can read inputssuch as activating sensors, pressing a button, or receiving Twitter messagesand convert them into outputs, like activating motors, turning on LEDs, or publishing something online.Due to its open-source nature, users can access essential information like circuit schematics for hardware and programming code for software.Users can issue commands to Arduino by sending a set of instructions to the microcontroller on the board.To do this, users utilize the Arduino programming language based on wiring and the Arduino Software (IDE), which is based on processing [7].
The Arduino software serves as a place to write programs that will later be uploaded to the Arduino.Additionally, the existing software is free to use and can run on various operating systems, including Windows, Linux, and Mac.The Arduino Software (IDE) is user-friendly for beginners but flexible enough to be utilized by advanced users.For teachers, it can be easily adapted to the Processing programming environment, making it a valuable educational tool for teaching programming concepts [8].There are three steps in Arduino programming: writing the program, checking (compiling) the program, and uploading the program to the microcontroller.To avoid errors when uploading the program to the Arduino hardware, two essential preparations need to be made: configuring the serial communication path between the computer and the Arduino hardware and setting the appropriate Arduino hardware type.To configure the serial communication path, navigate to Tools > Serial Port and select the appropriate port.
Arduino boards consist of various components and different interfaces combined on a single circuit board.The design has evolved over the years, and there are several variations with additional components.These boards have a set of pins used to connect various components that you may want to use with Arduino.These pins come in two types: digital pins, which can read and write a binary state (on or off), with most Arduino boards having 14 digital I/O pins; and analog pins, which can read a range of values and are useful for more precise control, with most Arduino boards having six of these analog pins.These pins are arranged in a specific pattern, so if you purchase additional boards designed to be compatible, often referred to as "shields," these pins will easily fit most compatible devices [9].
The power connector provides power to both the devices and low-voltage components connected to it, such as LEDs and various sensors, as long as the power requirements are not too high.The power connector can be connected to an AC adapter or small batteries.The microcontroller, the main chip that allows you to program the Arduino to execute commands and make decisions based on various inputs.The specific chip varies depending on the type of Arduino board you purchase but is generally an Atmel controller, usually ATmega8, ATmega168, ATmega328, ATmega1280, or ATmega2560.The most significant difference beginners will notice between these chips is the amount of onboard memory.The serial connector, implemented via a standard USB port on most newer boards, allows you to communicate with the board from your computer Jurnal Komunikasi Sains dan Teknologi

Development of an Automatic Water Saving System with Ultrasonic Sensor for Hand Washing Device … (Fahmy Rinanda Saputri)
and load new programs onto the device.Often, Arduino boards can also be powered through the USB port, eliminating the need for a separate power connection.Various other small components, such as oscillators and/or voltage regulators, provide essential capabilities to the board.The HC-SR04 ultrasonic sensor uses SONAR technology to determine the distance from an object, much like how bats navigate [10].It offers excellent non-contact range detection with high accuracy and stable readings in a user-friendly package, ranging from 2 cm to 400 cm or 1" to 13 feet.Its operation is not affected by sunlight or black material, although soft, acoustically reflective materials like cloth can be challenging to detect.The sensor comes complete with an ultrasonic transmitter and receiver.The ultrasonic sensor uses sound reflections to obtain the time between emitted and received waves.Typically, it sends waves at the transmit terminal and receives reflected waves.The time used corresponds to the normal speed of sound in the air (340 m/s) to determine the distance between the sensor and the obstacle.
A Liquid Crystal Display (LCD) is an electronic visual display that utilizes the light-modulating properties of liquid crystals combined with polarizers [11].Liquid crystals do not emit light directly but use a backlight or reflector to generate colored or monochromatic images.LCDs are available for displaying arbitrary images (like in general-purpose computer displays) or fixed images with low information content that can be displayed or hidden, such as words, numbers, and predefined seven-segment displays, as found in digital clocks.They use the same basic technology, with arbitrary images made up of small pixel matrices, while other displays have larger elements.LCDs can be either normal (positive) or inverted (negative), depending on the arrangement of the polarizer.For example, a positive character LCD with a backlight will have black letters on a background that matches the backlight color, while a negative character LCD will have a black background with letters in the same color as the backlight.
A light-emitting diode (LED) is a type of electronic component, a diode made of semiconductor material that emits light when subjected to a forward voltage current of a specific amount [12].LEDs can emit light in various colors, depending on the wavelength or wavelength and the semiconductor compound material used in the LED.LEDs are easy to use and have a shape similar to a bulb or incandescent lamp, making them easy to attach to various devices.Although LEDs resemble bulbs, they do not require filament burning and do not produce heat energy when emitting light.This is because LEDs utilize the electroluminescence phenomenon, where electrons flow into and fill microscopic holes in the semiconductor material due to current or an electric field, causing the emission of photons and the production of light of a single color.In short, when an LED is subjected to a voltage from anode to cathode, electrons will enter the positively charged microscopic holes, releasing photons and emitting light.LEDs are used for illumination and indication purposes.An example of LED usage for illumination is LED strip lights often used for home decoration or specific items.In an indication context, LEDs are used in traffic lights typically found on roads.
A Breadboard is a specialized board used for creating prototype electronic circuits and experiments.The project board, often referred to as a breadboard, serves as the foundation for constructing electronic circuits and is a prototype of an electronic circuit.In essence, breadboards are made of plastic with a specific pattern of holes.Breadboards come in three sizes: mini breadboards with 200 hole points, medium breadboards with 400 hole points, and large breadboards with 830 hole points.The breadboard features alphanumeric labels to indicate the connection pattern.For example, code A1-E1 designates interconnected holes, making it easy to assemble components on the breadboard neatly.Arranging components on a breadboard is easy because components placed on the breadboard can be repeatedly arranged in different circuit forms, and soldering is not required.
Jumper cables are electronic components or connecting cables commonly used to create electrical circuits or prototype systems using Arduino and breadboards.Some common issues with jumper cables include not having enough of them or experiencing easy wear and tear due to disregarding cable quality when purchasing.Therefore, when selecting jumper cables, there are a few key considerations to keep in mind: the cables should be reasonably flexible, and the connectors should be securely attached to the cables to prevent them from detaching.Stiff, inflexible jumper cables with loose connectors are more prone to damage during use.Jumper cables come in three main types: male-to-male, male-to-female, and female-to-female.
Tinkercad is an online-based electronics simulator platform.It provides a visual interface and allows you to work with Arduino UNO components that can be directly programmed.Tinkercad offers an engaging visual design, making it an enjoyable platform for users.It also comes with comprehensive features.Besides electronic circuit simulation, Tinkercad includes 3D design and 3D printing capabilities [13].

Figure 1. Block diagram of system
The built system consists of the electronics component that shows in the block diagram in Figure 1.There is ultrasonic sensor, potensiometer, Arduino UNO, PC/Laptop, Arduino IDE, LCD, and LED.The handwashing indicator begins with the handwashing process within a specified range, which in this research is 0-30 cm.Subsequently, the ultrasonic sensor will read input through reflected waves from the hand.The input will be processed according to the program on the Arduino UNO and IDE.As an output, the LED will light up alternately from red to yellow to green with a time interval of 6 seconds.Simultaneously, the LCD will remain lit continuously, providing a display as a notification to continue handwashing until the light turns green.This process will repeat according to the need.

RESULTS AND DISCUSSION
In this section, it is explained the results of research and at the same time is given the comprehensive discussion.The experiment's outcome is as follows: when an object is brought close to the ultrasonic sensor within a distance interval of 0 to 30 cm, the sensor will read the reflected waves and send a signal to the Arduino.This signal is then processed according to the program uploaded to the IDE, and as a result, an LED starts to light up.The LED alternates between red, yellow, and green with a 6-second interval.Separately, an LCD, which is not directly connected to the circuit, displays the message "WASH YOUR HANDS UNTIL THE LIGHT TURNS GREEN!" Consequently, individuals are advised to follow the LCD and LED notifications to wash their hands for approximately 18 seconds.Figures 2, 3, 4 are images of the assembled system.This system consists of two parts, namely the microcontroller connection with the ultrasonic sensor.The second system is the microcontroller with the LCD connected to a potentiometer.Figure 1 shows the red LED indicator still ON, Figure 2 shows the yellow LED indicator starting to light up, and Figure 3 displays the green LED indicator that is already ON.Green LED For the explanation of Arduino circuit 1, the circuit comprises jumpers, LEDs, and an ultrasonic sensor.Three LEDs are connected to Pins 5, 6, and 7, as well as GND.The ultrasonic sensor (HC-SR04), used as a sonar to detect an object's location (unaffected by sunlight or black objects), has four terminals: VCC (connected to 5V), Trig (trigger Pin), Echo (Echo Pin), and GND (connected to GND on the Arduino).Therefore, the appropriate connections must be made to each terminal.Additionally, jumpers connected to GND and 5V on the (-) and (+) terminals are available for linking multiple components simultaneously.
The program for Arduino circuit 1 includes the declaration of integer variables, "echoPin" mapped to digital pin 11, "trigPin" to 12, "distance," and "i" mapped from 5 to 6.It also includes the use of a "long" variable, which is extended to 32 bits and is utilized for "duration" in this experiment.In the void setup section, "for" is used to declare "i = 5" and "<= 7," which is interpreted as Output.The "pinMode" function is used to define trigPin as Output and echoPin as Input.
In the void loop, "digitalWrite" is used for trigPin to set it as LOW and HIGH with intervals of 2 and 10 milliseconds, using the "delayMicroseconds" code."duration" is then determined using "pulseIn" on echoPin to read the pulse or wave transmission and time it, such as from LOW to HIGH and back to LOW.The timing read is used in the following code for "distance" calculation, which follows the formula "((duration * 0.0343)/2))."The "distance" result is then used for the next code block, which employs an "if" statement with the condition that "distance" is above 0 and below or equal to 30, leading to the execution of the "ledtimer" function.
In the "ledtimer" function, if the "distance" "if" statement is executed, it first turns the LED connected to digital pin 7 to HIGH and delays for 4 seconds.It then proceeds to use a "for" loop, where if the "i" variable reads pin 6 with the condition "i greater than or equal to 5," the "i" value will be reduced, resulting in a HIGH state.This is followed by an alternative, where if "i" has decreased to 5, the LED connected to pin 7 will be set to LOW (off).Furthermore, if "i" equals 7 and is less than or equal to 5, the "i" value decreases, and the LED connected to pin 7 will be in a LOW state at that point.Figure 5. Arduino 1 circuit using LED and ultrasonic sensor For an explanation of Arduino circuit 2, it can be seen that an Arduino circuit will be created, consisting of cables/jumpers connected to Pins 2, 3, 4, 5, 9, 10, 11, and 12, 5V, GND, a B10K potentiometer, a 220 Ohm resistor, an ultrasonic sensor, and an LCD.In this case, appropriate cable connections are needed for the potentiometer, namely connecting the left terminal to GND, the middle one to a Digital Pin, and the right one to 5V.The assembly process for this circuit involves directly connecting the 16 pins of the LCD (from D0 to K) to the breadboard.Then, jumper cables will be connected with 3 jumpers from the LCD to GND (Pins K, RW, and VSS) because Pin K is the GND for the LED inside the LCD, VSS is the GND for the display on the LCD, and RW is used for reading and writing data.There are two other essential jumpers to consider, one from 5V to the LCD at VDD, and the other from Pin A. Since turning on the LCD requires power to activate the display and LED.The program for Arduino circuit 2 is created using the LiquidCrystal library, enabling the IDE to access specific functions to work with the LCD, as explained in the theoretical section.There are 19 types of codes that can be used to control the LCD's performance.In this experiment, "lcd.begin(),lcd.print(), lcd.scrollDisplayLeft(), and lcd.scrollDisplayRight()" are used.The "lcd.begin()" function determines the dimensions of the LCD in the circuit, which is 16x2 (columns and rows).The "lcd.print()" function is used to display the text "WASH HANDS UNTIL THE GREEN LIGHT!" on the LCD screen.The "lcd.scrollDisplayLeft()" and "lcd.scrollDisplayRight()"functions are used to move the text to the left and right.The "for" loop is used to determine the movement by shifting the desired string to the left and right.

CONCLUSION
Arduino is an open-source tool comprising both hardware and software that enables users to send commands in the form of a program to be executed by the microcontroller under predefined conditions.Using Arduino allows an individual to create a system with its own set of inputs and outputs based on the program developed in the Arduino IDE.Through communication between the IDE and the microcontroller, the functions and commands can be executed.In this experiment, it can be concluded that by combining the Arduino UNO microcontroller, an ultrasonic sensor, LEDs and an LCD, and a potentiometer, a user can design a system that serves as a timer for optimal handwashing time, approximately 20 seconds.The design and concept of the device successfully built in this study can be applied in real-life scenarios, in the future.

Figure 2 .Figure 4 .
Figure 2. he results of the experiment when the LED is still red