Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 47

AUTOMATIC HAND SANITITZER

Project Report

Submitted in Partial Fulfillment of


Requirement For The Award of the Degree Of
Bachelors of Technology
(Electronics and Communication Engineering)
To

Himachal Pradesh Technical University, Hamirpur

Submitted by:
Abhishek(18BT020401), Aditya (18BT020402) ,Sahil
(1902042008)

Under the
Supervision of
Er.Sandeep Thakur
(Assistant Professor)

Department of Electronics and Communication


Engineering
Atal Bihari Vajpayee Government Institute of Engineering and
Technology Pragatinagar – 171202, Shimla
January, 2022
DECLARATION
We, Abhishek (18BT020401), Aditya(18BT020402), Sahil (1902042008) student of
Bachelor of Technology (B.Tech) in the department of Electronics and Communication
Engineering, hereby declare that we own the full responsibility for the information, results
etc. provided in this project titled “Automatic Hand Sanitizer” submitted to the Electronics
and Communication Engineering Department, ABVGIET, Pragatinagar for the award of the
degree of (B.Tech). We hereby declare that this project is our own work and effort and that it
has not been submitted anywhere for any award. Where other sources of information have
been used, they have been acknowledged. We have taken care in all respect to honour the
intellectual property right and have acknowledged the contribution of others for using them in
academic purpose. We further declare that in case of violation of intellectual property right or
copyright, we, as the candidate will be fully responsible for violation of any intellectual
property right.

Date: Abhishek(18BT020401)

Place: Aditya(18BT020402)

Sahil(1902042008)

Department of ECE, ABVGIET, Pragatinagar. i


CERTIFICATE

This is to certify that the project work entitled “Automatic Hand Sanitizer”, submitted by,
Abhishek (18BT020401), Aditya (18BT020402), Sahil (1902042008) in the partial fulfilment
of the requirement for the award of degree of Bachelor of Technology in Electronics and
Communication Engineering to Himachal Pradesh Technical University, Hamirpur, is a
record of students own work carried out under our supervision and guidance. To the best
of our knowledge, this project has not been submitted to part or full elsewhere in any other
university or institution for the award of any other degree or diploma. It is further understood
by this certificate that the undersigned do not endorse or approve any statement made,
opinion expressed or conclusion drawn herein, but approve the project only for the purpose
for which it is submitted.

(Er. Sandeep Thakur)

Assistant Professor, ECE

ABVGIET, Pragatinagar (Shimla)

Department of ECE, ABVGIET, Pragatinagar. ii


ACKNOWLEDGEMENT

The satisfaction that accomplishes the successful completion of any task would be incomplete
without the mention of the people who made it possible and whose constant guidance and
encouragement crown all the efforts success.

Perseverance, inspiration and motivation have always played a key role in any venture. It is
not just the brain that matters most, but that which guides them. The character, the heart
generous qualities and progressive forces. What was conceived just as an idea materialized
slowly into concrete facts.

At this level of understanding, it is often difficult to understand the wide spectrum of


knowledge without proper guidance and advice. Hence, we take this opportunity to express
our heartfelt gratitude to our project guide Er. Sandeep Thakur, who had faith in us and
allowed us to work on this project.

We are extremely grateful to our respected Principal Dr. S.N Singh for fostering an excellent
academic climate in our institution. We would like to thank, Er. Sandeep Thakur (OIC
ECE), for his immense interest, valuable guidance, constant inspiration and kind cooperation
throughout the period of work has undertaken, which has been instrumented in the success of
our project.

We would like to thank our professors Er. Ajeet Thakur and Er. Anshika Salaria, for
providing us the useful information related to project making. Their contributions and
technical Support in preparing this report are greatly acknowledged. We also would like to
thank Mr. Gopal Chand and Mr. Mahesh Pant for providing all the equipments which are
needed for the completion of our project.

Last but not the least, we wish to thank our parents for financing our studies in this college,
as well as for constantly encouraging us to learn engineering. Their personal sacrifice in
providing this opportunity to learn engineering gratefully acknowledged.

Department of ECE, ABVGIET, Pragatinagar. iii


ABSTRACT

This project is about Automatic hand sanitizer system. This system consists of an Arduino,
ultra-sonic sensor, servo motor which are the major components of the system. Basic working
of the system is that it has to detect object i.e. in this case human which is done by ultrasonic
sensor and then if someone gets closer enough to the sensor it detects and sends an interrupt to
the Arduino. Then Arduino will turn on the motor which ultimately connected with the sanitizer
which sanitizes hands of a particular person . Hence sanitization of hands is achieved. This less
investment system is suitable for both indoor and outdoor applications.

Department of ECE, ABVGIET, Pragatinagar. iv


TABLE OF CONTENTS

