Wollo University Kombolcha Technology Institute School of Electrical and Computer Engineering Communication Stream BSC Thesis Project

You might also like

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

Wollo University

Kombolcha technology Institute


School of Electrical and Computer Engineering
Communication Stream
BSc thesis project
Title: IoT based Emergency Medical Response and Smart Ambulance
System
Name ID
1. Teketel Tsegaye 2103/10
2. Kemila Abebe 1528/10
3. Nuriya Esmail 1893/10

Advisor’s Mr. Zelalem &


Mr. Bereket
10/01/2015 E.C
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

Declaration
We honestly declare that this is our work and this project paper is submitted for the final
year project of BSc in Electrical and computer engineering at Wollo University Kombolcha
Institute of Technology. This is to certify that the above declaration made by our effort is
correct to the best of our knowledge. In doing so, we assure you that we agree with all
written above with our signature as follows.
Name ID NO signature
1. Teketel Tsegaye 2103/10 ___________
2. Kemila Abebe 1528/10 ___________
3. Nuriya Esmail 1893/10 ___________

Institute: Kombolcha Institute of Technology (KIOT)


School: Electrical, Computer, and Biomedical Engineering (ECBE)
Program: B.Sc. Degree
Project title: Automatic temperature controller for a digital library in KIOT

This is to certify that I have read this project and that in my opinion, it is fully adequate, in
scope and quality, as a project for the degree of Bachelor of Science.

Name of the Advisors Signature


Mr. Zelalem ______________
Mr. Bereket ______________

i
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

Acknowledgment
First of all, we would like to express our deep thanks and appreciation for our advisor Mr.
Zelalem & Mr. Bereket who helped us by giving us different and challenging ideas and
correcting our mistakes depending on our project title. Secondly, we would like to thanks
the faculty and staff of the institutes of Technology School of Electrical, Computer and
Biomedical Engineering and in the focus area of communication Engineering. Lastly, apart
from the efforts of a group member, the success of this project depends largely on the
encouragement and guidelines of many others.

ii
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

Abstract
IoT is one of the most advancing developments of the 21st century. IoT refers to a network
of all those items that are used in association with electronics, sensors, and software to
enhance connection, collection, and data exchange. IoT makes it easy to connect all of
your things or devices to the internet. A wireless sensor network [WSN] is a network of
small embedded devices, like sensors for monitoring and recording the physical conditions
of the environment wirelessly. Cloud Computing refers to the use of various services like
services, storage, and software over the internet often referred to as a cloud. In every
medical emergency, every second is very important to save a person's life. In this research
paper, we focus on this issue and proposed a project which saves all delays and saves
precious lives. The proposed solution allows us to save all delayed aspects efficiently and
saves a life. Emergency Medical Services comprises reaching the hospital within a
minimum amount of time so that immediate health care is provided. The proposed system
gives the nearby hospital's location by the combined usage of Global Positioning System
(GPS) hardware and Google Map Application Programming Interface (API). Based on the
Internet of Things, also provides information regarding hospital facilities like the number
of beds, the blood level of all types, and the availability of doctors using various Embedded
System devices in real-time during major accidents where multiple casualties have to be
treated. These real-time data are accessed from the ambulance through internet
connectivity and alert signals are given to the corresponding hospitals selected by the
casualties. This helps in reducing the mortal rate and improves the hospitality of the
people.

iii
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

Table of Contents
Declaration ........................................................................................................................... i

Acknowledgment ................................................................................................................ ii

Abstract .............................................................................................................................. iii

List of Figures .................................................................................................................... vi

List of Tables .................................................................................................................... vii

Chapter One ........................................................................................................................ 1

Introduction ......................................................................................................................... 1

1 .1. Background of the Project ....................................................................................... 1

1.2. Statement of the problem ......................................................................................... 4

1.4. Objective of the project ............................................................................................ 4

1.4.1. General objective ............................................................................................... 4

1.3.2. Specific objectives ............................................................................................. 4

1.4. Significant and Limitations of the project ................................................................ 4

1.4.1. Significant of the project ................................................................................... 4

1.4.2. Limitations of the project .................................................................................. 5

1.5. Scope of the project .................................................................................................. 5

Methods ........................................................................................................................... 5

Chapter Two........................................................................................................................ 7

2. Literature Review ........................................................................................................ 7

Chapter Three...................................................................................................................... 9

Methods and Material...................................................................................................... 9

3.1 Description of material used ..................................................................................... 9

1. Xampp ......................................................................................................................... 9

2. Arduino Uno microcontroller .................................................................................... 10

iv
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

3. Passive Infrared Sensor ............................................................................................. 11

4. Radiofrequency ......................................................................................................... 12

5. Infrared sensor ........................................................................................................... 14

6. Node mcu esp32 ........................................................................................................ 15

7.PHP language ............................................................................................................. 17

8.MySQL ....................................................................................................................... 18

8. Sublime Text ............................................................................................................. 20

3.2 Proposed research design ........................................................................................ 21

3.2.1.1 Block diagram of the system ......................................................................... 21

1. Ambulance module ................................................................................................... 22

2. Traffic module ........................................................................................................... 22

3. Hospital module ........................................................................................................ 23

4. Website module ......................................................................................................... 23

Chapter Four ..................................................................................................................... 24

4. Simulation Result and Discussion ............................................................................. 24

4.1 Simulation ............................................................................................................... 24

4.2 Future Work ............................................................................................................ 35

Chapter Five ...................................................................................................................... 36

5. Conclusion and Recommendation ................................................................................ 36

5.1 Conclusion............................................................................................................... 36

5.2 Recommendation ..................................................................................................... 36

References ......................................................................................................................... 37

Appendix ........................................................................................................................... 39

