Steps to Make Your Own Contactless Sanitizer Dispenser, how to make Contactless Sanitizer Dispenser, Circuit Diagram of Contactless Sanitizer Dispenser code for Contactless Sanitizer Dispenser

Now a days, everyone is aware of the fact that corona virus is spreading exponentially worldwide. We need to protect ourselves from the infected person(s). Earlier we were using manual sanitizers which can’t prevent us from the bacteria/viruses and hence could affect us. There is a high risk of transmission of Corona virus through manual touch of the sanitizer. For example, suppose in public places, when an infected person touches the manual sanitizer, there is a high risk of transmission of viruses to other healthy person. Hence personal safety and health is paramount. Therefore, in order to protect ourselves from getting infected we can use the automating hand sanitizer (touch-free), where there is no need of manual operation; sensor does the work for us by detecting the presence of our hand.


The main objective of this project is to design and implement an IR sensor  based touch free hand sanitizer dispenser.

  • The project’s aim is to avoid manual touch to minimize the spread of bacteria & viruses.
  • Ensuring individual health & hygiene.
  • It is user friendly and economical.


  • It is required everywhere whether it is homes, hotels, schools, universities, factories etc. During this pandemic situation, it is an effective tool to combat the virus.
  • In short, it may be used at every place where person to person contact could be possible. For example consider train/bus, where person comes in contact with everything, it could be handle or berth.
  • It creates sterile environment. 

Components Required


  1. Arduino UNO: The Arduino Uno board is a 8 bit-microcontroller. It has I/0 pins including both digital and analog pins.
    Arduino Uno as a Microcontroller to control the system of Contact free hand sanitizer dispenserBuy it here: Arduino Uno 

  2. Relay Module: It is an electrical switch that is operated by an electromagnet. It has three pins NO (normally open), COM (common) and NC (normally close). It changes it contact accordingly i.e. open or closes so that other electric circuit works properly.
    1 Channel Relay Module Buy it here: 1 Channel Relay Module

  3. 3-6V Mini water pump submersible: It has an easy and simple functioning. Just immerse the pump in water. Suitable pipe needs to be connected to the outlet. Provide the required power i.e. 3-6V to start pumping water.
    3-6V Mini water pump submersible to pump the hand sanitizer from the bottleBuy it here: 3-6V Mini water pump submersible

  4. BC547: The BC547 transistor is an NPN transistor. A transistor is used for amplifying the current.
    BC547 Transistor for amplification of currentBuy it here: BC547 Transistor

  5. Jumpers Wires: It is an electrical wire having connector (pin) at each end which is used for connecting the components. There is no need of soldering if one is using the breadboard for making connections between components in their project.
    Male to male jumper wire, male to female jumper wire, and female to female jumper wire for circuit connectionsBuy it here: Male to male, male to female, and female to female jumper wire

  6. Bread board: It is a rectangular board having mounting holes present everywhere on it in a systematic manner. They are used for creating connections between components. The connections are not permanent and therefore can be removed and placed again.
    830-point bread board to make circuit connection Buy it here: 830-point bread board 

  7. IR sensor: This sensor can be used to detect the motion. It emits the light in order to sense some object of the surroundings.  An IR sensor consists of an IR LED which is transmitter and an IR Photodiode which is the receiver.

    IR Transmitter or IR LED (White one)
    Infrared Transmitter is a light emitting diode (LED) which emits infrared radiations.
    IR Receiver or Photodiode (Black one)
    Infrared receivers or infrared sensors detect the radiation from an IR transmitter.
    IR sensor is used for detecting handBuy it here: IR sensor module 

    The emitter is an IR LED and the detector is an IR photodiode. The IR photodiode is sensitive to the IR light emitted by an IR LED. Photodiode resistance varies according to the light intensity. In other words, it exhibits photoconductivity.


  1. Arduino Software (IDE): It is an open-source Software(IDE) which makes it easy for us to write code and upload it to the Arduino boards. It runs on Windows, Linux etc.


The Contact-less hand sanitizer dispenser is an infrared motion sensor-based dispenser. It is used to dispense any alcohol-based sanitizer. It has a touch-less operation, which makes it convenient for people to use it fearlessly and confidently. It facilitates the sanitization process. You may call it as an automatic or touch-free sanitizer dispenser. When hands are placed in the proximity of the sensor, the infrared sensor detects the object (hand). This is then used as an input for the Arduino Uno. If the object is within the range of IR sensor then the pump gets activated and dispenses the designated amount of sanitizer.

Flow Chart

Flow chart for contact less hand sanitizer dispenser

Circuit Diagram

Connection diagram for contact less hand sanitizer dispenser

Code For Arduino 

int IR_pin = 2 ;
int Relay_pin = 8 ;

void setup()
  pinMode(IR_pin, INPUT);        // IRsensor
  pinMode(Relay_pin, OUTPUT);      // mini - Pump

int readPin=1;

void loop()
  readPin = digitalRead(IR_pin);
  if(readPin == HIGH)
    digitalWrite(Relay_pin, LOW);
    Serial.println("Pump is OFF");
    digitalWrite(Relay_pin, HIGH );
    Serial.println(" Pump is ON");

Serial Output

Serial output when hand is not sensed by IR sensor of contact less hand sanitizer dispenser


Contact-less hand sanitizer dispenser could be used to prevent the spread of viruses/bacteria. I personally, believe there is a high importance of a contact-less hand sanitizers for improving health and well-being of individuals at work or at home not only during the pandemic but for other times and seasons as well. This will ensure the safety of people and hence is the best replacement for manual sanitizers.

Diy projects

Leave a comment

All comments are moderated before being published