Professional Documents
Culture Documents
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.
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.
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
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
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
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.
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
Fritzing software is used to design the Automated Handwashing control system shown in
Fig. 2.
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,
#define irPin 2
#define waterEchoPin 4
#define waterTrigPin 5
#define relayPin 6
void setup() {
Serial.begin(9600);
pinMode(irPin, INPUT);
pinMode(waterTrigPin, OUTPUT);
pinMode(waterEchoPin, INPUT);
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, HIGH);
}
void loop() {
digitalWrite(waterTrigPin, LOW);
delayMicroseconds(2);
digitalWrite(waterTrigPin, HIGH);
delayMicroseconds(10);
waterDuration = pulseIn(waterEchoPin, HIGH);
waterDistance = waterDuration / 29 / 2;