v
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

List of Figures
Figure 1.1 Death Rate due to unavailability of ambulance Service .................................... 1
Figure 1.2 Sending Patient’s Information to the Hospital .................................................. 3
Figure 1.3 workflow............................................................................................................ 6
Figure 3.1 xampp server ..................................................................................................... 9
Figure 3.2 Arduino Uno .................................................................................................... 10
Figure 3.3 Passive infrared sensors. .................................................................................. 11
Figure 3.4 IR sensor .......................................................................................................... 14
Figure 3.5 ESP32 .............................................................................................................. 16
Figure 3.6 PHP language .................................................................................................. 17
Figure 3.7 sublime text ..................................................................................................... 20
Figure 3.8 Block diagram of the system ........................................................................... 21
Figure 4.1 Database of Website ........................................................................................ 24
Figure 4.2 Login page ....................................................................................................... 25
Figure 4.3 Doctor home page............................................................................................ 26
Figure 4.4 Add medical record page ................................................................................. 27
Figure 4.5 enter the cord number ...................................................................................... 28
Figure 4.6 list checkup page ............................................................................................. 28
Figure 4.7 checkup ............................................................................................................ 29
Figure 4.8 medical background page ................................................................................ 29
Figure 4.9 Doctor monitoring page ................................................................................... 30
Figure 4.10 User home page ............................................................................................. 31
Figure 4.11 user checkup page.......................................................................................... 32
Figure 4.12 user side medical background ....................................................................... 32
Figure 4.13 Ambulance calling page ................................................................................ 33
Figure 4.14 database of ambulance ................................................................................... 33
Figure 4.15 nearby hospital page ...................................................................................... 34

vi
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

List of Tables
Table 2.1 literature review .................................................................................................. 8
Table 3.1 radio frequency spectrum bands ....................................................................... 13

vii
Chapter One

Introduction
1 .1. Background of the Project
IoT refers to the network of physical devices, home appliances, and all those items that
are used in conjunction with sensors, electronics, connectivity, and software to enhance
connection, collection, and data exchange. The development of IoT makes it possible to
connect different sensors with the internet to provide the ability to exchange and use
information rapidly [1].

Today many cities are trying to transform themselves into smart cities. Making
advancement in the medical field is one of the difficult and most challenging jobs. That
includes various factors like arriving ambulance in the hospital as soon as possible when a
patient is in critical condition and providing the best treatment to the patient in an
emergency condition so that many precious lives will be saved [2][3][4]. In Ethiopia,
emergency response is very slow compared to other countries. This is due to a lack of
technology implementation.

Figure 1.1 Death Rate due to unavailability of ambulance Service


https://www.researchgate.net/figure/Death-Rate-due-to-not-available-ambulance-Service_fig1_34328287

1|Page
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

According to a survey, 48% of heart attack patients can be treated if the ambulance reached
the hospital on time as shown in Figure 1.1 [7]. Due to the increase in population, the
number of vehicles also increasing day by day on the road [5]. This rapid increase in the
number of vehicles causes many problems [6].

Such as an increase in traffic jams, which has caused a problem for ambulances in moving
patients to the appropriate destinations on time in case of emergency. Statistically, Between
March 2018 to 2020, in Ethiopia, 30,086 patients visited the ED and 604 patients died
within 72 h of presentation (274 died within 24 h and 232 within > 24–72 h). Shock
(36.7%) and road traffic accidents (3.16%) were the major causes of death. Triage category
red AOR 0.23 95% CI 0.1–0.55 and duration of illness 4–24 h AOR 0.47 95% CI 0.26–
0.87 were significantly associated with decreased very early emergency department
mortality [10]. To overcome these problems, we introduced IoT based traffic management
system for an ambulance. In this project, the basic information of the patient and his
medical information were sent to the hospital management to make them alert for the
treatment of that patient [8]. The smart ambulance system application gives hospital
information related to the user’s medical emergency. It’s a protocol that gives information
efficiently about the patient’s health including pulse, blood pressure, etc.

The medical system focuses on the measurement and evaluation of some parameters, e.g.,
Heart rate, pulse, temperature, and humidity [9]. The basic condition and information of
the patient are attained in an ambulance by IoT and sent to the hospital before the
ambulance reached there.

Patients in smart health units can be treated remotely when physicians or specialists are not
available. Physicians at the remote site can interact with a patient in a smart health unit via
the internet using some state-of-the-art applications and physicians can get real-time data
of patients collected by sensors at the smart health unit and can suggest medicine or some
further investigations. This will also help the poor patients not to go too far distance
hospitals for normal checkups. The patient will only travel if a physician recommends it.

This implementation model will provide the health facility at the doorstep to the public
with a great economic impact on both government investment and public expenditures and

2|Page
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

collectively on the country’s economy. This smart health unit solution will not only provide
the basic health facility to the patient but will also facilitate the physician to take auto
decisions. Machine learning techniques will be used to take auto decisions on the cloud
server by using cloud services. Cloud services will also provide remote storage and
machine learning techniques to maintain the patient’s database and auto decisions. Another
benefit for the government is to keep track of the entire nation’s health.

Figure 1.2 Sending Patient’s Information to the Hospital


https://www.researchgate.net/figure/Death-Rate-due-to-not-available-ambulance-Service_fig1_343282876

This inevitable requirement for emergency medical assistance paves the way to develop an
Emergency Medical Services application. e.g., locating hospitals, and clinics around the
place where accidents occur. A tourist or a visually impaired person finds it easy to access
this information. In the advanced medical information environment, during emergency
conditions, the victims expect information regarding the facilities provided by the hospitals
and according to that, they can take up treatment in the desired hospitals.

