You are on page 1of 48

Automatic Hand Sanitizer Container to Prevent the Spread of Corona Virus

Disease
ABSTRACT

COVID pandemic has influenced human life in various sectors. Various attempts were made to reduce
the virus transferring by work from home, social distancing, and also including hand hygiene. So far,
most of the available hand sanitizers do not operate automatically. This article aims to make an
automatic hand sanitizer where soap and water can come out automatically. Besides that, automated
hand sanitizer will make notification to the owner, if the liquid has run out to the smartphone. The
infrared (IR) will sense the presence of heat and motion of the object with the distance up to 50mm. It
send data to the Arduino Nano to activate the pump. If the ultrasonic sensor detect the distance of
water to he sensor 35 cm it will send data to node MCU that connect to Blink server. It can transfer the
data to the output devices such as smartphones or PC based on the Internet of Things (IoT). The results
of the hand sanitizer testing that the system can run smoothly with a minimum detection error of
transferring data.

Keywords— Automatic hand sanitizer, Infrared sensor, Ultrasonic sensor

1. INTRODUCTION

In early 2020, a virus emerged that was spreading rapidly to several countries. The first case related to
the virus was reported in Wuhan, Hubei Province [1]. WHO named this disease the 2019 novel
coronavirus (2019-nCoV), then changed its name to Coronavirus Disease (COVID-19) which was caused
by the virus of Severe Acute Respiratory Syndrome Coronavirus-2 (SARS-Cov-2) [2]. This virus is zoonotic
(a virus that is transmitted between animals and humans) and originates from bats [3]. Besides, this
virus can also be transmitted from humans to humans [4]. Coronavirus can be transmitted either by air,
direct contact, or indirectly. However, it is most commonly spread by droplets. Symptoms caused by this
virus include the mild flu, namely a cold, sore throat, cough, fever, and difficulty breathing. In severe
cases, Covid-19 can manifest as pneumonia. Patients can develop acute respiratory distress syndrome
for a short time and die from multiple organ failure [5]. The existence of this disease has a big impact on
both socials and economics. WHO has declared this a pandemic disease and many cities around the
world are in a lockdown situation. To prevent the cause of this virus, it can be done by keeping a
distance at least 1 meter, avoid going to crowded places, avoid touching the eyes, mouth, and nose
when outside, and cleaning hands with soap or alcohol-based hand rub [6]. Providing containers for
cleaning fluids in public spaces is a form of Covid-19 prevention, but the provision of containers is
currently ineffective because there are parts that are often touched. This could be a point of
transmission for Covid-19. Many health actions are carried out using automatic systems including air
quality monitoring [7], hand sanitizers [8][9], hand hygiene [10],[11]. Hand sanitizers are an alternative
for washing hands during a pandemic. It can be used when and water are not available. Hand sanitizer is
also available in several forms such as liquid (spray) or gel [12]. Hand sanitizer is usually made from
materials such as alcohol, polyacrylic acid, glycerin, propylene glycol, or plant extracts [13]-[14]. The
process of killing germs starts with removing the oil on the skin, then the bacteria in the body will come
to the surface. Soap or alcohol will kill bacteria after rubbing to your hand. Hand sanitizer is effective
against Covid-19 [15]. So far, most of the available hand sanitizers do not operate automatically. This
article aims to make an automatic hand sanitizer where soap and water can come out automatically.
Besides that, automated hand sanitizer will make notification to the owner, if the liquid has run out to
the smartphone. The infrared (IR) will sense the presence of heat and motion of the object and send
data to the Arduino Uno so that it can activate the pump. If the water height is less than 10 cm, the
ultrasonic sensor will send data to node ESC8266 as a Wifi microcontroller to the output devices such as
smartphones or PC based on the Internet of Things (IoT). The results of the hand sanitizer testing that
the system can run smoothly with a minimum detection error of transferring data.

2. METHODS

Several steps were carried out in this research to test the Automatic hand sanitizer container has shown
in Figure.1. Due to the spread of Covid desease, first we analyse the importance of environment needed
for automatic hand sanitizer. The second step we make the literature study about the related article. We
design the hardware, examine the product and report the result.

Figure 1. Flowchart Automatic hand sanitizer container


2.1 System Design

