Download as pdf or txt
Download as pdf or txt
You are on page 1of 75

SMART HEALTH MONITORING SYSTEM - IOT

A PROJECT REPORT

Submitted by

MASILAMANI.N (723919106003)

VANITHA.S (723919106006)

in partial fulfillment for the award of the degree


of
BACHELOR OF ENGINEERING
In

ELECTRONICS AND COMMUNICATION ENGINEERING

ARJUN COLLEGE OF TECHNOLOGY

COIMBATORE 642120
ANNA UNIVERSITY:: CHENNAI 600 025

MAY 2023

i
ANNA UNIVERSITY:: CHENNAI 600 025
BONAFIDE CERTIFICATE

Certified that this project report “SMART ATTENDANCE AND DOOR UNLOCK

SYSTEM” is the bonafide work of RAJA.I (723919106004) and


VIJAY.C(723919106007) who carried out the project work under my supervision.

SIGNATURE SIGNATURE
Dr. D. SATYARAJ ME, Mr.N.MURUGAN M.E.,
Ph.D., MISTE SUPERVISOR
HEAD OF THE DEPARTMENT Assistant Professor
Associate Professor Department of ECE
Department of ECE Arjun College of
Arjun College of Technology Technology
Coimbatore - 642120 Coimbatore - 642120

Submitted for the university project viva-voice held on ____________

INTERNAL EXAMINER EXTERNAL EXAMINER


ii
ACKNOWLEDGEMENT

First and foremost we convey our sincere indebtedness to the almighty for his blessings
throughout the project and its success.
We owe a great deal to express our honorable chairman Thiru. R.SURIYA NARAYANAN,
Secretary Dr.S.SURESH KUMAR M.E., Ph.D., for their exuberance in motivating young minds.
Our deepest gratitude and thanks to our motivator and Principal Dr. C.UTHAYA KUMAR
M.E.,Ph.D., who always helped us whenever we approached him during the course of our project.
We would also like to express our profound thanks to our Head of the Department Dr. D.
SATYARAJ ME,Ph.D.,MISTE., Associate professor, Department of ECE, whose thoughtful
words helped us in completing our project successfully.
Our sincere gratitude and unplumbed thanks to our beloved project coordinator and guide
Mr. N. MURUGAN M.E., Assistant professor, Department of ECE, for his constant
encouragement, Valuable Guidance and constructive criticism in making this project a successful
one.
We express our thanks to all Faculty Members and Skilled Assistants of Electronics and
Communication Engineering and our lovable friends for their help and wishes for the successful
completion of this project.
Finally, yet importantly, we would like to express our indebtedness to our beloved parents for their
affectionate blessing co-operation at all stages of this academic venture and also our well-wishers.

iii
Abstract

The Internet of things (IoT) describes physical objects (or groups of such
objects) with sensors, processing ability, software, and other technologies that connect
and exchange data with other devices and systems over the Internet or other
communications networks. Internet of things has been considered a misnomer because
devices do not need to be connected to the public internet, they only need to be
connected to a network and be individually addressable.A ESP32 microcontroller is
employed in the proposed system to process data from the sensors. In this system
consist of a DS18B20 Temperature sensor. The microcontroller takes data from the
sensors, processes it, and then sends it to ThingSpeak, where it is saved in spreadsheets
for further analysis. When the patient’s health exceeds its normal level, the googlesheet
will send a message directly to the doctor or medical team, instructing them to monitor
health. The 12 LCD display was utilized to display the current body temperature,
heartbeat rate in real time.

