You are on page 1of 6

METHODS

Control System Design

Figure 1. Block Diagram of Automated Handwashing System

There are two proximity sensors. The first one is the ultrasonic sensor that is used for

monitoring the water level. The ultrasonic works by emitting sound waves, and the researcher

chooses the ultrasonic sensor since it works well with detecting water level. The other sensor is

the IR sensor used for object/hand detection, it sends control signal to the microcontroller and

perform action based on this signal. The DC submersible pump was used to discharge water with

hand detection signal. The switching is based on the IR sensor readings through a relay module.

Hardware Components of the System

Arduino Nano. A small, complete and bread-board friendly board based on the

ATMEGA 328P. It is fully compatible with the official Arduino Board with 5V operating

voltage, 7-12V input voltage, 32kb flash memory, 2kb SRAM and 16mhz clock speed.

Figure 2. Arduino Nano

Ultrasonic Sensor. A non-contact distance measuring sensor that operates at 40kHz,

with a detection range of up to 450 cm, and a resolution of 0.3cm. It requires a power supply of

+5V DC and has a quiescent current of 3mA and a working current of less than 5mA, making it

ideal for low-power applications. The sensor has an effectual angle of less than 15° and a

measuring angle of 30 degrees, allowing for precise distance measurements.


Figure 3. HC-SR04 Ultrasonic Sensor

IR Sensor. A device that detects obstacles and measures their distance using infrared radiation.

It has a detection range of 2-30cm and a detection angle of 35°, and operates on an external

3.3V-5V voltage. The detection range can be adjusted using the potentiometer. The module uses

the stable comparator LM393 and can be powered by 3-5V DC.

Figure 4. IR Sensor Module

Relay Module. Relay Module is designed to control or switch devices that require more

power than most micro-controllers can handle. It has one normally closed and one normally open

contact, and uses a triode drive to increase the relay coil. It has a power supply indicator lamp

and a control indicator lamp. The module can control typical household appliances up to 10A. It

comes in three different relay voltages: 5V, 12V, and 24V

Figure 5. Relay Module


Buck Converter. A particular DC-DC Buck Converter capable of current up to 3A, with

adjustable output voltage of 1.25V-30V via the trim pot.

Figure 6. Buck Converter

12V Power Supply. A switching mode type with a capacity of 220W, it can supply a DC

voltage of 12VDC, and a current up to 16.7A, it features a trim potentiometer to fine tune the

output voltage.

Figure 7. 12V DC Power Supply

DC Submersible Pump. A safe and environmentally friendly device with low power

consumption. It can be used with tap water, groundwater, and other fluids. It has a current of

0.1A and a rated voltage of DC 5V-12V, with a power consumption of 2W. The pump operates

within a working temperature range of -20℃ to 50℃.

Figure 8. DC Submersible Water Pump


Circuit Diagram

Fritzing software is used to design the Automated Handwashing control system shown in

Fig. 2.

Figure 9. Automated Handwashing System Perspective View

Figure 10. Automated Handwashing System Perspective View


Principle of Operation

The handwashing machine automatically dispenses water and soap when someone puts

their hands under it. The machine uses an infrared sensor (IR) to detect the presence of hands and

a water sensor to detect the water level of the tank. When hands are detected, the water pump is

turned on, and when hands are removed, the water pump is turned off. The ultrasonic sensor

detects the water level in the machine. When the water level is above the set distance, the water

pump is active and when the water level drops below the set distance, the water pump may not

be able to turn on, this suggests that the tank should be refilled with water. Additionally, the code

sets a flag variable to prevent the water pump from turning on continuously if someone leaves

their hands under the water outlet. When the IR sensor detects the absence of hands and the

water level is below the set distance, the flag is reset and the water pump is turned on again. The

delay functions are also used to ensure the water pump does not turn on and off too quickly,

which could damage the pump.


(appendices)

Hand Washing System Design Code using Arduino IDE

#define irPin 2
#define waterEchoPin 4
#define waterTrigPin 5
#define relayPin 6

int waterDuration, waterDistance;


int setWaterDistance = 20;
int flag = 0;

void setup() {
Serial.begin(9600);
pinMode(irPin, INPUT);
pinMode(waterTrigPin, OUTPUT);
pinMode(waterEchoPin, INPUT);
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, HIGH);
}

void loop() {

int irState = digitalRead(irPin);

digitalWrite(waterTrigPin, LOW);
delayMicroseconds(2);
digitalWrite(waterTrigPin, HIGH);
delayMicroseconds(10);
waterDuration = pulseIn(waterEchoPin, HIGH);
waterDistance = waterDuration / 29 / 2;

Serial.print("IR State: ");


Serial.println(irState);
Serial.print("Water Distance: ");
Serial.println(waterDistance);

if (waterDistance > setWaterDistance || irState == HIGH && flag == 0) {


flag = 1;
delay(100);
digitalWrite(relayPin, HIGH);
Serial.println("Pump off");
}

if (waterDistance <= setWaterDistance && irState == LOW) {


flag = 0;
delay(60);
digitalWrite(relayPin, LOW);
Serial.println("PUMP on");
}
delay(1000);
}

You might also like