Figure 2 demonstrates the design of the Automatic hand sanitizer container system consisting of block
an infrared sensor and an ultrasonic sensor. If the infrared sensor sense the motion of hand, it will send
data to Arduino. Arduino send data to the relay to activate the water pump. If the distance of water
from sensor up to 35 cm in the clean water container, the sensor will send data to Arduino. Arduino will
transfer data to the node MCU as connectivity to a Blynk server. The Blynk App connected to the node
MCU. It sends a notification to the user that the water is empty.

2.2 Hardware Design

The circuit scheme can be shown in Figure 3 and Figure 4.

The circuit in this research has two systems that can work simultaneously. In Figure 3, if infrared (IR)
senses heat and motion of objects, it will send data to the Arduino nano so that it can activate the spray
pump and the cleaner reaches the hand through a small pipe.
The sensor connected to the Arduino will start working when the device is activated. The ultrasonic
sensor in this circuit is used to detect the distance to an object. The circuit in Figure 4 works when the
water level is less than 10 cm, the ultrasonic sensor will send data to the node MCU which will then be
sent to an output device such as a PC or smartphone as a Wifi microcontroller.

FLOW CHART

flow chart of the Automatic hand sanitizer container which will automatically dispense water and fill the
tank for the hand sanitizer process.

Figure 5. Flow chart automatic hand sanitizer container The flow chart shows a program that is loaded
into the microcontroller. Figure 5 is a flow chart of the Arduino software design. Arduino software will
process the input data that has been obtained. The reading data from the infrared sensor and the
ultrasonic sensor will be sent to the controller.
Sequence diagram
INPUT SYSTEM OUTPUT

LCD16X2
ULTRASONIC
SENSOR1

DCPUMP/solenoid
Arduino
valve
ULTRASONIC UNO
SENSOR2

Notification
WIFI(Node MCU)

IOT Platform
Use case Diagram

Connect wifi

Connect hardware to blynk

Read sensor data

Check Notification

Visual the data and analyse


LOW LEVEL DESIGN

A level-1 IoT system has a single node/device that performs sensing and/or actuation, stores
data, performs analysis and hosts the application. Level-1 IoT systems are suitable for modelling
low- cost and low-complexity solutions where the data involved is not big and the analysis
requirements are not computationally intensive
A level-2 IoT system has a single node that performs sensing and/or actuation and local
analysis. Data is stored in the cloud and the application is usually cloud-based.

• Level-2 IoT systems are suitable for solutions where the data involved is big; however, the
primary analysis requirement is not computationally intensive and can be done locally.
A level-3 IoT system has a single node. Data is stored and analyzed in the cloud and the
application is cloudbased. Level-3 IoT systems are suitable for solutions where the data involved
is big and the analysis requirements are computationally intensive.
Hardware Specifications

Wi-Fi MODULE

Esp8266 D1 Mini NodeMCU Wifi Development Board is an Arduino Compatible mini wifi board
with 4MB flash based on ESP8266EX. The board is with 11 digital input/output pins, all pins
have interrupt/PWM/I2C/one-wire supported(except D0) 1 analog input(3.3V max input) and a
Micro USB connection.

The development board features WiFi-SoC ESP8266 and is made for fast Internet-of-Things (IoT)
prototyping. It is flashed with the latest firmware version and can be set up and programmed
right away with the onboard micro USB connection. With only a few lines of code, the
NodeMCU Dev Kit connects to your local network and ready for control by other network
members like computers and smartphones.

The D1 mini is an ESP8266 development board that is compact, versatile and very easy to use
with the Arduino IDE. It supports natively by the Expressive SDK.
Features of Esp8266 D1 Mini Node MCU Wifi  Development Board:

 
Use BRT (Bias Resistor Transistor)
Easier into flash mode.
30% increase in radiating area
Good stability.
11 digital input/output pins, all pins have interrupt/pwm/I2C/one-wire supported(except for
D0)
1 analog input(3.2V max input)
Micro USB connection
Compatible with Arduino
Compatible with nodemcu
Support OTA wireless uploading
11 x I/O pins,1 x ADC pin
Specifications of Esp8266 D1 Mini Node MCU Wifi  Development Board:

 
Microcontroller ESP-8266EX
Operating Voltage 3.3 V
Digital I/O Pins 11
Analog Input Pins 1(Max input: 3.2V)
Clock Speed 80MHz/160MHz
Flash 4M bytes
Length 34.2mm
Width 25.6mm