Title Page No.

Declaration i

Certificate ii

Acknowledgement iii

Abstract iv

Table of Contents v

List of Figures vi

List of Tables viii

Chapter 1 Introduction

Chapter 2 Circuit Analysis 5-7

2.1 Block Diagram of Automatic Hand Sanitizer 5


2.2 Schematic Diagram on Proteus Software 6
2.3 Working Principle 7
Chapter 3 Components Description 8-20

3.1 Hardware Components 8


3.2 Hardware Components Description 8
3.2.1 Arduino Uno with integrated Atmega328 microcontroller 9
3.2.2 Ultrasonic sensor 14
3.2.3 Relay 17
3.2.4 Pump 18

Department of ECE, ABVGIET, Pragatinagar. v


3.2.7 Battery 20
3.3HardwareMaterial 22

Chapter 4SoftwareDevelopment 23-29

4.1 Arduino IDE 23


4.2 Steps for uploading the program using Arduino IDE Software 27
Chapter 5SourceCode 30

5.1 Source Code Explanation 30

Chapter 6 Result and Conclusion 35-36

6.1 Result and Conclusion 35


6.2 FutureScope 36
References 37

Department of ECE, ABVGIET, Pragatinagar. vi


LIST OF FIGURES

S.No. Fig.No. Figure Name Page No.


1 2.1 Block Diagram 5
2 2.2 Schematic Diagram on Proteus Software 6
3 3.1 Arduino uno 9
4 3.2 Internal Architecture of ATmega328 microcontroller 12
5 3.3 Ultrasonic Sensor HC-SR04 14
6 3.4 Working of Ultrasonic sensor 15
7 3.5 Timing Diagram 15
8 3.6 Error case of Positioning 16
9 3.7 Ideal case of Positioning 16
10 3.8 Relay 17
11 3.9 Pump 17
12 3.12 Battery 18
13 4.1 Arduino Software 28

Department of ECE, ABVGIET, Pragatinagar. vii


Automatic Hand Sanitizer 2022

Chapter 1

Introduction

The above project aims at developing a “Automatic hand sanitizer system ” based on ultra sonic
sensorOur project consists of Arduino as a microcontroller interfaced with servo motor and
ultrasonic sensor.As we know today the whole world is suffering from corona virus and to brek
the chain one must be sanitized first before and after going to public places or anywhere. For
taking care of this we are making this project.

Hands are considered to be the primary mode of infectious diseases, especially for those living
in close proximity such as college residence halls, shopping malls, bank halls, market areas etc.
Because of the frequent contact with hands and multiple surfaces, the incidence of cross-
contamination is significantly increased.Our project will ultimately sanitize the hands of the
person who is close enough to the system.The aim of this project is to develop a microcontroller
based automatic hand sanitizer system which ultimately sanitizes the hand of people .

DepartmentofECE,ABVGIET,Pragatinagar 1
Automatic Hand Sanitizer 2022

1.1 Overview

The overview of this project is as follows :

Chapter 1- Introduction- In this chapter introduction of Automatic Hand sanitizer objective,


literature survey, objective and application of this project are described.

Chapter 2- Circuit analysis – block diagram and schematic diagram.

In this chapter block diagram in diagram and Proteus simulation is described

Chapter 3- Components description, Hardware components in detail with their specification.

Chapter 4- Software development using Arduino Integrated Development Environment


(IDE).

In this chapter we are going to discuss about Arduino IDE software. It is used for running the
program on microcontroller of Arduino nano for controlling the protype.

Chapter 5- Source Code.

In this chapter, Source code is explained in detail.

Chapter 6 Result and Conclusion.

In this chapter, project result, conclusion and future scope are described.

DepartmentofECE,ABVGIET,Pragatinagar 2
Automatic Hand Sanitizer 2022

Chapter 2
Circuit Analysis

2.1Block diagram of Automatic Hand Sanitizer

Fig.2.1 Block Diagram

The above figure is a overall block diagram of Arduino based Hand Sanitizer

DepartmentofECE,ABVGIET,Pragatinagar 3
Automatic Hand Sanitizer 2022

2.2 SchematicDiagram

The circuit diagram of Automatic Hand Sanitizer Proteus software is given below.

Fig.2.2 Schematic Diagram on Proteus Software

DepartmentofECE,ABVGIET,Pragatinagar 4
Automatic Hand Sanitizer 2022

Working principle

HCSR04 generates pulses continuously and through it out to its line of sight .When we place
our hands for sanitization in between these pulses they will reflect back and received by the
receiver of HCSR04.
When the distance is less than cm the avoiding will be automatically high the
PIN(5),resulting the relay module turns ON which leads to trigger the pump which will
provide sanitization to our hands and when we move our hands away i.e 20cm far the arduino
will give signal to relay and the pump will turn off .
The range of detection of hands is setted as 20cm if distance of object is less then 20cm then
only sanitiser is pumped to hands

