Professional Documents
Culture Documents
Final Report Masi Vanithaa
Final Report Masi Vanithaa
A PROJECT REPORT
Submitted by
MASILAMANI.N (723919106003)
VANITHA.S (723919106006)
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
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
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
9 FIG-9 Buzzer 24
vi
13 FIG-13 7805 Voltage Regulator Pin Out Diagram 30
vii
CHAPTER 1
INTRODUCTION
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
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
4
2.2 ADVANTAGES AND APPLICATIONS
ADVANTAGES:
APPLICATIONS :
5
CIRCUIT DIAGRAM:
6
CHAPTER 3
SYSTEM SPECIFICATION
7
ESP32 MICROCONTROLLER
ESP32
8
• ROM - 448 KB (for booting and core functions)
• SRAM - 520 KB
• Bluetooth 4.2/BLE
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
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:
• 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.
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.
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.
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:
• 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:
WORKING PRINCIPLE
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.
17
SPECIFICATION:
• The communication of this sensor can be done with the help of a 1-Wire method
• 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.
18
• We can use it in the thermostat controls system.
• easuring device.
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
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
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:
● Shutdown pin
● CMRR is 80 dB
22
● 4 mm × 4 mm and 20-lead LFCSP package
● Handy ECG
● Physiology studies
● Interaction of human-computer
● Psychophysiology
23
1.4 BUZZER
Figure.9: BUZZER
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
25
Applications of Piezo Buzzer
● Pest deterrents.
● Computer devices.
● Telephones.
● Toys / games.
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:
28
7812 Voltage Regulator Circuit:
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
7805 IC Rating
● Current rating Ic = 1A
● Current regulator
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:
PRODUCT FEATURES:
• 3-Terminal Regulators
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.)
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.
37
3.2 SOFTWARE SPECIFICATION
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
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.
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.
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.
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.
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.
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
SYSTEM STUDY
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:
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).
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
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:
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
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
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
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
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
enjoyable and rewarding, individuals are more likely to actively participate and
58
CHAPTER 7
BIBLIOGRAPHY
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:
59
CHAPTER 8
APPENDICES
SCREENSHOT:
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;
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);
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.
66
REFERENCES
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.
68