Thus, people's need is extended to find the availability of specialist, blood type, bed count,
and ratings of the hospitals. The proposed system provides this information in the
ambulance by which the casualties can be guided to select the required hospitals. It also
sends an alert signal to the selected hospital and particular specialist to make required
arrangements prior. The integration of monitoring, obtaining, and sharing of data like
location and facilities of the hospitals through a secure service layer is defined as IoT. This
project used hardware-based uses Arduino Uno and GPS.

3|Page
1.2. Statement of the problem
Emergency illnesses are life-threatening conditions that constitute serious health problems.
like pregnant women are subjected to unwanted bleeding and death due to the lack of
immediate Ambulance response. Due to the road closure, the lives of those who need
immediate medical care help will be lost. And also due to the lack of beds in medical
facilities, patients are subjected to unwanted fatigue and death. Medical professionals are
not adequately prepared because they do not have any information about emergency
patients. Because only primary care is given in the ambulance, patients who need urgent
help may die due to a lack of further medical knowledge. Lack of efficient traffic control
can lead to the loss of thousands of lives due to ambulances not being able to reach the
hospital in time. There has been a huge rise in road accidents and a lack of information
about nearby hospitals and clinics which leads to the death of victims of the accidents.

1.4. Objective of the project


1.4.1. General objective
The general objective of this project was to combine smart ambulances and smart
emergency medical services based on IoT.

1.3.2. Specific objectives


Some of the specific objectives of this project are:
➢ Choosing website front-end software language.
➢ Choosing website back-end software language.
➢ To develop a website.
➢ To analyze and identify the sensors to be used.
➢ Interface patient monitoring and traffic light sensors to Arduino UNO.
➢ Connects website with Proteus using Wi-Fi.

1.4. Significant and Limitations of the project


1.4.1. Significant of the project
Emergency medical services are vital during all phases of disaster response, with key roles
including mass-casualty triage, on-scene treatment, communication, evacuation,
coordination of patient transport, and patient tracking. This project is helpful for the
hospital management to receive the basic information of a patient who is in an ambulance

4|Page
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

to take perform necessary actions. Hospital management continuously monitors the health
condition of that patient.

1.4.2. Limitations of the project


The limitation of the project is as follows
✓ Need fast internet connection.
✓ Need digital data of Hospitals like patient medical background, number of beds, number
of doctors, and blood type availability.
✓ Lack of habit and acceptance of the society to smart systems.

1.5. Scope of the project


The main scope of this project will provide immediate ambulance response. medical care
in the ambulance, checking the medical background in the ambulance, checking blood
availability if it is needed using the internet of things. Different outputs given by
monitoring systems are collected and then sent to the server which hosts the web services.
All collected information about the patient is stored in the database. It is then displayed in
the web service. So, the doctor receives information about the patient’s health and the
caretaker in the ambulance gets information about the prescription of the patient.

Methods
Source of data
The basic part of this project is the website. To develop a website, we used different
languages following their function. The website has two parts, the front end, and the back
end. The front end of a website is the part that users interact with. Everything that we see
when we are navigating around the Internet. To develop this, we used CSS and HTML
languages, the former language used for styling and coloring purposes and the second
language used for describing the structure of the Web pages respectively. The other which
is the back end of the website (or “server-side”) is the portion of the website we don't see.
It's responsible for storing and organizing data and ensuring everything on the client-side
works. The backend communicates with the frontend, sending and receiving information
to be displayed as a web page. In our website we used two different languages to develop
this side, those are JavaScript which is responsible for describing the button work
command, and MYSQL which is used for communicating the server with our website.
After this, we analyze which sensors are suitable for our project and then we design the

5|Page
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

circuit using proteus software. Finally, we connect the Arduino with our website using
ESP.

Figure 1.3 workflow

6|Page
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

Chapter Two
2. Literature Review
[10] B.Janani Saradha et al. proposed a system using a cloud network to connect both
ambulance and traffic controlling units. Intelligent traffic signal control is achieved using
RFID technology. The idea is whenever the ambulance is detected near the signal, the
RFID reader tracks the ambulance attached with an RFID tag and sends the data to the
cloud. After sending the data through a mobile app, the acknowledgment will be sent to
the user, then the system will automatically change the signal to green in the path of the
ambulance. In this, it provides uninterrupted services to an emergency vehicle. The
accuracy of RFID is more compared to other alternative technologies like the camera.

[11] Jay Lohokare et al. proposed the idea of capturing the live location of emergency
services. Using these locations, people who need emergency services can connect to the
officials. The main contribution of this paper is that it provides a solution that can be
extended to an entire city where there can be a huge number of users using this system.
Prerequisites for this application according to the author is the need for Internet and GPS
(Global Positioning System) enabled devices such as smartphones through which real-time
location can be sent to the server. This paper gives a brief back-end Architecture that will
help to handle a huge number of users.

[12] Omkar Udawant et al. proposed a smart ambulance system. The basic idea is
whenever the ambulance is within the range of 100m, the signal changes to green for some
time. They make use of cloud and GPRS technology. Ambulance contains sensors like
heart rate sensor, blood pressure, and ECG. These sensors' data will be sent to the hospital’s
database simultaneously. Treatment will be planned by the hospital authorities according
to the patient's condition. So it saves so much time. Ahir et al. proposed an android
application and hardware module for traffic signal implementation. The android
application has four buttons for four directions. It depends on the route that which
ambulance driver will select, the ambulance driver will select the appropriate direction and
send activate command for the particular signal. In the android application, the patient's
information is also stored which consists of name, age, and blood group, among others.
The hardware module for traffic signals has used Arduino for traffic signals. It consists of

7|Page
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

a Wi-Fi module, with the help of which it captures information from the server and
connects the android application directly with the traffic signal.

