Site Loader
Get a Quote
Rock Street, San Francisco

Master Thesis
Development of Wireless Patient Simulator for Extracorporeal Life Support

Author:
Abdul Wajid Khan
BME(MT) 252749

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

Supervisors:
Prof. Dr. med Dipl.-Ing. (BA) Gerd Haimerl
M.Sc. (FH) Brigitte Straub

Date:
08-May-2018

Topic: Development of Wireless Patient Simulator for Extracorporeal Life Support

Author: Abdul Wajid Khan
Faculty: MME
Master course: Bio-Medical Engineering
Supervisor: Prof. Dr. Gerd Haimerl & M.Sc. Brigitte Straub
Semester: 5

Abstract
This thesis describes the development of wireless patient simulator which is carried in Zentrum für Angewandte Simulation, Hochschule Furtwangen. Patient simulator are devices which can be programmed to work as human body or a medical condition. The patient simulator which is present in university is not easy to transport from one place to other plus it is operated by main supply which is a big hindrance in portability of the system Previously work is being done to make simulator which can be controlled from PC wirelessly. This thesis will take further the development of Hardware and Software which is used as a platform to create wireless simulator with integrated battery backup. Raspberry Pi 3 is used as a main hardware controller with ADC and DAC communicating with SPI and I2C protocol respectively. For controlling the hardware in patient mannequin GPIO pins of Raspberry Pi 3 are used as Digital Input /Outputs. User can control the simulator through GUI which is programmed in LabVIEW and Python. Database of ECG is also processed to work with this simulator so that a user can select different ECG cases for simulation and can also vary heart rate with respect to ECG condition.

Keywords: Wireless Simulation, Analog and Digital I/O, Raspberry Pi3
?

THEMA DER MASTERARBEIT: Entwicklung eines kabellosen Patientensimulators für die extrakorporale Lebenserhaltung

Author: Abdul Wajid Khan
Fakultät: MME
Studiengang: Bio-Medical Engineering
Aufsicht: Prof. Dr. Gerd Haimerl & M.Sc. Brigitte Straub
Semester: 5

Abstrakt
Diese Arbeit beschreibt die Entwicklung eines kabellosen Patientensimulators, der im Zentrum für Angewandte Simulation der Hochschule Furtwangen durchgeführt wird. Patientensimulator sind Geräte, die so programmiert werden können, dass sie als menschlicher Körper oder als medizinischer Zustand funktionieren. Der Patientensimulator, der in der Universität vorhanden ist, ist nicht einfach von einem Ort zum anderen zu transportieren und wird durch die Hauptversorgung betrieben, was ein großes Hindernis für die Portabilität des Systems darstellt. Bisher wurde daran gearbeitet, einen Simulator zu schaffen, der vom PC aus drahtlos gesteuert werden kann . Diese Arbeit wird die Entwicklung von Hardware und Software weiter vorantreiben, die als Plattform für die Erstellung eines kabellosen Simulators mit integriertem Batterie-Backup verwendet wird. Raspberry Pi 3 wird als Haupt-Hardware-Controller verwendet, wobei ADC und DAC jeweils mit SPI- und I2C-Protokoll kommunizieren. Zur Steuerung der Hardware im Patienten-Mannequin werden GPIO-Pins des Raspberry Pi 3 als digitale Ein- / Ausgänge verwendet. Der Benutzer kann den Simulator über eine GUI steuern, die in LabVIEW und Python programmiert ist. Die Datenbank des EKG wird auch verarbeitet, um mit diesem Simulator zu arbeiten, so dass ein Benutzer verschiedene EKG-Fälle für die Simulation auswählen kann und auch die Herzfrequenz in Bezug auf den EKG-Zustand variieren kann.

Keywords: Wireless Simulation, Analoge und Digitale I / O, Raspberry Pi3

Declaration of Authorship
I, Abdul Wajid Khan, declare that this thesis has been written by me and all the work presented in it are my own.
Furthermore, I confirm that no sources have been used in the preparation of this thesis other than those indicated in the thesis itself.
Villingen Schwenningen
Abdul Wajid Khan

08-May-2018

Acknowledgements
This thesis is the last stage of my master degree. I have carried out this thesis within my specialization in my degree program. I would like to thank Mr. Andreas Dietz for his guidance and support from start of my thesis. M.Sc. Brigitte Straub, Prof. Dr. Gerd Haimerl for accepting to supervise this thesis project. Furthermore, I want to thank my Family who provide me motivation and support throughout my master studies and thesis. Friends who help me in different problems. Above all I thank ALLAH Almighty for all his blessings.

Contents
1. Introduction 11
1.1 Patient Simulators 11
1.2 Zentrum für Angewandte Simulation 11
1.3 Extracorporeal life support 11
1.4 Outline of Thesis 12
2. Theoretical Background 13
2.1 History of Simulation 13
2.2 Need for Patient Simulator 13
2.3 Types of Patient Simulator 15
3. Material and Methods 17
3.1 Design Requirements 17
3.2 Thesis Work flow 18
3.3 Controller 18
3.4 Analog to Digital Converter (ADC) MCP3008 19
3.4.1 SPI Communication 20
3.5 Makerhub LINX and BCM2835 Package 21
3.5.1 Working of LINX 22
3.6 Digital to Analog Converter (DAC) AD5669 23
3.6.1 I2C Communication 25
3.7 Power Supply 25
3.7.1 Voltage Regulator LM2596S 25
3.7.2 Battery Charging Circuit 25
4. Development of GUI 31
4.1 Programming for Digital Output, Digital Input and Analog Input 31
4.2 Programming for Analog Output 35
4.3 Hardware Board A 40
4.4 Power Management Board B 40
4.5 Battery working time 40
5. Discussion and Results 42
5.1 Wireless Communication 42
5.2 ADC MCP3008 (Analog Input) 42
5.3 DAC AD5669 (Analog Output) 47
5.4 Switching Between Battery Power and Adapter Power Supply 55

6. Conclusion and Future Development 56
References 57
Appendix 60

