They the requirements for developing a platform

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.

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

order now

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.

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

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.
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.

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.

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.

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. ?


I'm Mary!

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

Check it out