Smart care business uses the Internet of Things

It is important to increase the quality of health and medicine. A wearable system for continuous monitoring of the patient is important to overcome this issue. Thus a patient with Arrhythmia due to its low cost and success in saving the life of the patient was the right option for the care partner. In addition, the device will provide a consumer with a smart smartphone application with accurate pulse beat and body temperature data in real time. MAX 30100 and LM35 are primarily used for the detection of human heart and temperature. The performance of these sensors is generated by an arrhythmia algorithm in the esp32 segment.


Introduction
Increasing number of elderly people is a challenge because they have high predisposition to heart disease, so they need to be monitored . According to the UN World Health Organization (WHO), the elder population will exceed the population of children younger than 5 years. In 2020, the elder population will continue to grow at an unexpected rate. A recent statistic for National Institute Health (NIH) shows that 617 million people worldwide are over 65 years old.
Heart disease is one of the main causes of sudden deaths, Recent statistic of National Health Service (NHS) shows that there are more than 2 million people a year in the United Kingdom (UK) suffer arrhythmia. Early detection and treatment prevent occur sudden deaths (Almatarneh, et al., 2019).
Heart rhythm problem (arrhythmias) occurs when heartbeats are irregular, because the electrical signals are not working correctly. The regular heartbeats rate for normal people at rest is between 60 and 100 beats per minute (BPM). Doctors classify arrhythmias into two types according to their location or speed (Alshamaileh et al., 2016).  Overactive thyroid gland I. Tachycardia: heart rate more than 100 BPM (an abnormally fast heart rate).

II.
Bradycardia: heart rate lower than 60 BPM (an abnormally slow heart rate).

III.
Atrial arrhythmias come from the upper heart chambers (atria).

IV.
Ventricular arrhythmias come from the lower heart chambers (ventricles).

Figure 3. Symptoms of Arrhythmia
Currently, in the market, there are several Internet of Things (IoT) devices able to collect patient vital signs. However, the price of these devices makes them unattainable for most part of the population. Therefore, as engineering means helping those most in need, this project is providing a medical companion system with high availability, high performance and low cost which is the main aim and aspire of this study.
The aim of this project is to provide a medical companion system with high performance and low cost for helping people who are suffering arrhythmia by monitoring their vital signs with a smartphone application that is designed to follow up the patient and generate an alarm if the heart rates are indicating a dangerous situation and need an assistance.

Literature Review
In previous years, several methods have been presented in the area of arrhythmia detection to monitor the patient in a simple way. This section will present (or discuss) these methods. Firstly. Karim Mohammad designed and implement an embedded system for monitoring cardiac disease by detecting the patient's heartbeat using an electrocardiogram (ECG) (Altweiq and Alkhawaldeh, 2019).
Design a system which automatically detects the abnormal heartbeat then call the helpline in an abnormal situation using a GSM module. Niralex implemented a chip for measuring Straightness Training (ST) evaluation and alert the patient who suffers a heart disease. The abnormal heart situation is detected by characterizing the points of electrocardiogram (ECG) waveform, which the discrete wavelet transforms (DWT) algorithm is used to characterize the points .
A system for elderly people, this system is a walking stick, which placed in it a transmitter that contains a biosensor and amplifier circuitry to amplify the heartbeat signal, and the receiver system is worn by the elderly which contains a microcontroller and GSM. Designed a personal heart rate monitoring system using a biometric sensor. This system is very useful to a patient who wants to detect his heart rate by himself. Implemented a system for ECG monitoring using microcontroller and biosensors to detect the heart rate. The heartbeat can be monitored based on the detected ECG signal (Selvathi, et al. 2017).
Ufoaroh proposed a real-time system for monitoring a heartbeat. The system monitors the heart rate. In the critical situation, it sends SMS alert to the medical experts and patients family members. Ricardo Joaquinito designed a prototype model to measure the bio signal, for wireless data transmission to a smartphone; he uses ARM processor and Bluetooth . Design and implementation. V.