?
List of Figures
Figure 1 Stages of Simulation Session 5 14
Figure 2 Intravenous insertion arm 6 15
Figure 3 Cardiology Simulator named Harvey 6 15
Figure 4 METI Human Patient Simulator 6 16
Figure 5 Block Diagram of Wireless Simulator Setup 17
Figure 6 Python Test Program MCP3008 20
Figure 7 SPI working Block diagram 20
Figure 8 Example of LINX VI for Blinking LED 21
Figure 9 LINX Local I/O working 22
Figure 10 LINX Remote I/O working 23
Figure 11 DAC Test Program 24
Figure 12 I2C working Block diagram 25
Figure 13 Charging Module 29
Figure 14 4PDT Relay 29
Figure 15 AC/DC Adapter 30
Figure 16 Block Diagram for Digital Input / Output 32
Figure 17 Digital I/ O Control 32
Figure 18 Example of Connecting a Hardware to Digital Out Pin. 32
Figure 19 Block Diagram for Analog Input 33
Figure 20 Analog Inputs on MCP3008 34
Figure 21 Conversion of ECG Data 36
Figure 22 UDP Communication LabVIEW 37
Figure 23 Python UDP Program 37
Figure 24 ECG Data Simulation 39
Figure 25 Power Mnagement Board (L) Top side, (R) Bottom side 41
Figure 26 Hardware Board (L) Top side, (R) Bottom side 41
Figure 27 Two voltages on 2 Analog Inputs 43
Figure 28 Sine wave signal 25hz 44
Figure 29 Sine wave signal 120Hz 45
Figure 30 Sine wave signal 250Hz 46
Figure 31 Voltage Output Accuracy 47
Figure 32 Sine and Triangle Waveforms 48
Figure 33 Simulated Sine wave as Seen on Oscilloscope (Ch 1 simulated Sine wave, Ch2 Sine wave from Function generator) 49
Figure 34 Simulated Sine wave as Seen on Oscilloscope (Ch 1 Simulated Sine wave, Ch2 Sine wave from Function generator) 50
Figure 35 Correlation between Simulated and Ideal data 51
Figure 36 Correlation between Simulated and Ideal data 52
Figure 37 Correlation between Simulated and Ideal data 53
Figure 38 Low pass Filter Result 54
Figure 39 Switching b/w power supplies 55
Figure 40 Hardware Board Circuit Diagram 61
Figure 41 Power Management Board Circuit Diagram 62
?

List of Tables
Table 1 Comparison of Different Cell (Battery) 26
Table 2 Cell Comparison Result 28

?

List of Abbreviations
GPIO General Purpose Input / Output
SPI Serial Peripheral Interface
UART Universal Asynchronous Receiver-Transmitter
I2C Inter-Integrated Circuit
BCM Broadcom Chip
PCB Printed Circuit Board
LAN Local Area Network
CLK Clock
CS Chip Select
MISO Master Input Slave Output
MOSI Master Output Salve Input
SDA data signal
GUI Graphical User Interface
Li-Ion Lithium Ion
SCK clock signal
RPi 3 Raspberry Pi 3

Chapter 1
Introduction
1.1 Patient Simulators
Patient Simulators are used for teaching purpose for doctors and healthcare professionals. A patient simulator can be programmed to act like human being in disease or any physical condition. Simulator are used for learning purpose of medical staff such as doctors, paramedical staff and medical students. By the help of these simulator a person can learn how to deal with the patient in any emergency cases without putting in danger a real human being. A person can do mistakes and learn from these mistakes as patient simulator is not a real human being. These simulators can build confidence in user which would be helpful when the person work with real patient.
Zentrum für Angewandte Simulation
This institute is situated in Hochschule Furtwangen campus Villingen-Schwenningen. Working is being done in this institute to develop different simulators for medical cases such as Extracorporeal life support, cardiac assistive system, intra-aortic balloon pumping and extracorporeal membrane oxygenation. In last year’s work is being to develop a patient simulator which must be small and battery powered so that it can be put in patient mannequin and can be controlled wirelessly by a user through a PC. This simulator is to be designed to work with extracorporeal life support. In this thesis, work is being done to improve wireless communication between PC and hardware controller and other improved functionalities have been introduce.
1.3 Extracorporeal life support
Extracorporeal life support is a process which is occurring outside patient body. In case of disease or trauma when patient heart or lung is not working properly extracorporeal devices are attached to a patient for life support. This can be a heart lung machine which is used during heart or lung surgery or a lung assisted device which is used in oxygenation or deoxygenation of blood. These devices can be used in operation room or during patient transport from one hospital to another.

1.4 Outline of Thesis
A wireless patient simulator should be developed which can be used with other medical devices to train medical staff. A simulator which can output biological signals such as ECG or vital signs just like a real human body. The communication between simulator and user should be wireless and the user can also control different sensors and hardware within patient mannequin. The simulator should be powered by battery for easy transportation.
The individual tasks of thesis are as follow
Improving wireless communication between Patient simulator hardware and PC.
Programming Hardware for generating Digital input/output and Analog input/output signals for controlling of actuators, taking data from sensors and simulation of ECG signal.
Conversion of ECG database to work with Patient simulator.
Design of GUI in LabVIEW for real time data display and controlling of different function of simulator.
Designing of Battery and Main Operated Power supply for powering all hardware.
Housing of hardware and designing of PCB to be installed in Patient simulator.

Chapter 2
Theoretical Background
2.1 History of Simulation
Simulation technique in field of medical science date back to middle ages. When human sculptures are made of clay and stone to determine the biological functionalities of human body 1. In modern era a son and father from Paris developed an obstetrical mannequin which is made of a dead baby and human pelvis 2. The idea of current patient simulation comes from aviation industry when a toy making company made a device for mouth to mouth ventilation. In our case it is used as a Cardiopulmonary resuscitation simulator.
2.2 Need for Patient Simulator
In Science a person can learn more, with good concept when he sees a thing done it front of him as a science experiment. The same rule applies in Medical and Health Sciences. A medical student can learn how to treat or do a surgery on a patient when he sees another senior doctor doing it, for fast learning a student must do more practice and hands on real patient but this approach can have led to errors and mistakes which can be serious for patient life. In modern world due to social expectation, accountability of error had increased. Doctors were found to make medical error even having good knowledge 3. It is estimated worldwide about 142,000 people died due to medical errors in 2013 4. For overcoming this problem Patient simulator are used. These are machines which act like real patient or human body. They can be help full when teaching new medical students how to interact and respond when some real patient comes in front of them. By working on these simulator, a person can learn about many diseases and medical condition without dangering the life of real human being. It can help also in building self-confidence. Learning from mistakes can allow medical students to increase their skill levels to optimize clinical outcomes. These simulators can be programmed to mimic any condition of human body. These simulators can vary from simple artery or veins simulator to a typical human body simulation unit such as SimMan 3G. Now a day’s simulation session take place at medical institute in which medical staff can participate to learn.

