Full text
BACHELOR FINAL THESIS Design of a Nurse Calling System with Real Time Indoor Locations Capabilities Author: Enric Botella Pastor Director /Co-director: Javier Freire Venegas Degree: Bachelor in Industrial Technology Engineering Examination session: Extension, 2023 Document: Report
i Abstract The main driver of this project has been to design a prove of concept of a device that allows live voice communication between patients and medical staff and the capability to locate in real time patients in an enclosed environment. The author of this project had an initial constraint it was supplied by the project director supplied for this project a DWM1001-DEV Module Development Board which provides accurate positioning thanks to its wireless Real Time Location System. After a study of the problem, a selection of components, both hardware and software were selected. The sound system is composed of a I2S Microphone SPH0645 for real time audio capturing, an I2S Amplifier Breakout board MAX98357A and a generic 8ohms speaker. The patient interface component is a button used to trigger communication. For the development of the software the Espressif IoT Development Framework was used, it provides APIs for the user to program the ESP32. The ESP-IDF was installed on VSCode IDE. For debugging the system, we used a J-Link PRO with the Eclipse IDE. The ESP32 communicates with a python-based server using a Wi-Fi network, the communication is based on the UDP protocol. The result is a prototype that showcase that a final product based on this system is feasible, it presents great autonomy and excellent real time communication features. Further lines of work are described, and the presented system is flexible enough to integrate them. El motor principal d'aquest projecte ha sigut dissenyar un dispositiu que permet la comunicació per veu en directe entre pacient i personal sanitari amb la capacitat de localitzar en temps real els pacients en un entorn tancat. Per l'elaboració del dispositiu, el director del projecte ens proporciona un mòdul DWM1001- DEV sense fils que estableix un posicionament precís gràcies a l'ús de la tecnologia Ultra Wide Band. Un cop estudiat el problema, es van seleccionar una sèrie de components tant de hardware com de software. El sistema de so està format per un micròfon I2S SPH0645 per la captura d'àudio en temps real, una targeta I2S Amplifier Breakout MAX98357A i un altaveu genèric de 8 ohms. La interfície pacientdispositiu es dona a través d'un polsador, una vegada activat, el pacient pot comunicar-se amb el personal de l'hospital. Pel desenvolupament del software es va fer servir Espressif IoT Development Framework, que proporciona APIs per tal que l'usuari programi l'ESP32. L'ESP-IDF s'ha programat amb l'IDE VSCode; per debuggejar el sistema es va utilitzar un J-Link PRO con el IDE Eclipse. L'ESP32 es comunica amb un servidor basat en Python fent ús d'una xarxa Wi-Fi, on la comunicació es basa en el protocol UDP. Com ha resultat tenim un prototip que demostra que un producte final basat en aquest sistema és factible, presenta gran autonomia i excel·lents prestacions de comunicació en temps real. Es descriuen altres línies de treball, i el sistema presentat és prou flexible per a integrarles.
Bachelor thesis title ii
iii Table of contents ABSTRACT .................................................................................................................................................... I TABLE OF CONTENTS .................................................................................................................................. III LIST OF TABLES ............................................................................................................................................ V LIST OF FIGURES ......................................................................................................................................... VI LIST OF ABBREVIATIONS / GLOSSARY ......................................................................................................... IX 1. INTRODUCTION ....................................................................................................................................... 1 1.1 OBJECT ............................................................................................................................................... 1 1.2 SCOPE................................................................................................................................................. 2 1.3 REQUIREMENTS .................................................................................................................................... 3 1.4 RATIONALE .......................................................................................................................................... 4 2 BACKGROUND AND/OR REVIEW OF THE STATE OF THE ART ............................................................... 5 2.1 REGULATIONS ....................................................................................................................................... 5 2.2 STANDARDS ......................................................................................................................................... 5 2.3 EXISTING TECHNOLOGY ........................................................................................................................... 6 2.3.1 Legacy solutions ........................................................................................................................... 6 2.3.2 New state of the art solutions ...................................................................................................... 7 3 METHODOLOGY ................................................................................................................................ 10 3.1 SYSTEM ARCHITECTURE ........................................................................................................................ 10 3.2 SUBSYSTEM ARCHITECTURE ................................................................................................................... 11 3.2.1 RTLS Subsystem .......................................................................................................................... 11 3.2.1.1 Choosing the right Interface ............................................................................................................. 12 3.2.2 Communication system .............................................................................................................. 13 3.2.2.1 Choosing a Physical/Data-Link layer Network Protocol .................................................................... 13 3.2.2.2 Integrated or separate Wi-Fi Module ............................................................................................... 13 3.2.3 Sound System ............................................................................................................................. 14 3.2.3.1 Analog Audio Processing .................................................................................................................. 14 3.2.4 Patient interface ........................................................................................................................ 16 3.2.5 Power Supply ............................................................................................................................. 16 3.2.6 Master Mcu ............................................................................................................................... 17 4 ELECTRONIC COMPONENTS .............................................................................................................. 18 4.1 MASTER MCU .................................................................................................................................... 18 4.2 POWER SUPPLY ................................................................................................................................... 20 4.3 AUDIO SYSTEM ................................................................................................................................... 21 4.3.1 Recording system ....................................................................................................................... 21 4.3.2 Playback System ........................................................................................................................ 22 4.4 DWM1001-DEV .............................................................................................................................. 24 4.5 PATIENT INTERFACE ............................................................................................................................. 24 5 TOOLS ............................................................................................................................................... 25 5.1 SOLDERING AND ELECTRONICS TESTING .................................................................................................... 25 5.2 PROGRAMMING THE ESP32 .................................................................................................................. 26 5.2.1 Hardware ................................................................................................................................... 26 5.2.2 Software .................................................................................................................................... 26 5.2.3 Installation ................................................................................................................................. 27 5.2.4 Start a project ............................................................................................................................ 27 5.3 JTAG DEBUGGING THE ESP32 .............................................................................................................. 28 5.3.1 Hardware ................................................................................................................................... 28
Bachelor thesis title iv 5.3.2 Software .................................................................................................................................... 28 5.3.3 Set-up ......................................................................................................................................... 29 5.3.4 Start debugging ......................................................................................................................... 30 5.4 WIRESHARK ....................................................................................................................................... 31 6 CONSIDERATION AND DECISION REGARDING ALTERNATIVE SOLUTIONS .......................................... 32 7 DISCUSSION OF THE SOLUTION ........................................................................................................ 34 7.1 CONFIGURING THE RTLS ...................................................................................................................... 34 7.1.1 Network ..................................................................................................................................... 34 7.1.2 Scalability ................................................................................................................................... 35 7.2 PROGRAMMING THE ESP32 ................................................................................................................. 36 7.2.1 RTLS data fetch .......................................................................................................................... 38 7.2.1.1 Component Architecture .................................................................................................................. 39 7.2.2 Interface component .................................................................................................................. 42 7.2.2.1 Component Architecture .................................................................................................................. 43 7.2.3 Wi-Fi Component ....................................................................................................................... 44 7.2.3.1 Component Architecture .................................................................................................................. 45 7.2.4 Audio pipeline ............................................................................................................................ 49 7.2.4.1 Recording pipeline ............................................................................................................................ 49 7.2.4.2 Playback pipeline .............................................................................................................................. 52 7.2.5 UDP component ......................................................................................................................... 54 7.2.5.1 Component architecture .................................................................................................................. 55 7.3 SERVER ............................................................................................................................................. 60 7.3.1 Server Architecture .................................................................................................................... 61 8 BUDGET SUMMARY .......................................................................................................................... 65 9 ANALYSIS AND ASSESSMENT OF ENVIRONMENTAL AND SOCIAL IMPLICATIONS ............................... 67 10 CONCLUSIONS .................................................................................................................................. 68 11 REFERENCES ..................................................................................................................................... 70 ANNEX C BUDGET ..................................................................................................................................... 80
v List of tables Table 1. Technical Characteristics of MEM Mics (Source: Enric, Botella-Pastor) Table 2. Technical Characteristic of different RTLS solutions (Source: Gladysz, B., and K. Santarek. “An Approach to Rtls Selection.” DEStech Transactions on Engineering and Technology Research, no. icpr, Mar. 2018, https://doi.org/10.12783/dtetr/icpr2017/17576.) Table 3: dwm_pos_get request (Source: Decawave Ltd. DWM1001 Firmware API Guide. 2019, p. 43, https://www.qorvo.com/products/d/da007975 . Accessed 12 Nov. 2022.) Table 4: dwm_pos_get response (Source: Decawave Ltd. DWM1001 Firmware API Guide. 2019, p. 43, https://www.qorvo.com/products/d/da007975 . Accessed 12 Nov. 2022.) Table 5: Budget summary (Source: Enric, Botella-Pastor) Table 6: Budget (Source: Enric, Botella-Pastor) Table 7: Component providers (Source: Enric, Botella-Pastor) Table 8: Data Sheets (Source: Enric, Botella-Pastor)
Bachelor thesis title 2 1.2 Scope This project has three main phases. The first phase research and analysis of the problem, the second phase focus on designing a solution to the problem and the third phase implements that design. The first phases main work packages are: • Study of the problem and requirements. • Study of regulations and standards applied. • Study of legacy solutions and state of the art solutions to similar problems. • Study of project related to Audio or RTLS. The Design of a solution deliverables are: • Identification of Main Components of the System. • Identification of Main interfaces between Components. • Identification of key elements for each Component. • Proposal of a System Architecture. • Selection between Hardware/Software alternatives to build or prototype. The implementation of the design will focus on the delivery of a prototype which will demonstrate if the project is feasible and further development is justified. The prototype at least must deliver real time voice communication and in time positioning. From the knowledge acquired proposals for further development or modifications of the presented prototype will be made.
3 1.3 Requirements Requirements for this project have been drafted in close contact with the Tutors and nurse Dr. Adelina, who I thank a lot for her input as a healthcare worker. The project requirements are the following: • Location of device user with a 1m radius precision. • Device should be portable, light weight and rechargeable. • Device should have an autonomy of >=24h. • Device should be able to locate patients in an enclosed space. • Update position of the patient when he prompts a button and make it available for • Update position of the patient at lease every three minutes. • The patient should only interact with one button, and it should be easy to access and prompt. • Once the patient prompts the button, he can talk using a microphone attached to the device. • Health care workers can contact back the patient via voice. • The patient should be able to hear back an answer from health care workers. • Health care workers should be able to know information about the patient who is behind the device. Name, what unit is he/she in (ex. Traumatology), last updated position. • Creation of interface for health care workers to access information about patients and contact with them if patient press the button. • The system requires a micro controller with Wi-Fi to link the microphone, speakers and a server. • The device should use MDEK1001 Development Kit as Realtime location system (RTLS) as we currently own a kit, and the accuracy is in the range of centimetres.
Bachelor thesis title 4 1.4 Rationale This Project wants to solve a problem in the health care sector. ICU units in most hospitals have a limited number of beds that cannot handle the influx of patients at peak hours or special events. If this scenario is reach patients lay on the alleyways of the hospital in mobile beds or chairs. Normal communication channels in the hospital are immediately severed. When hospitals run at capacity the communication channels if a patient asks for help consist of a button patient can press. From a panel hospital staff can spot which room has asked for assistance and then reach out the alleyway where red light above the room signals that the patient inside need assistance. This method of communication works fine but it is not portable or scalable. Several dysfunctions in a hospital occur because of lacking a communication system that is portable or scalable. Patients are forced to scream if they want to get the attention of the staff. This method clearly has drawbacks, it is not assured that someone will hear the patient when heard it is not clear where the screams might come from. It is also tiresome for the patient and other patients that hear the screams and might add stress to them which is decremental to health. Applying embedded systems technology will allow us to solve this issue while allowing us to add new functionalities that current systems lack. RTLS allows us to retrieve locations of a device within an enclosed or open environment with great precision while being portable. Allowing the location of patients not only inside of the hospital but also in the surrounding of the hospital. The possibility of adding in time communication will allow the patient and healthcare staff to share import information. The use of an interactive interface with extra information about patients and their location is also a great addition as it allows to get basic information of who is asking for help. This kind of device could not only be used on a hospital but elderly residence or other facilities with people that requires assistance. One example would be in an elderly residence, people with dementia could be tracked if the patients leave the building.
5 2 Background and/or review of the state of the art Nursing call systems, also known as patient call systems or emergency call systems are considered medical devices. They are subject to Regulations, guidelines and standards have been created to assure the correct functioning of the device. 2.1 Regulations Medical devices due to their critical function must be approved by the regulatory body of each jurisdiction before being marketed. The biggest agencies are the FDA, with oversight over the USA, the EMA, which is used as reference by the member states of the European Union to set regulations. Achieving approval from both agencies, which are seen as global standards, help access third markets. In Spain the governing body is the AEMPS which as part of the EU, uses the EMA legal framework as reference but approves the use of medical devices for its jurisdiction. The FDA classifies devices powered by an AC- or battery-powered intended for medical purposes that is used by a patient to operate an environmental control function, such as a telephone or to sound an alarm for assistance as powered environmental control system which are Class II (special controls) medical devices. Class II medical devices are of moderate risk. The specific requirements are under Title 21 of the Code of Federal Regulations, subchapter H. [1][2] The EMA classifies medical devices according to the Medical Devices Regulation.M According to Rule 10 Active devices intended for diagnosis and monitoring are classified as class IIa, an active device is a device used to supply information for monitoring conditions, states of health which our nursing call system falls in. [3] We will focus on the general obligations by the EMA, as is the main regulatory body in Europe and the AEMPS uses its legal framework to make decisions and other national bodies. The device must: • Meet the general safety and performance requirements specified in the Annex I of the MDR, which requires a premarket clinical investigation. • After complying with the MDR must get a CE marking. • A Unique Device Identifier number and be registered in the electronic system, according with MDR Article 29. • Be subject to reporting requirements under the medical device vigilance system. • According to Article 52 of the MDR, a class IIa device must have a quality management system, be subject to an audit and have a surveillance assessment of it. [4] 2.2 Standards Standards are useful to ensure quality and reliability of medical devices. Compliance with regulatory requirements for the approval of the product as standards have requirements and guidelines to ensure the safety and effectiveness.
Bachelor thesis title 6 The following standards are useful to ensure the quality and compliance of the product. ISO 14981:2019: Medical devices – Application of risk management to medical devices This document specifies terminology, principles and a process for risk management of medical devices, including software as a medical device and in vitro diagnostic medical devices. [5] ISO 80001-1:2021: Application of risk management for IT-networks incorporating medical devices — Part 1: Safety, effectiveness and security in the implementation and use of connected medical devices or connected health software [6] IEC/TR 80001-2-1:2012 to IEC/TR 80001-2-9:2017 Technical Reports which provide guidelines on how to apply ISO 80001-1:2021. [7] ISO 13485:2016 is a standard that specifies requirements for a quality management system for organizations that manufacture or provide medical devices and related services. It covers the entire life cycle of medical devices, including design, production, and distribution. The standard helps demonstrate regulatory requirements for medical devices. [8] Another useful standard from the German normalisation body is the DIN VDE 0834: Call systems in hospitals, care homes and similar institutions. It specifies the standards for equipment, planning, erection and operation and Environmental conditions and electromagnetic compatibility. All other relevant ISO can be found in ANNEX B 2.3 Existing technology 2.3.1 Legacy solutions Old nurse communication systems, are phone call systems over IP, made up of a Control Station ranging from a simple telephone with a Display that can show the origin of the call and allow bidirectional communication to more complex integrated software suites that allow to position patients in a floor plan. Modern interfaces for the patient allow it to request different services, from emergency assistance to other functions, such as switching off/on the light. One of such systems is made by Schrack Seconet Care Communication GmbH. They sell a Control Station named “Multi-Functional CT Touch Displays”, which integrates a telephone terminal which can be used to do calls to groups, room listening and control of door entrances. [9] [10] The system works along their call panels.
7 Figure 1. Stainless Steel Call Units by Carecom Figure 2. Nurse Control Station The disadvantage of these systems is that they require a physical installation of a telephone cable from the Control Station to the room where the Call Panel is located. If such installation is not available, the cost to escalate or set-up the system is expensive, as we are required to perform renovations. Another consequence of this physical constrain is that the patient or nurse is not allowed to interact with the system unless close to the interfaces. Which could lead to the patient not being able to call for help or the nurse missing precious time in critical situations. If the system allows positioning it shows a fixed position as the device is not portable which limits this functionality. 2.3.2 New state of the art solutions Novel solutions have moved from a traditional wired system to wireless solutions, which solve the main disadvantage of legacy systems. The scalability now is not depended on the ability to have sockets where you can plug your Call units. For example, the IP-DECT 400 COBS TALK system, which is made up of phones and a necklace wireless device, which allow nurse and patients to communicate over voice and call for assistance. For achieving this Wi-Fi technology is used as physical and data link layer for small distances, Wi-Fi AP are positioned around the facility, each AP is linked using an ethernet physical layer to achieve communication over large distances. A COBS Message server CMS, receive all data and processes it, handling requests from all the devices. [11] It also has a display that allows nurses to know the state of each patient.
Bachelor thesis title 8 Figure 3. IP-DECT 400 As a RTLS solution they offer another product which can be integrated with the system, with the use of a RFID signal emitter and a portable receiver. When the signal is captured by the receiver the identification signal is sent to the CMS which takes further action. [12] One downside of this combination is the need of using two products to achieve real time location and voice communication, increasing the complexity of the system. The manufacturer specifies that the range of each emitter is up to 1-4m which can be short ranged. [12] Figure 4. Alarm with speech and positioning
9 Another company is Stanley Healthcare, their Aeroscout line of RTLS products use ultrasound technology. The system consists of a device named by Stanley Healthcare as exciter which emits signals that are detected by tags wore by the patients. Then the tags emit their position to a server using Wi-Fi technology. [13] Figure 5. Stanley Aeroescout Tag The tags used by the patient also allow to do emergency calls to nurses. All the information and devices can be managed from their proprietary software, MovileView , a platform that integrates and unifies various sources of visibility data, including RTLS, Passive RFID, and sensor data, to provide real-time location, status, and condition information for assets. It has an open API and out-of-the-box adapters for integration with third-party systems and offers a range of applications including Asset Management, Environmental Monitoring, and Infant Protection. MobileView also has tag management capabilities, including over-the-air updates and reports and alerts on tag battery levels, tag assignment history, and other information. [14]
Bachelor thesis title 10 3 Methodology In this chapter we discuss the process of system design from the understanding of stakeholder's requirements to the definition of the components needed to create the device and their interfaces. 3.1 System Architecture To design the system, we must first understand the stakeholders' requirements. For this project, we interviewed professor and nurse Dr.Adelina which carefully explained us the requirements she found most important. First, the device should be portable, wireless, battery powered with at least 24h battery life and the interface machine-patient should be easy to use. It must allow bi-directional patient-staff communication and real-time positioning. Once we understand the requirements, we search for projects that have used RTLS technology or audio, both professional and amateur. Amateur projects related to real time audio streaming and RTLS with the most common Development Boards available were studied, such as ESP32, STM32, and Arduino boards. Notable mentions: Chris Greening ESP32 Walkie-Talkie: Chris Greening made an amazing Walkie-Talkie using the ESP32 mcu. The system consists of an ESP32 with an I2S microphone and an I2S Amplifier, data captured is streamed over UDP broadcast or ESP-NOW. [15] Localino: Open-Source Indoor Positioning System (Arduino + Decawave) A project posted in Instructables, a webpage were creators share how they created their projects but now has grown to full sized marketable company. They use a DWM1000, ESP8266-07 with a custom-made PCB. The system allows to track the position DWM1000 modules. [16] This helped us identify the different components that our system would require. • Sound System, broken down into two subsystems, the recording system and the playback system. • A Communication system, to transmit and receive data from/to other devices. • A RTLS system, which would locate the device in the space. • A physical interface for the patient. • A master Mcu which would coordinate all the components of the system. • A power supply system with a battery incorporated that will feed our tags. • A server that will handle alarms, position and audio being stream from devices and will route it to its final user. • A web UI for the medical staff to interact with the system.
11 Figure 6. System Architecture Components Once we have broken our needs on different components, we should start defining them based on our interfaces and needs. Both the development of a server and web UI are out of the scope of this project. 3.2 Subsystem Architecture The main constrain in this architecture is the use of the module DWM1001-DEV for RTLS. Its interface will be defined. It will be the first subsystem to be studied and it will define the interface between it and other subsystems. 3.2.1 RTLS Subsystem The DWM1001-DEV is a development board for the DWM1001 module. It is a hardware platform that includes a DWM1001 module and other components, such as a microcontroller, connectors, and headers. The DWM1001-DEV board provides access to the various features of the DWM1001 module, including the BLE and UWB radios, and allows developers to interact with the
Bachelor thesis title 18 4 Electronic components Based on the components defined on the system architecture we find the appropriate solutions offered in the market. 4.1 Master Mcu To select the Master Mcu we focused on the most restrictive constrain, the Mcu must have support to run TensorFlow. The supported Development boards are: [28] • Arduino Nano 33 BLE Sense • SparkFun Edge • STM32F746 Discovery kit • Adafruit EdgeBadge • Adafruit TensorFlow Lite for Microcontrollers Kit • Adafruit Circuit Playground Bluefruit • Espressif ESP32-DevKitC • Espressif ESP-EYE • Wio Terminal: ATSAMD51 • Himax WE-I Plus EVB Endpoint AI Development Board • Synopsys DesignWare ARC EM Software Development Platform • Sony Spresense Only these 4 boards have a Wi-Fi module. • Expressif ESP32-DevKitC • Expressif ESP-EYE • Wio Terminal: ATSAMD51 • Synopsys DesignWare ARC EM Software Development Platform Expressif ESP-EYE has been discarded because it does not have enough Pins for GPIO, the Wio Terminal: ATSAMD51 comes with an encapsulation and a screen device which we do not need so it has been discarded and the Synopsys DesignWare ARC EM Software Development Platform is a powerful platform, but it is sold at 950 euros per unit.[29] The logical choice is one of the Expressif ESP32-DevKitC boards. We have selected the ESP32 Series because it matches our requirements, and it is an affordable Mcu with a powerful API, called ESP-IDF and are CE and FCC certified which is important in order to get our medical device market approval. [30]
19 Figure 14.ESP-32 Dev Kit C V4 Some of the major features of the ESP32 DevkitC include: • Wi-Fi: The device has built-in Wi-Fi, which can be used to connect to the Internet or other devices wirelessly. • Bluetooth: The ESP32 DevkitC has dual-mode Bluetooth, which allows it to support both classic Bluetooth and Bluetooth Low Energy (BLE). • Security: The device has a built-in hardware cryptographic engine for secure communication. • Low-power operation: The ESP32 DevkitC is designed to be energy efficient, with a deep sleep current of less than 5 µA. • Development support: The device is supported by a range of development tools, including the Arduino Integrated Development Environment (IDE) and the Espressif IoT Development Framework (ESP-IDF). • Input/output (I/O) capabilities: The ESP32 DevkitC has a wide range of I/O capabilities, including: o Digital I/O pins: 36 total, of which 4 can be used as pulse-width modulation (PWM) outputs o Analog input pins: 12 total, with a resolution of up to 12 bits o Interfaces: The device has I2C, I2S, and SPI interfaces, as well as a UART interface for serial communication. • 5V and 3.3V pins. • Micro USB type B.
Bachelor thesis title 20 Figure 15. ESP-32 Dev Kit C V4 Pinout 4.2 Power Supply The ESP32 can be powered in three ways [31]: • Using a 3.3V pin but the voltage must be regulated with an external circuit as it does not have an in-built regulator. • Using a 5V pin with an in-built voltage regulator AMS1117-3.3 that converts it into 3.3V. • Using a Micro USB type B. For this project we will power the ESP32 using an external battery with an USB output connected to the ESP32.Freeing the 3.3V and 5V pins we are able to power all the peripherals attached to the ESP32 including the DWM1001-DEV module with the 5V pin. For fast prototyping we have used an old power bank. The main characteristics are[32]: • 5V supply. • 5000mAh capacity Li-Po battery. • 2x USB 2.4A output ports • 1x Micro USB input port.
21 4.3 Audio System 4.3.1 Recording system A MEMS microphone (Microelectromechanical Systems microphone) is a type of microphone that uses a tiny mechanical structure to detect sound waves and convert them into an electrical signal. MEMS microphones are small and lightweight, and they are often used in portable devices such as smartphones and laptops. They have an ASIC (Application-specific integrated circuit) which includes a pre-amplifier and/or an ADC. They have several advantages over other types of microphones, including high sensitivity, low power consumption, and good resistance to noise and distortion. [33] https://www.cuidevices.com/blog/comparing-mems-and-electret-condenser-microphones An Electret condenser microphone (ECM) is a type of microphone that uses a thin, electrically charged diaphragm to detect sound waves and convert them into an electrical signal. The diaphragm is positioned close to a fixed metal plate, and the electrical charge on the diaphragm changes as it moves in response to sound waves. This change in electrical charge is then amplified and converted into an audio signal. They are known for their high sensitivity and ability to accurately capture a wide range of frequencies. They require an external power source.[34] For this project we have selected a MEMS microphone as it is smaller, lighter, has lower power consumption, digital output and does not need an external power source. We need a MEMS microphone with digital output (I2S) breakout board, a breakout board is a PCB that has been designed to connect the pins of the integrated circuit to external devices. The available breakout boards are: Table 1. Technical Characteristics of MEM Mics ICS-43434 [37] INMP441 [36] SPH0645LM4H-B [35] Sensitivity -26dBFS -26dBFS -26dBFS SNR 65dBA 61dBA 65dBA Current at 1.8V 490 µA 1.4 mA 600µA AOP 120 dB SPL 120 dB SPL 120 dB SPL Sample Rate 6.25kHz to 51.6kHz 7.8 kHz to 50 kHz 32kHz to 64kHz Data Precision 24 bit 24 bit 18 bit Both ICS-43434 and INMP441 are I2S Standard Philips Format, Data signal have one bit shift compared to WS signal and the duty of WS signal is 50%.
Bachelor thesis title 22 Figure 16. I2S Standard Philips Format While the SPH0645LM4H-B has an I2S Data Format with MSB delayed 1 BCLK cycle after WS changes. Figure 17.I2S Data Format SPH0645 The best choice overall is ICS-43434.It has the lowest consumption and the best sound quality. ICS-43434 had to be shipped from overseas with long lead times so it was discarded. The INMP441 Data format is supported by ESP-IDF and has higher data precision than SPH and samples are cheaper. Decision to buy four samples was made but after testing them they were defective. A compromise with SPH0645LM4H-B was made, two samples were bought from trusted seller “ADAFRUIT” despite Data format not supported off the shelve by ESP-IDF API. It could be modified to support it. 4.3.2 Playback System We need a I2S DAC breakout board that takes I2S audio and outputs analog audio, the only available option is the MAX98357A/B. The MAX98357A/B breakout board works with. 4/8 ohms speakers. Major features are: [38] • 16/24/32-bit I2S data input supported. • Sample Rated of 8kHz to 96 kHz • Voltage 2.5V to 5.5V • 2.4mA Consumption • No MCLK required • 92% power efficiency
23 Figure 18. I2S DAC MAX98357A/B The output of the DAC is sent to an 8-ohm speaker which will convert the analog signal into sound. We have selected some standard 8-ohm 2W speakers from Weewooday. [39] Figure 19. Weewoday Speakers
Bachelor thesis title 24 4.4 DWM1001-DEV The DWM1001-DEV module can be configured as anchor or tag to build a RTLS. Characteristics [40]: • Supports UWB & Bluetooth® • Access to all DWM1001 GPIOs and interfaces via on board headers • Software APIs for application customization • Module APIs for configuration and interfacing over SPI, UART, BLE Power Sources. • Power Source from PIN (5V), USB(5V) or battery (3.6V to 5.5V). • Current level 500mA. Figure 20. DWM1001-DEV Technical Data 4.5 Patient interface For the patient interface we have bought standard push buttons from Gerbiled, which include a red cap. The led was not bought as the budget was exhausted and it was the least critical component of the prototype. For future work it will be included.
25 Figure 21. Push button installed on the system 5 Tools 5.1 Soldering and electronics testing Breakout boards come without pins header soldered to them. For this reason, we need a soldering iron. A solder Iron is used to heat and melt alloy of tin to join pins header to the breakout board. For this project, a cheap solder iron was bought from amazon. For more advanced projects a solder iron which temperature sensor is recommended.
Bachelor thesis title 26 Figure 22. Work In Process. Soldering Once we have soldered the items, we connect the devices to power and use a multimeter to test for short circuits. 5.2 Programming the Esp32 To write code in VScode we will use the ESP-IDF framework, it allows us to create firmware for their products thanks to the API calls. The framework is written in C. We will also write in C the firmware. 5.2.1 Hardware • ESP32-DevkitC • USB cable. USB A/ micro–USB B. • Computer running Linux but Windows or macOS are available. 5.2.2 Software • VSCode IDE • VSCode Expressif IDF Extension.
27 5.2.3 Installation • Download and Install VSCode IDE from https://code.visualstudio.com/ . • Install VSCode Espressif IDF extension https://github.com/espressif/vscode-esp- idf-extension/blob/master/docs/tutorial/install.md . 5.2.4 Start a project For first use it is recommended to read the tutorials on VSCode ESP-IDF extesion github. VSCode ESP-IDF basic use The firmware will be divided in components. A component is a self-contained piece of code that provides a specific functionality. Components can be added to an ESP-IDF project by including them in the project's component.mk file or by using the idf_component_register() function in the project's CMakeLists.txt file, so they can be compiled and linked. [42] Components help structure the project and make them more readable and easier to understand. We have divided components based on their functionality, this allows for easier maintenance of the code and portability as it can be reused in other projects.
Bachelor thesis title 34 7 Discussion of the solution The System can be divided into a Realtime Location System, the patient device and the server and its user interface. We will discuss each component on its own and how it has been managed to accomplish the goals. 7.1 Configuring the RTLS The RTLS system with DWM1001-DEV consists of modules configured as anchors or tags. The tag collects information about anchors by listening to anchor messages. It will calculate the distance to the closest anchor in each quadrant until it leaves the quadrant when it will again search for the closest anchors. [46] Figure 29. Tags choice of anchors 7.1.1 Network To achieve optimal performance in a wireless network using anchors, it is recommended to space them 20 to 25 meters apart in a square grid configuration, which is equivalent to a diagonal distance of 28 to 35 meters between opposite anchors. However, in cases where there is no direct line of sight between anchors, it may be necessary to reduce the distance between them to ensure satisfactory performance. It is important to conduct testing in the specific implementation environment to determine the best spacing for the anchors. This will allow you to determine the optimal distance for your set of conditions and ensure that the network performs at its best.
35 7.1.2 Scalability The system expansion for anchors in the network infrastructure consists of assigning each anchor a seat number between 0 and 29, ensuring that no anchor can hear two anchors with the same seat number, synchronizing all nodes with the superframe timing of the initiator, and limiting the maximum clock level to 127. It can support up to 30 anchors, but if a 31st anchor is added, it must reuse a seat number if the other anchors are spaced far enough apart to prevent any anchor from hearing two anchors with the same seat number. [46] Figure 30: Scaling the DRTLS showing anchor’s seat numbers The system expansion for tags allows for a maximum of 150 Hz system capacity, with tags ranging to up to 4 anchors and being assigned a specific Time Waveform Ranging (TWR) slot. If all TWR slots are already allocated, a new tag will not be able to obtain a slot. [46] Multiple networks in the same area to share the same air space and not interfere with each other by overlapping messages. In ANNEX A Configuration of Module DWM1001 as an anchor or tag go is explained.
Bachelor thesis title 36 7.2 Programming the ESP32 All the code discussed here is located at my GitHub: https://github.com/solubleCopper. The finite state machine of our system has three states, UNINIT, INIT and FULL COMM. Figure 31: System Finite State Machine In the INIT state peripherals are initiated, Wi-Fi, I2S, UART, GPIO and component task such as swc_uart and udp_client. The system transition to INIT state occurs when components have been initiated in the entry point of the system. The function app_main() in the main.c file is the entry point.
37 Figure 32: Entry point. App_main. In the INIT state the position message is sent to the server. The system also checks if the button has been pressed by the patient or the server has sent a start communication packet. The system transitions to COMM state if the patient presses the button or the server has sent a start communication packet. The udp_client_task monitors connections with the server if start com message is received it transitions the system to com state. Figure 33: Transition to FSM_COMM state from received control packet. The swc_button component monitors the button state, a GPIO interrupt handler is triggered when the button is pressed, the handler transitions the system to com state. Figure 34: Transition to FSM_COMM from GPIO interrupt In the COM state the position is sent each minute to the server and the audio pipeline is activated. Packets with audio are sent from the nurse calling system to the server and in response audio packets are sent back and then handled to the i2s component. The system transitions to INIT state when the socket error counter for receiving and sending messages has reached the maximum, when the counter for incorrect incoming messages has reached the maximum or the server request the client to close communications. These functionalities are managed from the swc_udp which manages the communications with the server.
Bachelor thesis title 38 7.2.1 RTLS data fetch The component swc_uart configures the UART port of the ESP32 to interface the DWM1001-DEV UART port. The module interacts with DWM API via its UART interface at baud rate 115200. Figure 34 shows the workflow of the DWM1001 UART interface. In the UART Generic mode communication, the ESP32 device is acting as the initiator, while the DWM1001 module is the responder. [47] Figure 34: DWM1001 UART workflow The API TLV dwm_pos_get request is used to obtain the position of the node.The request and response are defined as: Table 3: dwm_pos_get request Example response: Table 4: dwm_pos_get response We will have to send two bytes, 0x02 and 0x00 to the UART interface of the DWM and parse an 18byte response from the DWM.
39 7.2.1.1 Component Architecture Figure 35: SWC_UART Workflow To implement this functionality, we will use the esp-idf driver/uart.h API , FreeRTOS libraries FreeRTOS.h and task.h. The driver/uart.h is a series of functions in the ESP-IDF that allow the configuration and use of the UART peripheral, transmit and receive data over UART serial connection, set baud rates and other communication parameters. [48] FreeRTOS is a real-time operating system (RTOS) for ESP-IDF, provides a set of functions and tools for creating multi-threaded applications on the ESP32, allowing users to prioritize and schedule tasks The freertos/freeRTOS.h and freertos/task.h provide the basic functionalities of the RTOS. [49] The flow of the component is implemented using Tasks and delays from FreeRTOS. At entry the UART driver is initiated. Then each 15 ms we check for the state of the system. If the state is different from UNINIT we will call the function read_write() which reads and writes to the UART, parses de result and updates the global variable that holds the position.
Bachelor thesis title 40 Figure 36: FreeRtoos Uart Task The uart_init() function, configures the UART driver, sets buffers and queues for the received data and initiates de driver.
41 Figure 37,38: uart_init() function The read_write() function, triggered every 15ms, writes to UART the request position payload and waits for an event in the UART driver. If data is received it checks if it is the expected payload and then copies it to pos_raw global variable.
Bachelor thesis title 42 Figure 39,40: read_write() function 7.2.2 Interface component The interface component is programmed in the swc_button component of the code. The button is connected to an ESP32 pin and GND. When pressed an interrupt in ESP32 occurs, the state of the system is changed and the communication with the server starts. To program this component, we will use the GPIO API from ESP-IDF and its libraries “driver/gpio.h” and “esp_intr_alloc.h” .The “driver/gpio.h” allows you to configure the direction and state of the GPIO pins, as well as read and write data to them and the “esp_intr_alloc.h” allows us to allocate an interrupt handler that will change the state value. [50]
43 7.2.2.1 Component Architecture Figure 41: SWC_BUTTON Workflow The function init_gpio() initializes the component. The button is configured as internal pullup resistor. The resistor is used to avoid a shortage between the Vdd and GND when the switch is on, which will cause overheat and may end up damaging the electronics. Figure 42: Internal Pull-up resistor configuration The default state of the GPIO pin is HIGH. When the switch is on it falls to LOW, the interrupt should be triggered on an edge fall.
Bachelor thesis title 50 Figure 51: i2s_rx_init() function The main parameters of the I2S bus are set. The sample rate is set by the master (ESP32) it will share its BCLOCK with the MIC which will use it to get the correct sample rate. We have set 16Khz as the sample rate as it the standard format for Wideband Audio used in VoIP, which provides good quality audio for voice applications. [54] Channel format is only left as we only have one MIC and the communication I2S_COMM_FORMAT_STAND_I2S but is later modified to set that MSB bit comes after half BCLOCK not one with the REG_SET_BIT () calls. Figure 52: MSB adjustment for MIC The pins for the i2s peripheral are also set. The DMA buffers are also set. Up to 4 buffers of 1024 samples are set to store data. DMA buffers is accessed by the peripheral directly and stores data independently of the CPU, freeing resources. 1024 sample are chosen to interrupt the CPU the less.
51 The DMA buffer is accessed by a call from the udp_client_task from the swc_udp when we are in the COMM state. The component calls the i2s_read() function from the “driver/i2s.h”. Pases a pointer to the i2s_read_buffer where it will store the data on the DMA, the size of the data it wants to read, it is set to 255 samples after that it collects garbage, a pointer to a size_t param to store the number of bytes read and the ticks to wait. The function will wait until the information is received. Figure 53: DMA read call Once the information is received, we call the sample_32bit_to_16bit function from the swc_i2s component. This function will resample the data, as the data received from the mic is 18-bit width as the 18-24 bits are set to 0 and 24 to 32 are tri-stated, to use less bandwidth. The data will be copied to the tx_buffer and a header that identifies audio packets from our application (0x01,0x03) will be added.
Bachelor thesis title 52 Figure 54,55: sample_32bit_to_16bit() After copying the data to the tx_buffer the udp_client_task will send the data to socket using the sendto() function. Which will encapsulate the data in a udp packet and send to the set address and port in the function. 7.2.4.2 Playback pipeline
53 As in the recording pipeline, we set the configuration of the I2S driver and pins from the swc_i2s. On entry the function i2s_tx_init () is called. We will configure the sample rate as 16Khz, 16 bits per sample, only one channel left and I2S_COMM_FORMAT_STAND_I2S as the audio received from the server is in this format. The DMA buffer length is reduced to decrease the latency.
Bachelor thesis title 54 Figure 56,57: i2s_tx_init() The recvfrom() function called in the udp_client_task from the swc_udp waits for a packet from the server before the timeout expires. When received, the function populates the rx_buffer with the message contained in the udp packet after decapsulating it. Figure 58: recvfrom() function If in FSM_COMM state and our packet header is (0x01,0x03), the data received is written to the DMA calling the function i2s_write () passing the rx_buffer. Figure 59: Write audio to DMA The I2S driver will read from the DMA and send it through the I2S bus. 7.2.5 UDP component This component allows the application to communicate with the server. It is where the application interacts with the transport layer used to transport the packets to the destination. UDP known as Unified Datagram Protocol has been chosen and not TCP known as Transmission Control Protocol because is connectionless and does not require both end points to synchronise, it does not perform heavy checks on received data and doesn’t reorder packets in a chronological order like TCP. The UDP header is also smaller than TCPs. For those reasons UDP is lighter and faster than TCP and the preferred transport protocol for streaming. [55][56]
55 7.2.5.1 Component architecture Figure 60: SWC_UDP workflow On init buffers for receive and transmit payloads are allocated and other needed variables are defined. Figure 61: udp_client_task() function Then the Socket is created, sockets provide end to end communication between two endpoints. The Socket represents an endpoint. We set the socket domain to IPv4, the SOCK_DGRAM which creates an UDP socket and the protocol to UDP We also set a timeout on the receiving packets of 50 MS. The timeout is set to avoid blocking the process and packet loss. It has been adjusted monitoring Wi-Fi Network with Wireshark. If we fail to create the socket, a restart is called to avoid unexpected behaviour.
Bachelor thesis title 56 Figure 62: UDP Socket Creation If the endpoint is created successfully, the task starts managing communications. It performs operations depending on the state of the system.
57 The following diagram explains how the communications work once the socket has been created. Figure 63: Communication Workflow
Bachelor thesis title 58 The code that implements that logic is as it follows: Here packets payloads are built depending on the system state. Figure 64: Implementation of packet payload building Once we have our payload, we use the function sendto() to send the data on the socket with UDP encapsulation. After that we will do error check. Figure 65: Packet Sending and Error Check
59 If it has been successful, we will wait for a response until the rx timeout expires. On response we will do error check. Figure 66: Packet Reception and Error Check If no error, we will parse the data. If it is an audio packet, we will send it to the DMA or if it is the server requesting us to start communicating, we will change the state to FSM_COMM. If the packet is not recognized, we will increase the error counter. Figure 67: Treatment of Received Payloads
Bachelor thesis title 66 Industrial Engineer Fees Development of the project 600 hour 24000 Subtotal 24000 Total 24165,92
67 9 Analysis and assessment of environmental and social implications Figure 74: SDG Symbol The UN sets seventeen Substanaible Development Goals for 2030. It is a call to promote promote prosperity while building economic growth and address a range of social needs including education, health, social protection, and job opportunities, while tackling climate change and environmental protection. [58] Figure 75: Goal 3 Goal number three aims to ensure healthy lives and promoting well-being at all ages. This project ensures a good communication between patients and hospital staff, which can provide lifesaving. It also has applications on elderly care homes where the system can be used to track residents with Alzheimer or other degenerative diseases. [59] Figure 76: Goal 8 Goal number 8 aims to create higher levels of economic productivity through technological upgrading and innovation, through high value added and labour-intensive sectors. The creation of a business unit that manufacture RTLS nurse calling system address this goal.[60] Figure 77: Goal 9 Goal number nine aims to enhance the scientific, technological capabilities of industrial sectors, encouraging innovation. The project creates new technological capabilities for this country with the manufacturing RTLS Nursing Call Systems. [61]
Bachelor thesis title 68 10 Conclusions The nurse calling system designed accomplishes most of the goals we wanted to achieve. The device successfully integrates the DWM1001-DEV module which provides excellent location capabilities in the cm range in an indoor environment. The device is wireless does not need any wired external interface and the weight of all prototype components is about 250gr creating a portable and light weight device. The device successfully integrates an independent power source with enough power to have an independent autonomy of more than 24h. It also provides a common USB micro-B interface for easy recharge of the device. The device has a friendly user interface, with one button we can start communicating with the staff. It can also be remotely activated and only the staff can cut the communication. The device software is readable and well commented, the division into components dives code based on its functionality which makes the code easier to maintain and scale. We have created a protocol to share data with the server. Depends on the state of the device it will send nothing, its position or both the position and audio captured. The device in return will read messages coming from the server, control messages like request for starting or stopping communication or audio data. The captured position is refreshed and shared with the server in less than 3 minutes as it was required. We have been able to successfully create two parallel audio pipelines for recording and playback of audio in the device with good quality, the parallel audio pipeline work in real time. The created server can send control commands to the server, it can start an audio transmission or stop it. Depending on the state of the system, it sends PC mic audio to the device and playbacks the received audio with good quality. On receiving position data, it stores the data and prints it to the terminal. We have not been able to offer the staff a user interface where it can see the data and control the system. The work required to do it was underestimated and the implementation of this functionality must be delayed but is feasible. The designed software for the ESP32 and the hardware architecture have accomplished the requirements expected for a prototype but still has room for improvement. Points of improvement have been identified: • Integrate all components into a PCB. This will reduce weight and volume. Audio quality will benefit from it as it very sensible to EMC interference which will be reduced. • Use of filters to improve audio quality. • Integration of a low consumption MEMS MIC, e.g: ICS-43434. • Implementation of data compression, one minute of 16-bit mono PCM audio are 1.92 Mbytes, data compression will reduce network overload. • Design of external case for the final product. • Implementation of voice commands using Machine Learning such as TensorFlow to be used as patient interface and leds. • Implementation of low consume operating mode of DWM1001-DEV, which will increase the device autonomy. • Implementation of device Identification.
69 The designed server is enough to demonstrate that the system is feasible but for a final production stage it needs a lot of improvement. The help of a backend and frontend software engineer would be needed. The system trials should be performed in an hospital environment to find the appropriate RTLS tags and anchor layout.
Bachelor thesis title 70 11 References 1 FDA. “CFR.” Code of Federal Regulations Title 21 Chapter I Subchapter H – Medical Devices,https://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfcfr/cfrsearch.cfm?fr=890.37 25. Accessed 4 Sept. 2022. 2 FDA. “Federal Register” Code of Federal Regulations Title 21. Subchapter-H, https://www.ecfr.gov/current/title-21/chapter-I/subchapter-H . Accessed 4 Sept. 2023. 3 EP/CoE. REGULATION (EU) 2017/745 OF THE EUROPEAN PARLIAMENT AND OF THE COUNCIL of 5 April 2017 on medical devices, amending Directive 2001/83/EC, Regulation (EC) No 178/2002 and Regulation (EC) No 1223/2009 and repealing Council Directives 90/385/EEC and 93/42/EEC. 2017, https://eur-lex.europa.eu/legalcontent/EN/TXT/HTML/?uri=CELEX:02017R0745-20200424&from=EN#tocId3 . Accessed 5 Sept. 2022. 4 MDCG. Guidance on Classification of Medical Devices. Oct. 2021, https://health.ec.europa.eu/system/files/2021-10/mdcg_2021-24_en_0.pdf. Accessed 7 Sept. 2022. 5 “ISO 14971:2019.” ISO, https://www.iso.org/standard/72704.html. Accessed 10 Sept. 2022. 6 “IEC 80001-1:2021.” ISO, https://www.iso.org/standard/72026.html. Accessed 10 Sept. 2022. 7 “IEC 80001-1:2021.” ISO, https://www.iso.org/standard/72026.html. Accessed 10 Sept. 2022. 8 “ISO 13485:2016.” ISO, https://www.iso.org/standard/59752.html. Accessed 10 Sept. 2022. 9 SCHRACK SECONET. Call Units for Nurse Call Systems. https://carecomsolutions.com/en_ccs-nurse-call-products/en_ccs-nurse-call-call-units.html. Accessed 16 Sept. 2022. 10 SCHRACK SECONET. Nurse Control Station. https://carecom-solutions.com/en_ccs- nurse-call-products/en_about-our-products-in-detail/en_ccs-nurse-call-display-units-nurse- control-station.html . Accessed 16 Sept. 2022. 11 COBS. IP-DECT 400 COBS Talk. https://cobs-ws.com/en/products/wirelesscommunication/item/ip-dect-400-cobs-talk . Accessed 17 Sept. 2022. 12 COBS. Alarms with Indoor Location. https://cobs-ws.com/en/products/wirelesscommunication/item/larm-med-tal-och-positionering. Accessed 17 Sept. 2022. 13 Stanley Health Care. MobileView®5 Most Advanced Software Platform for Unified Asset and People Visibility Management. 2022,
71 https://www.stanleyhealthcare.com/sites/stanleyhealthcare.com/files/2022- 10/MobileView%20Data%20Sheet_09-2022.pdf . Accessed 18 Sept. 2022. 14 Stanley Health Care. MobileView®5 Most Advanced Software Platform for Unified Asset and People Visibility Management. 2022, https://www.stanleyhealthcare.com/sites/stanleyhealthcare.com/files/2022- 10/MobileView%20Data%20Sheet_09-2022.pdf . Accessed 18 Sept. 2022. 15 Greening, Chris. “ESP32 Walkie-Talkie.” Hackster.Io, 5 Apr. 2021, https://www.hackster.io/chris-greening/esp32-walkie-talkie-f8d0dd. Accessed 21 Sept. 2022. 16 Localino. “Localino: Open Source Indoor Positioning System (Arduino + Decawave).” Instructables, 1 Dec. 2016, https://www.instructables.com/Localino-Open-Source-Indoor- Location-System-Arduin/. Accessed 21 Sept. 2022. 17 Qorvo. “DWM1001-DEV - Qorvo.” Qorvo - RF Solutions for Mobile, Infrastructure and Defense, https://www.qorvo.com/products/p/DWM1001-DEV. Accessed 14 Sept. 2022. 18 Campbell, Scott. “Basics of UART Communication.” Circuit Basics, 13 Feb. 2016, https://www.circuitbasics.com/basics-uart-communication/. Accessed 18 Sept. 2022. 19 Campbell, Scott. “Basics of the SPI Communication Protocol.” Circuit Basics, 13 Feb. 2016, https://www.circuitbasics.com/basics-of-the-spi-communication-protocol. Accessed 18 Sept. 2022. 20 Ltd., Decawave/Qorvo. DWM1001 Firmware API Guide. Page 43. 2019, https://www.qorvo.com/products/d/da007975 . Accessed 22 Sept. 2022. 21 Computer Hope. What Is a Server? https://www.computerhope.com/jargon/s/server.htm . Accessed 22 Sept. 2022. 22 Knerl, Linsey. “Does My Computer Have Bluetooth?” HP, 18 Oct. 2019, https://www.hp.com/us-en/shop/tech-takes/does-my-computer-have-bluetooth. Accessed 22 Sept. 2022. 23 Tanaza. “5 Things You Should Know about Wi-Fi Speed and Distance Covered”. 17 Mar. 2017, https://www.tanaza.com/classichotspot/blog/5-things-know-wi-fi-speed-distance- covered/. Accessed 22 Sept. 2022. 24 Texas Instruments, Incorporated. Principles of Data Acquisition and Conversion (Rev. A). 2015, https://www.ti.com/lit/an/sbaa051a/sbaa051a.pdf. Accessed 26. Sept. 2022. 25. STMICROELECTRONICS. Datasheet - STM32F205xx STM32F207xx. 2020, https://www.st.com/resource/en/datasheet/stm32f207vg.pdf. Accessed 26 Sept. 2022. 26. Arduino. Produt Reference Manual – Arduino UNO R3 2023.
Bachelor thesis title 72 https://docs.arduino.cc/resources/datasheets/A000066-datasheet.pdf. Accessed 26 Sept. 2022 27. Espressif. ESP32-DevKitC V4 Getting Started Guide - ESP32 - — ESP-IDF Programming Guide Latest Documentation. https://docs.espressif.com/projects/espidf/en/latest/esp32/hw-reference/esp32/get-started-devkitc.html#get-started-esp32- devkitc-board-front. Accessed 26 Sept. 2022. 28 TensorFlow. TensorFlow Lite for Microcontrollers. https://www.tensorflow.org/lite/microcontrollers. Accessed 30 Sept. 2022. 29 Trenz Electronic GmbH. “DesignWare ARC EM Software Development Platform.” Trenz Electronic GmbH Online Shop (EN), https://shop.trenz-electronic.de/en/TEC0089-02-D2C- 1-D-DesignWare-ARC-EM-Software-Development-Platform?c=539. Accessed 2 Oct. 2022. 30. Espressif. Certificates. https://www.espressif.com/en/support/documents/certificates. Accessed 2 Oct. 2022. 31. Espressif. ESP32 DevkitC V4 Schematics. 06 Dec. 2017, https://dl.espressif.com/dl/schematics/esp32_devkitc_v4-sch.pdf. Accessed 2 Oct. 2022. 32. Amazon. “EUARY PowerBank 5000mAh - Cargador Portátil Ultra Compacto Con Salida 2A.” Batería Externa de Bolsillo Para Batería de Huawei, Samsung, Xiaomi y Otros (Negro): Amazon.Es: Electrónica, https://www.amazon.es/gp/product/B082PMBWRZ . Accessed 2 Oct. 2022. 33. STM. “MEMS Microphones.” STMicroelectronics, https://www.st.com/en/mems-and- sensors/mems-microphones.html. Accessed 4 Oct. 2022. 34. Cuidevices. “Comparing MEMS and Electret Condenser (ECM) Microphones.” CUI Devices, 8 Jan. 2019, https://www.cuidevices.com/blog/comparing-mems-and-electret- condenser-microphones. Accessed 4 Oct. 2022. 35. KNOWLES. “SPH0645LM4H-B I2S Output Digital Microphone.” 17 July 2015, https://cdn-shop.adafruit.com/product-files/3421/i2S+Datasheet.PDF. Accessed 4 Oct. 2022. 36. IvenSense. INMP441 Omnidirectional Microphone with Bottom Port and I2 S Digital Output. 2014, https://invensense.tdk.com/wp-content/uploads/2015/02/INMP441.pdf. Accessed 4 Oct. 2022. 37. IvenSense. ICS-43434 Multi-Mode Microphone with I2S Digital Output. 2014, https://invensense.tdk.com/wp-content/uploads/2016/02/DS-000069-ICS-43434-v1.2.pdf Accessed 4 Oct. 2022. 38. Adafruit. Adafruit I2S 3W Class D Amplifier Breakout - MAX98357A. https://www.adafruit.com/product/3006. Accessed 4 Oct. 2022.
73 39. Amazon. Altavoz Weewooday 6 Piezas 2W 8 Ohmios. https://www.amazon.es/dp/B09MRK24PP. Accessed 4 Oct. 2022. 40. DecaWave. DW1000 Datasheet. 2017, https://www.qorvo.com/products/d/da007952. Accessed 7 Oct. 2022. 41. Amazon. Gebildet Tact Push Button Interruptor. https://www.amazon.es/dp/B082DBBPGC?th=1. Accessed 7 Oct. 2022. 42. Espressif. Build System - ESP32 - ESP-IDF Programming Guide Latest Documentation.https://docs.espressif.com/projects/esp-idf/en/latest/esp32/apiguides/build-system.html . Accessed 23 Oct. 2023. 43. Wireshark. Wireshark.Frequently Asked Questions. https://www.wireshark.org/faq.html#_what_is_wireshark . Accessed 14 Nov. 2022. 44. Terso. “What Is RFID? HF vs. UHF Explained.” Terso, 20 Sept. 2019, https://www.tersosolutions.com/what-is-rfid/ . Accessed 18 Nov. 2022. 45. Gladysz, B., and K. Santarek. “AN APPROACH TO RTLS SELECTION.” DEStech Transactions on Engineering and Technology Research, no. icpr, Mar. 2018, https://doi.org/10.12783/dtetr/icpr2017/17576. 46. Qorvo. DWM1001 System Overview and Performance. 2018, https://www.qorvo.com/products/d/da007974. Accessed 13 Nov. 2022. 47. Qorvo. DWM1001 Firmware API Guide. 2019, https://www.qorvo.com/products/d/da007975. Accessed 20 Nov. 2022. 48. Espressif. Universal Asynchronous Receiver/Transmitter (UART) - ESP32 - ESP-IDF Programming Guide v4.4.3 Documentation. https://docs.espressif.com/projects/espidf/en/v4.4.3/esp32/api-reference/peripherals/uart.html. Accessed 20 Oct. 2022. 49. Espressif. FreeRTOS - ESP32 - ESP-IDF Programming Guide v4.4.3 Documentation.https://docs.espressif.com/projects/esp-idf/en/v4.4.3/esp32/apireference/system/freertos.html . Accessed 20 Nov. 2022. 50. Espressif. GPIO & RTC GPIO - ESP32 - ESP-IDF Programming Guide v4.4.3 Documentation.https://docs.espressif.com/projects/esp-idf/en/v4.4.3/esp32/apireference/peripherals/gpio.html. Accessed 26 Nov. 2022. 51. Espressif.Wi-Fi - ESP32 - ESP-IDF Programming Guide Latest Documentation. https://docs.espressif.com/projects/esp-idf/en/latest/esp32/apireference/network/esp_wifi.html. Accessed 30 Nov. 2022.
Bachelor thesis title 74 52. Espressif. “Esp-Idf/Station_example_main.c at v4.4.1 · Espressif/Esp-Idf.” Github, https://github.com/espressif/espidf/blob/v4.4.1/examples/wifi/getting_started/station/main/station_example_main.c. Accessed 20 Nov. 2022. 53. Eggert, L., et al. RFC 8085: UDP Usage Guidelines. https://www.rfceditor.org/rfc/rfc8085.html . Accessed 22 Nov. 2022. 54. Cox, Richard, et al. “ITU-T Coders for Wideband, Superwideband, and Fullband Speech Communication [Series Editorial.” IEEE Communications Magazine, vol. 47, no. 10, Oct. 2009, pp. 106–09, https://doi.org/10.1109/mcom.2009.5273816. 55. Postel, J. RFC 768: User Datagram Protocol. https://www.rfc-editor.org/rfc/rfc768. Accessed 24 Nov. 2022. 56. Eddy, Wesley M. RFC 9293: Transmission Control Protocol (TCP). 2022, https://www.rfc-editor.org/rfc/rfc9293.html. Accessed 24 Nov. 2022. 57. Pharm, Hubert. PyAudio: Cross-Platform Audio I/O for Python, with PortAudio. 2006, https://people.csail.mit.edu/hubert/pyaudio/. Accessed 31 Nov. 2022. 58. United Nations. “Home.” United Nations Sustainable Development, 12 Mar. 2018, https://www.un.org/sustainabledevelopment/. Accessed 31 Dec. 2022. 59. United Nations. “Health.” United Nations Sustainable Development, 7 Jan. 2015, https://www.un.org/sustainabledevelopment/health/. Accessed 31 Dec. 2022. 60. United Nations. “Economic Growth.” United Nations Sustainable Development, 7 Jan. 2015, https://www.un.org/sustainabledevelopment/economic-growth/. Accessed 31 Dec. 2022. 61. United Nations.“Infrastructure and Industrialization.” United Nations Sustainable Development, 7 Jan. 2015, https://www.un.org/sustainabledevelopment/infrastructureindustrialization/ . Accessed 9 Jan. 2023. 62. ZVEI. Call Systems According to DIN VDE 0834. 2017, https://www.zvei.org/fileadmin/user_upload/Presse_und_Medien/Publikationen/2017/Juli/ Rufanlagen_nach_DIN_VDE_0834/Rufanlagen_Call_Systems_DIN_VDE_0834_Online.p df . Accessed 8 Sept. 2022.
75 ANNEX A CONFIGURE DWM1001-DEV AS TAGS OR ANCHORS Hardware toolchain • DWM1001-C • PC with Ubuntu. Software toolchain • Segger J-Flash Lite available at https://www.segger.com/downloads/embeddedstudio • Minicom. Flash last firmware 1. Download DWM1001C Software and Documentation Pack at https://www.qorvo.com/products/d/da008479. 2. Open J-Flash Lite. 3. Choose nrf52832_XXAA as Device and SWD as interface, use default speed 1000. Click “OK”. Figure 78: Screenshot Step 3 Flashing Firmware 4. Click “Erase Chip” to do a full chip erase. 5. In Data File, click and browse to the hex file provided in the DWM1001C Software and Documentation Pack ($ExtractionPath/DWM1001/Factory_Firmware_Image/ DWM1001_PANS_R2.1.hex) to flash, click “Program Device”.
Bachelor thesis title 82 ANNEX D HARDWARE COMPONENT DATA SHEET Table 8: Data Sheets Component Data Sheet AZDelivery ESP32 DEVKIT C V4 AZ DELIVERY ESP32 DvKit C DATA SHEET Adafruit I2S 3W Clase D Amplificador Breakout - MAX98357A MAX98357A/B DATASHEET Adafruit SPH0645LM4H SPH0645LM4H DATASHEET DWM1001-DEV DWM1001-DEV DATASHEET ANNEX E GANTT DIAGRAM Figure 91: Initial Gantt Chrono Figure 92: Initial Gantt Chart and Diagram
83 The initial planned duration of the project was one semester, but the project has been delayed one semester. The reasons where: The project requirements discussed with the tutor on the start of the project cannot be feasible reached by one student on its own in one semester. My knowledge of C and the ESP-IDF framework was not good enough. This delayed the project as I had to start an online course to learn. As we know there has been a global microchip crisis, delivery times for electronic components are longer than expected and the reliability of them is worse. We bought MEMS mic to an Amazon Store with good reviews but once the product arrived and was tested it did not work. Microphones from another store had to be bought but their delivery times where long. This delayed the project one month and a half as we were uncapable to test the code and we could not work in other components in parallel. There have not been follow-up deliverables as the tutor did not request them.
Bachelor thesis title 84 ANNEX E QUALITY CHECKLIST Quality checklist Student’s name Enric Botella Pastor. Final thesis title: Design of a Nurse Calling System with Real Time Indoor Location Capabilities. Formal features – Format Formal features – Content A1 – Cover formats ☒ B1 – Presentation of the problem ☒ A2 – Table of contents ☒ B2 – Background and literature review ☒ A3 – Summary of tables and figures ☒ B3 – Presentation and justification of solutions ☒ A4 – Spelling/units ☒ B4 – Compliance with the scope and specifications ☒ A5 – Tables/figures ☒ B5 – Economic, environmental and safety features ☒ A6 – Document formats ☒ B6 – Timing ☒ A7 – Thesis length ☒ B7 – Conclusions and recommendations ☒ A8 – References ☒ A9 – List of documents ☒ Assessment criteria Difficulty of the work ☒ Very high ☐ High ☐ Medium ☐ Low Accomplishment of objectives ☐ Complete ☒ High ☐ Partial Support and monitoring by the professor ☐ Very high ☐ High ☒ Medium ☐ Low Number of hours spent on the thesis ☒ More than 600 ☐ More than 400 ☐ More than 300 ☐ Less than 300 Other considerations:
85 Student’s signature Enric Botella Pastor