`
iv
TABLE OF CONTENTS
CHAPTER TITLE PAGE NO

1 INTRODUCTION
1.1 PROBLEM STATEMENT 3
2 LITERATURE REVIEW
2.1 HEART MONITORING MANAGEMENT SYSTEM 4
2.2 ADVANTAGES AND APPLICATIONS 5
2.3 CIRCUIT DIAGRAM 7
3 SYSTEM SPECIFICATION
3.1 HARDWARE SPECIFICATION 8
3.2 SOFTWARE SPECIFICATION 38
4 SYSTEM STUDY
4.1 EXISTING SYSTEM 48
4.2 PROPOSED SYSTEM 51
5 TESTING & IMPLEMENTATION
5.1 SYSTEM TESTING 53
5.2 SYSTEM IMPLEMENTATION
6 CONCLUSION 54
7 BIBLIOGRAPHY 55
8 APPENDICES
8.1 SCREENSHOTS 57
8.2 SOURCE CODE 5

v
List of Figures

S.No FIGURE NO NAME OF FIGURE PAGE NO

1. FIG-1 ThinkSpeak Image 4

2. FIG-2 Circuit Diagram 6

3. FIG-3 Hardware Specification 7

4. FIG-4 ESP32 Microcontroller 8

DS18b20 Temperature Sensor


5. FIG-5 16

6. FIG-6 PIN Configuration 17

7. FIG-7 AD832 ECG Sensor 19

8. FIG-8 AD8232 PIN Configuration 21

9 FIG-9 Buzzer 24

10 FIG-10 Switch Mode Power Supply 12 2A 26

11 FIG-11 Voltage Regulator Board 28

12 FIG-12 7812 Voltage Regulator Circuit 29

vi
13 FIG-13 7805 Voltage Regulator Pin Out Diagram 30

14 FIG-14 7805 Voltage Regulator IC 34

15 FIG-15 ThinkSpeak Channels 49

16 FIG-16 API Key 49

17 FIG-17 Project KIT 59

18 FIG-18 Project OUTPUT 65

vii
CHAPTER 1

INTRODUCTION

IoT is used to integrate the data picking units like sensors,


communication devices are connected to the internet. This
arrangement is to make a network set up i.e., called as embedded
network. It is additionally conceivable to get information or get data
by communicating with sensors present in the external environment.
The IoT devices could be classified in groups of smart sensors, user
devices and gateways. The user data is provided with its own sensors
that enable it to accumulate data and produce information.

The Internet of things (IoT) describes physical objects (or


groups of such objects) with sensors, processing ability, software,
and other technologies that connect and exchange data with other
devices and systems over the Internet or other communications
networks. Internet of things has been considered a misnomer
because devices do not need to be connected to the public internet,
they only need to be connected to a network and be individually
addressable.

A ESP32 microcontroller is employed in the proposed


system to process data from the sensors. In this system consist of a
DS18B20 Temperature sensor. The microcontroller takes data from
the sensors, processes it, and then sends it to Thing Speak,

1
where it is saved in spreadsheets for further analysis. When
the patient’s health exceeds its normal level, the googlesheet will
send a message directly to the doctor or medical team, instructing
them to monitor health. The 12 LCD display was utilized to display
the current body temperature, pulse in real time.

2
CHAPTER 2

LITERATURE REVIEW

2.1 HEART MONITORING MANAGEMENT SYSTEM

In this research paper, the design and development of a


microcontroller based heartbeat and body temperature monitor using fingertip
and temperature sensor is shown. The device involves use of optical technology to
detect the flow of blood through the finger and offers the advantage of portability
over conventional recording systems. Wireless body area network based
remote patient monitoring systems have been presented with numerous
problems including efficient data extraction and dynamic tuning of data to
preserve the quality of data transmission.

Evaluation of the device on real signals shows accuracy in heart beat measurement,
even under intense physical activity. This paper presents these challenges as
well as solution to these problems by proposing an architecture which allows a
network to be formed between the patient and doctor in order to enable remote
monitoring of patient by analyzing the data of patient. The device consists of
sensors which are used to measure heartbeat as well as body temperature of a
patient and it is controlled by a central unit. The readings from these sensors
are further processed and sent via GSM module to a remote location where it is
displayed on cell phone.

3
The optical heartbeat sensor counts the heartbeat per minute and Temperature
sensor measures the temperature from the body and both the measured data are
sent to a receiving end utilizing wireless technology where the data is displayed
in a cell phone for further processing and patient care. This device is shown superior
in comparison to traditional systems

Fig.1: Thinkspeak image

4
2.2 ADVANTAGES AND APPLICATIONS

ADVANTAGES:

 Improvement in patient outcomes


 Reduction of healthcare costs
 Increased patient and family satisfaction
 Increased patient safety
 Improvement in clinical systems productivity
 Encourages patient involvement in their healthcare

APPLICATIONS :

● Increased patient comfort and convenience enable better patient


satisfaction.
● IoT healthcare devices, wearable technology and data allow

physicians to monitor patients with greater precision and


provide better-informed treatment.
● Simultaneous reporting and monitoring
● Data assortment and analysis
● Tracking and alerts
● Remote medical assistance

5
CIRCUIT DIAGRAM:

Fig.2: Circuit diagram

6
CHAPTER 3

SYSTEM SPECIFICATION

4.1 HARDWARE SPECIFICATION

Fig.3: Hardware specification

7
ESP32 MICROCONTROLLER

Fig.4: ESP32 Microcontroller

ESP32

The ESP32 is way advanced compared to the ESP-12e. Among


several features, the ESP32 packs a CPU core, a faster Wi-Fi, more
GPIOs (especially increased analog pins that we all desired), supports
Bluetooth 4.2 and Bluetooth low energy. The board also comes with
touch-sensitive pins, alongside a built-in Hall Effect and temperature
sensors.
The specs listed below belong to the ESP32
• Integrated Crystal - 40 MHz

• Module Interfaces - UART, SPI, I2C, PWM, ADC, DAC,


GPIO, pulse counter, capacitive touch sensor
• Integrated SPI flash - 4 MB

8
• ROM - 448 KB (for booting and core functions)

• SRAM - 520 KB

• Integrated Connectivity Protocols - Wi-Fi, Bluetooth, BLE

• On - chip sensor - Hall sensor

• Operating temperature range - 40 - 85 degrees Celsius

• Operating Voltage - 3.3V

• Operating Current - 80 mA (average)

The development board equips the ESP module containing


TensilicaXtensa® Dual-Core 32-bit LX6 microprocessor. This
processor is similar to the ESP8266 but has two CPU cores (can be
individually controlled), operates at 80 to 240 MHz adjustable
clock frequency and performs at up to 600 DMIPS (Dhrystone
Million Instructions Per Second).

• Xtensa Dual-Core 32-bit LX6

• Upto 240MHz Clock Freq

• 520kB internal SRAM

• 4MB external flash

• 802.11b/g/n Wi-Fi transceiver

• Bluetooth 4.2/BLE

• The ESP32 Integrates 802.11b/g/n HT40 Wi-Fi

9
transceiver, so it can not only connect to a Wi-Fi network
and interact with the Internet, but it can also set up a network
of its own, allowing other devices to connect directly to it.
The ESP32 supports Wi-Fi Direct as well, which is a good
option for peer-to-peer connection without the need of an
access point. The Wi-Fi Direct is easier to setup and the data
transfer speeds are much better than Bluetooth.
• The chip also has dual mode Bluetooth capabilities, meaning
it supports both Bluetooth 4.0 (BLE/Bluetooth Smart)
and Bluetooth Classic (BT), making it even more versatile.

POWER REQUIREMENT

As the operating voltage range of ESP32 is 2.2V to 3.6V,


the board comes with a LDO voltage regulator to keep the voltage
steady at 3.3V. It can reliably supply up to 600mA, which should be
more than enough when ESP32 pulls as much as 250mA during
RF transmissions. The output of the regulator is also broken out
to one of the sides of the board and labeled as 3V3. This pin can be
used to supply power to external components.

Power to the ESP32 development board is supplied via the on-


board Microbe USB connector. Alternatively, if you have a
regulated 5V voltage source, the VIN pin can be used to directly
supply the ESP32 and its peripherals.
10
Also, the sleep current of the ESP32 chip is less than 5 µA, making
it suitable for battery powered and wearable electronics
applications.

11
Peripherals and I/O

Although the ESP32 has 48 GPIO pins, only 25 of them are broken out to the
pin headers on both sides of the development board. These pins can be assigned to all
sorts of peripheral duties, including:

• 15 ADC channels – 15 channels of 12-bit SAR ADC’s. The ADC range


can be set, in firmware, to either 0-1V, 0-1.4V, 0-2V, or 0-4V
• 2 UART interfaces – 2 UART interfaces. One is used to load code serially.
They feature flow control, and support IrDA too!
• 25 PWM outputs – 25 channels of PWM pins for dimming LEDs or controlling
motors.

• 2 DAC channels – 8-bit DACs to produce true analog voltages.

• SPI, I2C & I2S interface – There are 3 SPI and 1 I2C interfaces to hook
up all sorts ofsensors and peripherals, plus two I2S interfaces if you want to
add sound to your project.
• 9 Touch Pads – 9 GPIOs feature capacitive touch sensing.

The ESP32’s pin multiplexing feature (Multiple peripherals multiplexed on a


single GPIO pin). Meaning a single GPIO pin can act as an ADC input/DAC
output/Touch pad.

Pin D34, D35, VP and VN cannot be configured as outputs, but they can be used as
either digital inputs, analog inputs, or for other unique purposes. Also note that they
do not have internal pull-up or pull-down resistors, like the other GPIO pins.
12
Also, GPIO pins VP and VN are an integral part of the ultra-low-noise pre-amplifier
for the ADC, which help to configure the sampling time and noise of the pre-amp.

Serial Communication

The board includes CP2102 USB-to-UART Bridge Controller from Silicon Labs,
which convert USB signal to serial and allows your computer to program and
communicate with the ESP32 chip.

ESP32 Development Board Pin-out:

The ESP32 development board has total 30 pins that interface it to the
outside world. The connections are as follows:

Power Pins There are two power pins viz. VIN pin & 3.3V pin. The VIN pin can be
13
used to directly supply the ESP32 and its peripherals, if you have a regulated 5V voltage
source. The 3.3V pin is the output of an on-board voltage regulator. This pin can be used
to supply power to external components.

GND is a ground pin of ESP32 development board.

Arduino Pins are nothing but ESP32’s hardware I2C and SPI pins to hook up all sorts
of sensors and peripherals in your project.

GPIO Pins ESP32 development board has 25 GPIO pins which can be assigned to
various functions programmatically. Each digital enabled GPIO can be configured to
internal pull-up or pull-down, or set to high impedance. When configured as an input,
it can also be set to edge-trigger or level-trigger to generate CPU interrupts.

ADC Channels The board integrates 12-bit SAR ADCs and supports measurements
on 15 channels (analog enabled pins). Some of these pins can be used to build a
programmable gain amplifier which is used for the measurement of small analog
signals. The ESP32 is also designed to measure the voltages while operating in the
sleep mode.

DAC Channels The board features two 8-bit DAC channels to convert digital signals
into true analog voltages. This dual DAC can drive other circuits.

Touch Pads The board offers 9 capacitive sensing GPIOs which detect capacitive
variations introduced by the GPIO’s direct contact or close proximity with a finger or

14
other objects.

UART Pins ESP32 development board has 2 UART interfaces, i.e. UART0 and
UART2, which provide asynchronous communication (RS232 and RS485) and IrDA
support, and communicate at up to 5 Mbps. UART provides hardware management of
the CTS and RTS signals and software flow control (XON and XOFF) as well.

SPI Pins SPI Pins ESP32 features three SPIs (SPI, HSPI and VSPI) in slave and master
modes. These SPIs also support the following general-purpose SPI features:

• 4 timing modes of the SPI format transfer

• Up to 80 MHz and the divided clocks of 80 MHz

• Up to 64-Byte FIFO

All SPIs can also be used to connect to the external Flash/SRAM and LCD.

PWM Pins The board has 25 channels (Nearly All GPIO pins) of PWM pins controlled
by Pulse Width Modulation (PWM) controller. The PWM output can be used for
driving digital motors and LEDs. The controller consists of PWM timers and the PWM
operator. Each timer provides timing in synchronous or independent form, and each
PWM operator generates the waveform for one PWM channel.

EN Pin is used to enable ESP32. The chip is enabled when pulled HIGH. When pulled
LOW the chip works at minimum power.

15
1.2 DS18B20 TEMPERATURE SENSOR:

Fig.5: DS18B20 temperature sensor

WORKING PRINCIPLE

The working principle of this DS18B20 temperature sensor is like a temperature


sensor. The resolution of this sensor ranges from 9-bits to 12-bits. But the default
resolution which is used to power-up is 12-bit. This sensor gets power within a low-
power inactive condition. The temperature measurement, as well as conversion of A-
D, can be done with a convert-T command. The resulting temperature information.
The can be stored within the 2-byte register in the sensor, and after that, this sensor
returns to its inactive state. If the sensor is power-driven by an exterior power supply,
then the master can provide read time slots next to the Convert T command. The sensor
will react by supplying 0 though the temperature change is in the improvement and
reacts by supplying 1 though the temperature change is done.

16
16
PIN CONFIGURATION

• Pin1 (Ground): This pin is used to connect to the GND terminal of the circuit

• Pin2 (Vcc): This pin is used to give the power to the sensor which ranges from

3.3V or 5V

• Pin3 (Data): The data pin supplies the temperature value, which can
communicate with the help of 1-wire method.

Fig.6: Pin configuration

17
SPECIFICATION:

• This sensor is a programmable and digital temperature sensor

• The communication of this sensor can be done with the help of a 1-Wire method

• The range of power supply is 3.0V – 5.5V

• Fahrenheit equal s to -67°F to +257°F

• The accuracy of this sensor is ±0.5°C

• The o/p resolution will range from 9-bit to 12-bit

• It changes the 12-bit temperature to digital word within 750 ms time

• This sensor can be power-driven from the data line

• The temperature can be calculated from -55°C to +125°C.

• These are obtainable like SOP, To-92, and as a waterproof sensor Alarm
options are programmable
• The multiplexing can be enabled by Unique 64-bit address.

DS18B20 Temperature Sensor Applications

The applications of DS18B20 include the following.

• This sensor is extensively used to calculate temperature within rigid


environments which includes mines, chemical solutions, otherwise soil, etc.
• This sensor is used to measure the liquid temperature.

18
• We can use it in the thermostat controls system.

• It can be used in industries as a temperature m

• easuring device.

• This sensor is used as a thermometer.

• It can be used in devices like which are sensitive to thermal.

• These are used in HVAC systems.

• Applications where the temperature has to be measured at multiple points.

1.3 AD8232 ECG SENSOR

The AD8232 ECG sensor is a commercial board used to calculate the electrical
movement of the human heart. This action can be chart like an Electrocardiogram and
the output of this is an analog reading. Electrocardiograms can be very noisy, so to
reduce the noise the AD8232 chip can be used. The working principle of the ECG
sensor is like an operational amplifier to help in getting a clear signal from the intervals
simply. The AD8232 sensor is used for signal conditioning

Figure.7 . AD8232 ECG sensor

19
in ECG as well as other measurement applications of biopotential. The main
purpose of this chip is to amplify, extract as well as filter biopotential signals which are
small in the noisy conditions like those formed through the replacement of remote
electrode as well as motion.

Working Principle

AD8232 electrodes placement AD8232 works on 3.3 volts [3]. The ECG
sensor AD8232 supplies the ECG signal to the controller section. The system is based
on ARM 7 controller which is used to acquire the ECG signals. Microcontroller
acquires the ECG signals data and processing can be done using embedded C
programming. Microcontroller sends the data serially to a single board computer called
Raspberry Pi. The Raspberry Pi is a series of small single-board computers developed
in the United Kingdom by the Raspberry Pi Foundation to promote the teaching of
basic computer science in schools and in developing countries. Raspberry pi works on
Raspbian operating system which is Linux based OS. A Raspberry Pi is a credit
card-sized computer. The Raspberry Pi is slower than a modern laptop or desktop but
is still a complete Linux computer and can provide all the expected abilities that
implies, at a low-power consumption level. We have used this system because it is a
portable computer which can be used in any moving vehicle like ambulance and requires
dc voltage to operate which is also available in a vehicle. Through the use of AD8232
sensor and the logic used in the program we can see the ECG signals on serial plotter
of controller.

20
AD8232 PIN CONFIGURATION

Fig.8: AD8232 Pin Configuration

The heart rate monitoring sensor like AD8232 includes the pins like SDN pin, LO+
pin, LO- pin, OUTPUT pin, 3.3V pin, and GND pin. So that we can connect this IC to
development boards like Arduino by soldering pins. Additionally, this board includes
pins like the right arm (RA), left arm (LA) & right leg (RL) pins to connect custom
sensors. An LED indicator in this board is used to indicate the heartbeat rhythm of
humans. The AD8232 sensor comprises a function like quick restore, used to decrease the
length of long resolving tails of the HPFs. This sensor is accessible in a 4 mm × 4 mm
size, and the package of this sensor is 20-lead LFCSP. It operates from −40°C -to- +85°C
but the performance is specified from 0°C -to- 70°C.

21
Features and Specifications:

The features of this sensor mainly include the following.

● Operation of single supply ranges from 2V to 3.5V

● The front end is integrated fully with only lead ECG

● The virtual ground can be generated through integrated reference

● RFI filter is used internally

● The current supply is low like 170 µA

● The output is rail to rail

● Shutdown pin

● CMRR is 80 dB

● Incorporated RLD amplifier (right leg drive

● Electrode configurations are 2 or 3

● The operational amplifier is uncommitted

● It accepts half-cell potential up to ±300 mV

● Three-pole adaptable LPF with adaptable gain

● The signal gain is high using DC blocking capacity

● Filter settling can be improved by quick restore

● Two-pole adaptable HPF

22
● 4 mm × 4 mm and 20-lead LFCSP package

Applications of AD8232 ECG Senso

The applications of the AD8232 ECG sensor include the following.

● Monitoring of heart and fitness activity

● Handy ECG

● Monitoring of remote health

● Used in gaming devices

● Acquisition of biopotential signal

● Physiology studies

● Prototyping of biomedical instruments

● Variability of heart rate

● Interaction of human-computer

● Psychophysiology

23
1.4 BUZZER

Figure.9: BUZZER

Piezoelectric Sounders / Buzzers are sound components prepared by incorporating


a piezoelectric vibration plate in a plastic case (resonator).

Piezoelectric sounders are sound components which generate sound suitable for use as
input signals (including multi-tone, melody and so forth) without built-in
oscillation circuits. This characteristic allows them to be used in a wide range of
applications. They come as the SMD type, which is optimal for small, high-density
mounting and the pin type, which can be used for general purposes. Piezoelectric
buzzers are sound components which generate a monotone using a built-in oscillation
circuit.

24
Working Principle of Piezo Buzzers

The piezoelectric element is composed of a piezoelectric ceramic and a metal


plate held together with adhesive. Both sides of the piezoelectric ceramic plate contain
an electrode for electrical conduction. Piezo materials exhibit a specific phenomenon
known as the piezoelectric effect and the reverse piezoelectric effect. Exposure to
mechanical strain will cause the material to develop an electric field, and vice versa.
When an alternating voltage is applied to the piezoceramic element, the element
extends and shrinks diametrically. This characteristic of piezoelectric material is
utilized to make the ceramic plate vibrate rapidly to generate sound waves.

25
Applications of Piezo Buzzer

● Alarms / warning devices / automobile alarms.

● Pest deterrents.

● Computer devices.

● Telephones.

● Toys / games.

1.5 SWITCH MODE POWER SUPPLY 12 2A

Fig.10: Switch mode power supply 12 2A

12 Volt 2 Amp switch mode power supply takes an AC input of 100-240V and
gives stabilized 12V 2A DC output with low ripple and low interference. The circuit
26
uses an integrated circuit LP2704A of a series of circuits
LP2703A/LP2703A./LP2704A package (SOP8). With the usual PWM (pulse wide
modulation) controller is different, it uses a simple on/off control method to stabilize
the output voltage. Integrate a 700 V power MOSFET, the working frequency is 140
kHz, high voltage switches current source, current limiting, and thermal shutdown
circuit. The thermal shutdown circuit detects the temperature of the junction, the
threshold is set at 130 °C (typical) and has a hysteresis range of 55 °C (typical).In the
Undervoltage state, the prohibition time of power MOSFET switching exceeds the
usual 1.2 seconds until the end of the Undervoltage state. This power controller can work
in a typical small flyback supply and it doesn't even need an auxiliary winding.

27
Schematic of 12V 2A Switch-mode power supply circuit with IC LA2704A shown below:

3.7.7812 VOLTAGE REGULATOR BOARD:

Fig.11: 7812 Voltage Regulator board

The L7812 is a LOW DROP Voltage Regulator able to provide up to 1A of Output


Current at a fixed 12V output voltage.

28
7812 Voltage Regulator Circuit:

Fig .12: 7812 Voltage Regulator Circuit

A DC voltage regulator is a circuit that steps down DC voltage


accurately according to the need of the circuit. In this article you will learn to step
down DC voltage to 12 v. We are going to make a linear voltage regulator circuit using
IC 7812.
WORKING:

7812 is a voltage regulator IC that provides 12 v output when an input voltage


of 14 v – 35 v is provided. The DC input is applied to pin number 1 and 2 and the output
DC voltage is obtained from pin 2 and 3. Where pin 2 is common for negative terminal
as shown in circuit diagram. For constant use of the IC, input voltage should not exceed
28v.Linear voltage regulator drop voltage and emit (looses) them in the form of heat.

3.8. 7805 VOLTAGE REGULATOR:

Fig.13: 7805 Voltage Regulator pin out diagram


PIN1-INPUT

The function of this pin is to give the input voltage. It should be in the range of 7V to
35V. We apply an unregulated voltage to this pin for regulation. For 7.2V input, the
PIN achieves its maximum efficiency.

PIN 2-GROUND

We connect the ground to this pin. For output and input, this pin is equally neutral (0V).

PIN3-OUTPUT

This pin is used to take the regulated output.

7805 IC Rating

● Input voltage range 7V- 35V

● Current rating Ic = 1A

● Output voltage range VMax=5.2V ,VMin=4.8V


Applications of Voltage Regulator 7805 IC:

● Current regulator

● Regulated dual supply

● Building circuits for Phone charger, UPS power supply circuits,


portable CD player and etc.,

PIN DETAILS OF 7805:

Pin No. Pin Function Description

In this pin of the IC positive


1 INPUT Input voltage (7V-35V)
unregulatedvoltage is given in
regulation.
In this pin where the ground is
2 GROUND Ground (0V) given. This pin is neutral for
equally the input and output.

Regulated output; 5V The output of the regulated 5V


3 OUTPUT
(4.8V-5.2V) volt istaken out at this pin of the
IC regulator
Scaling the output:

The 7805’s scaled output provides the input voltage (Vin) to the bandgap
reference and the bandgap provides an error signal as the output. The 7805’s bandgap
circuit removes the feedback loop that exists inside a traditional bandgap reference.
Instead, the entire chip becomes the feedback loop. If the output voltage is correct (5V),
then the voltage divider provides 3.75V at Vin. Any change in output voltage propagates
through Q6 and R7, causing the voltage at the base of Q7 to rise or fall accordingly.
This change is amplified by Q7 and Q8, generating the error output. The error output,
in turn, decreases or increases the current through the output transistor. The negative
feedback loop adjusts the output voltage until it is correct.
Schematic of 7805 Voltage Regulator IC:

Fig.14: 7805 Voltage Regulator IC

PRODUCT FEATURES:

• 3-Terminal Regulators

• Output Current up to 1.5A

• Internal Thermal-Overload Protection

• High Power-Dissipation Capability


• Internal Short-Circuit Current Limiting

• Output Transistor SAFE-Area Compensation

3.8. CONVERSION OF ECG TO EEG SENSOR

BRAIN WAVES

The brain has billions of neurons, and each individual neuron connects (on average)
to thousands of others. Communication happens between them through small
electrical currents that travel along the neurons and throughout enormous networks
of brain circuits. When all these neurons are activated they produce electrical pulses
– visualize a wave rippling through the crowd at a sports arena – this synchronized
electrical activity results in a “brainwave”. When many neurons interact in this way
at the same time, this activity is strong enough to be detected even outside the brain.
By placing electrodes on the scalp, this activity can be amplified, analyzed, and
visualized. This is electroencephalography, or EEG – a fancy word that just means
an electric brain graph. (Encephalon, the brain, is derived from the ancient Greek
“enképhalos,” meaning within the head.)

One way that EEG ‘brainwaves’ convey information is in their rate


of repetition. Some oscillations, measured on the scalp, occur at more than 30 cycles
per second (and up to 100 cycles per second!) These cycles, also called frequencies,
are measured as Hz, or hertz, after the scientist who proved the existence of
electromagnetic waves. When looked at this way, brainwaves come in five flavors,
each of which corresponds to a Greek letter. As we’ll see, these different brainwaves
correspond to different states of thought or experience. While there are many other
ways to analyze brainwaves, many practitioners of a field called neurofeedback rely
on dividing brain oscillations into these five categories.

Some of these brain oscillations are more easily detectable on


specific parts of the scalp, corresponding to the parts of the brain just below. The brain
has many specialized regions that correspond to different processes, thoughts, and
sensations. Particular oscillations often reflect distinct regions and networks in the
brain communicating with each other.

Serial Plotter:

Serial Plotter is one of the tools in Arduino IDE. Arduino can read the
temperature, heart rate or any kind of sensor data, and send it to serial plotter. It
receives data from Arduino and visualizes data as waveforms. Serial Plotter can
visualize not only single but also multiple sensor data in the same graph. Data is
exchanged between serial plotter and Arduino via USB cable, which is also used to
upload the code to Arduino. Therefore, to use serial plotter it must be connected to
the Arduino and PC via this cable.
Serial Plotter includes a selection box and to select serial baud rate and a graph:

● X-axis represents the Time. It has 500 points. The time between each point is
the time between two consecutive Serial.println() function calls. This time is
usually equal to the time of loop() function.
● Y-axis represents the values received from Arduino. The Y-axis automatically
adjusts itselfas the value increases or decreases.

How to open Serial Plotter ?

On Arduino IDE, Go to Tools >> Serial Plotter

37
3.2 SOFTWARE SPECIFICATION

3.2.1 SOFTWARE TOOLS

Arduino Software IDE

Developer(s)
: Arduino Software

Written in
: C, C++

Operating system
: Windows, macOS, Linux

Platform
: IA-32, x86-64, ARM

38
Step 1: Arduino IDE Setup

Before start simulation need to make sure that in File>>Preferences, compilation is


marked. Because "compilation" compile the code and generate .hex file.This .hex file
is needed for running the Proteus simulation.

39
40
Step 2: Proteus Setup

Proteus is the software where we run our simulation. First make sure that have
Proteus installed in your operating system. If not, then download and install
Proteus.After run the Proteus

41
software, If you don't find arduino in the library.Then, there is a .rar file download it
and copy/cut the file.After that paste it into the Proteus library, using windows 8
operating system. In this case the location of the Proteus library is, C drive>Program
Files>Labcenter Electronics>Proteus 7 Professional>LIBRARY.After that you will
find arduino in your library.

Step 3: (Step-1) Proteus Simulation

Run Arduino IDE and go to File>Examples>01.Basics>Blink and open it.Click


on "Verify" button.Then copy(Ctrl+C) the .hex file.

42
Step 4: (Step-2) Proteus Simulation

43
44
Run the Proteus and draw the circuit like the picture.You can directly connect
Led with pin 13.But it is a good practice to add a 220 ohm resistor with led in
series.Resistor limits the current flow.Double click on arduino and paste the .hex file in
"Program File:".Run the simulation by clicking "Run the simulation" button. LED is
Blinking.

3.2.2 Thing Speak

Thing Speak is an open-source software written in Ruby which allows users


to communicate with internet enabled devices. It facilitates data access, retrieval and
logging of data by providing an API to both the devices and social network
websites. ThingSpeak was originally launched by ioBridge in 2010 as a service in
support of IoT applications.

45
ThingSpeak has integrated support from the numerical
computing software MATLAB from MathWorks, allowing ThingSpeak users to
analyze and visualize uploaded data using MATLAB without requiring the purchase
of a MATLAB license from MathWorks

46
.
Using the ThingSpeak IoT cloud we could analyze and monitor the data of the
sensors from anywhere from the world using internet. We also get the data of the
sensor stored in the ThingSpeak in spreadsheet format. ThingSpeak is free source it is
useful for the students.

Setting up the Thing Speak

ThingSpeak allows you to publish your sensor readings to their website and plot
them in charts with timestamps. Then, you can access your readings from anywhere
in the world.

Installing the Thing speaks Library

To send sensor readings to ThingSpeak, we’ll use the thingspeak-arduino


library. You can installthis library through the Arduino Library Manager. Go to Sketch
> Include Library > Manage Libraries… and search for “Thing Speak” in the
Library Manager. Install the ThingSpeak library by MathWorks.

47
ThingSpeak – Getting Started

Go to ThingSpeak an click the “Get Started For Free” button to create a new
account. This account is linked to a Mathworks account. So, if you already have a
Mathworks account, you should log in with that account.

Creating New Channel

After your account is ready, sign in, open the “Channels” tab and select “My Channels“.

48
Fig.15: Thinkspeak channels

API Key

To send values from the ESP32 to ThingSpeak, you need the Write API Key.
Open the “API Keys” tab and copy the Write API Key to a safe place because you’ll
need it in a moment

Fig.16: API Key


49
50
CHAPTER 4

SYSTEM STUDY

4.1 EXISTING SYSTEM

Gateways. Data goes from things to the cloud and vice versa through the gateways.
A gateway provides connectivity between things and the cloud part of the IoT
solution, enables data preprocessing and filtering before moving it to the cloud (to
reduce the volume of data for detailed processing and storing) and transmits control
commands going from the cloud to things. Things then execute commands using
their actuators.

Cloud gateway facilitates data compression and secure data transmission between
field gateways and cloud IoT servers. It also ensures compatibility with various
protocols and communicates with field gateways using different protocols depending
on what protocol is supported by gateways.

Streaming data processor ensures effective transition of input data to a data lake
and control applications. No data can be occasionally lost or corrupted.

Data lake. A data lake is used for storing the data generated by connected devices
in its natural format. Big data comes in "batches" or in “streams”. When the data is
needed for meaningful insights it’s extracted from a data lake and loaded to a big
data warehouse.

Big data warehouse.Filtered and preprocessed data needed for meaningful insights
is extracted from a data lake to a big data warehouse. A big data warehouse contains
only cleaned, structured and matched data (compared to a data lake which contains
all sorts of data generated by sensors).

51
Data analytics. Data analysts can use data from the big data warehouse to find trends
and gain actionable insights. When analyzed (and in many cases – visualized in
schemes, diagrams, infographics) big data show, for example, the performance of
devices, help identify inefficiencies and work out the ways to improve an IoT system
(make it more reliable, more customer-oriented). Also, the correlations and patterns
found manually can further contribute to creating algorithms for control
applications.

Machine learning and the models ML generates. With machine learning, there is
an opportunity to create more precise and more efficient models for control
applications. Models are regularly updated (for example, once in a week or once in a
month) based on the historical data accumulated in a big data warehouse. When the
applicability and efficiency of new models are tested and approved by data analysts,
new models are used by control applications.

Control applications send automatic commands and alerts to actuators, for example:

● Windows of a smart home can receive an automatic command to open or


close depending on the forecasts taken from the weather service.
● When sensors show that the soil is dry, watering systems get an automatic
command to water plants.
● Sensors help monitor the state of industrial equipment, and in case of a pre-
failure situation, an IoT system generates and sends automatic notifications to
field engineers.

52
The commands sent by control apps to actuators can be also additionally stored
in a big data warehouse. This may help investigate problematic cases (for example,
a control app sends commands, but they are not performed by actuators – then
connectivity, gateways and actuators need to be checked). On the other side, storing
commands from control apps may contribute to security, as an IoT system can
identify that some commands are too strange or come in too big amounts which may
evidence security breaches (as well as other problems which need investigation and
corrective measures).

Control applications can be either rule-based or machine-learning based. In the


first case, control apps work according to the rules stated by specialists. In the second
case, control apps are using models which are regularly updated (once in a week,
once in a month depending on the specifics of an IoT system) with the historical data
stored in a big data warehouse.

Although control apps ensure better automation of an IoT system, there should
be always an option for users to influence the behavior of such applications (for
example, in cases of emergency or when it turns out that an IoT system is badly tuned
to perform certain actions).

53
4.2 PROPOSED SYSTEM

User applications are a software component of an IoT system which enables the
connection of users to an IoT system and gives the options to monitor and control
their smart things (while they are connected to a network of similar things, for
example, homes or cars and controlled by a central system). With a mobile or web
app, users can monitor the state of their things, send commands to control
applications, set the options of automatic behavior (automatic notifications and
actions when certain data comes from sensors).

Device management:

To ensure sufficient functioning of IoT devices, it’s far not enough to install them
and let things go their way. There are some procedures required to manage the
performance of connected devices (facilitate the interaction between devices, ensure
secure data transmission and more):

● Device identification to establish the identity of the device to be sure that it’s
a genuine device with trusted software transmitting reliable data.
● Configuration and control to tune devices according to the purposes of an
IoT system. Some parameters need to be written once a device is installed (for
example, unique device ID). Other settings might need updates (for example,
the time between sending messages with data).
● Monitoring and diagnostics to ensure smooth and secure performance of
every device in a network and reduce the risk of breakdowns.
● Software updates and maintenance to add functionality, fix bugs, address
security vulnerabilities.

54
User management

Alongside with device management, it’s important to provide control over the
users having access to an IoT system.

User management involves identifying users, their roles, access levels and
ownership in a system. It includes such options as adding and removing users,
managing user settings, controlling access of various users to certain information, as
well as the permission to perform certain operations within a system, controlling and
recording user activities and more.

Security monitoring:

Security is one of the top concerns in the internet of things. Connected things
produce huge volumes of data, which need to be securely transmitted and protected
from cyber-criminals. Another side is that the things connected to the Internet can
be entry points for villains. What is more, cyber-criminals can get the access to the
“brain” of the whole IoT system and take control of it.

To prevent such problems, it makes sense to log and analyze the commands
sent by control applications to things, monitor the actions of users and store all these
data in the cloud. With such an approach, it’s possible to address security breaches
at the earlies stages and take measures to reduce their influence on an IoT system
(for example, block certain commands coming from control applications).

Also, it’s possible to identify the patterns of suspicious behavior, store these
samples and compare them with the logs generated by an IoT systems to prevent
potential penetrations and minimize their impact on an IoT system.

55
CHAPTER 5

TESTING & IMPLEMENTATION

5.1 TESTING
System testing is done by running exercise using a test scenario in the form of
variations in age, running speed and length of running period to see the effect of physical
activity on the number of heart rates.

5.2 IMPLEMENTATION:

This framework comprises of Microcontroller heartbeat sensor, GSM modem,

GPS recipient. For estimating Heartbeat, the input is taken from a figure of a human.
Heartbeat sensors will create a digital pulse corresponding to each thump. This heartbeat

is checked by interfacing the heartbeat sensor to the microcontroller to and programming

the microcontroller in counter mode. After counting of pulse for one minute, the value of
heartbeat will be displayed on LCD and if the value is beyond the normal range then the
location of the patient will be a message to care person using GSM. This message

location in the format of latitude and longitude. By inserting this co-ordinate in GPS
navigator then you will get the exact location of the patient.once you started the getting
signals ,if something the heartbeat raises unconditionally it shows alert and continuosly
vibrating.

56
CHAPTER 6

CONCLUSION

The “SMART PATIENT HEALTH MONITORING SYSTEM USING IoT”,

has been checked and implemented successfully. The proposed system could gather,

reading of various important indications of the patient and after that evaluate at cloud

then caution the doctor or concerned individuals about the health condition. It monitors

the Vital signs and sense abnormalities. These abnormalities alert the medical

staff, it reduces the manual monitoring.The system uses MQTT communication to

send the data to cloud platform. This message protocol transmits the readings of

important patient’s vital sense and helps a web interface to give a pictorial

representation of information.

57
FUTURE ENHANCEMENTS

1. Behavioral and Mental Health Monitoring: Health monitoring systems will

expand their focus to include behavioral and mental health aspects. This could involve

monitoring sleep patterns, stress levels, emotional well-being, or detecting early signs

mental health conditions. By providing insights and interventions in these areas.

2. User-Friendly Interfaces and Gamification: Future health monitoring

systems will feature user-friendly interfaces and gamification elements to enhance

user engagement and motivation. By making the monitoring experience more

enjoyable and rewarding, individuals are more likely to actively participate and

maintain their health routines.

58
CHAPTER 7

BIBLIOGRAPHY

1. S. M. Riazul Islam, Daehan Kwak, MD. Humaun Kabir , “The Internet of


Things for Health Care: A Comprehensive Survey”,Date of publication June 1,
2015, DOI 10.1109/ACCESS.2015.2437951.

2. Vandana Milind Rohokale, Neeli Rashmi Prasad, Ramjee Prasad, “A


Cooperative Internet of Things (IoT) for Rural Healthcare Monitoring and
Control”,978-1-4577-0787-2/11/ ©2011 IEEE.

3. Alexandros Pantelopoulos, Nikolaos G. Bourbakis ,”A Survey on Wearable


Sensor-Based Systems for Health Monitoring and Prognosis”,Publisher: IEEE
DOI: 10.1109/TSMCC.2009.2032660.

4. A.K. Bourke, J.V. O’Brien, G.M. Lyons A.K. Bourke et al.Gait &
Posture ,”Evaluation of a threshold-based tri-axial accelerometer fall
detection algorithm”, 26 (2007) 194–199.

5. Qiang Li, John A. Stankovic, Mark Hanson, Adam Barth, John Lach,”
Accurate, Fast Fall Detection Using Gyroscopes and Accelerometer-Derived
Posture Information”, DOI:

6.1109/ BSN.2009.46, Sixth International Workshop on Wearable and


Implantable Body Sensor Networks, BSN 2009, Berkeley, CA, USA, 3-5
June 2009.

7.J. Chen, K. Kwong, D. Chang ,”Wearable Sensors for Reliable Fall


Detection”, Publisher: IEEE, DOI: 10.1109/IEMBS.2005.1617246.

59
CHAPTER 8

APPENDICES

SCREENSHOT:

Fig.17: Project KIT

60
SOURCE CODE:
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "MAX30100_PulseOximeter.h"
#include <OneWire.h>
#include <DallasTemperature.h>
#include <WiFi.h>
#include <HTTPClient.h>
#include "ThingSpeak.h"
const char * ssid ="proj1";
const char * password = "123456789";
WiFiClient client;
unsigned long myChannelNumber = 2095591;

const char * myWriteAPIKey = "3DVX9PLJOTINH1A6";


String GOOGLE_SCRIPT_ID =
"AKfycbxG99ntU3WaJAC_eMi4bXVlNXTxc7H8Vr9ZKNc7Eyt8qbB
k1_EcjkXoUF3uQnycecii";

#define SCREEN_WIDTH 128 // OLED display width, in pixels


#define SCREEN_HEIGHT 64 // OLED display height, in pixels
int a,b,c;
// declare an SSD1306 display object connected to I2C
Adafruit_SSD1306 oled(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
#define ONE_WIRE_BUS 25
#define buzzer 18
// Setup a oneWire instance to communicate with any OneWire devices (not just
Maxim/Dallas temperature ICs)

61
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire)
PulseOximeter pox;
float BPM, SpO2;
uint32_t tsLastReport = 0;
void onBeatDetected()
{
Serial.println("Beat Detected!");
}
void setup() {
Serial.begin(9600);
pinMode(buzzer, OUTPUT);

// initialize OLED display with address 0x3C for 128x64


if (!oled.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("SSD1306 allocation failed"));
while (true);
}
Serial.print("Initializing Pulse Oximeter..");
if (!pox.begin())
{
Serial.println("FAILED");
for(;
;)
;
}
else

62
{

Serial.println("SUCCESS");
pox.setOnBeatDetectedCallback(onBeatDetected);
}
// The default current for the IR LED is 50mA and it could be changed by
uncommenting the following line.
pox.setIRLedCurrent(MAX30100_LED_CURR_7_6MA);
delay(2000); // wait for initializing
oled.clearDisplay(); // clear display
oled.setTextSize(1); // text size
oled.setTextColor(WHITE); // text color
oled.setCursor(0, 10); // position to display
oled.println(" Paitent Health "); // text to display
oled.println(" monitoring System");
oled.display();

WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
oled.print(".");
oled.display();
}
oled.clearDisplay();
oled.print("OK");
oled.display();
ThingSpeak.begin(client);

63
}

void loop() {
temp();
vital()
oled.print("HB:");
oled.println(a);
oled.print("Oxy:");
oled.println(c);
oled.display(); // show on OLED
if(b>99 or b<90)
digitalWrite(buzzer,HIGH);
else
digitalWrite(buzzer,LOW);
thingsspaeak();
String param;

param = "value="+String(b);
write_to_google_sheet(param);
}
void thingsspaeak()
{
ThingSpeak.setField(1,a);
ThingSpeak.setField(2,b);
ThingSpeak.setField(3,c);
int x = ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
}
void write_to_google_sheet(String params) {

64
HTTPClient http;
String url="https://script.google.com/macros/s/
"+GOOGLE_SCRIPT_ID+"/exec?"+params;

//Serial.print(url);
Serial.println("Postring GPS data to Google Sheet");
//---------------------------------------------------------------------
//starts posting data to google sheet
http.begin(url.c_str());
http.setFollowRedirects(HTTPC_STRICT_FOLLOW_REDIRECTS);
int httpCode = http.GET();
Serial.print("HTTP Status Code: ");
Serial.println(httpCode);
http.end();
}
void temp()
{
sensors.begin();
sensors.requestTemperatures();
oled.clearDisplay(); // clear display
oled.setTextSize(1); // text size
oled.setTextColor(WHITE); // text color
oled.setCursor(0, 10);
oled.print("Temp: ");
oled.println((sensors.getTempCByIndex(0) * 9.0) / 5.0 + 32.0);
oled.display(); // show on OLED
b=((sensors.getTempCByIndex(0) * 9.0) / 5.0 + 32.0);
delay(500);
}

65
Output ScreenShot – ThinkSpeak

The below screenshot represents output reading we get from the screenshot.

Fig.18: Project OUTPUT

66
REFERENCES

1. C. O’Brien and C. Heneghan, “A comparison of algorithms for estimation of a


respiratory signal from the surface electrocardiogram,” Computers in Biology
and Medicine, vol. 37, no. 3, pp. 305–314, 2007.
2. R. E. Nappi, E. Martini, L. Cucinella et al., “Addressing vulvovaginal
atrophy (VVA)/genitourinary syndrome of menopause (GSM) for healthy
aging in women,” Frontiers in Endocrinology, vol. 10, p. 561, 2019.
3.A. Bansal, S. Kumar, A. Bajpai et al., “Remote health monitoring system
for detecting cardiac disorders,” IET Systems Biology, vol. 9, no. 6,
pp. 309–314, 2015.
4.G. Dhiman, D. Oliva, A. Kaur et al., “BEPO: a novel binary emperor penguin
optimizer for automatic feature selection,” Knowledge-Based Systems.,
vol. 211, p. 106560, 2021.
5.K. Gatsis and G. J. Pappas, “Wireless control for the IoT,” in Proceedings
of the Second International Conference on Internet-of-Things Design and
Implementation, pp. 341-342, 2017 Apr 18.
6.S. Kaur, L. K. Awasthi, A. L. Sangal, and G. Dhiman, “Tunicate swarm
algorithm: a new bio-inspired based metaheuristic paradigm
for global optimization,” Engineering Applications of Artificial Intelligence,
vol. 90, p. 103541, 2020.
7.G. Dhiman and A. Kaur, “Spotted hyena optimizer for solving
engineering design problems,” in 2017 International Conference on Machine
Learning and Data Science (MLDS), pp. 114–119, Noida, India, 2017.
8.G. Dhiman and A. Kaur, “STOA: a bio-inspired based optimization algorithm
for industrial engineering problems,” Engineering Applications of Artificial
Intelligence, vol. 82, pp. 148–174, 2019.

67
9.G. Dhiman and A. Kaur, “A hybrid algorithm based on particle swarm and
spotted hyena optimizer for global optimization,” in In Soft computing for
problem solving, pp. 599–615, Springer, Singapore, 2019.
10. A. Kaur and G. Dhiman, “A review on search-based tools and techniques to
identify bad code smells in object-oriented systems,” in In Harmony search
and nature inspired optimization algorithms, pp. 909–921, Springer,
Singapore, 2019.

View at: Google Scholar

68

You might also like