2.3 Types of Patient Simulator
Patient Simulator can generally be divided in to 3 types with respect to closeness to reality. 6
Low fidelity
They are simple structure with minimum complexity. They are used to teach medical student task such as taking out blood from blood vessels or working with sutures for dressing of wounds. Lack of feedback is a drawback in this type of simulator.

Medium fidelity
These simulators are closer to reality. They have heart beat sound, chest movement and pulse. They can be used in basic to intermediate simulation exercises in which the parameter can be changed by a computer to train medical students. Other variation in this type is a virtual patient which is online or on a software. It acts like a real patient and give feedback for treatments.

High fidelity
These simulators are designed to approximate reality. They can give brief feedback, can talk and replicate all vital signs as of normal human being. They can be programmed by computer to train medical student for a specific medical condition or disease. The can come in types like full body or only a dedicated part of body

?

Chapter 3
3. Material and Methods
The chapter gives the description about the requirements for developing a platform which can be controlled wirelessly. Furthermore, implementation of techniques, software tools and hardware components used in making this simulator have been discussed.
3.1 Design Requirements
A controller (hardware chip) which is being selected must be programmed in such a way that it can be used as a main hardware. For controlling this main controller wirelessly, programming will be done in LabVIEW and Python language. The main controller should be able to work with sensors (Analog Inputs) and can control hardware (digital Inputs/ Outputs) such as pumps, heater and solenoids which can be attached to patient mannequin in future. The controller should have the ability to simulate biological signals (analog outputs) such as ECG. Moreover, portability and power requirements of the controller should be keep in mind so that it can be put directly inside patient mannequin.

Keeping figure (5) in mind raspberry pi 3 is selected to perform main controller job. For controlling of heaters, pumps and solenoids GPIO pins could be programmed for digital inputs and outputs. Simulation of Signals and reading of analog data from sensors is done by using dedicated IC which are communicating with raspberry pi 3 for Analog Inputs and Analog Outputs because these functions are not available raspberry pi 3. Detailed process of selection of hardware is discussed further in this chapter.
3.2 Thesis Work flow
Previously the main controller raspberry pi 3 was selected. MCP3008 is also connected to read analog data and changed it in to digital data for processing by raspberry pi 3. For wireless communication between raspberry pi 3 and user PC, a program was made in LabVIEW which is taking data from MCP3008 by UDP protocol. On the other hand, python program was written in raspberry pi 3 which is sending the data to LabVIEW program through UDP protocol. Wireless communication was working fine between PC and main controller but the transfer rate was not efficient for analog inputs.
After studying the previous work, I have divided my thesis tasks as follow
Improving wireless communication
Controlling of Digital and Analog Inputs/ Outputs.
Conversion of ECG Database
Designing of battery charging system
Further in this chapter it will be explain what are the methods and techniques I have used to do these tasks and explain the hardware and software components which I have used.
3.3 Controller
The main component of this project is Raspberry Pi3 which control all other hardware and wireless communication with LabView Program. Raspberry Pi3 is a pocket size computer board which can be used as a PC. It is equipped with BCM2837 chip. The ARM Cortex-A53 cores clocking at 1.2GHZ. With built-in WIFI and Bluetooth it can be controlled wirelessly. It has also 1 GB RAM plus a video graphic processor. 4 USB ports, HDMI and 10/100 LAN port comes handy when using as a desktop PC. 7

The main advantage of using this board is 40GPIO pins which can be programmed as per user needs. Different communication protocol like I2C, SPI and UART are also available to interface with different type of chips available in market. The raspberry pi 3 can be programmed as per user need through many programming languages. In this thesis LabVIEW and Python language is used.
Due to its small size and low power requirement it can be placed in Patient simulator and can be powered by 5VDC through a rechargeable battery or AC to DC wall adapter.
3.4 Analog to Digital Converter (ADC) MCP3008
The device takes analog data which is continuous and convert in to discrete values. These discrete values depend on no of bits or resolution of ADC. 8
The reason of using ADC is to get analog data measurement from different sensors attached to patient simulator. The analog data could be in voltage, Resistance or current. Different type of sensor could be Temperature, Pressure, Humidity, Flow and optic sensors.
Keeping above points in mind ADC should be selected which can take data from more sensors at a time and should be able to communicate with Raspberry Pi 3.
MCP3008 ADC from Microchip industries is selected to do this job. It is 8 channel 10bit ADC with SPI communication protocol. This ADC can be programmed to give four pseudo differential pairs or eight single ended inputs. It can be operated from single supply 2.7 to 5VDC which is positive point for working with Raspberry Pi 3 power output of 3.3 and 5 VDC. In this project I have power ADC with 3.3VDC with 10-bit resolution 0.003VDC change can be measured. The ADC gives a ratiometric value.
At 3.3VDC the ADC output 1023 and at 0 VDC it output 0. The voltage between 0-3.3VDC is a value between 0 to 1023. This can be calculated by formula given below

(Resolution of ADC)/(System Voltage)=(ADC Reading)/(Analog Voltage Measured)

In our case we are using 3.3VDC Vin and Vref. Resolution is 1023 and measured voltage is 2.57 VDC so we can calculate ADC reading by this formula.

1023/3.3=(ADC Reading)/2.57
ADC Reading =796
In figure (6) below simple test python program is running to show working of MCP3008 ADC 9. In python shell window the data from 8 channels is shown in 8 columns. 2.57 VDC is applied to channel 1 which is converted in to ADC value of 796 according to conversion formula.