The ESP8266 is a very user friendly and low cost device to provide internet connectivity to your
projects. The module can work both as a Access point (can create hotspot) and as a station (can
connect to Wi-Fi), hence it can easily fetch data and upload it to the internet making Internet of
Things as easy as possible. It can also fetch data from internet using API’s hence your project
could access any information that is available in the internet, thus making it smarter. Another
exciting feature of this module is that it can be programmed using the Arduino IDE which makes
it a lot more user friendly. However this version of the module has only 2 GPIO pins (you can
hack it to use upto 4) so you have to use it along with another microcontroller like  Arduino, else
you can look onto the more standalone ESP-12 or ESP-32 versions. So if you are looking for
a module to get started with IOT or to provide internet connectivity to your project then this
module is the right choice for you.
 

How to use the ESP8266 Module


There are so many methods and IDEs available to with ESP modules, but the most commonly
used on is the Arduino IDE. So let us discuss only about that further below.
The ESP8266 module works with 3.3V only, anything more than 3.7V would kill the module
hence be cautions with your circuits. The best way to program an ESP-01 is by using the FTDI
board that supports 3.3V programming. If you don’t have one it is recommended to buy one or
for time being you can also use an Arduino board. One commonly problem that every one faces
with ESP-01 is the powering up problem. The module is a bit power hungry while programming
and hence you can power it with a 3.3V pin on Arduino or just use a potential divider. So it is
important to make a small voltage regulator for 3.31v that could supply a minimum of 500mA.
One recommended regulator is the LM317 which could handle the job easily. A simplified
circuit diagram for using the ESP8266-01 module is given below

The switch SW2 (Programming Switch) should be held pressed to hold the GPIO-0 pin to
ground. This way we can enter into the programming mode and upload the code. Once the
code is released the switch can be released.
 

Applications

 IOT Projects
 Access Point Portals
 Wireless Data logging
 Smart Home Automation
 Learn basics of networking
 Portable Electronics
 Smart bulbs and Sockets
 

Fig-3:ESP8266 Wi-Fi module


Active Passive Buzzer

 
Active Passive Buzzer
Active Passive Buzzer Pinout
Buzzer Pin Configuration

Pin Number Pin Name Description

1 Positive Identified by (+) symbol or longer


terminal lead. Can be powered by 6V DC 
2 Negative Identified by short terminal lead.
Typically connected to the ground of the
circuit

 
Buzzer Features and Specifications
Rated Voltage: 6V DC
Operating Voltage: 4-8V DC
Rated current: <30mA
Sound Type: Continuous Beep
Resonant Frequency: ~2300 Hz 
Small and neat sealed package
Breadboard and Perf board friendly
 
Equivalents for Passive Buzzer
Piezo Electric buzzer, Speaker, Active Passive Buzzer with Module
 
How to use a Buzzer
A buzzer is a small yet efficient component to add sound features to our project/system. It is
very small and compact 2-pin structure hence can be easily used on breadboard, Perf Board and
even on PCBs which makes this a widely used component in most electronic applications.
There are two types are buzzers that are commonly available. The one shown here is a simple
buzzer which when powered will make a Continuous Beeeeeeppp.... sound, the other type is
called a readymade buzzer which will look bulkier than this and will produce a Beep. Beep.
Beep. Sound due to the internal oscillating circuit present inside it. But, the one shown here is
most widely used because it can be customised with help of other circuits to fit easily in our
application.
This buzzer can be used by simply powering it using a DC power supply ranging from 4V to 9V. A
simple 9V battery can also be used, but it is recommended to use a regulated +5V or +6V DC
supply. The buzzer is normally associated with a switching circuit to turn ON or turn OFF the
buzzer at required time and require interval.
 
Applications of Buzzer
Alarming Circuits, where the user has to be alarmed about something
Communication equipments
Automobile electronics
Portable equipments, due to its compact size
 
2D Model of Buzzer

I2C Serial Interface Adapter Module for LCD


 

I2C Serial Interface Adapter Module

I2C Serial Interface Adapter Module Pinout

Due to limited pin resources in a microcontroller/microprocessor, controlling an LCD


panel could be tedious. Serial to Parallel adapters such as the I2C serial interface adapter
module with PCF8574 chip makes the work easy with just two pins. The serial interface
adapter can be connected to a 16x2 LCD and provides two signal output pins (SDA and
SCL) which can be used to communicate with an MCU/MPU.

Features and Specifications of I2C Serial Interface Adapter Module