DepartmentofECE,ABVGIET,Pragatinagar 5
Automatic Hand Sanitizer 2022

Chapter 3
Components Description

In this chapter we will study the components description in detail.

3.1HardwareComponents

The main modules of the system are as follows:

 Arduino uno board with integrated ATmega 328microcontroller.


 Ultrasonic sensor.
 Battery.
 Relay
 Small pump

3.2 Hardware components Description : In this section, components used in this


project are studied in detail.

3.2.1 Arduino uno with integrated ATmega 328 microcontroller.

Arduino uno : Arduino uno (Fig.3.1) is one type of microcontroller board and it is
designed by Arduino.cc. It is built with microcontroller Atmega328.. It is a small size board
and also flexible with a wide variety of applications. It doesn’t have any DC jack so that the
power supply can be given using a small USB port otherwise straightly connected to the pins
like VCC & GND. This board can be supplied with 6 to 20volts using a mini USB port on the
board.

DepartmentofECE,ABVGIET,Pragatinagar 6
Automatic Hand Sanitizer 2022

DepartmentofECE,ABVGIET,Pragatinagar 7
Automatic Hand Sanitizer 2022

Technical Specifications of Arduino uno Board [9] in belowtable:

Board Name

Microcontroller ATmega 328


USB Connector Mini-B USB
Built-in LED Pin 13
Pins Digital I/O Pins 14
Analog input pins 8
PWM pins 6
UART Yes
Communication I2C Yes
SPI Yes
I/O Voltage 5V
Input voltage 7-12V
Power (nominal)

DC Current per I/O 20mA


Pin
Clock speed Processor Atmega32816M
Hz
Memory ATmega328p 2KB SRAM
32KB
flash 1KB
EEPROM
Weight 5gr
Dimensions Width 18mm
Length 45mm

Table 3.1: Specifications of ArduinoNano

DepartmentofECE,ABVGIET,Pragatinagar 8
Automatic Hand Sanitizer 2022

ATmega 328 microcontroller :

Atmega 328 microcontroller acts as a processor for the Arduino board. Nearly it consists of
28 pins. From these 28 pins, the inputs can be controlled by transmitting and receiving the
inputs to the external device. It also consists of pulse width modulation (PWM). These PWM
are used to transmit the entire signal in a pulse modulation. Input power supply such as Vcc
and ground are used. These IC mainly consists of analog and digital inputs. These analog and
digital inputs are used for the process of certain applications. The working of Arduino
microcontroller is where the proper connection is made checking all the input ports as well as
the power supply connection. The output of the pins can be connected with the external
devices according to their applications. The program to be executed for the applications can
be done by using Arduino software. Then after, these programs can be uploaded through the
Arduino microcontroller by using the USB cable. The purpose of reset button is to reset the
program which means the previous programs are deleted and we can use the Arduino for the
other application purposes. These Arduino ATMEGA-328 microcontrollers can be used for
‘n’ number of applications. These Arduino microcontrollers are widely used in automation
industries for controlling the process and to work the system in an automationmode.

DepartmentofECE,ABVGIET,Pragatinagar 9
Automatic Hand Sanitizer 2022

Archirecture of Atmega328 Microcontroller


The AVR core combines a rich instruction set with 32 general purpose working registers. All
the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two
independent registers to be accessed in one single instruction executed in one clock cycle.
The resulting architecture is more code efficient while achieving throughputs up to ten times
faster than conventional CISC microcontrollers. The ATmega32 provides the following
features: 32K bytes of In-System Programmable Flash Program memory with Read-While-
Write capabilities, 1024 bytes EEPROM, 2K byte SRAM,32 general purpose I/Olines.

Fig.3.2 Internal Architecture of Atmega328 microcontroller

DepartmentofECE,ABVGIET,Pragatinagar 10
Automatic Hand Sanitizer 2022