3.4.1 SPI Communication
Serial Peripheral Interface developed by Motorola gives a full duplex synchronous communication between slave and master 10. It uses one CLK wire which synchronize the data bits, one CS wire to select the slave and 2 data line MISO and MOSI. Master can communicate with one salve at a time by selecting Chip select (CS) pin to low. In MCP3008 max sampling rate at 3.3VDC is 75Ksps and at 5VDC is 200Ksps. In this thesis one MCP3008 chip is used so it is one master one slave case.

3.5 Makerhub LINX and BCM2835 Package
For wireless communication between LabVIEW and Raspberry Pi 3 this package is used 15. It can be used with combination of embedded platforms such as Arduino and Raspberry Pi. By using this package user can access SPI, I2C, Digital input and outputs, Analog inputs and outputs. The Communication between LabVIEW and Raspberry Pi 3 can be done wirelessly(WIFI), ethernet or by Serial interface. In this thesis the communication is done by wirelessly through TCP protocol. By the help of this package the user can control GPIO pins directly from LabVIEW. Programming can be done in LabVIEW by help of which user can control the controller as needed. The problem of data transfer rate which was there previously between MCP3008 and LabVIEW was also solved by using this package. In next chapters programming is further explained in details and the results are also discussed why this package is used.
?

With the help of LabVIEW toolkit 16 user can make desirable algorithm in VI´s and can change setting to suit the hardware or sensor which is being used.
In above figure (8) user can blink a led which is connected to GPIO pin 13 directly from LabVIEW. In block diagram Digital write can be changed to Digital read to do opposite of this VI i.e. The VI can take digital input and can display real time state (0 or 1) on selected GPIO pin. There are variety of other options like PWM, Digital read, Digital write and analog input a user can select in LabVIEW toolkit.

3.5.1 Working of LINX
LINX acts like a hardware abstraction layer that allow a user to connect a chip and control it with a single VI 17. There are 2 type of methods which a user can use
Local I/O
Raspberry Pi 3 is a Linux based device and can execute LabVIEW directly. VI´s are made on main PC which will control RPi3. These VI´s are then deployed on RPi3 via TCP communication protocol and with LabVIEW run time engine running on RPI3. The real-time data from RPi3 can be transferred to main PC and the user can directly interact with RPi3. This is called Interactive mode and in this thesis this mode is used for communicating between main PC and RPi3. The concept in shown below in figure (9).

Remote I/O
LabVIEW VI send commands directly from main PC to LINX firmware running on any chipset like arduinio, chipkits, ESP8266s and others. User can command the device to take reading from sensors and display real time data on VI. The firmware can be built for many devices and custom commands can be merged with firmware as shown in figure (10) below.

3.6 Digital to Analog Converter (DAC) AD5669
DAC converts digital signal to analog signal. DAC converts finite precision time series values to a continuous changing signal. It takes a value (binary, hex decimal) and converts in to voltage 11.
The reason of using DAC in this project is to simulate biological signals such as Electrocardiogram and other vital signs signals. MCP 4725 12bit 1 Channel with I2C protocol, MCP 4922 12bit 2 Channel with SPI protocol and AD5669 were taken into consideration for using in this thesis project. AD5669 is selected because it has 8 channel outputs and the resolution is also 16bits which can be helpful for precise modeling of analog signal and it can be controlled by I2C protocol. Another task of this thesis is to convert given ECG data of different ECG condition/disease to work with this simulator. This DAC requires a value between 0-65535 to convert to analog signal or voltage at its output channel. There are 8 channels which are sufficient as mainly 5 lead ECG data was given to be converted to work with this DAC. AD5669 communicate with Raspberry Pi 3 through I2C protocol and can be powered with 2.7 -5.5VDC.

As it is 16bit DAC a value between 0-65535 can be given which can be converted to a voltage level according to given formula.
(Resolution of DAC)/(System Voltage)=(DAC Value)/(Analog Voltage Measured)
65535/3.3=32767/(Analog Voltage Measured)
Analog Voltage Measured =1.65 V
In figure (11) below a test program is running on python 12. User can input channel no and value between 0-65535 to output voltage between 0-3.3 VDC. 0 value give 0 volts, 65000 value gives 3.27VDC and finally 32767 will give 1.65VDC as it is half of 3.3VDC.

3.6.1 I2C Communication
The Inter-Integrated circuit communication protocol was developed by Phillips Semiconductor. Multiple salves can be connected to multiple masters. Master can select to communicate with one slave at a time by providing specific slave address 13. The communication required only 2 wire SDA and SCK. These 2 wires can support up to 1008 slave devices. SDA is data signal and SCK is clock signal. Communication speed is generally 100KHz or 400KHz.
3.7 Power Supply
Two power supply were developed for powering of this simulator. One power supply consists of voltage regulators, 5VDC for powering of raspberry pi 3 and 5VDC, 12VDC for powering of sensors. Another power supply will charge the batteries. The components and there working is explained below.
3.7.1 Voltage Regulator LM2596S
Different DC voltages output are needed in this thesis for powering hardware. LM2596S Voltage regulator is used to power raspberry pi with 5 vdc and sensors with 5 and 12 VDC. LM2596S is a step down monolithic IC which is operated on a switching frequency of 150KHz and can drive up to 3 Amp load. It uses minimum external components and can be found as a module with these components easily. In this thesis a readymade module is used which has all the external components on it.
3.7.2 Battery Charging Circuit
The Patient Simulator need battery backup for uninterrupted operation in case of transporting of Patient simulator from one room to other. For this purpose, a battery charging circuit is needed which can power Raspberry Pi 3, hardware and sensors. To set up a battery charger circuit it is suggested that it should have a full protection against overcharging and over discharging of batteries. For this charging setup following components were used.

Battery
There are many types of batteries available to be use with patient simulators. A comparison was done in between different types of cells, to select which is light weight, small and have high energy density 14.
Table 1 Comparison of Different Cell (Battery)
Cell Type Advantages Disadvantages

Lead Acid Battery