This section mentions some of the features and specifications of the I2C Serial Interface
Adapter Module.

1. Operating Voltage: 5V DC
2. I2C control using PCF8574
3. Can have 8 modules on a single I2C bus
4. I2C Address: 0X20~0X27 (the original address is 0X20, you can change it yourself via the
onboard jumper pins)

 
Pin Configuration of I2C Serial Interface Adapter Module

The module has multiple pins onboard for communication with the MCU/MPU via the
I2C protocol. The table below shows the pin name, type, and their functions.

Pin Name Pin Type Pin Description

GND Power Ground

VCC Power Voltage Input

SDA I2C Data Serial Data

SCL I2C Clock Serial Clock

A0 Jumper I2C Address Selection 1

A1 Jumper I2C Address Selection 2

A2 Jumper I2C Address Selection 3

Backlight Jumper Control Backlight of panel

Note: The module has an onboard potentiometer to vary the contrast of the display.

 
Addressing Table of I2C Serial Interface Adapter Module

Up to 8 devices can be connected on a single I2C bus. The address of each can be
changed using the solder points provided on the board(A0, A1, A2). The table below
shows how the address is set using the points A0, A1, A2.

A0 A1 A2 Address

Open Open Open 0x27

Jumper Open Open 0x26

Open Jumper Open 0x25

Jumper Jumper Open 0x24

Open Open Jumper 0x23

Jumper Open Jumper 0x22

Open Jumper Jumper 0x21

Jumper Jumper Jumper 0x20

 
Connecting I2C Serial Interface Adapter Module to an MCU/MPU

The I2C serial adapter can be connected to 16x2 or 20x4 LCD displays via breakout pins.
Once it fits perfectly onto the LCD, we can connect the module to any MCU/MPU using
I2C protocol pins.

The power points VCC and GND can be connected to the 5V and the ground terminal of
the MCU/MPU, respectively. Also, connect the SDA, SCL pins of the module to the
MCU/MPU I2C pins respectively to send the data.

Alternatives for I2C Serial Interface Adapter Module

PCF8574T, MCP23017
 

Applications of I2C Serial Interface Adapter Module

Here are some of the applications of the I2C Serial Interface Adapter Module.

1. Serial to parallel data adapter


2. Robots
3. LCD Displays

2D Model of I2C Serial Interface Adapter Module

Below is the 2D model of the I2C Serial Interface Adapter Module along with its
dimensions in millimeters. The following information can be used to design custom
footprints of the module for PCB designing and CAD modelling.
5V Dual-Channel Relay Module

 
5V Dual-Channel Relay Module
Dual-Channel Relay Module Pinout
The dual-channel relay module is more or less the same as a single-channel relay module, but with some
extra features like optical isolation. The dual-channel relay module can be used to switch mains
powered loads from the pins of a microcontroller.
 
Dual-Channel Relay Module Pinout

Pin Number Pin Name Description

1 JD-VCC Input for isolated power supply for relay coils


2 VCC Input for directly powering the relay coils

3 GND Input ground reference

4 GND Input ground reference

5 IN1 Input to activate the first relay

6 IN2 Input to activate the second relay

7 VCC VCC to power the optocouplers, coil drivers, and associated circuitry

 
Dual-Channel Relay Module Specifications

 Supply voltage – 3.75V to 6V


 Trigger current – 5mA
 Current when relay is active - ~70mA (single), ~140mA (both)
 Relay maximum contact voltage – 250VAC, 30VDC
 Relay maximum current – 10A
 
Alternate Relay Modules
Single-channel relay module, four-channel relay module, eight-channel relay module.
 
Alternate Modules for AC switching
Solid State Relay module, SCRs, TRIACs
 
Components present on a 5V Dual Channel Relay Module
The following are the major components that would find on a Dual channel Relay module, we will
discuss them in detail further in this article.
5V Relay, Optocoupler, Diodes, Transistors, Resistors, LEDs, Male Headers, 3-pin Terminal connectors,
etc.
 Understanding 5V Dual-Channel Relay Module
The dual-channel relay module contains switching relays and the associated drive circuitry to make it
easy to integrate relays into a project powered by a microcontroller. On the left are two terminal blocks,
which are used to connect mains wires to the module without soldering.
 
Next, come to the two relays. As marked on the body of the relay, the relay coil is rated for 5VDC, and
the contacts are rated for 10A at 250VAC or 30VDC, or 125VAC or 28VDC.
 