32 general purpose working registers, a JTAG interface for Boundary-scan, On- chip
Debugging support and programming, three flexible Timer/Counters with compare modes,
Internal and External Interrupts, a serial programmable USART, a byte oriented Two-wire
Serial Interface, an 8-channel, 10-bit ADC with optional differential input stage with
programmable gain (TQFP package only), a programmable Watchdog Timer with Internal
Oscillator, an SPI serial port, and six software selectable power saving modes. The Idle mode
stops the CPU while allowing the USART, Two-wire interface, A/D Converter, SRAM,
Timer/Counters, SPI port, and interrupt system to continue functioning. The Power-down
mode saves the register contents but freezes the Oscillator, disabling all other chip functions
until the next External Interrupt or Hardware Reset. In Power-save mode, the Asynchronous
Timer continues to run, allowing the user to maintain a timer base while the rest of the device
is sleeping. The ADC Noise Reduction mode stops the CPU and all I/O modules except
Asynchronous Timer and ADC, to minimize switching noise during ADC conversions. In
Standby mode, the crystal/resonator Oscillator is running while the rest of the device is
sleeping. This allows very fast start-up combined with low-power consumption. In Extended
Standby mode, both the main Oscillator and the Asynchronous Timer continue to run The
device is manufactured using Atmel’s high density non volatile memory technology. The On-
chip ISP Flash allows the program memory to be reprogrammed in-system through an SPI
serial interface, by a conventional non volatile memory programmer, or by an On-chip Boot
program running on the AVR core. The boot program can use any interface to download the
application program in the Application Flash memory. Software in the Boot Flash section
will continue to run while the Application Flash section is updated, providing true Read-
While-Write operation. By combining an 8-bit RISC CPU with In-System Self-
Programmable Flash on a monolithic chip, the Atmel ATmega32 is a powerful
microcontroller that provides a highly-flexible and cost-effective solution to many embedded
control applications. The ATmega32 AVR is supported with a full suite of program and
system development tools including: C compilers, macro assemblers, program
debugger/simulators, in-circuit emulators, and evaluation kits.

DepartmentofECE,ABVGIET,Pragatinagar 11
Automatic Hand Sanitizer 2022

3.2.2 Ultrasonic Sensor HC-SR04


Ultrasonic sensors have an acoustic transducer which is vibrating at ultrasonic frequencies.
They emit short, high frequency sound pulses at regular intervals. Pulses are emitted in a
cone shaped beam and aimed at target object. They propagate in the air at the velocity of
sound. If they strike an object, then they are reflected back as echo signals to the sensor,
which itself computes the distance to the target based on the time-span between emitting the
signal and receiving the echo. As the distance to an object is determined by measuring the
time of flight and not by the intensity of the sound, ultrasonic sensors are excellent at
suppressing background interference. Virtually all materials which reflect sound can be
detected, regardless of their color. Even transparent materials or thin foils represent no
problem for an ultrasonic sensor. Ultrasonic sensors can see through dust-laden air and ink
mists. Even thin deposits on the sensor membrane do not impair itsfunction.

Fig.3.3 Ultrasonic Sensor


In this project we used three HC-SR04 ultrasonic distance sensor (fig.3.3). This economical
sensor provides 2cm to 400cm of non-contact measurement functionality with a ranging
accuracy that can reach up to 3mm. Each HC-SR04 module includes an ultrasonic
transmitter, a receiver and a control circuit. It consists four pins : VCC (Power), Trig
(Trigger), Echo (Receive), and GND (Ground). Specifecations of HC-SR04 are givenbelow;

 Operates at voltage 5V and current15mA.


 Generates waves at 40 kHz and detects obstacle around 200cm range.
 Sense at an angle of 120degree.
 Speed of ultrasonic waves is around340m/s.

DepartmentofECE,ABVGIET,Pragatinagar 12
Automatic Hand Sanitizer 2022

Fig.3.4 Working of Ultrasonic sensor

Fig.3.5 Timing Diagram

Features :

 Range: 2 cm to 400cm.
 Accurate and Stable rangedata.
 Data loss in Error zoneeliminated.
 Modulation at 40KHz.
 Mounting holes provided on the circuitboard.
 Triggered externally by supplying a pulse to the signalpin.
 5V DC Supply voltage.
 Echo pulse: positive TTL pulse, 87 µs minimum to 30 ms maximum(PWM)
 On Board Burst LED Indicator shows measurement inprogress.
 4-pin header makes it easy to connect using a cable, no solderingrequired.

DepartmentofECE,ABVGIET,Pragatinagar 13
Automatic Hand Sanitizer 2022

Practical Considerations for use :


Object positioning : The ECHO (PWM) sensor cannot accurately measure the distance to an
object : That has its reflective surface at a shallow angle so that sound will not be reflected
back towards the sensor (Angle θ < 90°) or is more than 4 meters away, that is shown below.
It Is too small to reflect enough sound back to the sensor. In addition, if your ECHO (PWM)
sensor is mounted low on your device, you may detect sound reflecting off the floor.
Positioning of Ultrasonic Distance Sensor (PWM) as shown in figure 3.6 and figure 3.7.

Fig. 3.6 Error Case ofPositioning

Fig. 3.7 Ideal Case ofPositioning


