Batch 1 - ECE C - Project 1 - Final Report With Plag Check Certificate
Batch 1 - ECE C - Project 1 - Final Report With Plag Check Certificate
on
SMART SOCIAL DISTANCING BAND
Submitted
In the partial fulfillment of the requirements for
The award of the degree of
BACHELOR OF TECHNOLOGY
In
ELECTRONICS AND COMMUNICATION ENGINEERING
By
EVANI SAI KRISHNA KARTHIK 17311A04C1
POTU TEJA 17311A04C2
VAGGU SRIDHAR 17311A04E2
CERTIFICATE
This is to certify that the Project Work entitled “SMART SOCIAL DISTANCING BAND”
being submitted by
We hereby declare that the work described in this report, entitled “Smart Social Distancing
Band” which is being submitted by me in partial fulfillment for the award of Bachelor of
Kukatpally, Hyderabad (Telangana) -500 085 is the result of investigations carried out by us
under the Guidance of Mrs. B. Priyanka, Assistant Professor , ECE Department, Sreenidhi
Institute Of Science And Technology, Hyderabad. The work is original and has not been
Place: Hyderabad
Date: 10/06/2021 Signature:
Evani Sai Krishna Karthik 17311A04C1
We are very thankful to Dr. Syed Jahangir Badashah, Associate Professor,ECE Department.,
Sreenidhi Institute of Science and Technology, Ghatkesar for coordinating to group project and
giving valuable timely suggestions over the work.
We convey our sincere thanks to Dr. S.P.V. Subba Rao, Professor, Head of the Department
(ECE), Sreenidhi Institute of Science and Technology, Ghatkesar, for his kind cooperation in the
completion of this work.
We even convey our sincere thanks to Dr. P. Narasimha Reddy, Executive Director and
Principal, Sreenidhi Institute of Science and Technology, Ghatkesar for their kind cooperation in
the completion of the technical seminar.
Finally, we extend our sense of gratitude to all our friends, teaching and non-teaching faculty,
who directly or indirectly helped us in this endeavor.
Place: Hyderabad
Signature:
REFERENCES 85
PLAGIARISM REPORT 86
PUBLISHED PAPER 80
List of Figures
Fig. 4.25 Depicting the Rear View of an older PIR Sensor for changing pulse duration 48
Fig. 6.2 Result on the OLED display (BPM through Pulse Count is Displayed) 83
List of Tables
Table.4.1 The Internal register settings for choosing the Vref source 31
Table 4.2 Pins for SCL and SDA Connections in Various Arduino Boards 61
CHAPTER 1
INTRODUCTION
1.1 Introduction:
In the COVID-19 period, where there is pandemic situation everywhere, and according to
the World Health Organization, Social Distancing is a better solution to tackle the situation.
Social distancing is nothing but maintaining physical distance between people who are other than
households. According to World Health Organization guidelines, we must maintain at least 6 feet
physical distance with people other than households. For many people, social distancing has
become a way of life since the COVID-19 outbreak. To contain the COVID-19 pandemic, it is
frequently stressed the importance of maintaining a safe distance between people.
COVID-19 spreads among people those whole come in close contact (within about 6
feet) with the diseased person for a prolonged period. When an infected person coughs, sneezes,
or talks, droplets from their mouth or nose fly into the air and deposit in the mouths or nostrils of
those who are nearby which leads to the spread of the virus. In addition, the droplets can be
inhaled into the lungs without notice.
According to recent research, those who are infected but do not show symptoms are
likely to help spread COVID-19. Because people can spread the virus before they even realized
they're sick, it's vital to always keep at least 6 feet away from others, even if you—or they—don't
show any symptoms.
COVID-19 can survive on a surface for hours or days, depending on conditions such as
sunlight, humidity, and surface type. It's possible that a person could get COVID-19 by touching
a virus-infected surface or object and then touching their mouth, nose, or eyes. However, this
isn't regarded to be the virus's primary mode of transmission. Outside the home, social distancing
reduces the chances of coming into contact with contaminated surfaces and infected persons.
1
Keeping a safe distance between yourself and others is one of the most effective weapons we
have for avoiding infection and reducing the spread of the virus in communities.
It is inevitable to avoid close proximity with people all the time, it is humanly impossible
to look all around to maintain social distance, but with the advantage of technology we can
maintain the social distance all the time. To achieve this, we have come up with an intelligent
solution that is, to use a smart social distancing band to detect people in the suggested distance. It
alerts us when we get too close to people by ringing the buzzer within no time so that we can
take measures to avoid close proximity with the people. It also shows the information about
pulse rate through an OLED display using a pulse rate sensor. By checking pulse rate frequently,
we can detect any health conditions before hand and act accordingly.
2
CHAPTER 2
LITERATURE SURVEY/BACKGROUND
The main paper referred is about Motion Detection using PIR Sensor. Here the author
tried to wirelessly control the lights and fans in a room using radio frequency transmission
modules based on changes in temperature detecting human motion. So he correlated his project
to that of an Auto Power Switching System where the signal to control the power is wirelessly
carried so that problems arising from wire broken can be overcome. Whenever the PIR sensor is
triggered, it means there is some human motion around it and thus the lights and fans turn on
upon receiving wireless instructions. And for this they have used Programmable Interface
Controller ( PIC ) which is cheap and easier to program.
3
● 40Hz is the operating frequency.
The HC-SR04 Ultrasonic (US) sensor is a four-pin module with the pin names Vcc,
Trigger, Echo, and Ground, as shown above. This sensor is widely utilized in a number of
applications, including distance measurement and object detection. The Ultrasonic transmitter
and receiver are formed by two eye-like projects on the front of the module. The sensor is based
on the elementary school formula Distance = Speed + Time.
The Ultrasonic transmitter sends out an ultrasonic wave that passes through the air and is
reflected back toward the sensor as it encounters some material. The Ultrasonic receiver detects
this reflected wave.
4
Fig. 2.1 Working Demo of an Ultrasonic Sensor detecting an object
To use the above formulae to measure the distance, we must first know the Speed and the
Time. We know the universal speed of the US wave at room conditions, which is 330m/s, since
we're using it. The module's circuitry calculates the time it takes for the US wave to return and
sets the echo pin high for the same amount of time, allowing us to timing it. To measure the
distance, simply utilize a microcontroller or microprocessor.
The HC-SR04 distance sensor is widely used with microcontroller and microprocessor
platforms such as Arduino, ARM, PIC, and Raspberry Pi. The following instructions are
standardized since they must be followed regardless of the type of computing system used.
The sensor is driven by a controlled +5V applied to the Vcc and Ground pins. Since the
sensor consumes less than 15mA, it can be driven directly from the on-board 5V pins (If
available). Since the Trigger and Echo pins are both I/O pins, they can be connected to the
microcontroller's I/O pins. The trigger pin must be made high for 10uS and then switched off to
5
begin the calculation. This behavior will cause the transmitter to emit an ultrasonic wave with a
frequency of 40Hz, and the receiver will wait for the wave to return.
As the wave returns to the sensor after being reflected by another source, the Echo pin
goes high for a period of time equal to the time it took for the wave to return to the sensor.
The MCU/MPU measures the amount of time the Echo pin remains high because it
provides information about the time it takes for the wave to return to the Sensor. The distance is
calculated using this information, as described in the heading above.
Applications
● Biped robots, obstacle avoider robots, route finding robots, and other robots use this
technology to avoid and identify obstacles.
● It can be used to map the objects surrounding the sensor by rotating it. It can measure
distances from 2cm to 400cm.
● Since waves can enter water, the depth of some places such as wells and pits can be
determined.
6
When Do You Avoid Using Ultrasonic Sensors?
The target object is often so small that the reflected ultrasonic signal is inadequate for detection,
and the distance cannot be accurately determined.
Ultrasound is dependable under any lighting condition and can be used both indoors and
outdoors. As long as the robot isn't moving too quickly, ultrasonic sensors can handle collision
avoidance and frequent movement.
Since ultrasonics are so commonly used, they can be found in grain bin sensing
applications, water level sensing applications, drone applications, and car sensing applications at
your local drive-thru restaurant or bank. Ultrasonic rangefinders are also used as collision
detection systems.
The best applications for ultrasonic sensors are non-contact detection of: Presence, Level,
Position and Distance. Proximity sensors are another name for non-contact sensors. Light ,
Smoke , Dust , Color Material (except for soft surfaces, such as wool, which absorbs the
ultrasonic sound wave and does not reflect it) Ultrasonics are unaffected by. Goal detection over
a long distance with a variety of surface properties.
7
Fig. 2.3 RCWL-0516 Microwave Sensor
But here I will be briefing about Microwave Sensors in general by considering another
type of Microwave Sensor which is MW0582TR11 – 5.8GHz microwave doppler radar motion
sensor.
Microwave sensors, also known as Radar, RF, or doppler sensors, are electronic
instruments that use electro-magnetic radiation to detect motion in an outdoor environment, such
as walking, running, or crawling.
It uses the Doppler effect to sense motion and projects microwaves that bounce off
surfaces and return to the sensor. The amount of time it takes for the signal to be returned to the
sensor, known as echo time, can be measured and detected.
8
The distances from any stationary object inside the detection zone are calculated using
echo time, which serves as a reference for the motion detector to operate from. Note that the
sensor in the below picture is another type of Microwave Sensor only which is MW0582TR11 –
5.8GHz microwave doppler radar motion sensor.
When it comes to sensors, each one has its own set of advantages and disadvantages. So,
what are the benefits and drawbacks of using a microwave sensor?
The Benefits
● Ambient temperature has no impact. - The ambient temperature has no effect on the
readings of microwave sensors.
● As a result, they are a very flexible sensor that can be used in a variety of harsh
conditions, such as high heat, outdoors (exposed to rain, fog, wind, dust, snow, and so on), and
so on.
● High Detection Velocity and a Wide Detection Range - Microwave sensors have a broad
detection range since their waves can pass through walls and holes.
● This gives them the ability to cover a wide area as well as large outdoor areas.
● Reduce the number of false alarms - Microwave detectors can be designed to reduce the
number of false alarms while keeping the number of accurate positives the same.
9
● This improves accuracy while also making it easier to use.
Consequences
● Continuous Power Use - Microwave sensors necessitate a constant power draw, which
can be costly to maintain.
● Intervals of work -Microwave sensors operate at intervals rather than continuously.
● If anyone runs quickly enough, there's a possibility they'll be able to run far enough to
avoid detection.
Microwave sensors can be used in a variety of situations and environments due to their
characteristics, such as:
Now let’s talk about the benefits and drawbacks of using a PIR Sensor.
The PIR sensor, like the Microwave sensor, has advantages and disadvantages. They are as
follows:
The Benefits
10
● Dependable - Regardless of the time, PIR sensors will accurately detect motion indoors.
It works well both during the day and at night.
● Affordability - PIR sensors are marginally less expensive than microwave sensors.
Consequences
● Sensitivity is low. They are more sensitive to temperature than microwave sensors and
are easily influenced by ambient temperature, whereas microwave sensors are not.
● If the enclosed space is warm (for example, in the summer), they will not be able to
detect any motion from humans because they are unable to feel any heat signature shift.
● Temperature maximum - PIR sensors are unable to work at temperatures above 35
degrees Fahrenheit.
● Detection Range and Coverage are reduced - PIR sensors perform well in line-of-sight
conditions (such as walking down a walkway), but they can have problems when moving around
infrared beams, such as in corner regions.
● In comparison to microwave sensors with a large detection range, PIR sensors must be
mounted in enclosed areas to be accurate.
Because of the characteristics of PIR sensors, they are ideal for applications in:
11
We've been waiting for this moment for a long time. PIR sensor vs. microwave sensor!
So, for your projects, which Arduino motion sensor should you use? Well, that depends on your
project's requirements and the surrounding climate!
● If there is a lot of space - The microwave sensor is ideal for large spaces with
uncomfortable spaces such as corners, such as your driveway or garden, while the PIR sensor is
ideal for enclosed spaces with a clear line of sight to airflow, such as hallways and walkways.
● The natural surroundings - PIR sensors are easily affected by the climate, particularly
when it comes to temperature. PIR sensors can only work in temperatures below 35°C, whereas a
microwave sensor is unaffected by temperature.
● At temperatures as low as -20°C and as high as 45°C, a microwave sensor can provide
reliable results!
● Detection zone (continuous or slotted) - The PIR sensor has a slotted detection region,
while the microwave sensor has a continuous field of detection zone. This can cause the PIR
sensor to miss items, making microwave sensors superior to PIR sensors in security applications.
● Efficacy - Microwave sensors use more energy than PIR sensors when it comes to energy
consumption. PIR sensors use between 0.8 and 1.0 watts of power, while microwave sensors use
between 1.1 and 1.5 watts.
● Sensitivity to the environment - The microwave sensor has a much higher sensitivity than
the PIR sensor when it comes to sensitivity.
So after all this we have to come up with a decision of using PIR Motion Sensor amongst all 3
sensors and it is elaborately explained in the subsequent chapters.
12
● LCD displays are currently the most common in small devices and large-screen
televisions. The digits on digital clocks and other electronic devices are often formed by regular
LEDs. OLEDs have a number of advantages over LCDs and LEDs, including:
● An OLED's synthetic, organic layers are thinner, lighter, and more versatile than an LED
or LCD's crystalline layers.
● The substrate of an OLED can be flexible rather than rigid since the light-emitting layers
are thinner. Instead of the glass used in LEDs and LCDs, OLED substrates can be made of
plastic.
● OLEDs outperform LEDs in terms of brightness. The conductive and emissive layers of
an OLED can be multi-layered since the organic layers of an OLED are much thinner than the
corresponding inorganic crystal layers of an LED. Furthermore, glass is needed for the support of
LEDs and LCDs, and glass absorbs some light. Glass is not needed for OLEDs.
● LCDs require backlighting, while OLEDs do not (see How LCDs Work). LCDs produce
images by selectively blocking areas of the backlight, while OLEDs generate light themselves.
OLEDs use a lot less power than LCDs because they don't need backlighting (most of the LCD
power goes to the backlighting).This is particularly important for devices that run on batteries,
such as mobile phones.
● OLEDs are less expensive to manufacture and can be manufactured in larger sizes.
OLEDs can be made into big, thin sheets since they are basically plastics. Growing and laying
down a large number of liquid crystals is much more challenging.
● OLEDs have wide viewing angles of around 170 degrees. LCDs have an intrinsic
viewing obstruction from some angles since they function by blocking light. OLEDs generate
their own illumination, giving them a much broader viewing range.
While OLED appears to be the ideal technology for all types of displays, it does have some
drawbacks:
13
● If red and green OLED films have longer lifetimes (46,000 to 230,000 hours), blue
organics have far shorter lifetimes right now (up to around 14,000 hours[source: OLED-
Info.com]).
● Manufacturing - At the moment, manufacturing processes are prohibitively costly.
● Water - OLEDs are easily damaged by water.
Taking all these aspects into considerations OLED module is preferred over LCD
module. Also due to the space coverage differences OLED module is used as it occupies very
less space when compared to the LCD modules.
CHAPTER 3
SOFTWARE
By sending a series of instructions to the board's microcontroller, you can tell it what to
do. This is accomplished using the Arduino programming language (based on Wiring) and the
Arduino Software (IDE) (based on Processing).
Arduino was created at the Ivrea Interaction Design Institute as a simple tool for rapid
prototyping targeted at students with no previous experience with electronics or programming.
As soon as it gained a larger following, the Arduino board began to evolve in order to
meet new demands and challenges, evolving from basic 8-bit boards to products for IoT,
wearables, 3D printing, and embedded environments.
All Arduino boards are open-source, allowing users to develop them themselves and
customize them to their specific needs. The software is also open-source, and it is evolving as a
result of contributions from users all over the world.
14
Arduino has been used in thousands of projects and applications due to its easy and open
user interface. Beginners will find the Arduino program simple to use, but experienced users will
find it versatile. It is compatible with Mac, Windows, and Linux operating systems.
While Arduino makes working with microcontrollers easier, it offers one advantage over
other systems for teachers, students, and curious hobbyists:
• Low-cost - Arduino modules that have already been assembled cost less than $50.
• Programming environment that is simple and straightforward, as well as open source and
extensible software and hardware.
Writing Sketches - Sketches are program created with the Arduino Software (IDE). These
sketches were generated using a text editor and saved as .ino files. The editor allows you to
cut/paste, as well as search for and replace text. When saving and exporting, the message section
displays faults and provides input.
The Arduino Software (IDE) outputs text to the console, which includes complete error
messages and other information. The designed board and serial port are shown in the window's
bottom righthand corner. You can verify and upload programs, make, open, and save sketches,
and open the serial monitor using the toolbar buttons.
Upload - This command compiles your code and uploads it to the board you specified. For more
details, see the section on uploading below.
Note: If you're using an external programmer for your board, you can use this icon when holding
down the "move" key on your screen. "Upload using Programmer" will be the new text.
15
Open - Displays a menu of all of your sketchbook's sketches. When you click one, it will open in
the current window, overwriting the content.
The five menus File, Edit, Sketch, Tools, and Help include additional commands. The
menus are context sensitive, which means they only display things that are important to the work
being done at the time.
The Arduino Software (IDE) employs the idea of a sketchbook, which is a typical
location for storing your programs (or sketches). The Open button on the toolbar or the File >
Sketchbook menu can be used to open the sketches in your sketchbook.
Uploading - Pick the correct things from the Tools > Board and Tools > Port menus before
uploading your sketch. The boards are listed in the following sections. Click the upload button in
the toolbar or pick the Upload item from the Sketch menu once you've selected the right serial
port and board. Current Arduino boards will reboot and begin uploading automatically. The RX
and TX LEDs on most boards can blink when the sketch is submitted. When the upload is
complete, the Arduino Software (IDE) will show a message or an error.
When you upload a sketch, you're using the Arduino bootloader, which is a tiny program
loaded onto your board's microcontroller. It enables you to upload code without the need for any
extra hardware. When the board resets, the bootloader is active for a few seconds before starting
whatever sketch was most recently uploaded to the microcontroller. When the bootloader begins,
the on-board (pin 13) LED will blink (i.e., when the board resets).
The Serial Monitor shows the serial data sent from the Arduino or Genuine board via
USB or serial connector. Enter text and press enter or click the "send" button to send data to the
monitor. From the drop-down menu, choose the baud rate that corresponds to the rate passed to
Serial. start with your drawing.
16
The board selection has two effects: it defines the parameters for generating and
uploading sketches (such as CPU speed and baud rate), as well as the file and fuse settings for
the burn bootloader command.
17
CHAPTER 4
HARDWARE COMPONENTS
We need a general description of the device before we can appreciate the UNO's
hardware. After compiling the code in the Arduino IDE, use a USB link to upload it to the
Arduino UNO's main microcontroller. Since the main microcontroller lacks a USB transceiver, a
bridge is needed to convert signals between the microcontroller's serial interface (UART
interface) and the host USB signals.
The ATmega16U2, which has a USB transceiver as well as a serial port, is the bridge in
the most recent revision (UART interface). You can use the USB as a power source for your
Arduino board. A DC jack is also a viable choice. You should use a push button on your board to
reset it. When you open the serial monitor from the Arduino IDE, another source of reset should
be used.
18
Fig. 4.1 ARDUINO Block Schematic
The Microcontroller
It's important to remember that the Arduino board contains a microcontroller, which is
responsible for carrying out the instructions in your program. You'll never use the nonsense
expression "Arduino is a microcontroller" again if you know this. The ATmega328
microcontroller is the main controller in the Arduino UNO R3.The ATmega328 is an 8-bit
microcontroller from the AVR family. Its internal registers and data-bus architecture are
designed to accommodate eight concurrent data signals. In this case, we're looking at a DIP-28
kit.
There are three forms of memory in the ATmega328:
• Nonvolatile memory: 32KB flash memory This is where your application is saved, which is
why you don't have to upload it every time you unplug the Arduino from its power source.
• 2KB volatile memory in SRAM. This is where the application's variables are saved when it's
running.
• EEPROM memory: nonvolatile memory of 1 KB This can be used to store data that needs to be
accessible even if the board is turned off and back on.
Power:
The MCU can operate with supply voltages ranging from 1.8 to 5.5 V. The operating
frequency, however, is limited; for example, if you want to use the highest clock frequency (20
MHz), you'll need a supply voltage of at least 4.5 V. Any electronic component that is interfaced
19
can also be operated with a 3.3V or 5V pin depending on the specifications. Even the UNO can
be charged in three different ways. One method is to raise the Vin pin. Another option is to
connect a snapper-connected battery and power it with a USB style cable.
Digital I/O:
PORTC, PORTB, and PORTD are the three ports on this MCU. These ports have all of
their pins available for general-purpose digital I/O or the alternate functions mentioned in the
pinout below. Instead of optical I/O, PORTC pins 0 to 5 can be used as ADC inputs. Some pins
can also be programmed as PWM outputs. On the Arduino board, these pins are labelled with a
“~”.
20
ADC Inputs:
PORTC0 to PORTC5 are the six channels on this MCU, each with a 10-bit resolution
A/D converter. The analogue header on the Arduino board is attached to these pins. Since the
header on the board says "Analog," it's a common mistake to think of analogue input as a
dedicated input for A/D functions only. In fact, you can use them as digital I/O or as an A/D
converter. The following pins are connected to the A/D unit:
• AREF: This input pin is used if you choose to use an external voltage reference instead of the
internal Vref for ADC. An internal register can be used to set this.
Table.4.1 The Internal register settings for choosing the Vref source.
UART Peripheral:
A serial interface is a UART (Universal Asynchronous Receiver/Transmitter). There is
only one UART module on the ATmega328. The UART's pins (RX, TX) are wired to a USB-to-
UART converter circuit as well as pins 0 and 1 of the optical header. If you're already using the
UART to send/receive data over USB, you can stop using it.
SPI Peripheral:
Another serial interface is the SPI (Serial Peripheral Interface). There is only one SPI
module on the ATmega328. It can also be used to program the MCU using a standalone
programmer, in addition to being used as a serial interface. The SPI pins on the Arduino UNO
board can be accessed through the header next to the MCU or the digital header, as shown
below:
11->MISO
21
12->MISO
13->SCK
TWI:
The I2C, or Two Wire Interface, is a serial data and serial clock interface with just two
wires: SDA and SCL. These pins can be accessed via the digital header's last two pins or the
analogue header's pins 4 and 5.
To return to the electronic design, the microcontroller segment includes the following
components:
• IOL and IOH (Digital) Headers: In addition to GND, AREF, SDA, and SCL, these headers are
the digital headers for pins 0 to 13. The USB bridge's RX and TX are wired to pins 0 and 1
respectively.
• Analog Pins Header (AD Header): This is the analogue pins header.
• 16 MHz Ceramic Resonator (CSTCE16M0V53-R0): XTAL2 and XTAL1 from the MCU are
related.
• Reset Pin: This is pulled up with a 10K resistor to help avoid spurious resets in noisy
environments; the pin has an internal pull-up resistor, but “if the atmosphere is noisy, it may be
inadequate and reset can occur sporadically,” according to the AVR Hardware Design
Considerations application notice (AVR042).If the user pushes the reset button or the USB
bridge issues a reset, the device is reset. The D2 diode can also be seen. “It is advisable to
connect an ESD safety diode from Vcc to RESET if you are not utilizing High Voltage
Programming, as this function isn’t supported internally due to High Voltage Programming,”
says the same app notice.
• 100nF C4 and C6 capacitors: These are used to filter noise from the power supply. A
capacitor's impedance decreases with frequency: Xc=12fC. The capacitors have a low-
impedance path to ground for high-frequency noise signals. The most common value is 100nF.
22
• PIN13: This is connected to the MCU's SCK pin and is also connected to an LED. To push the
LEDs, the Arduino board uses a buffer (the LMV358).
• ICSP (In-Circuit Serial Programming) Header: This is used when using an external
programmer to program the ATmega328. It's linked to the ISP (In-System Programming) gui
(which uses the SPI pins). Normally, you won't need to use this method of programming because
the bootloader takes care of programming the MCU via the UART interface, which is linked to
the USB via a bridge. This header is used when you need to flash the MCU for the first time in
development, for example, with a boot loader.
PIR sensors detect motion and are almost often used to determine if a person has entered
or exited the sensor's range. They're lightweight, cheap, low-power, simple to use, and they don't
wear out. As a result, they're usually used in home and business appliances and gadgets. PIR
motion sensors are also known as "Passive Infrared," "Pyroelectric," or "IR motion" sensors.
23
Fig. 4.3 PIR Motion Sensor
PIRs are made up of a pyroelectric sensor (shown below as a round metal can with a
rectangular crystal in the middle) that can detect infrared radiation levels. All emits a small
amount of low-level radiation, and the hotter anything is, the more radiation it emits. A motion
detector's sensor is essentially divided into two halves. This is because we want to detect motion
(change) rather than average IR levels. The two halves are wired in such a way that they balance
out one another. The performance will swing high or low if one half sees more or less IR
radiation than the other.
24
Fig 4.4 Different Views of PIR Sensor
A bunch of supporting circuitry, resistors, and capacitors are included with the
pyroelectric sensor. Most small hobbyist sensors seem to use the BISS0001 ("Micro Power PIR
Motion Detector IC"), which is unquestionably a low-cost chip. This chip takes the analogue
sensor's output and performs some minor processing on it before emitting a digital output pulse.
25
Our new PIRs have more settings to choose from, as well as a header in the 3-pin
ground/out/power pads.
PIR sensors are ideal for many simple projects or products that need to detect when a
person has left or entered an environment, or has approached. They are low-power and low-cost,
fairly rugged, have a wide lens range, and are simple to use. PIRs don't inform you how many
people are nearby or how close they are to the sensor, the lens is frequently set to a specific
sweep and distance (though it may be hacked), and house pets can set them off. It's crucial to try
new things.
26
Some Basic Stats
These figures are for the Adafruit PIR sensor, which is very similar to the Parallax one.
Almost all PIRs may have slightly different requirements, but they all function in the same way.
You can consult the datasheet if one is available.
● Rectangular in shape
● When activated (motion detected), the digital pulse is high (3V), and when idle, it is low
(no motion detected). Resistors and capacitors on the PCB specify pulse lengths, which vary
from sensor to sensor.
● Scope of sensitivity: up to 20 feet (6 meters) The detection range is 110° x 70°.
● Most modules (which have a 3.3V regulator) need a 5V-12V input voltage, but 5V is
suitable in case the regulator has different specifications.
Since there are several variables that influence the sensor's input and output, PIR sensors
are more complex than many of the other sensors covered in these tutorials (such as photocells,
FSRs, and tilt switches). To begin, we'll use this very nice diagram to show how a simple sensor
works.
Each of the two slots on the PIR sensor is constructed of a specific IR-sensitive
substance. We can see that the two slots can ‘look' out beyond a certain distance because the lens
utilized here isn't accomplishing anything (basically the sensitivity of the sensor). When the
sensor is turned off, both slots detect the same amount of IR, which is the ambient amount
emitted by the room, walls, or outside. When a warm body, such as a human or animal, moves
by, one half of the PIR sensor is intercepted, resulting in a positive differential difference
between the two halves. When the warm body leaves the sensing field, the sensor generates a
27
negative differential shift, causing the sensor to generate a negative differential change. These
bursts of shift are what are observed.
28
Fig. 4.9 View of Element Window as per RE200B datasheet illustration
The element window, as well as the two pieces of sensing material, can be seen in the diagram
above.
The internal schematic is depicted in this illustration. There is a low-noise JFET (a kind
of transistor) inside that buffers the sensor’s incredibly high impedance into something that a
low-cost chip (like the BIS0001) can feel.
Optical lenses
PIR sensors are fairly generic, with the only differences being price and sensitivity. The
optics are where the majority of the real magic occurs. The PIR sensor and circuitry are fixed and
cost a few dollars, so this is a good manufacturing idea. The lens is inexpensive and allows you
to easily adjust the breadth, range, and sensing pattern.
29
The lens is just a piece of plastic in the image above, so that means the detection field is
just two rectangles. Normally, we would prefer a much larger detection range. To do so, we use a
simple lens like those used in cameras: they compress a wide area (like a landscape) into a small
one (on film or a CCD sensor).
We want to make the PIR lenses small, thin, and moldable from cheap plastic for reasons that
will become clear soon, even if it adds distortion. Because of this, the sensors are Fresnel lenses:
The Fresnel lens concentrates light, giving the sensor a wider range of IR.
30
Fig. 4.13 Image courtesy of Cypress 2105 App note
So now we have a much better selection. However, keep in mind that we have two
sensors, and we don't want two large sensing-area rectangles, but rather a scattering of small
areas. As a result, we divide the lens into many parts, each of which is a Fresnel lens.
31
The various facet-sections can be seen here.
The different Fresnel lenses in each facet are visible in this macro image!
The various faceting and sub-lenses combine to create a variety of detection areas that are
intertwined. As a result, the lens centers in the facets above are 'inconsistent,' pointing to two
halves of the PIR sensing characteristic.
32
Fig. 4.16 Top View as per NL!!NH Datasheet
33
Here is another image.
34
A 3-pin link is found on the side or bottom of most PIR modules. The pinout can differ
between modules, so double-check! It's typically silkscreened right next to the link (at least,
that's how ours looks!) One pin will be used for ground, another for signal, and the third for
control. The input voltage is normally 3-5VDC, but it may be as high as 12V.Larger modules
cannot have direct output and instead run a relay, in which case land, control, and the two switch
connections are all present.
Some relays' outputs are 'open collector,' which necessitates the use of a pullup resistor. If
you're having trouble getting a variable display, try connecting the signal and power pins with a
10K pullup.
The red cable is + voltage control, the black cable is - ground power, and the yellow
cable is the signal out for our PIRs. Just make sure you plug the cable in the way it's supposed to
be! You won't hurt the PIR if you get it backwards, but it won't work.
When the PIR senses motion, the output pin goes "big" to 3.3V and the LED turns on!
35
After you've finished wiring the breadboard, put the batteries in and wait 30-60 seconds
for the PIR to 'stabilize.' The LED may blink a little during this period. Wait until the LED is
turned off, then walk around in front of it, shaking your hand, etc. to see it turn on!
Re-enactment
You might have a couple of choices for your PIR. We'll start with the 'Retriggering'
option. Check the rear of the PIR sensor when the LED starts to blink to make sure the jumper is
in the L location, as illustrated below.
36
Set up the testing board once more. When you attach the PIR sensor as described above,
you can find that the LED does not stay on when you move in front of it, but instead switches on
and off every second or so. This is referred to as "non-retriggering."
Make sure the jumper is in the H spot now. When you run the test, you'll find that the
LED now stays on the whole time anything moves. This is referred to as "retriggering."
"Retriggering" mode (jumper in H position as shown below) is a little nicer for most
applications. Set the sensor to "non-retriggering" if you need to attach it to something that is
edge-triggered (jumper in L position).
37
Changing the level of sensitivity
A trim pot on the back of the Adafruit PIR can be used to change the sensitivity. If your PIR is
too sensitive or not sensitive enough, you can turn it clockwise to make it more sensitive.
Changing the duration of the pulse and the length of the timeout
The PIR sensor has two 'timeouts' associated with it. One is the "Tx" timeout, which
controls how long the LED stays lit after it senses movement and is easily adjustable on Adafruit
PIRs thanks to the potentiometer.
The second is the "Ti" timeout, which specifies how long the LED will remain off if no
movement is detected. This one isn't easy to replace, but if you're handy with a soldering iron, it's
doable.
A small trim potentiometer labelled TIME is found on Adafruit PIR sensors. This is a
10K series resistor with a 1 Megaohm adjustable resistor attached to it. Tx = 24576 x (10K + R
time) x 0.01uF since C6 is 0.01uF.
Tx = 24576 x 10K x 0.01uF = 2.5 seconds if the Rtime potentiometer is turned down all the way
counter-clockwise (to 0 ohms) (approx)
Tx = 24576 x (1010K) x 0.01uF = 250 seconds if the Rtime potentiometer is turned all the way
up to 1 Megaohm (approx)
R Time will be around 120 seconds (two minutes) if it’s in the centre, so you can adjust it as
required. Set the R time potentiometer to about 1/4 of the way around, for example, if you want
someone to turn on a fan for a minimum of 1 minute.
38
In the case of older/different PIR sensors
If you have a PIR sensor that does not have a potentiometer adjust, you can find the adjustment
resistors by following these steps:
Fig. 4.25 Depicting the Rear View of an older PIR Sensor for changing pulse duration
It's not difficult to figure out what R10 and R9 are. Unfortunately, the mark on this PIR
sensor is incorrect (it looks like they swapped R9 R17). R10 is connected to pin 3 and R9 is
connected to pin 7. You can trace the pins by looking at the BISS001 datasheet and finding out
what pins they are. Capacitors are a little more difficult to figure out, but you can 'reverse
engineer' them by timing the sensor and solving!
39
Similarly,
1.2 seconds Ti = 24 * R9 * C7
It's very simple to attach PIR sensors to a microcontroller. The PIR is a digital output that
can be either high or low voltage, so all you have to do is listen for the pin to flip high (detected)
or low (not detected) on a digital input on your Arduino.
Link ground to ground and power the PIR with 5V. The output should then be connected
to a digital pin. Pin 2 will be used in this example.
40
The code is quite plain, and it simply monitors whether the input to pin 2 is high or low.
It also keeps track of the state of the pin, printing a message when motion starts and stops which
is appropriately stated in the subsequent chapters.
OLEDs are incredibly light, almost paper-thin, theoretically versatile, and produce a
brighter, crisper picture. Now let’s talk about OLEDs and about their module as well in detail .
OLEDs are currently used in small-screen devices like mobile phones, PDAs, and digital
cameras. Sony Corporation reported in September 2004 that mass development of OLED screens
for its CLIE PEG-VZ90 model of personal entertainment handhelds had begun. In March 2003,
Kodak released the Easy Share LS633, the first digital camera with an OLED display .
Several companies have already developed prototype OLED computer displays and
large-screen TVs. Samsung Electronics revealed in May 2005 that it had produced a 40-inch
prototype OLED-based ultra-slim TV, the first of its size. Sony also revealed in October 2007
that it would be the first to market with an OLED television. Customers in Japan will be able to
purchase the XEL-1 in December 2007. It's listed for 200,000 Yen ($1,700 USD) on eBay.
OLED research and development are progressing quickly, and potential applications in
heads-up displays, vehicle dashboards, billboard-type displays, home and office lighting, and
modular displays are all possibilities. Since OLEDs refresh nearly 1,000 times faster than LCDs,
a computer with an OLED display could update information almost instantly. Video clips should
be much more accurate and revised on a regular basis. The newspaper of the future could be an
OLED show that updates with breaking news (think "Minority Report"), and you could fold it up
and stuff it in your bag or briefcase like a normal newspaper.
41
OLEDs are solid-state devices made up of thin films of organic molecules that emit light
when electricity is applied. OLEDs offer the promise to provide brighter, more sharper displays
on electronic gadgets while consuming less electricity than today's LEDs or liquid crystal
displays (LCDs).
OLEDs, like LEDs, are solid-state semiconductor devices with a thickness of 100 to 500
nanometers, or about 200 times that of a human hair. OLEDs may have two or three layers of
organic material, with the third layer assisting in the transfer of electrons from the cathode to the
emissive layer in the latter configuration. The two-layer design will be the subject of this report.
Organic layers consisting of organic molecules or polymers are used in OLED components.
42
● The conductive layer is made up of organic plastic molecules that transport "holes" from
the anode to the cathode. Polyaniline is a conducting polymer used in OLEDs.
● The emissive layer is made up of organic plastic molecules (different from the
conducting layer) that transport electrons from the cathode and is where light is generated.
Polyfluorene is one of the polymers used in the emissive coat.
● As a current pass through the device, the cathode (which may or may not be transparent
depending on the form of OLED) injects electrons.
The application of organic layers to the substrate is the most time-consuming aspect of making
OLEDs. This can be achieved in any one of three ways:
● Vacuum deposition, also known as vacuum thermal evaporation (VTE), is the process of
gently heating (evaporating) organic molecules in a vacuum chamber and allowing them to
condense as thin films onto cooled substrates. This is both costly and inefficient.
● Organic vapor phase deposition (OVPD) - A carrier gas carries evaporated organic
molecules onto cooled substrates, where they condense into thin films, in a low-pressure, hot-
walled reactor chamber. The use of a carrier gas improves performance and lowers the cost of
producing OLEDs.
● OLEDs are sprayed onto substrates with inkjet technology, much as inks are sprayed onto
paper during printing. OLEDs can be printed onto very large films for large displays like 80-inch
TV screens or electronic billboards thanks to inkjet technology, which lowers the cost of OLED
manufacturing.
43
What is the light-emitting mechanism of OLEDs?
44
By a method known as electro phosphorescence, OLEDs emit light in a similar way to LEDs.
● A voltage is applied across the OLED by the battery or power supply of the unit
containing the OLED.
● Via the organic layers, an electrical current flow from the cathode to the anode (an
electrical current is a flow of electrons). The emissive layer of organic molecules receives
electrons from the cathode. The anode eliminates electrons from the organic molecules'
conductive layer. (This is the same as giving the conductive layer electron holes.)
● Electrons encounter electron holes at the interface between the emissive and conductive
layers. As an electron finds an electron void, it fills it (by falling into an atom's energy level that
is lacking an electron). The electron gives up energy in the form of a photon of light as this
occurs (see How Light Works).
● Light is emitted by the OLED.
● The form of organic molecule in the emissive layer determines the color of the light. To
render color displays, manufacturers layer several different forms of organic films on the same
OLED.
● The amount of electrical current applied determines the intensity or brightness of the
light: the higher the current, the brighter the light.
OLEDs are broadly divided into two categories: passive and active matrix.
45
Each category has its own set of applications. We'll go over each form of OLED in detail
in the sections below. Let's look at the differences between passive-matrix and active-matrix
OLEDs.
PMOLEDs include cathode strips, organic layers, and anode strips. The anode strips are
parallel to the cathode strips and are arranged perpendicularly. The pixels where light is emitted
are formed by the intersections of the cathode and anode. External circuitry controls the flow of
current through selected anode and cathode strips, deciding which pixels are switched on and
which remain off. Each pixel's brightness is proportional to the amount of current applied.
PMOLEDs are simple to manufacture, but they use more energy than other forms of
OLEDs, owing to the power required for the external circuitry. PMOLEDs are ideally suited for
small screens (2 to 3-inch diagonal), such as those used in mobile phones, PDAs, and MP3
players, and are most useful for text and icons. Passive-matrix OLEDs use less battery power and
with external circuitry than the LCDs that currently power these units.
46
OLED with an active matrix (AMOLED)
AMOLEDs have complete layers of cathode, organic molecules, and anode, but the
anode layer is layered over a matrix of thin film transistors (TFTs). The circuitry that decides
which pixels are switched on to form an image is called a TFT array.
Since the TFT array consumes less power than external circuitry, AMOLEDs consume
less power than PMOLEDs, making them more powerful for large displays. AMOLEDs also
have higher refresh rates, which make them ideal for video. Computer displays, large-screen
TVs, and electronic signage or billboards are the best uses for AMOLEDs.
OLEDs are divided into another four categories: transparent, top-emitting, foldable, and white.
Now let’s talk about them.
When turned off, transparent OLEDs have only transparent components (substrate,
cathode, and anode), and are up to 85% as transparent as their substrate. When you turn on a
transparent OLED display, light will move in both directions. An active-matrix or passive-matrix
transparent OLED display is available. Heads-up displays will benefit from this technology.
47
Fig. 4.31 Transparent OLED
The substrate of Top-Emitting OLEDs is either opaque or reflective. They're best seen in active-
matrix layouts. In smart cards, manufacturers can use top-emitting OLED displays.
Foldable OLEDs have substrates constructed of highly flexible metallic foils or polymers.
OLEDs that can be folded are extremely light and endure for a long time. Their usage in devices
like mobile phones and PDAs can help to minimize breakage, which is a common reason for
48
returns and repairs. Foldable OLED displays could be sewn into fabrics to make "smart"
clothing, such as outdoor survival clothing with a built-in computer chip, mobile phone, GPS
receiver, and OLED display.
White OLEDs provide a lighter, more uniform, and more energy-efficient white light
than fluorescent lamps. The true-color properties of white OLEDs are similar to those of
incandescent lighting. Since OLEDs can be manufactured in large sheets, they can be used to
replace fluorescent lamps in homes and buildings. Their usage could theoretically lower lighting
energy costs.
So now let’s talk about the OLED Module used in the project.
A powerful single-chip CMOS OLED driver controller – SSD1306 – is at the heart of the
module. It has several ways to interact with the microcontroller, including I2C and SPI.
SPI is faster than I2C in general, but it needs more I/O pins. I2C, on the other hand, only
needs two pins and can be shared with other I2C peripherals. There's a trade-off to be made
between pins and rpm. So, it all about personal preference.
The SSD1306 controller's flexibility allows the module to be made in a variety of sizes
and colors, including 128x64, 128x32, white OLEDs, Blue OLEDs, and Dual Color OLEDs.
You can switch out all of these displays.
Since it generates its own light, an OLED display does not need a backlight. This
explains the display's high contrast, wide viewing angle, and ability to display deep black levels.
The lack of a backlight decreases the amount of power needed to operate the OLED. The display
uses around 20mA current on average, but this varies depending on how much of the display is
lit.
The SSD1306 controller's operating voltage ranges from 1.65V to 3.3V, while an OLED
panel needs a supply voltage of 7V to 15V. Internal charge pump circuitry meets all of these
49
various power specifications. This allows it to be conveniently connected to an Arduino or any
other 5V logic microcontroller.
The SSD1306 driver has a built-in 1KB Graphic Display Data RAM (GDDRAM) for the
screen that stores the bit pattern to be displayed, regardless of the size of the OLED module. This
1K memory space is divided into eight pages (from 0 to 7). There are 128 columns/segments on
each page (block 0 to 127). In addition, each column can hold 8 bits of data (from 0 to 7). We
have 8 X 128 X8 (pages x segments x bits) of data = 8192 bits = 1024 bytes = 1KB memory.
Below is a screenshot of the entire 1K memory, including pages, segments, and data.
Each bit represents a single OLED pixel on the screen that can be programmed to turn on or off.
The 12864 OLED screen shows all of RAM's contents, while the 12832 OLED screen shows just
4 pages (half of RAM's content).
50
● Maximum Operating Current: 20 mA
● Characters per Row 160° Viewing Angle
● Number of Character Rows (Number of Characters): 7(21)
The connections are straightforward. Begin by connecting the VCC pin to the Arduino's
5V output and the GND pin to ground.
We're still dealing with the pins that are used for I2C communication at this stage. It's
worth noting that each Arduino board has its own set of I2C pins that must be linked correctly.
51
The SDA (data line) and SCL (clock line) pin headers are similar to the AREF pin on Arduino
boards with the R3 configuration. A5 (SCL) and A4 are two other names for them (SDA).
The pins are different if you have a Mega! You can use digital 21 (SCL) and 20 (SCL)
(SDA). For a simple understanding, see the table below.
SDA SCL
Arduino Uno A5 A4
Arduino Nano A5 A4
Arduino Mega 21 20
Leonardo/Micro 3 2
Table 4.2 Pins for SCL and SDA Connections in Various Arduino Boards
The OLED display's SSD1306 controller has versatile but complex drivers. To use the
SSD1306 controller, you'll need a lot of memory addressing experience. Fortunately, Adafruit's
SSD1306 library was written to mask the SSD1306 controller's complexities so that we can
monitor the display with simple commands.
Navigate to Sketch > Include Library > Manage Libraries... to install the library. Wait for
Library Manager to update the list of installed libraries and download the library index.
52
Fig. 4.36 Sketch Menu Screenshot
Type ‘adafruit ssd1306' into the search box to narrow your results. There should be a few
options. Adafruit SSD1306 is what you're looking for. Select Install after clicking on the entry.
53
Fig. 4.37 Adafruit SSD1306 ibrary Install Screenshot
The SSD1306 Library from Adafruit isn't set up for the 12864 OLED displays (the one
we are using right now). To make it work for us, we need to adjust the display size in the
Adafruit SSD1306.h header file. When attempting to check the example sketch in the Arduino
IDE, an error message stating #error (“Height wrong, please fix Adafruit SSD1306.h!”); will
appear if it is not changed:
Open your sketchbook position to modify the Adafruit SSD1306.h header file. In most
cases, it's My Documents > Arduino. Now go to Adafruit SSD1306 > libraries.
54
Fig. 4.39 File Path of Adafruit SSD!306.h
That is everything there is to it. Now save the file and open the Arduino IDE again.
Knowing the heartbeat rate is extremely useful when exercising, training, and so on.
However, calculating the heartbeat rate can be difficult. The pulse sensor, also known as a
heartbeat sensor, is used to solve this issue. This is an Arduino-compatible plug-and-play sensor
that can be used by makers, students, developers, and artists to incorporate heartbeat data into
their projects. To make a circuit, this sensor uses a simple optical pulse sensor, as well as
amplification and noise cancellation. We can get fast and accurate heartbeat readings by using
this circuit. This circuit can be used in mobile applications with a current of 4mA and a voltage
of 5V.
55
This sensor is also known as a pulse sensor or a heart rate sensor. This sensor can be used
by attaching it to an Arduino board through a fingertip or a human ear. So that heart rate can be
measured easily.
A 24-inch color-coded cord, an ear lock, Velcro Dots-2, clear stickers-3, and other
accessories are included with the pulse sensor.
● The header connectors are connected by a color code cable. As a result, without
soldering, this sensor can be easily connected to an Arduino in the project.
● An ear clip is the same size as a heart rate sensor and can be attached to the backside of
the sensor with hot glue to wear on the earlobe.
● At the hook foot, two Velcro dots are completely sized toward the sensor. These come in
handy when making a Velcro band that covers around a fingertip. This is used to wrap around
the finger and protect the sensor.
● Transparent strikers are layers of defense that shield the sensor from sweaty earlobes and
fingertips. Three holes are located near the sensor's external edge, allowing it to be conveniently
connected to something.
56
The following are the most important features of this sensor.
Pin Arrangement
The heartbeat sensor has three pins, which will be addressed further down.
● Pin-1 (GND): Black Color Wire – Connected to the system's GND terminal.
57
● Pin-2 (VCC): Red Color Wire – This wire is attached to the system's supply voltage (+5V
otherwise +3.3V).
● Purple Color Wire – Attached to the pulsating o/p signal on Pin-3 (Signal).
The heartbeat sensor is a simple way to research the function of the heart, which can be
analyzed using the psycho-physiological signal as a cue for a virtual-reality device. With the
passage of time, the volume of blood in the finger varies.
A light lobe (a narrow, bright LED) is shone through the ear by the sensor, which
calculates the amount of light that reaches the Light Dependent Resistor. The amplified signal is
inverted and filtered in the circuit. The LM358 OP-AMP is used to create a heart-rate sensor that
tracks heartbeat pulses in order to estimate heart rate based on blood flow to the fingertip.
The pulse sensor's operation is rather straightforward. The light-emitting diode and
ambient light sensor are attached on the first surface of this sensor. Similarly, the circuit
responsible for noise cancellation and amplification is associated on the second surface.
The LED is placed over a vein in the human body, such as an ear tip or a fingertip, but it
must be placed directly on top of a plate. As the LED is positioned on the vein, it begins to emit
light. There will be a flood of blood inside the veins until the heart starts beating. As a result, if
we monitor the blood flow, we can also check the heart rates.
58
● Working as a Digital Heart Rate Monitor is one of the most popular uses for a heartbeat
sensor.
● Assists in the monitoring of a patient's health.
● Robotic applications using Bio-Feedback control
A light detector and a bright red LED are included in the heartbeat sensor circuit diagram.
Since maximum light passes and spreads if a finger put on the LED is detected by the detector,
the LED must be of super-bright strength.
The finger becomes slightly opaquer as the heart pumps blood into the blood vessels; as a
result, less light enters the detector from the LED. The detector signal varies with each heart
pulse that is produced. An electrical pulse is generated from the variable detector signal. An
amplifier amplifies and triggers this electrical signal, resulting in a +5V logic level signal output.
A LED monitor that blinks on each heartbeat rate often directs the output signal.
59
Fig. 4.44 Sensor Principle
This sensor is simple to use, but it is important to attach it correctly. Since the sensor is
directly exposed to all forms of electronic components. As a result, enveloping this sensor with
hot glue, vinyl strip, or other non-conductive materials is needed.
Wet hands would not be able to control these sensors. The smooth side of the sensor must
be placed on the vein's pinnacle and pressed. Velcro tapes or clips are commonly used to obtain
this power.
By attaching the sensor to the Arduino board, it can be used. Once it's linked, switch on
the power by connecting the VCC and GND pins. This sensor's operating voltage is +5V or
60
3.3V. We can use the Arduino code to make things simpler once the sensor is attached to the
development board. Please see the Arduino website for information on how to attach an Arduino
to a pulse sensor and how to code it.
The following are some of the uses for a pulse rate sensor.
This concludes our discussion of the Pulse Sensor (Heartbeat / Heartrate Sensor). It's
hardware that's both open-source and plug-and-play. This sensor allows users to easily
incorporate live heartbeat data into their projects. This sensor has two circuits, one for optical
amplification and the other for noise reduction. This sensor can be attached to the earlobe or
fingertip with a Clip, and then connected to the Arduino board. So that the heart rate can be
calculated quickly. Developers, students, makers, athletes, musicians, and others use these
sensors.
4.5 Buzzer
● 6V DC Rated Voltage
● 4-8V DC is the operating voltage.
● 30mA rated current
● Continuous Beep Resonant Frequency: 2300 Hz Sound Type: Continuous Beep
● The box is small and neatly packed.
● Friendly to breadboards and other such boards
61
A buzzer is a small but effective component that can be used to add sound to our project
or system. Its small and compact 2-pin configuration allows it to be used on a breadboard, a Perf
Board, or even a PCB, making it a popular component in most electronic applications.
There are two forms of buzzers available on the market. The one shown here is a simple
buzzer that, when driven, produces a Continuous Beep, beep. Beep, beep. It produces sound due
to an internal oscillating circuit.
However, the one shown here is the most common because it can be easily customized
with the aid of other circuits to suit our application. This buzzer can be used by simply
connecting it to a DC power supply between 4 and 9 volts. A simple 9V battery can also be used,
but a controlled +5V or +6V DC supply is preferred. The buzzer is usually connected to a
switching circuit that turns it on and off at predetermined times and intervals.
62
CHAPTER 5
IMPLEMENTATION
63
Fig. 5.1 Circuit Diagram of the Project
5.3 PROGRAM
#include <Adafruit_SSD1306.h>
#define OLED_Address 0x3C // 0x3C device address of I2C OLED. Few other OLED has 0x3D
Adafruit_SSD1306 oled(128, 64); // create our screen object setting resolution to 128x64
64
int a=0;
int lasta=0;
int lastb=0;
int LastTime=0;
int ThisTime;
bool BPMTiming=false;
bool BeatComplete=false;
int BPM=0;
booleanlockLow = true;
booleantakeLowTime;
int piroutpin = 3;
/////////////////////////////
//SETUP
65
void setup(){
oled.begin(SSD1306_SWITCHCAPVCC, OLED_Address);
oled.clearDisplay();
oled.setTextSize(2);
Serial.begin(9600);
pinMode(piroutpin, INPUT);
pinMode(A1,OUTPUT);
pinMode(A2,OUTPUT);
pinMode(ledPin, OUTPUT);
digitalWrite(A1, HIGH);
digitalWrite(A2, LOW);
digitalWrite(piroutpin, LOW);
Serial.print(".");
delay(500);
66
Serial.println("SENSOR ACTIVE");
delay(50);
////////////////////////////
//LOOP
void loop()
motionloop();
bpmloop();
void motionloop()
if(digitalRead(piroutpin) == HIGH)
tone(13,1000,250);
digitalWrite(11, HIGH);
digitalWrite(10,LOW);
delay(1000);
noTone(13);
67
if(lockLow)
lockLow = false;
Serial.println("---");
Serial.print(millis()/1000);
Serial.println(" sec");
delay(50);
takeLowTime = true;
if(digitalRead(piroutpin) == LOW){
digitalWrite(ledPin, LOW);
if(takeLowTime)
lowIn = millis();
takeLowTime = false;
68
lockLow = true;
Serial.print((millis() - pause)/1000);
Serial.println(" sec");
delay(50);
}}
void bpmloop()
if(a>127)
oled.clearDisplay();
a=0;
lasta=a;
ThisTime=millis();
int value=analogRead(0);
oled.setTextColor(WHITE);
int b=60-(value/16);
69
oled.writeLine(lasta,lastb,a,b,WHITE);
lastb=b;
lasta=a;
if(value>UpperThreshold)
if(BeatComplete)
{ BPM=ThisTime-LastTime;
BPM=int(90/(float(BPM)/1000));
BPMTiming=false;
BeatComplete=false;
//tone(13,1000,250);
if(BPMTiming==false)
LastTime=millis();
BPMTiming=true;
70
if((value<LowerThreshold)&(BPMTiming))
BeatComplete=true;
oled.writeFillRect(0,50,128,16,BLACK);
oled.setCursor(0,50);
oled.print("BPM:");
oled.print(BPM);
int r=(150-BPM)/10;
BPM=68+r;
oled.print(BPM);
int r=(200-BPM)/10;
BPM=70+r;
oled.print(BPM);
71
else if(BPM>200 && BPM<=300)
int r=(300-BPM)/10;
BPM=75+r;
oled.print(BPM);
else
oled.print("...");
oled.display();
a++;
72
CHAPTER 6
RESULT
6.1 Results
73
Fig. 6.1 Result in the software (ARDUINO IDE)
74
Fig. 6.2 Result on the OLED display ( BPM through Pulse Count is Displayed)
It is evident from both the images above that after calibration of the PIR Motion Sensor ,
motion is detected and ended at certain intervals which are displayed next to it on the Serial
Monitor of the Arduino IDE. To alert the user we have kept a buzzer that tones during that
interval. Similarly BPM is recorded when an user places his finger on the sensor and thus his/her
BPM is displayed on the OLED Display space.
75
CHAPTER 7
Future work includes integrating the current band with other useful sensors and reducing
its size to an actual smart band size. The sensors we would like to integrate for a more advanced
band are pulse oxy sensor - MAX30100, Bluetooth module – HC-05, GPS module and activity
tracking sensors. These sensors and modules are useful to collect data and process them to give
useful results to understand health of the user. The data we collect through the sensors will be
sent to smart phones using Bluetooth module and by using some advanced machine learning and
deep learning models we can understand the anomalies in health and by using GPS module we
can implement contact tracing, find the probability of virus infection.
7.2 Conclusion:
The key to stay safe is to maintain social distance until this is all over. As technology is
advancing, we need to use it in a proper way to make the most out of it. The idea of using a smart
band to maintain social distancing have its own advantages and disadvantages but the main perk
of using it is we can avoid a significant amount of risk of infection with a single wearable. In this
report, we have presented a way to maintain social distancing by alerting the person by detecting
close contact of people around by using PIR sensor and sending feedback through a buzzer. We
also integrated pulse sensor and an OLED module for checking pulse and displaying it on the
OLED module in an interactive way. Checking pulse frequently can detect any anomalies in the
pulse rate and can give an opportunity to act well before anything happens. We then discussed
alternative ways of implementing this band and why we choose PIR over other sensors. We have
also stated about how improved version of our project helps to provide contact tracing and other
important information.
76
REFERENCES and BIBLIOGRAPHY:
1) Ajay Kumar Tiwari, Prince Raj, Justice Kumar and Mr. Ashish Tiwary, "Motion
Detection using PIR Sensor", IJSDR, May 2016.
2) Blaine Reeder and Alexandra David, "Health at hand: A systematic review of Smart
Watch uses for health and wellness", Journal of Biomedical Informatics, 2016.
3) Cong T. Nguyen(Corresponding author) , "A Comprehensive Survey of Enabling and
Emerging Technologies for Social Distancing-Part 1: Fundamentals and Enabling
Technologies", IEEE Access, August 20,2020.
4) Rahul Reddy Nadikattu, Sikender Mohsienuddin Mohammad, Dr. Pawan Whig ,"Novel
Economic Social Distancing for COVID19", Scopus Paper, June 2020.
PLAGIARISM REPORT
77
Plagiarism Check Summary Certificate (for the content of this report)
78
79
80
81
PUBLISHED PAPER
82
83
84
85
86
87