The switching transistors amplify the signal from the inputs enough to drive the relay. The freewheeling
diodes prevent voltage spikes across the switching transistors. The status LEDs turn on when the relay is
active and indicate switching.
 
The optocouplers are used to provide additional isolation between the input and the relays. The
isolation can be selected using the VCC/JDVCC jumper.
 
The input jumper has two input and two power pins and can be easily used to connect to jumper wires
and other microcontrollers and sensors.
 
Internal Circuit Diagram for Dual-Channel Relay Module
The circuit on the board is as follows:
This same circuit is replicated twice on the module. There are several differences when compared to the
single-channel relay module. The first is that the optocoupler and relay can have a separate power
supply from the input. This is selected using the JD-V CC jumper – if the jumper is shorted, then the relay
coil and optocoupler output are connected to the signal V CC. If the jumper is left open, a separate power
supply can be provided to the relay coil through the JD-V CC pin.
 
The second is that the input is active low, meaning that the relay coil is activated only when the input is
low. This is because the optocoupler input and the indicator LED are chained to V CC. When the input is
high, the voltage difference across the chain is 0V and no current can flow, but when the input is low,
supply voltage appears across the chain and the optocoupler output conducts, supplying current to the
base of the drive transistor, turning the relay on.
 
How to use Dual-Channel Relay Module
The dual-channel relay module can be used to switch mains powered loads from the pins of a
microcontroller. Since there are two channels on the same board, two separate loads can be powered.
This is useful for home automation.
The loads can be connected as follows:
In this diagram, the relay on the left (channel 1) is connected in a regular fashion with the
load and source going between common and normally open, so when the relay is activated, the load is
powered. On the right channel (channel 2), the load and source are connected between common and
normally closed, which means that the load is powered by default till the relay is activated.
 
If the load is connected to the normally closed contact, then the input polarity ‘reversal’ can be fixed –
the load is powered on when the input is high, and the load is powered off when the input is low. This
method, however, wastes some current since the relay coil draws current when the load is switched off.

Dual-Channel Relay Module Basic Troubleshooting

If either of the relays does not turn on:

1. The contacts might be welded due to overcurrent/arcing. Shaking the module firmly might
help unstick the contacts
2. The driver circuitry might have been damaged due to overvoltage.
3. Input polarity might be incorrect.
4. Jumper might not have been moved to the correct position
 

Dual-Channel Relay Module Applications

 Switching mains loads


 Home automation
 Battery backup
 High current load switching

Arduino Nano
 

Arduino Nano Development Board

Arduino Nano Pin Diagram

The Arduino Nano is another popular Arduino development board very much similar to
the Arduino UNO. They use the same Processor (Atmega328p) and hence they both can
share the same program.

Arduino Nano Pinout Configuration

Pin Category Pin Name Details

Power Vin, 3.3V, 5V, GND Vin: Input voltage to Arduino when using


an external power source (6-12V).

5V: Regulated power supply used to power


microcontroller and other components on
the board.

3.3V: 3.3V supply generated by on-board


voltage regulator. Maximum current draw is
50mA.

GND: Ground pins.

Reset Reset Resets the microcontroller.

Analog Pins A0 – A7 Used to measure analog voltage in the range


of 0-5V

Input/Output Digital Pins D0 - D13 Can be used as input or output pins. 0V


Pins (low) and 5V (high)

Serial Rx, Tx Used to receive and transmit TTL serial


data.

External 2, 3 To trigger an interrupt.


Interrupts

PWM 3, 5, 6, 9, 11 Provides 8-bit PWM output.

SPI 10 (SS), 11 (MOSI), 12 Used for SPI communication.


(MISO) and 13 (SCK)

Inbuilt LED 13 To turn on the inbuilt LED.


IIC A4 (SDA), A5 (SCA) Used for TWI communication.

AREF AREF To provide a reference voltage for input


voltage.

Arduino Nano Technical Specifications

Microcontroller ATmega328P – 8-bit AVR family


microcontroller

Operating Voltage 5V

Recommended Input Voltage for Vin pin 7-12V

Analog Input Pins 6 (A0 – A5)

Digital I/O Pins 14 (Out of which 6 provide PWM output)

DC Current on I/O Pins 40 mA

DC Current on 3.3V Pin 50 mA

Flash Memory 32 KB (2 KB is used for Bootloader)

SRAM 2 KB
EEPROM 1 KB

