• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Get free circuit help 24/7

New Projects | Privacy Policy | About us | Contact | Disclaimer | Copyright | Videos 

You are here: Home / Health Related / Ultrasonic Hand Sanitizer Circuit

Ultrasonic Hand Sanitizer Circuit

Last Updated on October 4, 2020 by Swagatam 3 Comments

The ultrasonic hand sanitizer circuit detects the presence of human hand through reflected ultrasonic waves, and triggers a relay solenoid pump momentarily for dispensing the sanitizing liquid on the hands of the user.

The project uses the popular HC-SR04 ultrasonic sensor module for the required sensing function.

Using HC-SR04

The HC-SR04 ultrasonic sensor module is built usng a couple of specialized ultrasonic transducers rated to work and respond at a frequency of around 40 kHz.

caution electricity can be dangerous

The module has 4 pinouts for configuring into the intended driver circuit.

The supply pinouts are indicated with Vcc and Gnd pins. Where Vcc is the positive 5V input for the module, and the Gnd is supposed to be connected with the negative line of the input power supply.

The trigger pin works with a 10 us pulse which activates the two transducers for transmitting and receiving the reflected ultrasonic wave.

When a series of reflected signals is detected, the "Echo" pin becomes high for initiating the external relay or the solenoid or any preferred load.

Interfacing HC-SR04 with Arduino

In order to process the HC-SR04 module, and enable it to work as a precision ultrasonic proximity detector, we need a microcontroller unit such as an Arduino for the task.

When appropriately programmed with the code as given below, the Arduino becomes compatible with the HC-SR04, for the intended hand proximity detection and activation of sanitizer dispensing mechanism.

The interfacing wiring diagram of the Arduino with HC-SR04 and the relay stage can be seen in the following diagram:

Operational Details

The operational procedure of this ultrasonic hand sanitizer circuit is simple, and can be understood with the following points:

The Arduino provides the 10 us activation pulse to the HC-SR04 modules trigger pulse, which enables the module to send and receive the reflected pulse train from the target, which is the hand of the user.

This reflected data is sent to the rduino from the Echo pin of the HC-SR04 module.

The Arduino process the signal and enables stable DC output at pin7 of the board, which is connected with the relay driver stage via a 10k resistor and a 100uF capacitor.

The pin#7 of Arduino is supposed to stay high as long as the HC-SR04 modules continues to detect the users hand within the set proximity.

This mean the re;ay will also stay switched ON during this period, which we don't want.

To make sure that the relay and the attachwd dispensing mechnaism or pump is actated only for a few seconds, a capacitor is placed in series with the base of the BC547.

When pin#7 becomes high due to the presence of a human hand, the BC547 conducts only for so long as its base 100uF is fully charged, which happens within a couple of seconds.

Once the 100uF is fully charged, the BC547 base is inhibited from the base drive, and it stops conducting, switching OFF the relay and disabling the attached hand sanitizer dispensing mechanism.

When the hand is removed, the HC-SR04 stops sending the Echo signal to the Arduino, which flips its pin#7 to logic zero.

At this point, the 100uF base capacitor starts getting discharged via the Arduino pin#7 and the right side 10k ground resistor.

Program Code

The entire program code for the above discussed ultrasonic hand sanitizer circuit using HC-SR04 and Arduino is given below:


const int trigger = A1;
const int echo = A2;
int vcc = A0;
int gnd = A3;
int OP = 7;
long Time;
float distanceCM;
float distance = 15;  // set threshold distance in cm
float resultCM;
void setup()
{
pinMode(OP,OUTPUT);
pinMode(trigger,OUTPUT);
pinMode(echo,INPUT);
pinMode(vcc,OUTPUT);
pinMode(gnd,OUTPUT);
}
void loop()
{
digitalWrite(vcc,HIGH);
digitalWrite(gnd,LOW);
digitalWrite(trigger,LOW);
delay(1);
digitalWrite(trigger,HIGH);
delayMicroseconds(10);
digitalWrite(trigger,LOW);
Time=pulseIn(echo,HIGH);
distanceCM=Time*0.034;
resultCM=distanceCM/2;
if(resultCM<=distance)
{
digitalWrite(OP,HIGH);
delay(4000);
}
if(resultCM>=distance)
{
digitalWrite(OP,LOW);
}
delay(10);
}