Symptoms of Arrhythmia
Testing.
Finally, IZCI and Mehmet Akif proposed an algorithm based on Empirical Mode Decomposition (EMD) to detect the arrhythmia in four steps; as follows: As seen in the above literature survey, it covers a variety of such methods and applications of arrhythmia detection. This project primarily focuses on what has been concluded and developed to come up with a new method of a wireless device that is connected with a mobile application; used to periodically monitor one's heartbeats and temperature. Moreover, sent an alert in an abnormal situation (Gp and amp. 2019).

System design
The fourth industrial revolution is expected to significantly influence the way individuals live and in that case change society in different aspects. It appears in several fields such as Artificial Intelligence (AI), Nanotechnology, 3D printing, Quantum computing, Fifth-generation wireless technologies (5G), and Internet of Things (IoT).
All these fields appeared to massively effect and develop the smart systems and the smart world concept with their several applications. Smart systems make human life more convenient and easier. It has a huge influence on everyone's life as technology is updated day by day. The block diagram of the smart System is shown in the Figure 4. It consists of 5 modules which are; Sensors, Data acquisition (DAQ), Processing Unit, Communication, and Power requirements (Fariborzi, et al. 2007). .

Figure 4. Smart System
Wireless Sensor Network (WSN): they are group of sensors which are used to transport or tracking specific chemical or physical phenomenon Such as heat, humidity, vibration, and light, then transmit these data wirelessly to data processing centre without need the presence of human being in a place of the phenomenon. It Consists of several numbers of different small sensor nodes communicate wirelessly to each other, and also have intelligent sensors to monitor the changes in surrounding then collected, processed and sent to monitors. There are many applications on WSN as Military observation, Monitor traffic, Protection of infrastructure, and Tracking objects I.
Pre-processing II.
Machine to Machine Communication (M2M): It is technology to the development of IOT, and one of the first application of IOT. It allows the wireless and wired communications systems to communicate with other system and devices that have the same capacity. it uses some devices to take event then transmit over the wireless, wired and hybrid network to convert this event to the application. The expansion of wireless network around the world made a simple way to connect M2M and reduced the time and power needed to exchange information between machine, in result M2M is expanded and turned into a large system of a network to transmit most of the data to personal application. It is used in many applications as Health, Security and Safety, Smart Environment, Transportation. Hopefully, this technology is going to support generation cellular networks like 5G.
Internet of Things (IoT): It is the most important expression appears recently of modern technology which means a new generation of the internet that enables the communication between interconnected devices together via Internet Protocol. These devices consist of computers, phones, sensors, several tools of Artificial Intelligence and other tools. it is a contact between people, computers and smartphones through a single global network and through a traditional known internet protocol which allows people to be free to control any devices whether near or far without having to be in a specific place to deal with devices. In fact, it can be useful in several applications as smart cities, transportation, smart home, remote healthcare, education, traffic management, security, as result IOT is very useful for human life. The block diagram of the medical companion project is shown in the Figure 5. Nowadays, wearable devices become the most personal devices. They can expedite the speed of directing users to IoT. Moreover, they will be the entrance of IoT.

on-Field Network:
Every wearable device consists of MAX30100 and LM35 sensor, and Esp32.

I.
MAX30100: It is the first part of the sensing parts of the medical companion to measure the heart rate of patient and send the data to the ESP32. II.
LM35 : It is the second part of the sensing parts of the medical companion to measure the temperature of the patient and send the data to the ESP32 III.
ESP32: It is a programmable-system-on-chip (PSoC) microcontroller which gets the data from the sensing parts, sends these data to the Google Cloud using Wi-Fi and sends them to smart mobile application using Bluetooth.

Cloud Platform
Nowadays, Data analysis is one of the most important tasks in any project and not confined to Information Technology (IT) experts only. Due to the lack of technical expertise and resources, many non-technical cannot perform data analysis for their vast datasets. In fact, they do not need to perform large-scale analytics to fulfil their limited analysis, whereas Google provides a comprehensive set of data analysis tools for non-technical users. A set of Google tools Google Maps, Google Sheets, Google Charts, and Google Cloud. Google cloud is a suite of cloud computing services that allow the user to access their data via an Internet service connection on any device.

