Utkarsh Srivastava
Published

Touchless Soap/ Sanitizer Dispenser

Bored of pressing your dispenser and want to get rid? So, get out of the box cause this is going to help you, Just put your hand and ye!!!.

IntermediateShowcase (no instructions)1.5 hours491
Touchless Soap/ Sanitizer Dispenser

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×2
Solderless Breadboard Half Size
Solderless Breadboard Half Size
×1
Jumper wires (generic)
Jumper wires (generic)
×1
easySensors Infrared Obstacle Avoidance IR Sensor Module
×1
USB-A to B Cable
USB-A to B Cable
×1
Connector Adapter, DC Power - 2.1mm
Connector Adapter, DC Power - 2.1mm
×1
9V battery (generic)
9V battery (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Tape, Double Sided
Tape, Double Sided
Thread
Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Schematics

AUTOMATIC HAND WASH DISPENSER

This is the Schematics for this project.

Code

AUTOMATIC HAND WASH DISPENSER

C/C++
This is the code for the Arduino Uno for this project. Copy and paste this sketch.
/* *******************AUTOMATIC HAND WASH DISPENSER****************** */
#include <Servo.h>
Servo servo1; // at pin 2
Servo servo2; // at pin 3

int irPin = 4; // IR sensor at pin 4
int sensorOut = HIGH; // HIGH at No obstacle

void setup() {
  servo1.attach(2);
  servo2.attach(3);
  Serial.begin(9600);
  while(Serial.available())
  Serial.read();
  servo1.write(0); // Put servo1 at home position
  servo2.write(0); // Put servo2 at home position

}

void loop() {
  sensorOut = digitalRead(irPin);
  if(sensorOut == LOW)
  {
    Serial.println("Hand Detected!!");
    servo1.write(120);
    servo2.write(120);
    delay(10);
    servo1.write(0);
    servo2.write(0);
    delay(10);
  }
  else
  {
    Serial.println("Waiting for your hand :)");
    servo1.write(0);
    servo2.write(0);
  }
}

Credits

Utkarsh Srivastava
2 projects • 2 followers

Comments