Inexpensive
Simple charging circuit Heavy and big in size
Low energy Density
For proper operation can´t be discharge below 40% of capacity
Mounting should be in upright position

Lithium Ion

High energy density weight(3X), volume(6X)
Usually in small cylindrical structure (18650)
1 cell is 3.6Volts. No of batteries in series and parallel can be set to user need of volts and amp hours.
More discharge cycle Expensive then lead acid battery
Constant current and voltage supply for charging
Every cell in battery should be monitored for over discharge, over charge and charging current should be in between 0.5C to 1C.
Required Battery management circuit when using many batteries in series or parallel configuration

Lithium Polymer

Same cell voltage as of lithium polymer 3.7 volts
Robust and flexible
Low chance of leaking electrolyte More expensive than Li-ion battery
Low in energy density compare to li-ion battery
Required same charge and protection circuit as of Li-ion battery

Comparison of energy density with respect to Weight, Size and Price
Lead Acid Battery 12V 4.5AH weight 1600gm volume= 0.59 L
Energy = Voltage * Capacity
54Wh = 12V*4.5
Gravimetric Energy density(Wh/kg) = Energy/weight = 54/1.625 =32.69Wh/kg
Volumetric Energy density (Wh/L) = Energy/ volume = 54/0.59 = 91.6Wh/l
Price energy density (Wh/€) = Energy /Price= 54/15 = 3.6Wh/€

Li-Ion battery 3.6V (18650) 2500mAh weight = 47 gm volume=0.016L
Energy = Voltage * Capacity
9Wh = 3.6*2.5
Gravimetric Energy density(Wh/kg) = Energy/weight=9/0.047 = 191Wh/Kg
Volumetric Energy density (Wh/L) = Energy/ volume = 9/0.016 = 562.5 Wh/L
Price energy density (Wh/€) = Energy /Price=9/13 = 0.69Wh/€

Li-Polymer 3.7V 1200mAh weight=30gm volume = 0.0117L
Energy = Voltage * Capacity
4.4Wh = 3.7*1.2
Gravimetric Energy density(Wh/kg) = Energy/weight = 4.4/0.03 = 146.6Wh/kg
Volumetric Energy density (Wh/L) = Energy/ volume = 4.4/0.0117 = 339.41 Wh/L
Price energy density (Wh/€) = Energy /Price= 4.4/5 = 0.88Wh/€

CellType Wh/kg Wh/L Wh/€
Lead Acid 32.69 91.6 3.6
Li-Ion 191 562.5 0.69
Li-po 146.6 339.41 0.88

Table 2 Cell Comparison Result

As shown in result Lithium Ion cell can be use with patient simulator circuit due to its high energy density and low cost. In this thesis four Samsung INR18650-35E Li-Ion cells are used to make a battery. To overcome the disadvantages some additional charging and protection IC is used with Lithium ion battery for proper operation with safety.

For charging and using power from lithium ion battery a charging module is used which consist of following IC.
TP4056
NanJing Top Power ASIC Corp produce this 1 Amp Lithium Ion battery charger IC. Lithium Ion battery required constant voltage/ constant current charging to be properly charged. This IC provide constant voltage/ constant current to charge Li-ion battery with thermal protection as a safety feature. The charging current can be varied by Resistance which is programable. User can select the resistance as per current need to charge the battery. The charging voltage is 4.2 Volts and it automatically cutoff the power to battery when the charge current drop to 1/10th of the programmed value. The IC also monitor current, under voltage protection and charging status with fully charged status also.

DW01A
Fortune Semiconductor corporation produce this protection IC. It protects a Li-Ion battery from overcurrent, over discharging and over charging. This IC can be used with TP4056 for double protection. Less components are required to operate this IC. The small package is also a positive point to set this IC within a small battery space.

ML8205A
This IC consist of Dual N-Channel MOSFET´s, drains connected which work with DW01A to switch load off when battery voltages drop to 2.4 volts.

Relay
In this thesis project two 4 changer relay(4PDT) are used for charging of Battery pack and one SPDT relay to switch power between battery and AC/DC wall adapter. 4PDT relay is used because lithium cell when combine to form a battery should be charged separately for proper operation and safety. This is also called balance charging. When the patient simulator is battery powered, 4PDT relays are OFF connecting lithium cells in series to form a battery. For charging the batteries AC/DC wall power supply is used then the relay switches ON to disconnect the batteries from powering the simulator and the batteries get charged.

AC/DC Power adapter
The 12VDC 10A power adapter is used to charge the batteries and powering the simulator at the same time.

Battery Low Voltage Alarm
For checking battery voltage, a pre- build module is used. The low voltage alarm can be set between 2.7 to 3.8 VDC. This circuit module will monitor voltages from all 4 cells in battery and display on 7 segment display. ?

Chapter 4
4. Development of GUI
LabVIEW 2014 SP1 is used for making a GUI in this thesis. The GUI is like a control center for this thesis. User can see all the data in real time in this GUI and can control all hardware which is connected to Raspberry pi 3. The user can also simulate different ECG data which is stored in LabView program and can vary hear rate according to various ECG conditions. This can be helpful in simulating a patient with different disease or heart condition.
The GUI have 2 graphs. One graph is for analog data input. On this graph user can see the data of 8 channel of ADC simultaneously. The data on this graph is showed in voltages from 0 to 3.3 VDC. User can also see voltages of each channel on separate indicator just above the graph. Other graph is showing the ECG data which is sent from ECG database to DAC output Channels. User can also vary heart rate by simply typing value in bpm control.
On other hand there are 8 control LED’s for digital output by which user can change the state of GPIO pins to high or low, and there are 6 state indicators for GPIO pins user can see if the state is high or low, this can be use as digital input. By help of this configuration Digital input output task is done. By controlling the state of GPIO pin user can drive the hardware such as pumps, heater, solenoid value or user can communicate with sensor through digital inputs.
The Programming of GUI is done in 2 parts in LabVIEW and Python.
Programming for Analog Input, Digital Input and Digital Output in LabVIEW
Programming for Analog Output in Python