User Platform
The smartphone may become a second screen Internet of Things (IoT) future shaped by wearable devices as wearable devices get smarter. As part of the development process of smartphones, mobile applications are also getting more developed to meet customers' needs and deliver more services.
From this perspective, a mobile application was built to be a part of this project, in order to continually receive the data of the patient's heartbeats and temperature, whether it was via Wi-Fi or Bluetooth in case of Wi-Fi disconnection. It is also important to mention that the Wi-Fi is used to upload this data to Google Cloud to be analysed.

Sensor Definition
A device that responds to some type of input from the physical environments and detects the change in environmental phenomena. The input of the sensor could be heat, light, pressure, or any of other environmental phenomena, and the output is a signal that converted to human-readable display.  Figure 6, the sensor is a device that detects the physical environment and convert it into an electrical signal, which the controller can read it.

Classification
The sensors are classified into the following criteria: Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 3 February 2021 doi:10.20944/preprints202006.0177.v2 There are certain features that must take into consideration when choosing a sensor: The sensor can measure table 1 shows the different kinds of physical change.

Table 1. Physical Changes
The Medical Companion project measure temperature and heart rate. However, there are many kinds of temperature and heart rate, these kinds will discuss as follows:

A. Temperature Sensor:
This sensor collects information about temperature, and then converts it into a form that is suitable for reading by the microcontroller. Application. II.
Primary Input quantity. III.
Material and Technology.
Repeatability. VI. Linearity Table 2. Temperature Sensors Specifications Semiconductor-based sensors are the sensor that will be used in this project to measure the temperature, and there are many kinds of them, which one of them will be chosen for this project.

Table 3. Semiconductor-based Sensors Specifications
From Table 3 Lm35 sensor will be chosen for Medical Companion project.

I.
Thermistor: is a thermally sensitive resistor that shows a precise change in resistance corresponded to changes in temperature. There are two kinds of thermistor; Negative Temperature Coefficient (NTC) and Positive Temperature Coefficient (PTC). II.
RTD: also known as a resistance thermometer, it is a thermal resistor that is manufactured to change the electrical resistance with the change in temperature. It consists of a film or a wire wrapped around a ceramic for greater accuracy. III.
Thermocouple: it consists of two wires of different metals which form a measuring junction by connecting at one end. The changing voltage between these two points indicates proportional changes in temperature IV.
Semiconductor-based sensors: it is an electronic device fabricated in a similar way to other modern electronic semiconductor components such as microprocessors, also is placed on integrated circuits (ICs).

Data Acquisition System
Is the process of gathering of signals from the measurement of physical phenomena. This physical could be heartbeat for the patient, or his temperature. Then convert these signals to electrical signals. According to National Instruments (NI) the DAQ system consists of computer with programmable software, DAQ measurement hardware, and sensors.

I.
Heartbeat pulse sensor: it is used to examine the heart rate. A heart rate Integrated Circuit (IC) consists of Amplifying circuit and noise cancelling. The supply voltage: 3V or 5V. II.
Max30100 pulse oximeter: it is a heart rate monitor sensor. The Max30100 IC consists of two LEDs, low-noise analogue signal processing, a photodetector, and optimized optics. The supply voltage operates between 1.8V and 3.3V. III.
AD8232: It is used to measure the electrical activity of the cardiac as an Electrocardiogram (ECG).

Figure 4. DAQ process
According to Figure 6. DAQ hardware consists of Signal conditioning and analogue-digital converter: A. Signal conditioning elements: Is the manipulation of a signal by convert the output of physical quantities, in a way suitable to prepare it for the next stage of processing. Operational amplifiers (Op-Amps): They are the fundamental construction blocks of Analogue electronic circuits. There are different kinds of amplifies such as; Voltage follower, Non-inverting amplifier, inverting amplifier, Integrator, Differential amplifier, Comparator, Summing amplifier.

