DIY Touchless Hand Sanitizer Dispenser

 

Welcome back to another DIY gadget tutorial! Today, we're going to build a touchless hand sanitizer dispenser using an Arduino microcontroller. This project is not only practical but also promotes hygiene by reducing physical contact. It's a simple, affordable project that you can complete with basic electronics knowledge.

Why Go Touchless?

Touchless dispensers minimize the risk of germ transmission. Especially during flu seasons or pandemics, reducing contact with commonly touched surfaces is crucial. Building your own touchless dispenser is cost-effective and customizable to your needs.

What You'll Need

  • Arduino UNO (or any compatible board)
  • Ultrasonic Sensor (HC-SR04)
  • Small water pump or servo motor (for pushing sanitizer)
  • Relay module (if using a pump)
  • 5V power source (battery or USB)
  • Jumper wires
  • Tube for sanitizer
  • Container to hold sanitizer
  • Plastic case/enclosure (optional)

How It Works

The ultrasonic sensor detects a hand placed in front of it. When a hand comes within a certain distance (e.g., 10 cm), the Arduino activates a relay or servo to dispense sanitizer. After a short delay, the system resets and waits for the next hand.

Wiring Diagram

  • HC-SR04 Trig to Arduino pin 9
  • HC-SR04 Echo to Arduino pin 10
  • VCC and GND of sensor to 5V and GND of Arduino
  • Relay IN to Arduino pin 7 (or Servo signal to pin 7)

Sample Code



#define trigPin 9

#define echoPin 10

#define relayPin 7void setup() { pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); pinMode(relayPin, OUTPUT); digitalWrite(relayPin, LOW); Serial.begin(9600); }

void loop() { long duration; int distance;

digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH); distance = duration * 0.034 / 2;

if (distance > 0 && distance < 10) { digitalWrite(relayPin, HIGH); delay(1000); digitalWrite(relayPin, LOW); delay(2000); } } 

Assembly Steps

  1. Connect the ultrasonic sensor and relay to the Arduino as described above.
  2. Place the pump inside the sanitizer container and connect it to the relay.
  3. Use tubing to guide sanitizer from the pump to the dispenser outlet.
  4. Upload the code to your Arduino using the Arduino IDE.
  5. Power your Arduino with a USB cable or 5V adapter.
  6. Test the distance detection and dispensing mechanism.

Tips for Better Design

  • Use a waterproof container and insulate electronics properly.
  • Mount the sensor at an appropriate height (around hand level).
  • Add a reset delay to avoid multiple triggers.
  • Consider a rechargeable power supply for portability.

Safety Precautions

  • Ensure all connections are insulated to prevent short circuits.
  • Use a low-voltage pump suitable for continuous use.
  • Do not let electronics get in contact with the liquid sanitizer.

Conclusion

And there you have it! A simple, functional, and hygienic touchless hand sanitizer dispenser made right at home. Not only is this a fun project, but it’s also practical and highly relevant. If you liked this guide, stay tuned for more DIY gadget tutorials on this blog.

Happy making!

Comments

Popular Posts