Calculations done by host Microcontroller :
 Speed of ultrasonic waves is 340 m/s.WKT, speed =distance/time.
 We need to calculate the distance between the sensor and theobstacle.
 Distance = speed xtime.
 D = (0.0340cm/us x T)/2 (the duration we get is twice as it needs to and from motion
for measuring total time, hence distance is divided by 2 to get the actualdistance).
 D = T/58.82 (T is number of pulses counted multiplied with internal clockfrequency
i.e. 200ns).

DepartmentofECE,ABVGIET,Pragatinagar 14
Automatic Hand Sanitizer 2022

3.2.3 Relay Relay is one kind of electro mechanical that functions as a switch. The relay
coil is energized by DC so that contact switches can be opened or closed. A single
channel 5V relay module generally includes a coil, and two contacts like normally open
(NO) and normally closed (NC).

Fig.3.8 relay

3.2.4  Water pump


Mini submersible water pumps are mostly deployed in household settings, and due to its
size and weight, smaller DC motors are usually coupled with these water pumps.Min
submersible water pumps are very efficient as well because they do not require a lot of
energy to vacuum in water within which they are submerged. 

Fig.3.9 Pump

DepartmentofECE,ABVGIET,Pragatinagar 15
Automatic Hand Sanitizer 2022

3.2.5 Battery

In this project we used two affordable, reliable, 9v lithium-ion with the capacity of 600mah
each. It is a DC battery. Ideally used in many circuits with low power consumption so that it
can work for longer durations.

Fig.3.12 Battery

Since We are using two batteries so the ratings get double and we get more voltage.

Battery Sepcifications are given in below table:

1 Manufacturer Hi-Watt

2 Voltage 9V

3 Capacity 600mAh

4 Power source DC

5 Feature High quality & Durability

6 Battery Type Lithium Ion

7 Discharge 620ohm
Resistance

Table 3.4 Battery Specifications

DepartmentofECE,ABVGIET,Pragatinagar 16
Automatic Hand Sanitizer 2022

Chapter 4
Software Development

In this chapter we are going to discuss about Arduino IDE software. The Arduino IDE
software is used for uploading the program to the microcontroller board.

4.1 ArduinoIDE

The Arduino Integrated Development Environment - or Arduino Software (IDE) - contains a


text editor for writing code, a message area, a text console, a toolbar with buttons for
common functions and a series of menus. It connects to the Arduino and Genuino hardware
to upload programs and communicate withthem.

4.1.1 WritingSketches

Programs written using Arduino Software (IDE) are called sketches. These sketches are
written in the text editor and are saved with the file extension .ino. The editor has features for
cutting/pasting and for searching/replacing text. The message area gives feedback while
saving and exporting and also displays errors. The console displays text output by the
Arduino Software (IDE), including complete error messages and other information. The
bottom righthand corner of the window displays the configured board and serial port. The
toolbar buttons allow you to verify and upload programs, create, open, and save sketches, and
open the serial monitor. Versions of the Arduino Software (IDE) prior to 1.0 saved sketches
with the extension .pde. It is possible to open these files with version 1.0, you will be
prompted to save the sketch with the .ino extension onsave.

The available tools are:

Verify : Checks your code for errors compiling it.

Upload : Compiles your code and uploads it to the configured board. See uploading below for
details. If you are using an external programmer with your board, you can hold down "shift"
key on your computer when using this icon. The text will change to "Upload using
Programmer"

New :Creates a new sketch.

DepartmentofECE,ABVGIET,Pragatinagar 17
Automatic Hand Sanitizer 2022

Open :Presents a menu of all the sketches in your sketchbook. Clicking one will open it
within the current window overwriting its content. Due to a bug in Java,this menu doesn't
scroll; if you need to open a sketch late in the list, use the File Sketchbook menuinstead.

Save : Saves your sketch.

Serial Monitor : Opens the serial monitor.

Additional commands are found within the five menus: File, Edit, Sketch, Tools, Help.The
menus are context sensitive, which means only those items relevant to the work currently
being carried out are available.

4.1.2 File

 New : Creates a new instance of the editor, with the bare minimum structure of a
sketch already inplace.
 Open : Allows to load a sketch file browsing through the computer drives andfolders.
 Open Recent : Provides a short list of the most recent sketches, ready to beopened.
 Sketchbook : Shows the current sketches within the sketchbook folder structure;
clicking on any name opens the corresponding sketch in a new editorinstance.
 Examples : Any example provided by the Arduino Software (IDE) or library shows
up in this menu item. All the examples are structured in a tree that allows easy access
by topic orlibrary.
 Close : Closes the instance of the Arduino Software from which it isclicked.
 Save : Saves the sketch with the current name. If the file hasn't been named before, a
name will be provided in a "Save as."window.
 Save as : Allows to save the current sketch with a differentname.
 Page Setup : It shows the Page Setup window forprinting.
 Print : Sends the current sketch to the printer according to the settings defined in Page