Warning: The proposed ultrasonic hand sanitizer circuit has not been tested practically by the author. The idea was inspired from this article, and modified appropriately for enabling the required momentary ON/OFF function for the dispenser pump, or the solenoid.

You'll also like:

  • 1.  Using UV-C Light Chambers for Disinfecting Humans from Coronavirus
  • 2.  Transcutaneous Nerve Stimulator Circuit
  • 3.  Digital Thermometer Circuit – Uses a Solar Cell for Power
  • 4.  How to Kill Coronavirus with Ozone Gas Generator
  • 5.  Room Air Ionizer Circuit – For Pollution Free Living
  • 6.  Electronic Acupuncture Circuit [Bio-Stimulation Circuit]

About Swagatam

I am an electronic engineer (dipIETE ), hobbyist, inventor, schematic/PCB designer, manufacturer. I am also the founder of the website: https://www.homemade-circuits.com/, where I love sharing my innovative circuit ideas and tutorials.
If you have any circuit related query, you may interact through comments, I'll be most happy to help!

Have Questions? Please Comment below to Solve your Queries! Comments must be Related to the above Topic!!

Subscribe
Notify of
3 Comments
Newest
Oldest
Inline Feedbacks
View all comments

Primary Sidebar

Categories

  • 3-Phase Power (15)
  • 324 IC Circuits (19)
  • 4017 IC Circuits (52)
  • 4060 IC Circuits (26)
  • 555 IC Circuits (99)
  • 741 IC Circuits (20)
  • Arduino Engineering Projects (83)
  • Audio and Amplifier Projects (115)
  • Battery Chargers (83)
  • Car and Motorcycle (94)
  • Datasheets (73)
  • Decorative Lighting (Diwali, Christmas) (33)
  • Electronic Components (101)
  • Electronic Devices and Circuit Theory (36)
  • Electronics Tutorial (120)
  • Fish Aquarium (5)
  • Free Energy (34)
  • Fun Projects (13)
  • GSM Projects (9)
  • Health Related (20)
  • Heater Controllers (29)
  • Home Electrical Circuits (103)
  • How to Articles (20)
  • Incubator Related (6)
  • Industrial Electronics (28)
  • Infrared (IR) (40)
  • Inverter Circuits (98)
  • Laser Projects (12)
  • LED and Light Effect (93)
  • LM317/LM338 (21)
  • LM3915 IC (25)
  • Meters and Testers (66)
  • Mini Projects (149)
  • Motor Controller (67)
  • MPPT (7)
  • Oscillator Circuits (26)
  • PIR (Passive Infrared) (8)
  • Power Electronics (34)
  • Power Supply Circuits (79)
  • Radio Circuits (10)
  • Remote Control (48)
  • Security and Alarm (62)
  • Sensors and Detectors (121)
  • SG3525 IC (5)
  • Simple Circuits (75)
  • SMPS (29)
  • Solar Controllers (61)
  • Timer and Delay Relay (53)
  • TL494 IC (5)
  • Transformerless Power Supply (8)
  • Transmitter Circuits (41)
  • Ultrasonic Projects (16)
  • Water Level Controller (45)

Calculators

  • AWG to Millimeter Converter
  • Battery Back up Time Calculator
  • Capacitance Reactance Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • Inductance Calculator
  • LC Resonance Calculator
  • LM317, LM338, LM396 Calculator
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • Reactance Calculator
  • Small Signal Transistor(BJT) and Diode Quick Datasheet
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator

© 2023 · Swagatam Innovations

wpDiscuz