[13] Ahir et al. proposed an android application and hardware module for traffic signal
implementation. The android application has four buttons for four directions. It depends on
the route that which ambulance driver will select, the ambulance driver will select the
appropriate direction and send activate command for the particular signal. In the android
application, the patient's information is also stored which consists of name, age, and blood
group, among others. The hardware module for traffic signals has used Arduino for traffic
signals. It consists of a Wi-Fi module, with the help of which it captures information from
the server and connects the android application directly with the traffic signal.

Table 2.1 literature review

8|Page
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

Chapter Three
Methods and Material
3.1 Description of material used
1. Xampp
XAMPP is an abbreviation for cross-platform, Apache, MySQL, PHP, and Perl, and it
allows you to build a WordPress site offline, on a local web server on your computer.
This simple and lightweight solution works on Windows, Linux, and Mac – hence the
“cross-platform” part.

Figure 3.1 xampp server

9|Page
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

2. Arduino Uno microcontroller


Arduino is an open-source platform used for building electronics projects. Arduino consists
of both a physical programmable circuit board (often referred to as a microcontroller) and
a piece of software, or IDE (Integrated Development Environment) that runs on your
computer, used to write and upload computer code to the physical board.

The Arduino platform has become quite popular with people just starting with electronics,
and for good reason. Unlike most previous programmable circuit boards, the Arduino does
not need a separate piece of hardware (called a programmer) to load new code onto the
board -- you can simply use a USB cable. Additionally, the Arduino IDE uses a simplified
version of C++, making it easier to learn to program. Finally, Arduino provides a standard
form factor that breaks out the functions of the microcontroller into a more accessible
package.

Figure 3.2 Arduino Uno

10 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

3. Passive Infrared Sensor


The PIR Sensor is a pyroelectric device that detects motion by sensing changes in the
infrared (radiant heat) levels emitted by surrounding objects. This motion can be detected
by checking for a sudden change in the surrounding IR pattern.
PIR sensor has elements made of a crystalline material that generates an electric charge
when exposed to infrared radiation. The changes in the amount of infrared striking the
element change the voltages generated. The device contains a special filter called a Fresnel
lens, which focuses the infrared signals onto the element.
The PIR device should be suitably enclosed inside a Fresnel lens cover so that its efficiency
is adequately enhanced. The Fresnel lens is used to focus the infrared field disturbed by
human motion on crystalline elements in the PIR sensor that generates an electric charge
when exposed to infrared radiation. The changes in the amount of infrared on the elements
alter the voltages generated. The PIR Sensor (Parallax 555- 28027) can detect a person
approximately from 20 - 30 feet. This can vary with environmental conditions.
The PIR sensor has single-bit output, its small size makes it easy to conceal, compatible
with all parallax microcontrollers, and the operating voltage is between 3.3V & 5V with
<<100mA current draw, generating 3.2 voltage. The power requirement is 3V to 6V; 12mA
at 3V, 23mA at 5V, the operating temperature is from 32 to 122 °F (0 to 50 °C) and
Dimensions of 1.41 x 1.0 x 0.8 in (3.58 x 2.54 x 2.03 cm).

Figure 3.3 Passive infrared sensors.

11 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

The sensor is designed to adjust to slowly changing conditions that would happen normally
as the day progresses and the environmental conditions change but responds by making its
output high when sudden changes occur, such as when there is motion. The PIR sensor
selection is dependent on detection distance, its small size makes it easy to conceal, and
Easy to interface to the microcontroller. In this project, PIR is used to detect the existence
of the person in the room.

4. Radiofrequency
Radiofrequency (RF) is a measurement representing the oscillation rate of the
electromagnetic radiation spectrum, or electromagnetic radio waves, from frequencies
ranging from 300 gigahertz (GHz) to as low as 9 kilohertz (kHz). With the use of antennas
and transmitters, an RF field can be used for various types of wireless broadcasting and
communications.

How radio frequency works


Radiofrequency is measured in units called hertz (Hz), which represent the number of
cycles per second when a radio wave is transmitted. One hertz equals one cycle per second;
radio waves range from thousands (kilohertz) to millions (megahertz) to billions
(gigahertz) of cycles per second. In a radio wave, the wavelength is inversely proportional
to the frequency. Radio frequencies are not visible to the human eye. As the frequency is
increased beyond that of the RF spectrum, electromagnetic energy takes the form of
microwaves, infrared radiation (IR), visible, ultraviolet, X-rays, and gamma rays.

RF Technology
Many types of wireless devices make use of RF fields. Cordless and cellphones, radio and
television broadcast stations, Wi-Fi and Bluetooth, satellite communications systems, and
two-way radios all operate in the RF spectrum. In addition, other appliances outside of
communications, including microwave ovens and garage door openers, operate at radio
frequencies. Some wireless devices, like the TV remote controls, computer keyboards, and
computer mice, operate at IR frequencies, which have shorter electromagnetic wavelengths

12 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

How the radio frequency spectrum is used?


The radio frequency spectrum includes the set of frequencies of the electromagnetic
framework ranging from 30 Hz to 300 GHz. It is divided into several ranges, or bands, and
given labels, such as low frequency (LF), medium frequency (MF), and high frequency
(HF), for easier identification. Except for the lowest-frequency segment, each band
represents an increase in frequency corresponding to an order of magnitude (power of 10).
The following table depicts the eight bands in the RF spectrum, showing frequency and
bandwidth ranges. The super high microwave spectrum.

Table 3.1 radio frequency spectrum bands

13 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