Setup.
 Preferences : Opens the Preferences window where some settings of the IDE may be
customized, as the language of the IDEinterface.
 Quit : Closes all IDE windows. The same sketches open when Quit was chosen will
be automatically reopened the next time you start theIDE.

DepartmentofECE,ABVGIET,Pragatinagar 18
Automatic Hand Sanitizer 2022

4.1.3 Edit

 Undo / Redo : Goes back of one or more steps you did while editing; when you go
back, you may go forward withRedo.
 Cut : Removes the selected text from the editor and places it into theclipboard.
 Copy :Duplicates the selected text in the editor and places it into theclipboard.
 Copy for Forum : Copies the code of your sketch to the clipboard in a form suitable
for posting to the forum, complete with syntaxcoloring.
 Copy as HTML : Copies the code of your sketch to the clipboard as HTML, suitable
for embedding in webpages.
 Paste : Puts the contents of the clipboard at the cursor position, in theeditor.
 Select All : Selects and highlights the whole content of theeditor.
 Comment / Uncomment : Puts or removes the // comment marker at the beginning of
each selectedline.
 Increase / Decrease Indent : Adds or subtracts a space at the beginning of each
selected line, moving the text one space on the right or eliminating a space at the
beginning.
 Find : Opens the Find and Replace window where you can specify text to search
inside the current sketch according to severaloptions.
 Find Next : Highlights the next occurrence - if any - of the string specified as the
search item in the Find window, relative to the cursorposition.
 Find Previous : Highlights the previous occurrence - if any - of the string specified as
the search item in the Find window relative to the cursorposition.

4.1.4 Sketch

 Verify/Compile : Checks your sketch for errors compiling it; it will report memory
usage for code and variables in the consolearea.
 Upload : Compiles and loads the binary file onto the configured board through the
configuredPort.
 Upload using the programmer : This will overwrite the bootloader on the board; you
will need to use Tools > Burn Bootloader to restore it and be able to Upload to USB
serial port again. However, it allows you to use the full capacity of the Flash memory
for your sketch. Please note that this command will NOT burn the fuses. To do so a
Tools -> Burn Bootloader command must beexecuted.

DepartmentofECE,ABVGIET,Pragatinagar 19
Automatic Hand Sanitizer 2022

 Export Compiled Binary : Saves a .hex file that may be kept as archive or sent to the
board using othertools.
 Show Sketch Folder : Opens the current sketch folder.
 Include Library : Adds a library to your sketch by inserting #include statements at the
start of your code. For more details, see libraries below. Additionally, from this menu
item you can access the Library Manager and import new libraries from .zipfiles.
 Add File : Adds a source file to the sketch (it will be copied from its current location).
The new file appears in a new tab in the sketch window. Files can be removed from
the sketch using the tab menu accessible clicking on the small triangle icon below the
serial monitor one on the right side o thetoolbar.

4.1.5 Tools

 AutoFormat :This formats your code nicely: i.e. indents it so that opening and closing
curly braces line up, and that the statements inside curly braces are indentedmore.
 ArchiveSketch :Archives a copy of the current sketch in .zip format. The archive is
placed in the same directory as thesketch.
 FixEncoding&Reload :Fixes possible discrepancies between the editor char map
encoding and other operating systems charmaps.
 SerialMonitor :Opens the serial monitor window and initiates the exchange of data
with any connected board on the currently selected Port. This usually resets the board,
if the board supports Reset over serial portopening.
 Board :Select the board that you're using. See below for descriptions of the various
boards.
 Port :This menu contains all the serial devices (real or virtual) on your machine. It
should automatically refresh every time you open the top-level toolsmenu.
 Programmer :For selecting a harware programmer when programming a board or chip
and not using the onboard USB-serial connection. Normally you won't need this, but
if you're burning a bootloader to a new microcontroller, you will usethis.
 BurnBootloader :The items in this menu allow you to burn a bootloader onto the
microcontroller on an Arduino board. This is not required for normal use of an
Arduino or Genuino board but is useful if you purchase a new ATmega
microcontroller (which normally come without a bootloader). Ensure that you've
selected the correct board from the Boards menu before burning the bootloader on the
target board. This command also set the rightfuses.

DepartmentofECE,ABVGIET,Pragatinagar 20
Automatic Hand Sanitizer 2022

4.1.6 Help

Here you find easy access to a number of documents that come with the Arduino Software
(IDE). You have access to Getting Started, Reference, this guide to the IDE and other
documents locally, without an internet connection.

Find in Reference : This is the only interactive function of the Help menu: it directly selects
the relevant page in the local copy of the Reference for the function or command under the
cursor.

4.1.7 Sketchbook

