Skip to Content

AUTOMATIC HAND DRYER

In today's fast-paced world, automation is playing an increasingly significant role in improving hygiene, convenience, and energy efficiency. One such innovation is the automatic hand dryer, a device commonly found in public restrooms that activates when hands are detected beneath it. Traditional hand drying methods, such as paper towels or push-button dryers, often lead to hygiene concerns due to physical contact and waste accumulation. 

This project aims to address these issues by developing a touch-free, efficient, and cost-effective hand drying system using an infrared (IR) sensor, microcontroller, and relay-controlled fan or heater. The primary goal is to enhance sanitation, minimize paper waste, and optimize power usage by ensuring the dryer operates only when needed. Through real-time hand detection and responsive activation, this system represents a step forward in automation, hygiene, and environmental sustainability.

Components Required

  • Arduino Uno
  • IR Sensor
  • Relay Module
  • DC Fan / Heating Element
  • 12V Power Supply
  • Jumper Wires
  • Breadboard

Circuit Diagram

Component Connections

1. Connecting the IR Sensor to the Arduino

The IR sensor is responsible for detecting the presence of hands beneath the dryer. It works by emitting infrared light and measuring the reflection when an object is present.

Wiring the IR Sensor to the Arduino

  • VCC (Power Input) → Connect to 5V on the Arduino to supply power to the sensor.
  • GND (Ground) → Connect to GND on the Arduino for a common ground.
  • OUT (Signal Output) → Connect to any digital input pin on the Arduino (e.g., D2).

Why use an IR sensor?

IR sensors provide a contactless way to detect objects, making them ideal for hygiene-focused applications like hand dryers.

2. Connecting the Relay Module to the Arduino

A relay module acts as a switch that allows the Arduino to control high-power devices, such as a fan or heating element.

Wiring the Relay Module to the Arduino

  • VCC (Power Input) → Connect to 5V on the Arduino.
  • GND (Ground) → Connect to GND on the Arduino.
  • IN (Control Pin) → Connect to a digital output pin on the Arduino (e.g., D3).
  • NO (Normally Open Terminal) → Connect to one terminal of the fan or heating element.
  • COM (Common Terminal) → Connect to the positive terminal of the power supply.

Why use a relay module?

The Arduino alone cannot handle high-power loads. The relay module acts as a switch, enabling the Arduino to safely control the fan or heater.

3. Powering the System

To ensure the components receive adequate power, follow these steps:

Powering the Fan or Heating Element

  • 12V Power Supply → Connect the positive terminal to the relay’s COM terminal and the negative terminal to GND.

Powering the Arduino

  • Use a USB cable to connect the Arduino to a computer or a power adapter for stable power.

Important: Never connect the 12V supply directly to the Arduino’s 5V pin, as it could damage the board. Instead, use the VIN pin to safely regulate voltage.

4. Installing the Components in the Hand Dryer

Mounting the IR Sensor

  • Secure the IR sensor near the bottom of the dryer, ensuring it can detect hands accurately.

Setting Up the Fan or Heating Element

  • Position the fan or heater inside the dryer casing, directing airflow toward the user’s hands.
  • Connect the power wires to the relay module.

Uploading the Code to the Arduino

  • Open the Arduino IDE on your computer.
  • Paste the provided Arduino code into a new sketch.
  • Connect the Arduino to your computer using a USB cable.
  • Select the correct board and port in the Arduino IDE.
  • Click the Upload button to transfer the code to the Arduino.

CODE

int irSensor = 2;  // IR sensor connected to digital pin 2

int relay = 3;     // Relay module connected to digital pin 3


void setup() {

  pinMode(irSensor, INPUT);

  pinMode(relay, OUTPUT);

  digitalWrite(relay, LOW); // Ensure the dryer is off at startup

}


void loop() {

  int sensorValue = digitalRead(irSensor);


  if (sensorValue == LOW) { // If a hand is detected

    digitalWrite(relay, HIGH); // Turn on the dryer

  } else {

    digitalWrite(relay, LOW); // Turn off the dryer

  }


  delay(50);

}

CODE EXPLANATION

1. Pin Definitions

int irSensor = 2;  
int relay = 3;
  • irSensor is assigned to pin 2, where the IR sensor sends its detection signal.
  • rel​ay is assigned to pin 3, which controls the hand dryer’s power.

2. setup() Function

void setup() {

  pinMode(irSensor, INPUT);

  pinMode(relay, OUTPUT);

  digitalWrite(relay, LOW);

}

  • pinMode(irSensor, INPUT): Configures the IR sensor pin as an input, allowing the Arduino to read its signals.
  • pinMode(relay, OUTPUT): Sets the relay pin as an output, enabling the Arduino to control the dryer.
  • digitalWrite(relay, LOW): Ensures the dryer remains off when the system starts.

3. Reading Sensor Data and Controlling the Dryer

void loop() {
  int sensorValue = digitalRead(irSensor);

  if (sensorValue == LOW) {
    digitalWrite(relay, HIGH);
  } else {
    digitalWrite(relay, LOW);
  }

  delay(50);
}
  • The IR sensor outputs LOW when an object (a hand) is detected.
  • If sensorValue is LOW, the relay is activated, turning on the dryer.
  • If no hands are detected, the relay is turned off to conserve energy.

4. Adding a Delay for Stability

delay(50);
    • This short delay stabilizes sensor readings and prevents rapid switching, ensuring smooth operation.

How It Works Together

  1. The IR sensor continuously monitors for hand presence.
  2. When a hand is detected, the Arduino activates the relay, turning on the fan or heating element.
  3. When the hand is removed, the dryer turns off, saving power.

OBSERVING FUNCTIONALITY

  1. Normal Operation: When the system is powered up, the Arduino continuously reads the force sensor’s value and prints it on the serial monitor. Under normal conditions, the readings remain below the threshold, and the buzzer remains off.
  2. Intrusion Detection: If someone or something applies sufficient force to the sensor—causing the reading to exceed the threshold—the Arduino immediately calls the triggerAlarm() function. The buzzer is activated, emitting a loud sound to signal a potential intrusion.
  3. Resetting the Alarm: Once the force is removed and the sensor reading drops below the threshold, the Arduino calls the resetAlarm() function, turning the buzzer off. This ensures that the alarm only sounds during genuine intrusion events.

COMMON PROBLEMS AND SOLUTIONS

1. Dryer Not Turning On:

    • Cause: Faulty sensor or incorrect wiring.
    • Solution: Check the sensor wiring and ensure the IR sensor detects objects properly.

2. Relay Clicking But No Airflow:

    • Cause: Incorrect fan or heater wiring.
    • Solution: Verify the relay connections and ensure the fan/heater receives power.

3. Sensor Detecting Hands Too Late or Too Soon:

  • Cause: Poor sensor placement or interference.
  • Solution: Adjust the sensor’s position and reduce interference from reflective surfaces.

Conclusion

This automatic hand dryer project demonstrates the power of contactless automation, enhancing hygiene and convenience. By integrating an IR sensor with an Arduino-controlled relay, the system ensures efficient drying with minimal energy waste. Whether used in restrooms, kitchens, or public spaces, this design showcases how simple electronics can significantly improve everyday experiences.


Comments

OBSTACLE DETECTION ROBOT