5. Infrared sensor
IR technology is used in daily life and also in industries for different purposes. For
example, TVs use an IR sensor to understand the signals which are transmitted from a
remote control. The main benefits of IR sensors are low power usage, their simple design
& their convenient features. IR signals are not noticeable by the human eye. The IR
radiation in the electromagnetic spectrum can be found in the regions of the visible &
microwave. Usually, the wavelengths of these waves range from 0.7 µm 5 to 1000µm.

The IR spectrum can be divided into three regions near-infrared, mid, and far-infrared. The
near IR region’s wavelength ranges from 0.75 – 3µm, the mid-infrared region’s wavelength
ranges from 3 to 6µm & the far IR region’s infrared radiation’s wavelength is higher than
6µm.

What is an IR Sensor/Infrared Sensor?


An infrared sensor is an electronic device, that emits to sense some aspects of the
surroundings. An IR sensor can measure the heat of an object as well as detects motion.
These types of sensors measure only infrared radiation, rather than emitting it which is
called passive IR sensors. Usually, in the infrared spectrum, all objects radiate some form
of thermal radiation.

These types of radiations are invisible to our eyes and can be detected by an infrared sensor.
The emitter is simply an IR LED (light emitting diode) and the detector is simply an IR
photodiode that is sensitive to IR light of the same wavelength as that emitted by the IR
LED. When IR light falls on the photodiode, the resistances and the output voltages will
change in proportion to the magnitude of the IR light received.

Figure 3.4 IR sensor

14 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

Working Principle
The working principle of an infrared sensor is similar to the object detection sensor. This
sensor includes an IR LED & an IR Photodiode, so combining these two can be formed as
a photo-coupler otherwise optocoupler. The physics laws used in this sensor are planks
radiation, Stephan Boltzmann & weans displacement.

IR LED is one kind of transmitter that emits IR radiation. This LED looks similar to a
standard LED and the radiation which is generated by this is not visible to the human eye.

Infrared receivers mainly detect radiation using an infrared transmitter. These infrared
receivers are available in photodiode form. IR Photodiodes are dissimilar as compared with
usual photodiodes because they detect simply IR radiation. Different kinds of infrared
receivers mainly exist depending on the voltage, wavelength, package, etc.

Once it is used as the combination of an IR transmitter & receiver, then the receiver’s
wavelength must equal the transmitter. Here, the transmitter is IR LED whereas the
receiver is an IR photodiode. The infrared photodiode is responsive to the infrared light
that is generated through an infrared LED. The resistance of the photo-diode & the change
in output voltage is in proportion to the infrared light obtained. This is the IR sensor’s
fundamental working principle.

Once the infrared transmitter generates emission, when it arrives at the object & some of
the emission will reflect toward the infrared receiver. The sensor output can be decided by
the IR receiver depending on the intensity of the response.

6. Node mcu esp32


ESP32 has 32-bit LX6 microprocessors, which run up to 600 DMIPS. The ESP32 will run
on breakout boards and modules from 160Mhz up to 240MHz. That is a very good speed
for anything that requires a microcontroller with connectivity options. The two cores are
named Protocol CPU and Application CPU. That means the processor handles the WIFI,
Bluetooth, and other internal peripherals like SPI, I2C, ADC, etc. The APP_CPU is left out
of the application code. This differentiation is done in the Espresso Internet Development
Framework (ESP-IDF). ESP-IDF is the official software development framework for the
chip. Arduino and other implementations for the development will be based on ESP-IDF.

15 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

ESP-IDF uses free RTOS for switching between the processors and data exchange between
them. We have done numerous tutorials on free RTOS and with all the bare-metal
programming tutorials for ESP32 we will try and cover this aspect in detail. Although the
feature set is great at the price at which the chip is being sold, the complexity is enormous.
For the chip to get widely adopted, it will require huge efforts from Express as well as the
community.
Internal Memory
The processors have closely tied internal memory for the following usage:
• 448 Kbytes ROM for booting and core functions.
• 520 Kbytes on-chip SRAM for data and instruction.
• 8 Kbytes SRAM in RTC, which is called RTC SLOW Memory and can be accessed by the
co-processor
• during the Deep-sleep mode.
• 8 Kbytes SRAM in RTC, which is called RTC FAST Memory and can be used for data
storage; it is accessed
• by the main CPU during RTC Boot from the Deep-sleep mode.
• 1 Kbit of EFUSE, of which 256 bits are used for the system (MAC address and chip
configuration), and the remaining 768 bits are reserved for customer applications, including
Flash-Encryption and Chip-ID.

Figure 3.5 ESP32


Most of the modules like ESP32 use external Flash-W25Q32 (4M Bytes!) for storing the
application code. The chip supports 4 x 16 MBytes of external QSPI flash and SRAM with
hardware encryption based on AES.

ESP32 accesses the external QSPI flash and SRAM through high-speed caches.

16 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

• Up to 16 MBytes of external flash are memory-mapped onto the CPU code space,
supporting 8, 16, and 32-bit access. Code execution is supported.

• Up to 8 MBytes of external SRAM are memory-mapped onto the CPU data space,
supporting 8, 16, and 32-bit access. Data-read is supported on the flash and SRAM. Data-
write is supported on the SRAM. Since the processor architecture is 32 bits. The internal
peripherals, Wi-Fi, Bluetooth, External Memories, etc. are mapped to 2^32 (4GB) address
space.

7.PHP language
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open-source
general-purpose scripting language that is especially suited for web development and can
be embedded into HTML

Example #1 An introductory example

Figure 3.6 PHP language