4.1 Programming for Digital Output, Digital Input and Analog Input
MakerHub LINX addon package for LabVIEW and BCM2835 Libraries 18 were used to program Analog Input, Digital Input and Digital output. BCM2835 Chip is used in Raspberry Pi 3. User can excess GPIO Pins by the help of libraries in combination with LINX package.

The working of Digital Input and output is shown in figure (16). This method is also same when programming for more than one GPIO pin to be input or output. The same method with LabView programming is applied in this thesis GUI for programming 8 Digital outputs and 6 digital inputs.
Controlling of Digital I/ O pins can be done by above Figure (17) of GUI. The control LED are named according to GPIO Pins which can be connected to any hardware to control it. These GPIO pins can easily be seen on Hardware PCB board. A simple connecting circuit is shown in figure (18) for controlling of hardware which can be implemented to work with any digital out pin.

Analog input working is shown in figure (19). In this block diagram some additional sub VI’s are used to work with MCP3008 IC. SPI protocol is also used to communicate with this IC. MCP 3008 can be configured to use as single ended or in differential mode.

Different Analog Inputs voltages and signal were applied to different channels of MCP3008 in figure (20). When sensors are connected to MCP 3008 the result could also be seen on a voltage scale. By the help of this GUI graph user can monitor the data and from analog inputs. The user can control hardware like heater, pump and solenoids which are present in-patient simulator mannequin.

4.2 Programming for Analog Output
For analog output programming is done on python and LabVIEW. LabVIEW Program sent the data to be written on Analog output channel through UDP protocol in form of strings. On Raspberry Pi 3 Python program 19 is running which is receiving the data and changing these string value to numeric value. After this conversion is done python program sent that value to the designated channel.
The main reason of using Analog output is to create desired voltage signal or ECG. The database of ECG which is provided is on excel document with 500 data points. As explained in earlier in chapter 3 DAC required a numeric value between 0-65535 to be converted to voltage at output channel. These ECG data point were scaled in such a way that they became a numeric value between 0-65535. This was done in Microsoft Excel figure (20). Now these set of values were transferred in form of strings from LabVIEW program to Raspberry Pi 3 where python program change strings value to numeric value and write on respective channel. The ECG data is divided in to 6 columns. First 5 columns were taken to be changed to work with DAC. Python program works in such a way that every column has its own channel i.e. first column data will be output on channel 1, second column data will be output on channel 2 and same goes on for other channels.
?

In Figure (22) a simple UDP block diagram is shown. The same block diagram with some extra changes to vary heart beat is used in main GUI block diagram. The ECG data from excel is brought in LabVIEW and stored in Data IN. Then ECG data is transferred to Raspberry Pi3 through UDP protocol. Prior to running this program user must see the appropriate IP address and port setting to communicate properly with RPi 3.
On RPi3 Python program is working to receive the information sent by LabVIEW. This Program is schedule to run automatically as RPi3 power goes ON. The program is explained below.

Python Program working explained

Program is started by importing module. Socket module is imported because of UDP communication protocol. Then SMBus module is imported because it works with I2C protocol to communicate with AD5669 DAC.
Then DAC address for I2C communication with RPi3 and DAC channels address for writing data was given. From data sheet the information was gathered for selecting the channels which are needed to output the numeric values to voltage signal.
For receiving data from LabVIEW UDP program, UDP setting regarding port and IP address of sender was done.
The data from LabVIEW is in form of strings. These strings are formed by taking rows from 8 columns which were previously made in Excel. Explanation is given below.

First Row was taken changed to strings in Lab view, then this string is received by python program. String data was separated by commas, changed to integer value and then stored to 5 arrays respectively.
This process runs in Cycle to produce a 500points ECG signal as originally as in EXCEL sheet data.
The array value are stores in variable. These variables represent the name of channels on DAC where the integer value is to be sent, converted in to voltage.

In Figure (24), Waveform chart Analog output is the simulated data of ECG by LabVIEW Program. The oscilloscope shows the data of first 4 channels of DAC.

4.3 Hardware Board
Initially ADC and DAC was connected to Raspberry Pi 3 by using breadboard and 40Pin Extension cable. For powering Raspberry Pi3 and connected components 5 VDC wall adapter power supply was used. One of the task of this thesis is to develop a portable battery powered supply for powering components and a suitable casing in which all the hardware could be set. For connecting all the components Hardware Board PCB is developed on online software for PCB making named EASY EDA 20. Another PCB for charging batteries and switching power between wall adapter and batteries was made and named as Power Management Board.
The hardware board PCB contains ADC, DAC, one DC-DC converter for powering Raspberry Pi3 and Two DC-DC converters for powering the sensors and other hardware which can be connected in future development. It also contains 8 digital output pins and 6 digital input pins. The hardware board PCB was designed in such a way that it could directly come above Raspberry Pi 3 for saving space. The circuit diagram is attached in appendix.
4.4 Power Management Board
Power to batteries for charging and other components is distributed from Power management board. The main components on this board are relays and four TP4056 Li-Ion battery charging board. Four 3.6VDC Li-ION Cell are placed in series to make a battery. This battery gives 16.8 – 12.8 volts for powering of all the hardware and components. The battery cells needed to be charged separately, each cell is charged by separate TP4056 module. When AC/DC adapter is attached to charge the battery, the two 4PDT relay switch ON to disconnect battery cells in series to get them charged separately. For this purpose, two 4PDT relays were used. Another relay is used to switch between battery and adapter power. The circuit diagram is attached in appendix.
4.5 Battery working time
The battery rating is 3500mAh with 14v nominal voltage. For prolonging the life of Li-Ion cell and for safety it is decided to use half the capacity that is 1750mAh. The hardware board with RPi3 is taking 220mA at an average when running the GUI with full functionalities. The battery run time can be calculated by the formula given below.
Battery Life=(Battery mAh)/( mA consumed by circuit)
Battery Life (hours)=1750/220
Battery Life (hours)=7.95?

?

Chapter 5
5. Discussion and Results