Frequency (Clock Speed) 16 MHz

Communication IIC, SPI, USART

Other Arduino Boards

Arduino UNO, Arduino Pro Mini, Arduino Mega, Arduino Due, Arduino MKR1000 Wi-Fi


Board, Arduino Leonardo

Other Development Boards

Raspberry Pi, PIC Development Board, AVR Development Board, MSP430


Launchpad, TEENSY 3.6 Development Board, Intel Edison, ESP32, STM32F103C8T6 - Blue
Pill Development Board, NodeMCU ESP8266

Difference between Arduino UNO and Arduino Nano

The Arduino Nano is very much similar to the Arduino UNO. They use the same
Processor (Atmega328p) and hence they both can share the same program. One big
difference between both is the size. UNO is twice as big as Nano and hence occupies
more space on your project. Also, Nano is breadboard friendly while Uno is not. To
program an Uno, you need a Regular USB cable; whereas for Nano, you will need a mini
USB cable. The technical difference between Uno and Nano is shown below:

Nam Processor Operat CPU Analo Digital EEPR Fl USB USART


e ing/ speed g IO/PWM OM / as
Input In/Ou SRAM h
Voltage t [kB]

Uno ATmega328P 5V / 7- 16 6/0 14 / 6 1/2 32 Regul 1


12V MHz ar

Nano ATmega328P 5V / 7- 16 8/0 14 / 6 1/2 32 Mini 1


12V MHz

Difference between Arduino Nano and Arduino Mega

There is a considerable amount of difference between the Arduino Nano and the
Arduino mega as the processor used itself is different. Arduino Mega is more powerful
than an Arduino Nano in terms of speed and number of I/O pins. As you might guess,
the size is also bigger than an Arduino UNO. Arduino Mega is normally used for projects
which require a lot of I/O pins and different communication protocols. The technical
difference between Nano and Mega is shown below.

Nam Processor Operating CPU Ana Digital EEPRO Flash USB USA
e /Input speed log IO/PWM M / RT
Voltage In/ SRAM[k
Out B]

Mega ATmega2560 5V / 7-12V 16 16 / 54 / 15 4/8 256 Regula 4


MHz 0 r
Nano ATmega328P 5V / 7-12V 16 8/0 14 / 6 1/2 32 Mini 1
MHz

Understanding Arduino Nano

The Arduino board is designed in such a way that it is very easy for beginners to get
started with microcontrollers. This board especially is breadboard friendly, and that's
why it is very easy to handle the connections. Let’s start with powering the Board.

Powering you Arduino Nano:

There are total three ways by which you can power your Nano.

USB Jack: Connect the mini USB jack to a phone charger or computer through a cable
and it will draw power required for the board to function 

Vin Pin: The Vin pin can be supplied with an unregulated 6-12V to power the board.
The on-board voltage regulator regulates it to +5V.

+5V Pin: If you have a regulated +5V supply then you can directly provide this o the
+5V pin of the Arduino.

Input/output:

There are total 14 digital Pins and 8 Analog pins on your Nano board. The digital pins
can be used to interface sensors by using them as input pins or drive loads by using
them as output pins. A simple function like pinMode() and digitalWrite() can be used
to control their operation. The operating voltage is 0V and 5V for digital pins. The
analog pins can measure analog voltage from 0V to 5V using any of the 8 Analog pins
using a simple function like analogRead().

These pins apart from serving their purpose, can also be used for special purposes,
which are discussed below:

 Serial Pins 0 (Rx) and 1 (Tx): Rx and Tx pins are used to receive and transmit TTL serial data.
They are connected with the corresponding ATmega328P USB to TTL serial chip.
 External Interrupt Pins 2 and 3: These pins can be configured to trigger an interrupt on a
low value, a rising or falling edge, or a change in value.
 PWM Pins 3, 5, 6, 9 and 11: These pins provide an 8-bit PWM output by
using analogWrite() function.
 SPI Pins 10 (SS), 11 (MOSI), 12 (MISO) and 13 (SCK): These pins are used for SPI
communication.
 In-built LED Pin 13: This pin is connected with a built-in LED. When pin 13 is HIGH – LED is
on and when pin 13 is LOW, it is off.
 I2C A4 (SDA) and A5 (SCA): Used for IIC communication using Wire library.
 AREF: Used to provide reference voltage for analog inputs with analogReference() function.
 Reset Pin: Making this pin LOW, resets the microcontroller.