The Arduino Software (IDE) uses the concept of a sketchbook: a standard place to store your
programs (or sketches). The sketches in your sketchbook can be opened from the File >
Sketchbook menu or from the Open button on the toolbar. The first time you run the Arduino
software, it will automatically create a directory for your sketchbook. You can view or
change the location of the sketchbook location from with the Preferences dialog. Beginning
with version 1.0, files are saved with a .ino file extension. Previous versions use the .pde
extension. You may still open .pde named files in version 1.0 and later, the software will
automatically rename the extension to .ino.

4.1.8 Tabs, Multiple Files AndCompilation

Allows you to manage sketches with more than one file (each of which appears in its own
tab). These can be normal Arduino code files (no visible extension), C files (.c extension),
C++ files (.cpp), or header files (.h).

4.2 Steps for uploading the program using ArduinoIDE

After following the appropriate steps for installing software, we are now ready to test first
program with Arduino board.

 Launch the Arduinoapplication.


 Connect the Arduino board withcomputer.
 Open the blink example sketch by going to: File > Examples > 1. Basic >Blink.

DepartmentofECE,ABVGIET,Pragatinagar 21
Automatic Hand Sanitizer 2022

 Select the type of Arduino board using Tools > Board > ArduinoNano

Fig.4.1 Arduino Software

 Select the Serial/COM port that Arduino is attached to : Tools > Port >
COMMxx.
 After selecting the port, check the code by compiling it using tickarrow.

DepartmentofECE,ABVGIET,Pragatinagar 22
Automatic Hand Sanitizer 2022

 Now if the code is correct then it will show ‘DoneCompiling’.


 After Compiling the sketch upload using uploadSymbol.

Fig.4.2 Blink Centre

 After uploading, onboard LEDs on Arduino starts flashing, followed by the message
‘Done Uploading’ in the status bar of the BlinkSketch.

DepartmentofECE,ABVGIET,Pragatinagar 23
Automatic Hand Sanitizer 2022

Chapter5

SourceCode

5.1 Explanation

Program:
long duration; // variable for the duration of sound wave travel
int distance; // variable for the distance measurement