5.1 Wireless Communication
Raspberry Pi is connected through WIFI to computer which is running LabView GUI. The system and simulator should be connected to a same network. Raspberry Pi 3 will work only on 2.4Ghz WIFI but upgraded version which is Raspberry Pi 3B+ can work on 2.4GHz and 5 GHz Band 21. This could be use in future development.
5.2 ADC MCP3008 (Analog Input)
In this thesis MCP3008 reference voltage is set to 3.3VDC so it will take analog input from 0 to 3.3VDC. As it is 10bit ADC it can provide 0-1024 values. Testing for Analog Input is done by giving different voltage signals to channels of ADC. Sine wave signal was applied to all 8 channels. As the frequency reaches to 120 Hz the sine wave on GUI waveform chart looks distorted and as the frequency reaches 250 Hz the amplitude of sine wave was distorted in some sine wave it is visible but others it is not correct. So, it is suggested that by working in this GUI with MCP3008 up to 120 Hz signal can be correctly seen on waveform chart.
In figure (28,29,30) sine wave is applied from function generator which can be seen on oscilloscope image and on waveform chart sine wave as seen on GUI.

In figure (27) two different voltages are applied to 2 of the analog inputs as seen in oscilloscope view. The voltages on analog input are correctly displayed on waveform chart.

?

5.3 DAC AD5669 (Analog Output)
AD5669 is a 16bit DAC. It can take a value in between 0-65536 and change it to voltage according to reference voltage which is 3.3VDC. For insuring the DAC is working properly a simple python program is used. In figure (28) python program is running. A value is given to define channel. The value is converted to a voltage by formula as described in DAC working in 3.1.4. When the user gives a value of 65500 it is changed to 3.28 VDC which can be verified by image of oscilloscope. Another value of 32750 is also given which can also be verified.

AD5669 was also checked for generating different waveforms like sine or triangle wave which can be seen in figure (29) below. The waveforms were generated by giving a look up table in python program with 500 hundred values for sine and triangle wave.
For defining the output frequency limits of DAC, working with all 8 channels simultaneously a test was done. A look up table of 500 values for sine wave was selected because the ECG data which was given also have 500 data point in it. These values were sent to DAC by UDP communication from LabVIEW program. The user can vary the frequency of transmitted data in LabVIEW GUI. This test was done to check the output frequency of DAC. The output signal from DAC is observed on oscilloscope and frequency is measured in oscilloscope which tends to be correct figure (33,34). Other than viewing and measuring frequency on oscilloscope, the simulated data from DAC was compared with ideal sine wave generated in excel. The data points of simulated sine wave were exported from oscilloscope to Microsoft Excel. In excel ideal sine wave of same frequency was generated. Then only one period from both data was taken and correlation was found on MATLAB. In figure (35,36,37) MATLAB graph of data and correlation can be seen. As the sine wave reaches 3 Hz the steps of sine wave can be seen and as frequency reaches 20Hz the shape of sine wave is not visible any more.
?

Figure 33 Simulated Sine wave as Seen on Oscilloscope (Ch 1 simulated Sine wave, Ch2 Sine wave from Function generator)

?

As seen in correlation graph, when the frequency reaches above 15 Hz the correlation between simulated data and ideal sine wave decreases rapidly. By the help of this result it is assumed that for this circuit and programming DAC AD5669 can output the data up to 15 Hz.
In medical situation the highest heart beat per min is in ventricular fibrillation 22 which is between 150bpm – 500bpm. So, if this case is to be simulated the maximum frequency required is 10Hz for DAC output. In figure (35) 10Hz frequency result can be seen but the problem is the steps are more visible in simulated sine wave. For solving this problem, a low pass filter is used with cut-off frequency of 19.4Hz. A capacitor 10uF and Resistor 820 ohm is used to create this filter. By the help of this filter the simulated signal of 10Hz is filtered to remove the steps which can be seen in figure (38). In figure (38) Channel 1 shows simulated sine wave from DAC. Channel 2 shows the output 10 Hz sine wave by low pass filter.
?

5.4 Switching Between Battery Power and Adapter Power Supply
One task of this thesis is to develop a battery powered backup which can power all the hardware in simulator. When power from AC/DC adapter is applied the relays switch to charge the battery and switch to change the voltages from battery source to adapter source for Raspberry pi and other boards. From changing of power from battery power to adapter power the voltages become 0 for milliseconds. This problem was solved by putting a capacitor at input of hardware board figure (39).

?

Chapter 6
6. Conclusion and Future Development

Conclusion
This thesis discussed detailed description for providing the base structure for hardware and software for making a wireless simulator for medical use. The main given task to make digital, analog input and output is working efficiently with wireless communication through WIFI. Secondary task of system portability is also accomplished by making all hardware on small PCB same as size of Raspberry Pi 3 so that it can be placed in any patient mannequin, furthermore powering of hardware is accomplished by making rechargeable battery circuit. Last task to convert given ECG database is also accomplished which user can use to simulate different heart conditions. In future development LabVIEW and python code can be improved to work with different sensors and hardware which can be attached to simulator.
Future Development
New Model of Raspberry Pi which is RPi3 B+ can be used due to dual band WIFI 2.4GHz & 5GHz.
Sensors and actuators can be used with Digital and Analog Input Output.
LabView and Python Programming can be improved with use of different functions.
Analog output ECG signal can be programmed to work with real patient monitors.
Placing this hardware in to patient mannequin and connecting sensors and actuators which are available in Zentrum für Angewandte Simulation HFU.