These special functions and their respective pins are illustrated in the Arduino Nano
pinout diagram shown above.

How to use Arduino Nano

It will hardly take 5-10 minutes to upload your first program to Arduino Nano. All
you need the Arduino IDE, an USB cable and your Nano board itself.

Download and Install Arduino:

The first step would be to install the Arduino IDE which is available for download for free
from the below link. After installing Arduino, you might also want to install the drivers
(link given below) for your Arduino to communicate with your Computer.
 Arduino IDE Download
 Driver Download

Uploading your first program

Once arduino IDE is installed on the computer, connect the board with computer using
USB cable. Now open the arduino IDE and choose the correct board by
selecting Tools>Boards>Arduino/Nano, and choose the correct Port by
selecting Tools>Port. Arduino Uno is programmed using Arduino programming
language based on Wiring. To get it started with Arduino Uno board and blink the built-
in LED, load the example code by selecting Files>Examples>Basics>Blink. Once the
example code (also shown below) is loaded into your IDE, click on the ‘upload’ button
given on the top bar. Once the upload is finished, you should see the Arduino’s built-in
LED blinking. Below is the example code for blinking:

// the setup function runs once when you press reset or power the board

void setup() {

// initialize digital pin LED_BUILTIN as an output.

pinMode(LED_BUILTIN, OUTPUT);

// the loop function runs over and over again forever

void loop() {

digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)

delay(1000); // wait for a second

digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW

delay(1000); // wait for a second

Applications

 Prototyping of Electronics Products and Systems


 Multiple DIY Projects.
 Easy to use for beginner-level DIYers and makers.
 Projects requiring Multiple I/O interfaces and communications.

2D Model and Dimensions

HC-SR04 Ultrasonic Sensor


18 March 2021 - 0 Comments
 

HC-SR04 Ultrasonic Sensor Module


HC-SR04 Ultrasonic Sensor Pinout

Ultrasonic Sensor Pinout Configuration

Pin Pin Description


Number Name

1 Vcc The Vcc pin powers the sensor, typically with +5V

2 Trigger Trigger pin is an Input pin. This pin has to be kept high
by sending US wave.

3 Echo Echo pin is an Output pin. This pin goes high for a per
the time taken for the US wave to return back to the sen

4 Ground This pin is connected to the Ground of the system.

HC-SR04 Sensor Features


 Operating voltage: +5V
 Theoretical  Measuring Distance: 2cm to 450cm
 Practical Measuring Distance: 2cm to 80cm
 Accuracy: 3mm
 Measuring angle covered: <15°
 Operating Current: <15mA
 Operating Frequency: 40Hz

More details can be found in the HC-SR04 ultrasonic sensor


datasheet attached at the bottom of this article.

Equivalent distance measuring Sensors

US transmitter Receiver pair, IR sensor module, IR sensor pair, IR


Analog distance sensor,

HC-SR04 Ultrasonic Sensor - Working

As shown above the HC-SR04 Ultrasonic (US) sensor is a 4 pin


module, whose pin names are Vcc, Trigger, Echo and Ground
respectively. This sensor is a very popular sensor used in many
applications where measuring distance or sensing objects are
required. The module has two eyes like projects in the front
which forms the Ultrasonic transmitter and Receiver. The sensor
works with the simple high school formula that
Distance = Speed × Time

The Ultrasonic transmitter transmits an ultrasonic wave, this


wave travels in air and when it gets objected by any material it
gets reflected back toward the sensor this reflected wave is
observed by the Ultrasonic receiver module as shown in the
picture below

Now, to calculate the distance using the above formulae, we


should know the Speed and time. Since we are using the
Ultrasonic wave we know the universal speed of US wave at
room conditions which is 330m/s. The circuitry inbuilt on the
module will calculate the time taken for the US wave to come
back and turns on the echo pin high for that same particular
amount of time, this way we can also know the time taken. Now
simply calculate the distance using a microcontroller or
microprocessor.

How to use the HC-SR04 Ultrasonic Sensor

HC-SR04 distance sensor is commonly used with both


microcontroller and microprocessor platforms like Arduino,
ARM, PIC, Raspberry Pie etc. The following guide is universally
since it has to be followed irrespective of the type of
computational device used.

  Power the Sensor using a regulated +5V through the Vcc ad


Ground pins of the sensor. The current consumed by the sensor
is less than 15mA and hence can be directly powered by the on
board 5V pins (If available). The Trigger and the Echo pins are
both I/O pins and hence they can be connected to I/O pins of
the microcontroller. To start the measurement, the trigger pin
has to be made high for 10uS and then turned off. This action
will trigger an ultrasonic wave at frequency of 40Hz from the
transmitter and the receiver will wait for the wave to return.
Once the wave is returned after it getting reflected by any
object the Echo pin goes high for a particular amount of time
which will be equal to the time taken for the wave to return
back to the sensor.

The amount of time during which the Echo pin stays high is
measured by the MCU/MPU as it gives the information about
the time taken for the wave to return back to the Sensor. Using
this information the distance is measured as explained in the
above heading.

Applications
 Used to avoid and detect obstacles with robots like biped
robot, obstacle avoider robot, path finding robot etc.
 Used to measure the distance within a wide range of 2cm to
400cm
 Can be used to map the objects surrounding the sensor by
rotating it
 Depth of certain places like wells, pits etc can be measured
since the waves can penetrate through water

 
2D model of the component
DC-12V Water Pump Motor R365

New advanced version with high lift self priming diaphragm water pump.
This water pump has more lift power than the RS-360, bigger outlets
diameters, and the rubber retainers helps to secure the motor to some
stationary object. This motor is more suitable for practical needs, than other
toy water motor pumps. This pump cannot be put in water (liquid) when
using, not submersible.

Features:
 Model Number: R-385
 Rated Voltage : DC 9 V to 12V (1 amps)
 Load current: 0.7A (Max)
 Flow: 1.5 to 2 Ltr/min
 Power: 4W-7W
 Max Lift: 3m
 Max Suction: 2m
 Max Water Temp: 70 °C
 CPump Size: 90mm * 40mm * 35mm approx
 Fluid: 0-100 ° C
 Input/output tube diameter: outer 8.5mm, inner 6mm approx
 Max Current: Up to 2 Amps while starting up
 Life: up to 2500 Hours

SOFTWARE SPECIFICATION

Internet of things (IOT)


The Internet of things (IOT) is a system of interrelated computing devices, mechanical and
digital machines provided with unique identifiers (UIDs) and the ability to transfer data over a
network without requiring human-tohuman or human-to-computer interaction. The definition
of the Internet of things has evolved due to the convergence of multiple technologies, real-time
analytics, machine learning, commodity sensors, and embedded systems. Traditional fields of
embedded systems, wireless sensor networks, control systems, automation (including home
and building automation), and others all contribute to enabling the Internet of things.
Fig -8: Internet of things(IOT)

Blynk
Blynk was designed for the Internet of Things. It can control hardware remotely, it can display
sensor data, it can store data, visualize it and do many other cool things. There are three major
components in the platform. Blynk Server is responsible for all the communications between
the Smartphone and hardware.

Figure Blynk Server

Arduino IDE
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 with them.

3. RESULT AND DISCUSSIONS

Then Arduino will send the value to activate the water pump and node MCU. This automatic hand
sanitizer container uses sensors to detect temperature, object motion, and water level in the tank. The
sensor is programmed as automatic water control connected to the microcontroller. This system uses an
ultrasonic sensor and an infrared sensor. The ultrasonic sensor will detect if the water level is 35 cm
from the sensor. Data from the ultrasonic sensor will send to Arduino. Processed by Arduino and
transferred to the node MCU as connectivity to a Blynk server. Then Blynk App can be connected to the
node MCU to get the data that has been sent to the Blynk server. And that application gets to send a
notification if the clean water tank has been low. Otherwise, if the undetected water level is less than 10
cm, that application does not send a notification because the input does not receive a signal. Besides,
the infrared sensor connected with the microcontroller will work automatically detect heat and object
motion. When the input gets a signal, the water will come out automatically through the pump. This can
prevent the spread of bacteria or viruses because there is no need to touch the water(a) pump directly.
To find out the results of the ultrasonic sensor system, this research has (b)conducted seven
experiments. With an experimental distance of 10 mm to 70 mm.
5. CONCLUSION
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.
Infrared can detect the motion up to 50mm and ultrsonic sensor can detect the level of water
with the distance to the snsor 35 cm. Ultrasonic sensor can send data to the MCU and Blink
server and send notification to the user. So that it can be conclude that the system can work
smoothly that can prevent the spread of Covid-19.

You might also like