void setup() {
pinMode(trigPin, OUTPUT); // Sets the trigPin as an OUTPUT
pinMode(echoPin, INPUT); // Sets the echoPin as an INPUT
pinMode(5, OUTPUT);
Serial.begin(9600); // Serial Communication is starting with 9600 of baudrate speed
Serial.println("Ultrasonic Sensor HC-SR04 Test"); // print some text in Serial Monitor
Serial.println("with Arduino UNO R3");
}
void loop() {

digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Sets the trigPin HIGH (ACTIVE) for 10 microseconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = duration * 0.034 / 2; // Speed of sound wave divided by 2 (go and back)
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
if (distance >= 20 || distance <= 0)
{
Serial.println("no object detected");
digitalWrite(5,HIGH);
}
else {
Serial.println("object detected \n");
Serial.print("distance= ");
Serial.print(distance); //prints the distance if it is between the range 0 to 200
digitalWrite(5,LOW);

DepartmentofECE,ABVGIET,Pragatinagar 24
Automatic Hand Sanitizer 2022

Result And Conclusion

An automatic sanitizer dispensing machine designed and developed. Based on the testing result
and discussion, it can be concluded that the results of the automatic hand sanitizer testing can run
smoothly with a minimum detection error of transferring data. Ultrasonic sensor can send data to
the MCU.

Future Modifications
A huge portion of modifications can be added to changing current components to more energy
efficient technology Increasing or decreasing the size of the hand washing mechanism may be one
way to modify the design in order to accommodate for different circumstances. Downsizing the
machine and obtaining an outside power source for those parts that need them could be a
modification used in disaster relief efforts, or in the desolate regions in Africa where no power is, in
the Arctic on expeditions, in a submarine whose power may be limited and no trash is wanted, etc

DepartmentofECE,ABVGIET,Pragatinagar 25
Automatic Hand Sanitizer 2022

References

 www.arduino.ccand Google serach engine for images and information regarding the
modules.

 .
https://www.researchgate.net/publication/344076028_Novel_design_of_automatic_saniti
zer_dispenser_machine_based_on_ultrasonic_sensor.

 https://create.arduino.cc/projecthub/akshayjoseph666/covid-19-automatic-hand-sanitizer-
78cf6b.

DepartmentofECE,ABVGIET,Pragatinagar 26
Automatic Hand Sanitizer 2022

Applications

This project finds applications in various fields some of them are given below
1. Public place

2. Hospitals

3. School & Collages

4. Industries & Offices

Guide to implementation of
the WHO multimodal hand
hygiene improvement
strategy.
Available from:
http://www.who.int/patients
afety/en/ , accessed on
August 24, 2010.
Guide to implementation of
the WHO multimodal hand
DepartmentofECE,ABVGIET,Pragatinagar 27
Automatic Hand Sanitizer 2022

hygiene improvement
strategy.
Available from:
http://www.who.int/patients
afety/en/ , accessed on
August 24, 2010.
Guide to implementation of
the WHO multimodal hand
hygiene improvement
strategy.
Available from:
http://www.who.int/patients
afety/en/ , accessed on
August 24, 2010.
DepartmentofECE,ABVGIET,Pragatinagar 28
Automatic Hand Sanitizer 2022

Guide to implementation of
the WHO multimodal hand
hygiene improvement
strategy.
Available from:
http://www.who.int/patients
afety/en/ , accessed on
August 24, 2010.
Guide to implementation of
the WHO multimodal hand
hygiene improvement
strategy.
Available from:
http://www.who.int/patients
DepartmentofECE,ABVGIET,Pragatinagar 29
Automatic Hand Sanitizer 2022

afety/en/ , accessed on
August 24, 2010.
Guide to implementation of
the WHO multimodal hand
hygiene improvement
strategy.
Available from:
http://www.who.int/patients
afety/en/ , accessed on
August 24, 2010.
Guide to implementation of
the WHO multimodal hand
hygiene improvement
strategy.
DepartmentofECE,ABVGIET,Pragatinagar 30
Automatic Hand Sanitizer 2022

Available from:
http://www.who.int/patients
afety/en/ , accessed on
August 24, 2010.
Guide to implementation of
the WHO multimodal hand
hygiene improvement
strategy.
Available from:
http://www.who.int/patients
afety/en/ , accessed on
August 24, 2010.
Guide to implementation of
the WHO multimodal hand
DepartmentofECE,ABVGIET,Pragatinagar 31
Automatic Hand Sanitizer 2022

hygiene improvement
strategy.
Available from:
http://www.who.int/patients
afety/en/ , accessed on
August 24, 2010.
Guide to implementation of
the WHO multimodal hand
hygiene improvement
strategy.
Available from:
http://www.who.int/patients
afety/en/ , accessed on
August 24, 2010.
DepartmentofECE,ABVGIET,Pragatinagar 32
Automatic Hand Sanitizer 2022

Guide to implementation of
the WHO multimodal hand
hygiene improvement
strategy.
Available from:
http://www.who.int/patients
afety/en/ , accessed on
August 24, 2010.
Guide to implementation of
the WHO multimodal hand
hygiene improvement
strategy.
Available from:
http://www.who.int/patients
DepartmentofECE,ABVGIET,Pragatinagar 33
Automatic Hand Sanitizer 2022

afety/en/ , accessed on
August 24, 2010.
Guide to implementation of
the WHO multimodal hand
hygiene improvement
strategy.
Available from:
http://www.who.int/patients
afety/en/ , accessed on
August 24, 2010.
Guide to implementation of
the WHO multimodal hand
hygiene improvement
strategy.
DepartmentofECE,ABVGIET,Pragatinagar 34
Automatic Hand Sanitizer 2022

Available from:
http://www.who.int/patients
afety/en/ , accessed on
August 24, 2010.

DepartmentofECE,ABVGIET,Pragatinagar 35
Automatic Hand Sanitizer 2022

consumption is low and


the system can help to
achieve contactless
sanitizer
dispenser. It reduces the risk
of community transmission
of the virus
consumption is low and
the system can help to
achieve contactless
sanitizer
dispenser. It reduces the risk
of community transmission
of the virus
DepartmentofECE,ABVGIET,Pragatinagar 36
Automatic Hand Sanitizer 2022

consumption is low and


the system can help to
achieve contactless
sanitizer
dispenser. It reduces the risk
of community transmission
of the virus
consumption is low and
the system can help to
achieve contactless
sanitizer
dispenser. It reduces the risk
of community transmission
of the virus
consumption is low and
DepartmentofECE,ABVGIET,Pragatinagar 37
Automatic Hand Sanitizer 2022

the system can help to


achieve contactless
sanitizer
dispenser. It reduces the risk
of community transmission
of the virus
consumption is low and
the system can help to
achieve contactless
sanitizer
dispenser. It reduces the risk
of community transmission
of the virus
consumption is low and
the system can help to
DepartmentofECE,ABVGIET,Pragatinagar 38
Automatic Hand Sanitizer 2022

achieve contactless
sanitizer
dispenser. It reduces the risk
of community transmission
of the virus
consumption is low and
the system can help to
achieve contactless
sanitizer
dispenser. It reduces the risk
of community transmission
of the virus

DepartmentofECE,ABVGIET,Pragatinagar 39

You might also like