References
A typology of simulators for medical education. Meller G. J Digit Imaging. 1997 Aug; 10(Suppl 1): 194–196.
The history of medical simulation. Kathleen R. Rosen. J Crit Care. 2008 Jun;23(2):157-66. doi: 10.1016/j.jcrc.2007.12.004.
Simulation and its role in medical education (21-04-2012) Rashmi Datta, KK Upadhyay, VSM, and CN Jaideep
Global, regional, and national age-sex specific all-cause and cause-specific mortality for 240 causes of death, 1990-2013: a systematic analysis for the Global Burden of Disease Study 2013 Prof Christopher J L Murray 18-12-2014
Simulation-based learning: Just like the real thing. Dr. Fatimah Lateef. J Emerg Trauma Shock. 2010 Oct-Dec; 3(4): 348–352.
Simulation-based medical teaching and learning Dr. Abdulmohsen H. Al-Elq. J Family Community Med. 2010 Jan-Apr; 17(1): 35–40.
Raspberry Pi 3 Specification Weblink accessed on 15-09-2017 https://www.raspberrypi.org/products/raspberry-pi-3-model-b/
ADC. Weblink accessed on 20-10-2017 https://learn.sparkfun.com/tutorials/analog-to-digital-conversion
MCP3008 Test Program. Weblink accessed on 25-10-2017 https://learn.adafruit.com/raspberry-pi-analog-to-digital-converters/mcp3008
SPI Communication. Weblink accessed on 20-10-2017 https://learn.sparkfun.com/tutorials/serial-peripheral-interface-spi
DAC. Weblink accessed on 15-12-2017 https://www.allaboutcircuits.com/textbook/digital/chpt-13/digital-analog-conversion/, https://www.elprocus.com/digital-to-analog-converter-dac-applications/
DAC Test program. Weblink accessed on 27-12-2017 https://github.com/ControlEverythingCommunity/CE_PYTHON_LIB
I2C Communication. Weblink accessed on 22-12-2017 https://www.i2c-bus.org/
Battery Comparison. Weblink accessed on 2-2-2018 http://www.epectec.com/batteries/cell-comparison.html, https://static1.squarespace.com/static/55d039b5e4b061baebe46d36/t/56284a92e4b0629aedbb0874/1445481106401/Fact+sheet_Lead+acid+vs+lithium+ion.pdf, https://medium.com/solar-microgrid/battery-showdown-lead-acid-vs-lithium-ion-1d37a1998287
MakerHub LINX. Weblink accessed on 05-11-2017

https://www.labviewmakerhub.com/doku.php?id=libraries:linx:start
MakerHub LabVIEW tool kit. Weblink accessed on 06-11-2017 http://home.hit.no/~hansha/documents/lab/Lab%20Equipment/Raspberry%20Pi/Raspberry%20Pi%20with%20LabVIEW%20LINX/Raspberry%20Pi%20with%20LabVIEW%20LINX.pdf
Working of LINX. Weblink accessed on 06-11-2017 https://www.labviewmakerhub.com/doku.php?id=learn:libraries:linx:misc:linx-internals
BCM2835 Libraries. Weblink accessed on 15-11-2017 http://ftp.qwavesys.com/repository/Training_RMUTI_2017/ADC-3208/LabVIEW%20BCM2835%20Library%20for%20Raspberry%20Pi%20(Issue%201.1).pdf
UDP receive Python. Weblink accessed on 05-1-2018 https://wiki.python.org/moin/UdpCommunication
Online PCB making Easy EDA. Weblink accessed on 05-2-2018 https://easyeda.com/
Raspberry Pi 3B+. Weblink accessed on 05-04-2018 https://www.raspberrypi.org/products/raspberry-pi-3-model-b-plus/

Ventricular Fibrillation. Weblink accessed on 11-April-2018 https://lifeinthefastlane.com/ecg-library/ventricular-fibrillation/

Datasheets of Component Used
MCP3008 Analog to digital Converter http://www.produktinfo.conrad.com/datenblaetter/650000-674999/651456-da-01-en-IC_ADC_MCP3008_I_P_PDIP_16_MCP.pdf
AD5669 Digital to Analog Converter http://www.analog.com/media/en/technical-documentation/data-sheets/AD5629R_5669R.pdf
LM2596S Voltage regulator http://www.ti.com/lit/ds/symlink/lm2596.pdf
TP4056 Battery Charger IC https://dlnmh9ip6v2uc.cloudfront.net/datasheets/Prototyping/TP4056.pdf
DW01A http://escooter.org.ua/_fr/1/DW01A-DS-10_EN.pdf
ML8205A http://www.datasheetspdf.com/pdf/847699/MEILAI/ML8205A/1
Relay 4PDT http://www.produktinfo.conrad.com/datenblaetter/500000-524999/502923-da-01-en-REL__NORM_12_V_DC_SERIE_55_34.pdf
12V Power Adapter http://www.farnell.com/datasheets/2142225.pdf

?

Appendix

A. Hardware Board Circuit Diagram
B. Power Management Board Circuit Diagram
C. Instruction to work with GUI and Hardware
D. Complete Thesis Hardware
E. LabVIEW GUI

?

Instruction to work with Hardware and Software
LabVIEW 2014 SP1 is used for LabVIEW Programming. First install LabVIEW 2014 on user computer from which the simulator would be controlled.
Install LabVIEW MakerHub Package with BCM2835 Package. Detailed installation manual for these can be found in reference 16, 18.
On Raspberry Pi 3 every module and library is pre-installed. Connect Raspberry Pi 3 to same network as of user PC. For accessing raspberry pi 3 desktop VNC software is used.
On Raspberry Pi 3 UDP Receive program chkdatasine.py is auto running whenever raspberry pi boot. The user can change auto run setting by going in raspberry pi /home/pi/.bashrc. After opening .bashrc user can remove the last two lines to stop auto run ,
“echo Running at boot”
“sudo python /home/pi/5669AD/chkdatasine.py”
Open LabVIEW project. Connect RPi3. Open main VI and run it.
All the python file, Labview VI and datasheets are located as softcopy in CD.
Low voltage of battery is set to 3.3 volts. When the voltage reaches set limit device starts to beep. For charging cells of battery charging voltage is also displayed when charger is connected to power management board. Please charge cell up to 4.15 volts.
The LED near power switch in hardware board will give indication of Raspberry Pi 3 state On or off.
When the power switch is ON RPi3 boot and python program will be autorun. To shut down RPi3 user can access remotely the desktop through VNC and can shut down from there. After shutting down please wait 60sec to switch OFF. The LED will be off when RPi3 shuts down.

Complete Thesis Hardware

LabVIEW GUI

Post Author: admin

x

Hi!
I'm Victoria

Would you like to get a custom essay? How about receiving a customized one?

Check it out
x

Hi!
I'm Jeremy!

Would you like to get a custom essay? How about receiving a customized one?

Check it out