III.
A.C. Carrier systems: Amplifier drift and external interference in the signal circuit are the most difficult problems in conditioning low-level Direct Current (DC). If the signal is converted into Alternative Current (AC) form, amplified and then reconverted into DC, these problems could be avoided. The primary elements in an AC carrier system are one of the following kinds: A. R, L, C sensors in a suitable deflection bridge. B. LVDT sensor.
B. Analogue-to-digital conversion: The most output of sensors are analogue signals and the microcontroller is digital equipment. Analogue signals must be converted before manipulated by a microcontroller using Analogue to digital converter (ADC). The output data turns into a series of digital values by fixed precision with approximates the signal

Signal conditioning Deflection Bridge
Operational amplifiers AC Carrier systems

Processing Unit
There are many types of processors that are used in the smart systems. The most used processors are: • Microprocessor unit (MPU): Also known as a heart of Computer systems, it is an integrated circuit that incorporates the functions of a central processing unit of a computer. MPU is based on Harvard architecture where data memory and program memory are separate. • Microcontroller unit (MCU): Also known as a heart of embedded systems, it is a small computer on a compact integrated circuit designed to perform a specific task. Its integrated circuit consists of a processor core, memory, and programmable input/output peripherals. MCU is based on Von Neumann model where data and program are stored the same memory module.

Table 1. Comparison between Microprocessor and Microcontroller
MCs are used to control devices automatically, such as medical devices, automobile engine control systems, power tools, remote controls, appliances toys, office machines and other embedded systems. The MC is more economical because its design is created to reduce the cost and size compared to other designs that use separate memory, MP, and input/output devices.

Programmable System-on-Chip (PSoC) is a family of Microcontroller integrated circuits by Cypress
Semiconductor. It composed of a CPU core, programmable interconnect architecture, and configurable analogue and digital blocks. There are many types of PCoC, Table 6 will discuss the most common types of them.

Table 2. Characteristics of PSoC types
Espressif Systems produce a range of high-performance Wi-Fi and Bluetooth modules. They work with original equipment manufacturers to add wireless connectivity to their product [17]. Espressif devices will be used in Medical Companion project, due to their low-cost and high performance that they provide, which make them the best choice for this project. However, there are many types of Espressif devices, these types will be discussed as follows in table 7 bellow: After studying the characteristics of each type, Esp32 was the best choice for this project and this is due to the following reasons: Esp32 contains built-in Wi-Fi and Bluetooth. The data will be uploaded to Google Cloud using Wi-Fi and the need for Bluetooth come up to connect the medical companion device with the mobile application to prevent the Interruption of Wi-Fi. II.
The number of Analogue pins in ESP32 and ESP8266 is 18 pins and one pin, respectively. III.
The cost of ESP32 is £5.44, where it is £3.85 for ESP8266.However, if Bluetooth shield is added to ESP8266, it will cost more than ESP32.

Communication Media
One of the most important features of human society is the need for others. No one can live in isolation from others, be far from them or not communicating with them. Efforts have been always made to search for ways to facilitate communication between people. The purpose of communication is to create channels between groups and individuals in a way that ensures speed and determine the destination of the communication. In previous communities, they have emerged in the use of pigeons in the delivery of written messages between people and between countries, but in this era, we live in this matter easier and faster than before, thanks to the emergence of communication systems modern wired and wireless.

Figure 10. Types of Communication System
In the 20th and 21 centuries, we now have the means of telecommunications through fixed telephone networks. These networks have been providing fixed communication services through their presence in companies, homes, public and private institutions. As the progress of science emerged wireless communications that used technology Cellular networks in the provision of mobile communications services characterized by fast communication and ease of transition and flexibility of the system, and the breadth of spatial coverage as well as the abundance of service features provided by networks of cellular service providers.
The wired system in communications means that broadcast and reception (transmission) of information (data) over a wire between transmitter and receiver. Wire include transmission line like:

•
Coaxial Cable: It designed to transmit high-frequency signals and for community antenna. The coaxial cable which consists of a single solid-copper core which converts the information (data) electrically. Coaxial cable consists of two conductors, an outer cylinder that can be solid or braided, and an inner conductor that can be solid or stranded [18].  Wireless communication is a transfer of information and power between transmitter and receiver without the use of wire conduction, the transfer process done by using Electromagnetic (EM) waves and with remote controlled this information by EM wave, the most common use radio waves. There are many types of the wireless communication including Bluetooth, wireless network, mobile broadband, Wi-Fi, and Wi-Max.