Instead of lots of commands to output HTML (as seen in C or Perl), PHP pages contain
HTML with embedded code that does "something" (in this case, output "Hi, I'm a PHP
script!"). The PHP code is enclosed in special start and end processing instructions <? PHP
and?> that allow you to jump into and out of "PHP mode."

What distinguishes PHP from something like client-side JavaScript is that the code is
executed on the server, generating HTML which is then sent to the client. The client would
receive the results of running that script but would not know what the underlying code was.
You can even configure your web server to process all your HTML files with PHP, and

17 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

then there's no way that users can tell what you have up your sleeve.

The best part about using PHP is that it is extremely simple for a newcomer but offers many
advanced features for a professional programmer.

8.MySQL
MySQL is a relational database management system (RDBMS) developed by Oracle that
is based on structured query language (SQL). a database is a structured collection of data.
It may be anything from a simple shopping list to a picture gallery or a place to hold vast
amounts of information in a corporate network. In particular, a relational database is a
digital store collecting data and organizing it according to the relational model. In this
model, tables consist of rows and columns, and relationships between data elements all
follow a strict logical structure. An RDBMS is simply a set of software tools used to
implement, manage, and query such a database.

MySQL is integral to many of the most popular software stacks for building and
maintaining everything from customer-facing web applications to powerful, data-driven
B2B services. Its open-source nature, stability, and rich feature set, paired with ongoing
development and support from Oracle, have meant that internet-critical organizations such
as Facebook, Flickr, Twitter, Wikipedia, and YouTube all employ MySQL backends.

Four keys to understanding MySQL

Because MySQL enjoys the most widespread use in many industries, business users from
new webmasters to experienced managers should strive to understand its main
characteristics. Deciding whether to use this technology, and communicate about it
effectively, starts with a review of MySQL’s basic availability, structure, philosophy, and
usability.

1, MySQL is widely compatible

Though often associated with internet applications or web services, MySQL was designed
to be extensively compatible with other technologies and architectures. The RDBMS runs
on all major computing platforms, including Unix-based operating systems, such as the
myriad Linux distributions or Mac OS, and Windows.

18 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

MySQL’s client-server architecture means it can support a variety of backends, as well as


different programming interfaces. Data can be directly migrated from MySQL to its forks
(e.g., MariaDB), as well as most other RDBMSs thanks to architectural and language
similarities.

Established Oracle and third-party migration tools further allow MySQL to move data to
and from a vast set of general storage systems, whether these are designed to be on-
premises or cloud-based. MySQL can be deployed in virtualized environments, distributed
or centralized, and even exists as portable standalone libraries for learning purposes,
testing, or small applications.

MySQL’s wide compatibility with all these other systems and software makes it a
particularly practical choice of RDBMS in most situations.

2, MySQL databases are relational

The primary factor differentiating relational databases from other digital storage lies in
how data is organized at a high level. Databases like MySQL contain records in multiple,
separate, and highly codified tables, as opposed to a single all-encompassing repository, or
collections of semi- or unstructured documents.

This allows RDBMSs to better optimize actions like data retrieval, updating information,
or more complex actions like aggregations. A logical model is defined over all of the
contents of the database, describing for example the values allowed in individual columns,
characteristics of tables and views, or how indices from two tables are related.

Relational models have remained popular for several reasons. They empower users with
intuitive, declarative programming languages essentially telling the database what result is
wanted in language akin to, or at least comprehensible as, written English, instead of
meticulously coding up each step of the procedure leading to that result. This moves a lot
of the work into the RDBMS and SQL engines, better enforcing logical rules and saving
valuable resources and manpower.

3, MySQL is open-source

Any individual or enterprise may freely use, modify, publish, and expand on Oracle’s open-
source MySQL code base. The software is released under the GNU General Public License
(GPL) For MySQL code needing to be integrated or included in a commercial application

19 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

(or if open-source software is not a priority), enterprises can purchase a commercially


licensed version from Oracle. Again, these options provide organizations with additional
flexibility if deciding to work with MySQL. The public and community-based nature of
open-source releases enrich MySQL’s documentation and online support culture, while
also ensuring that sustained or newly-developed capabilities never stray too far from
current user needs.

4, MySQL is easy to use

Though MySQL’s relational nature and the ensuing rigid storage structures might seem
restrictive, the tabular paradigm is perhaps the most intuitive, and ultimately allows for
greater usability. MySQL makes many concessions to support the widest possible variety
of data structures, from the standard but rich logical, numeric, alphanumeric, date, and time
types, to more advanced JSON or geospatial data. Beyond mere data types and an
expansive built-in feature set, the MySQL ecosystem also includes a variety of tools, easing
everything from server management to reporting and data analysis. Regardless of the
RDBMS’s overarching architecture, users can invariably find a MySQL feature allowing
them to model and codify data how they wish. MySQL remains one of the most
straightforward database technologies to learn and use.

8. Sublime Text
A sublime Text editor is a sophisticated text editor which is widely used among developers.
It includes wide features such as Syntax Highlight, Auto Indentation, File Type
Recognition, Sidebar, Macros, Plug-in, and Packages that make it easy for working with
the code base.

Figure 3.7 sublime text

20 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

3.2 Proposed research design


In this section Arduino, heartbeat and pulse rate sensor, radio frequency and infrared ray
camera sensor, PIR, GPS, PHP language, fingerprint sensor, and NOdeMcuESP32 Wi-Fi
module are used. The method used the patient medical state record using all sensors and
sent the data to the website server. The main principle behind this is that all sensors send
their data to the cloud then the website analyzes the incoming data and depending on the
situation it takes an action.

3.2.1.1 Block diagram of the system


The system design of the total project is shown below figure-- with a simple block diagram.

Figure 3.8 Block diagram of the system

21 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

We used different sensors to achieve our goal. We used Global Positioning System to
retrieve the location of the ambulance, the location of the hospital, and the patient in a
critical situation. MAX 30105 is a powerful and versatile sensor that is capable of sensing,
heart rate, and eye blinking. Analog Heart Rate Sensor .is a sensor that provides a clear
measurement of the electrical pulse of the heart. it can also be used to measure heart bit per
minute. LCD is being used to see readings of the data coming from the sensors. ESP32 It
is the control unit [processor] of the whole circuit with built-in Wi-Fi to connect to the
internet. Build-in Wi-Fi processing board to send data to the cloud. A passive Infrared
sensor is a motion detector that senses the presence of patients in the bed and using logic
the total number of beds occupied and the total number of the vacant bed are found. The
number of vacant beds is sent to the server through ESP32.

The system described above can be divided into4 main modules.

❖ Ambulance module
❖ Hospital module
❖ Traffic module
❖ Website module

1. Ambulance module
The module includes Bio-medical sensors for capturing the patient's vital details, the
ESP32 used as the central controlling unit, and a component for Wi-Fi connectivity and
data transfer. Here we used biomedical sensors like the pulse rate sensor and heartbeat
sensor. Pulse rate and heartbeat sensor sense the pulse and give the heartbeat rate, systolic
and diastolic pressure. The front sensor with the heart logo makes the contact with the skin.
Also, you can see a small round hole, it is where the LED shines. There is also a little
square just under the LED. The square is an ambient light sensor used to adjust the screen
brightness in different light conditions, The LED shines light into the fingertip or other
capillary tissue, and the sensor reads the light that bounces back. And also, there is an LCD
that shows the patient condition to the emergency medical responders in the ambulance.

2. Traffic module
It consists of the traffic lights controlled by an ESP32 placed in the traffic light which acts
as a receiver. The direction selection signals initiated from the ambulance are received by
ESP32. These signals are then analyzed by the ESP and the signal in the selected direction
is turned to green, this allows the smooth passage of the ambulance through the junctions.

22 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

3. Hospital module
A website for accessing the server is opened for whole 24x7 days. The hospital staff will
be monitoring the patient's condition through this. Further, they make a contact with the
medical assistant in the ambulance and give necessary instructions about giving proper
medical care. The hospital staff utilizes this facility to make necessary arrangements for
treating the coming patient. And we used PIR to check how many beds are vacant or not
in the hospital and we used fingerprint sensors to check in and check out Doctors the
fingerprint data are collected and send to the server to check the Doctor's availability.

4. Website module
Website the main part of this project the website collect data from the sensor and use them
as input for the task website that going to perform. On the website the user can call the
nearby ambulance, user can view the medical background of its own, check the nearest
hospital, and hospital statuses like Doctors' availability, vacant bed, and blood level.

23 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

Chapter Four
4. Simulation Result and Discussion
4.1 Simulation
For our simulation in the computer, we Xampp local server and chrome browser.

Figure 4.1 Database of Website

To run the website in


the Chrome browser To run database of
we have to start the website for the
Apache server simulation we have
to start MySQL
server

24 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

After we start Apache and MySQL in the chrome browser, we open our website by using
http://localhost/ URL then our website will open on the browser the first page of our
website is the login page.

Figure 4.2 Login page


In the login to get into the website, the user has to insert a card number or Id and password
then select the type of user. If he does not have an account, he has to create a new account.
The website check in the database if the user inserts the correct card number or Id and
password and if the user selects the correct user type.

25 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

This is the Doctors home page it consists of different functions like adding patient medical
background, viewing patient medical background, Emergency patient monitoring page,
and map.

Figure 4.3 Doctor home page

26 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

In this section, there is a page where the doctors insert the patient medical background first
the doctor inserts the patient's card number and then fills in the laboratory result. And when
he clicks Add medical background button then the medical result will be stored in the
database.

Figure 4.4 Add medical record page

27 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

To view the medical background the doctor first has to insert the patient's card number then
the system checks in the database.

Figure 4.5 enter the cord number


If the card number does not exit it shows as no information available.

Figure 4.6 list checkup page

28 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

If the card number is correct, it shows the list of checkups.

Figure 4.7 checkup


By clicking the open button, the doctor can view the patient medical record.

Figure 4.8 medical background page

29 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

Emergency patient monitoring page the doctors can monitor the patient's status in the
ambulance. The doctor can monitor the patient heart bit, Blood pressure, and ambulance
location.

Figure 4.9 Doctor monitoring page

30 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

The next section of the system is the user interface of the website which include the user
can view his/her medical record, call an ambulance, nearby hospital, and map.

Figure 4.10 User home page

31 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

Users can view his/her medical record or result of doctor checkups by inserting card
numbers.

Figure 4.11 user checkup page


By clicking the open button open and view the medical background on his/her own.

Figure 4.12 user side medical background

32 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

In the next part user can call the nearest ambulance by clicking the Call for Ambulance
button after we click the Call for Ambulance button the system checks the database and
will find the nearby ambulance and notify the ambulance.

Figure 4.13 Ambulance calling page


By calculating the distance between the user location and the ambulance location then
choose the nearby ambulance and notify the ambulance to respond.

Figure 4.14 database of ambulance

33 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

The next part is finding the nearest hospital to the patient by calculating the distance
between the hospital and the patient by clicking the nearby hospital the user can find the
nearest hospital and also can view the hospital data like doctors’ numbers, available bed
numbers, and blood level.

Figure 4.15 nearby hospital page

34 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

And also, the user view map

Figure 4.16 map page

4.2 Future Work


Because of the short time, we could not connect the sensors with the website database but
this system can be extended to send the patient's vitals to the hospital once the patient has
been picked up by the ambulance. This can be achieved by monitoring the health of the
patients using different sensors and sending the data collected by the sensors to the hospital.
The hospital staff can use this information to provide medical assistance to the patient
without any delay. There are many other high-priority vehicles like ambulances that
requires reaching their destination without any hindrance. Some of the high-priority
vehicles are fire engines, police vehicles, etc. Our application can be extended to these
High Priority Vehicles also.

35 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

Chapter Five
5. Conclusion and Recommendation
5.1 Conclusion
We conclude that as we have developed our project and it works as we have expected then
it will be a very successful project which will be useful in our daily life. And by smart
Ambulance, we will be able to go one step forward in the health sector.

The existing traffic management system in Ethiopia has fixed timers for traffic signals to
switch traffic between different directions and no specific changes in traffic signals for
emergency vehicles. Ambulance service is one of the important services that get delayed
very often due to traffic. To deal with this problem we designed this system. Which
automatically changes the traffic lights in the path of the ambulance. As the ambulance
itself changes the signal, it doesn’t require waiting in the traffic. This will save many lives
as the ambulance will be able to reach its destination on time. And real-time tracking helps
the person who called the ambulance to track the movements of the ambulance and call
another ambulance if the called ambulance is taking too long to reach. Thus, this project
can be a lifesaver project.

5.2 Recommendation
This project will be very important to reduce death because of the unavailability of
ambulances and traffic crowds. So, if it is implemented in Ethiopia there will be a
significant change in the emergency medical response system. There are many other high-
priority vehicles like ambulances that requires reaching their destination without any
hindrance. Some of the high-priority vehicles are fire engines, police vehicles, etc. Our
application can be extended to these High Priority Vehicles also.

36 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

References
1. al., A. e., n.d. android application and hardware module for traffic signal Rathore, P. IoT-
based Ambulance with Advance Patient Care Monitoring.

2. Akanksha Singh Tushar Agarwal, Lakshita and Sachin Jaiswal, Intelligent Traffic
Control Unit, International Journal of Electrical, Electronics and Computer Engineering
2(2): 66-72(2013).

3. Amnesh Goel, Sukanya Ray and Nidhi Chandra Intelligent Traffic Light System to
Prioritized Emergency PurposeVehicles Based on Wireless Sensor Network, IJCA (0975-
8887) Volume 40-No.12, Issue of February 2012.

4. Mr. Nandagopal, Mr.’s. Iyyappan Automatic Accident Detection and Ambulance Rescue
with Intelligent Traffic Light System, International Journal of Advanced Research in
Electrical, Electronics and Instrumentation Engineering Vol. 2, Issue 4 of April 2013.

5. B.-H. Yang, S. Rhee, and H.H. Asada, Modeling of Finger Photoplethysmography for
Wearable Sensors, at the 1999 Annual Fall Meeting of the Biomedical Engineering.J. Clerk
Maxwell, A Treatise on Electricity and Magnetism, 3rd ed., vol. 2. Oxford: Clarendon,
1892, pp.68-73.

6. Venkatesh, H., Perur, S.D., & Jagadish, M.C. (2015). An approach to making way for an
intelligent ambulance using IoT. International Journal of Electrical and Electronics
Research, 3(1), 218-223.

7. Levecque, K., Anseel, F., De Beuckelaer, A., Van der Heyden, J., & Gisle, L. (2017). Work
organization and mental health problems in Ph.D. students. Research Policy, 46(4), 868-
879.

8. Kobayashi, T., Kimura, F., Imai, T., & Arai, K. (2019). Smart Ambulance Approach Alarm
System Using Smartphone. IEICE Transactions on Information and Systems, 102(9),
1689-1692.

9. Sharma, A., Choudhury, T., & Kumar, P. (2018, June). Health monitoring & management
using IoT devices in a Cloud-Based Framework. In 2018 International Conference on
Advances in Computing and Communication Engineering (ICACCE) (pp. 219-224). IEEE.

37 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

10. B. Janani Saradha, G. Vijayshri, T.Subha UG students “Intelligent Traffic Signal Control
System for Ambulance Using RFID and CLOUD”, Second International Conference on
Computing and Communications, 2017

11. Jay Lohokare, Reshul Dani, Sumedh Sontakke, Ameya Apte, Rishabh Sahni “Emergency
services platform for smart cities”, 2017
12. Omkar Udawant, Nikhil Thombare, Devanand Chauhan, Akash Hadke, Dattatray Waghole
“Smart Ambulance System using IoT”, 2017
13. D. Ahir, S. Bharade, P. Botre, S. Nagano, and M. Shah, “Intelligent Traffic Control System
for Smart

38 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

Appendix
<html>
<head>
</head>
<body style="background: linear-gradient(to right, rgb(80,200,220) ,white); color:
black;">

<center>
<form class="float_form" style="padding: 100px 100px" action="login_handler.php"
method="POST">
<fieldset>
<legend>Login Details:-</legend>
<strong>Card No or Id:</strong><br>
<input type="text" name="username" placeholder="Enter your username"
required><br><br>
<strong>Password:</strong><br>
<input type="password" name="password" placeholder="Enter your password"
required><br><br>
<strong>User Type:</strong><br>
Doctor <input type='radio' name='user_type' value='BusAdmin'
checked/><br><br>Patient <input type='radio' name='user_type' value='Customer'
checked/><br><br>

<?php
if(isset($_GET['msg']) && $_GET['msg']=='failed')
{
echo "<br>
<strong style='color:red'>Invalid Username/Password</strong>
<br><br>";
}

39 | P a g e
IOT BASED EMERGENCY MEDICAL AND SMART AMBULANCE

?>
<input type="submit" name="Login" value="Login">
</fieldset>
<br>
<a href="new_user.php"><i class="fa fa-user-plus" aria-hidden="true"></i> Create
New User Account?</a>
</form></center>
</body>
</html>

40 | P a g e
1|Page

You might also like