Wired
• Bluetooth: It is a standard technology for wireless communication to transfer data between two electronic devices through short distances by using ultra-high-frequency radio waves (UHF). In 1994, this technology began to develop to be as an alternative to cables of (RS-232). It is controlled via Bluetooth development kit from Special interest group (SIG), which include of more than 30 thousand member companies in the field of Telecommunications, networking and electronics.
• Wi-Fi: It is a technique which most wireless networks are based on it, it uses radio waves to exchange information instead of wires and cables, it also able to penetrate the barriers and walls. Moreover, it has high-speed data transmission and data rate up to 54 Mbps. • Worldwide Interoperability for microwave access (Wi-Max): It is a technique of broadband wireless communications systems; this technology is an alternative to wired communication technology that uses Digital Subscriber line (DSL). Moreover, it is an advanced technology of Wi-Fi. Almost it is working in the same way of Wi-Fi by different speeds and distance.

Table 4. Wireless Communication Specification
After studying the characteristics of each type, Wi-Fi and Bluetooth were the best choice for this project.

Power requirements
In the world we are living today, almost everything around us require electrical source. The source power may simply come from an electrical outlet from the electric power grid or storage devices such as batteries. The Figure 15 presents the types of power sources used; which are briefly discussed below.

Figure 14. Main Power Sources
Mains: There are many areas of energy resources. They mainly fall into two categories: non-renewable and renewable resources.
• Non-renewable energy is a source of energy that will ultimately run out and is available in limited supplies. The resources are mostly fossil fuels such as coal, oil (or petroleum) and natural gas. Although they are relatively inexpensive to extract, they lead to large amount of destruction and harm to the environment and cause pollutant emission, which is the main reason why the world is looking forward to fully depend on renewable energy in the future. • Renewable energy resources are by far the less pollutant sources of energy. They are replenished naturally over relatively short periods of time, have lower running cost and are widely available. There are five major of renewable energy resources: solar, wind, water (hydro), biomass and geothermal.
Nuclear energy though can be considered as either non-renewable or renewable; as nuclear energy, itself is a renewable energy source but the material used in nuclear power plants is not (Krishan, et al., 2019).
• Batteries: They contain two or more voltaic cells, which are connected in series to produce a constant DC voltage at the terminals of the battery's output. These voltaic cells use a chemical reaction to produce electrical energy.
The voltage output for a battery is determined by: 1-The elements used for the electrodes.
2-The size of the electrodes.
3-The type of electrolyte used.
There are two kinds of batteries as shown in figure 15, depends on the cells used to form the battery: • A primary cell: cannot be recharged due to the internal chemical reaction be returned [22].
• A secondary cell: also known as a storage cell, it can be recharged due to its chemical reaction can be returned [22].

Mains
Renewable Energy

Non-renewable Energy
Batteries Primary Secondry Medical companion is a wearable device that makes the Batteries the best choice for the power source instead of mains that will be used in this project.

Table 5. Comparison between Primary and Secondary Batteries
The secondary rechargeable battery is the type used in this project, as it can be recharged many times and has a much lower total cost of ownership and environmental impact. The most common ones are Lead Acid, Nickelcadmium, Nickel-metal-hydride, Lithium-ion and Lithium-ion-polymer. Lithium-ion-polymer was the best choice upon these types to be used. Although it has the highest cost; it has the longest cycle life, fastest charging time and it is the least toxic one. This type has excellent energy density and capacity. In addition to that, the solid polymer cell does not require the heavy protective cases of conventional batteries. Therefore, the cells can be formed into flat sheets which fit the device implemented in this project.

Conclusion
As a result of this study and doing this medical companion system, a real-time operating system for monitoring patients is provided with low-cost which enable more people to be able to buy it. This system also delivers the recorded data to a mobile app on the patient's smartphone and simplifies the tracking process of patients by automatically sending their location in emergency situations.