Final Report Drip Bag Monitoring System

Muhammad Simjee (simjeem@gmail.com) 203503366

Abstract
This report covers the design of an IV (intravenous) bag monitoring system for use in the hospital environment. There exists a demand for such systems, as the currently employed method of intravenous drug delivery often results in patients receiving an incorrect dosage. The system designed aims to provide solutions to the problems faced, by providing for the remote monitoring of the level of the IV bag as well as the infusion rate to the patient. In order to achieve this, two separate devices have been designed and constructed. The unit known as the remote device is attached to an existing IV stand and interfaced to the IV bag. Using a load cell, mass measurements of the IV bag are obtained at a specific sampling rate. This data is then transmitted using the wireless protocol of ZigBee to a unit known as the host where the data is processed and displayed using a PC. The system exhibited a worse case error of 2g in the mass measurement. This allows for the accurate computation of the level of the IV bag but results in significant errors in the flow rate measurement. A user friendly graphical user interface (GUI) has been designed which allows for the monitoring of a number of remote devices. The GUI also provides the user with access to a historical database which contains the patients personal and medication data as well as the monitoring data. The system is also capable of providing warnings if an improper dosage is detected and aims to reduce problems which are a result of human error.

ii

Contents
Abstract ...........................................................................................................................................ii List of Figures ................................................................................................................................. v List of Tables .................................................................................................................................vii List of Tables .................................................................................................................................vii List of Abbreviations...................................................................................................................... viii 1 2 Introduction ............................................................................................................................. 1 Overview................................................................................................................................. 2 2.1 2.2 2.3 Problems and Constraints ............................................................................................... 2 Solutions ......................................................................................................................... 2 Tasks............................................................................................................................... 3 Measurement........................................................................................................... 3 Intelligence .............................................................................................................. 4 Remote Monitoring................................................................................................... 5

2.3.1 2.3.2 2.3.3 2.4 2.5 2.6 3

Interaction between Devices............................................................................................ 5 Proposed System Operation............................................................................................ 6 Unit Design...................................................................................................................... 6

Implementation ....................................................................................................................... 8 3.1 Hardware......................................................................................................................... 8 Wireless Communication ......................................................................................... 8 Host ....................................................................................................................... 10 Remote Device ...................................................................................................... 12

3.1.1 3.1.2 3.1.3 3.2

Software ........................................................................................................................ 24 Overview................................................................................................................ 24 ZigBee Wireless Protocol....................................................................................... 27 Implementation ...................................................................................................... 28

3.2.1 3.2.2 3.2.3 4 5 6

Costing.................................................................................................................................. 40 Housing................................................................................................................................. 41 Analysis of the Design........................................................................................................... 42

iii

6.1 6.2 7 8 9

Testing .......................................................................................................................... 42 Problems and Solutions................................................................................................. 44

Conclusion ............................................................................................................................ 47 Reference ............................................................................................................................. 48 Appendix A1.......................................................................................................................... 49 9.1 9.2 9.3 Calculation of the Required CMRR of the Instrumentation Amplifier .............................. 49 Comparison of AD623 and INA126 using Error Budget Analysis ................................... 49 Medication Database..................................................................................................... 50

iv

List of Figures
Figure 1: Block Diagram Representation of the Gravity Intravenous Infusion Set............................ 1 Figure 2: Block Diagram illustrating functionality of the Database ................................................... 4 Figure 3: Diagram Describing the Exchange of Data between Host and Remote Device ................ 6 Figure 4: Block Diagram Representation of the Remote Device...................................................... 7 Figure 5: Block Diagram Representation of the Remote Device..................................................... 7 Figure 6: Hardware Configuration of the CC2420 RF Transceiver ................................................ 10 Figure 7: Block Diagram Representation of the Host..................................................................... 10 Figure 8: Block Diagram Representation of the Finalised Host Design.......................................... 11 Figure 9: Final Circuit Diagram of the Host.................................................................................... 12 Figure 10: Block Diagram of Remote Device................................................................................. 13 Figure 11: Illustration of Wheatstone bridge and its equation ........................................................ 15 Figure 12: Block Diagram Illustrating the Components of the Measurement System..................... 17 Figure 13: Circuit Diagram Illustrating the Hardware Configuration of Human Input Mechanism ... 17 Figure 14: LED Ladder Configuration............................................................................................ 18 Figure 15: Circuit Diagram of Display Hardware ........................................................................... 19 Figure 16: Figure Describing Average Current Equation ............................................................... 19 Figure 17: Block Diagram Illustrating the Requirements of the Power Supply ............................... 20 Figure 18: Power Supply Circuit Diagram ..................................................................................... 23 Figure 19: Final Circuit Diagram of the Host.................................................................................. 24 Figure 20: Timeline Diagram Illustrating the System Operation..................................................... 25 Figure 21: Summary of the Data Transferred between Host and Remote Device.......................... 26 Figure 22: Diagram Illustrating Layers and their Associated Policy Makers for the ZigBee Protocol ..................................................................................................................................................... 27 Figure 23: Time Line Diagram Illustrating the Sequence of Events Required to Establish Communication............................................................................................................................. 28 Figure 24: Figure Illustrating the Interaction between PC and Microcontroller ............................... 29 Figure 25: Flow Chart Depicting the Software of the Microcontroller ............................................. 30 Figure 26: Flow Chart Illustrating the Setup Phase ....................................................................... 32

v

Figure 27: Flow Chart Depicting the Software of the Measurement Phase.................................... 34 Figure 28: Diagram illustrating Structure of Client and Data Tables .............................................. 35 Figure 29: Table Relationships of the Database............................................................................ 35 Figure 30: GUI of IV Monitor ......................................................................................................... 37 Figure 31: Historical Database Window ........................................................................................ 38 Figure 32: Flow Chart Representation of Remote Device Software............................................... 40 Figure 33: Diagram Illustrating the Load Cell Housing .................................................................. 41 Figure 34: Modified Load Cell Housing Design ............................................................................. 45

vi

List of Tables
Table 1: Comparison of ZigBee and Bluetooth Technologies .......................................................... 8 Table 2: Comparison of measurement devices ............................................................................. 15 Table 3: Key Amplifier Specifications and their Priority ................................................................ 16 Table 4: Comparison of 10-bit and 12-bit ADC's ........................................................................... 17 Table 5: Comparison between Linear and Switching Regulators................................................... 21 Table 6: Comparison of SLA and Li-ion Batteries.......................................................................... 21 Table 7: Device types of the ZigBee Protocol................................................................................ 27 Table 8: Sampling Rate vs. Dosage .............................................................................................. 38 Table 9: Error Budget Comparison of AD623 and INA126 Instrumentation Amplifiers................... 49 Table 10: Illustration of the data contained in the medication database......................................... 50

vii

List of Abbreviations

NRE GUI UPS PC I/O USART USB VCP LED LCD RF Op-Amp In – Amp ADC Wi-Fi CMRR SLA Ni-Cad Ni-Mh PPM MAC OSI BCD

-

Non – Recurring Engineering Graphical User Interface Uninterruptible Power Supple Personal Computer Input or Output Universal Synchronous Asynchronous Receiver Transmitter Universal Serial Bus Virtual Communication Port Light Emitting Diode Liquid Crystal Display Radio Frequency Operational Amplifier Instrumentation Amplifier Analogue to Digital Converter Wireless Fidelity Common Mode Rejection Ratio Sealed Led Acid Nickel Cadmium Nickel Hydride Parts Per Million Medium Access Control Open Systems Interconnection Binary Coded Decimal Ohms

viii

1 Introduction
The use of technology in the medical field is by far the best use of human potential. However, as the gap between rich and poor increases, the cost of medical equipment has become out of reach of the third world where medical technology is most needed. An integral part of modern medical care is the use of intravenous (IV) drug delivery. Fluids that are typically delivered include glucose, saline and blood. IV drug delivery is essential in many situations especially when the human body goes into shock, as inter-muscular delivery methods are ineffective. Another important use is in the treatment of cholera prevalent in much of Africa, where intravenous fluid replacement has proved the most effective treatment. The most cost effective and widely used system of intravenous drug delivery is known as the gravity intravenous infusion set. The set comprises of a reservoir, drip chamber, feed tube and IV needle. The reservoir, commonly known as an IV bag holds the fluid to be infused. This reservoir connects to a drip chamber which is connected to the needle via a feed tube. The fluid in the reservoir flows into the patient’s blood stream at a rate controlled by the drip chamber. The diagram in Figure 1 describes the layout of the gravity intravenous infusion set.

Reservoir (IV Bag)

Drip Chamber Patient IV Needle Feed Tube

Figure 1: Block Diagram Representation of the Gravity Intravenous Infusion Set

There are two major problems associated with the system. The first is related to the flow rate which is controlled by the drip chamber. The drip chamber is a mechanical device with various settings which allow the drop rate to be varied. However, drop size and thus volume are dependent on the viscosity of the medication being delivered. Furthermore, due the manufacturing tolerances of the drip chamber, flow rates vary between sets. Standard hospital practice to alleviate this problem is for staff to monitor the fluid in the reservoir and adjust the drip chamber settings such that the reservoir is emptied within a desired time frame.

1

The second problem is the situation where the patient is no longer receiving any medication. This may be as a result of a blood clot in the patient’s vein, a failure of the IV set or the reservoir becoming empty. There are other problem areas facing the system which are a result of human error which often results in incorrect dosage. The persistence of any of these problems can result in fatalities. There are various systems which have been designed to provide solutions to these problems. The most common being the use of positive displacement infusion pumps. Such pumps provide accurately controlled infusion rates, but they and other similar devices suffer a major disadvantage, cost. The high costs are primarily due to the controllers required as well as fail safe systems in order prevent over infusion or the infusion of air. The cost of such systems range from R25000 – R500001 per unit. Thus it is the goal of this project to design a prototype system which solves the problems faced by the gravity intravenous infusion set whilst still being cost effective.

2 Overview
2.1 Problems and Constraints

As mentioned the 3 problems faced by the system are: • The patient does not receive the desired flow rate as prescribed, due to the nature of the infusion set. The patient receives no medication at all, due to the IV bag becoming empty. The patient receives incorrect medication or dosage due to human error

• •

The major constraint on the design is cost with a project budget of R700. Since the system is intended for medical use it must comply with IEC standard 60601 which governs medical equipment. However, this standard is extremely detailed and implementing all aspects is not feasible in the given time frame. Thus, only criteria critical to the overall system design will be considered. The limitations considered demand that the system in no manner affects the sterility of the infusion system and that the system can continue to function in the event of a power failure for 1 hour. 2.2 Solutions

The ideal solution to the problems discussed above, is to create a system which is capable of controlling the infusion rate. However, due to the limitations on cost, such a design is not feasible. In order to reduce costs the design aims to limit changes to the gravity feed system. To provide a feasible solution to the problems faced, a system which can measure the infusion flow rate and the level of the IV bag and provide this information to medical staff in an effective manner would be required. Whilst these measures implemented in a stand alone system provide solutions to the problems of incorrect flow rate and no flow, the solution is not optimal as nursing staff would still be required to individually check each device. Thus it was decided that the system would provide remote monitoring capabilities i.e. many IV units can be monitored from a single location. The system will also require a degree of artificial intelligence in order to attempt to reduce the hazards which are a result of human error.

1

Verbal quotation provided by the Netcare Group

2

Thus the designed system is required to carry out 4 major tasks: • • • • Measurement of flow rate Measurement of the level of the IV bag Remote monitoring of the measurement data Artificial intelligence in order to provide warnings in the event that improper dosage is detected 2.3 Tasks Measurement

2.3.1

The system is required to measure flow rate as well as determine the level of fluid in the IV Bag. The measurement must be provided with a level of accuracy such that the information is useful to medical practitioners. Through extensive research which primarily involved interviews with doctors and nursing staff it was determined that flow rate must be provided with an accuracy of 5%, whilst level must be provided with an accuracy of 1%. Due to the sterile nature of the hospital environment, commonly used methods of obtaining flow rate such as differential pressure, mechanical and vortex flow were deemed unsuitable as they are of an invasive nature. A method of non-invasive flow rate measurement currently employed in medical equipment, is achieved by counting the number of drops which fall through the dropper over a period of time. However, since drop size is a function of the medication being delivered and the dropper unit, the flow rate obtained is merely an estimate. Since it provides no guarantees of accuracy, it was ruled out. Electromagnetic, ultrasonic and cross correlation flow meters are often used in industry for the measurement of volatile and highly corrosive liquids. Whilst these measurement systems are noninvasive their exorbitant costs ranging from R50 000 to R500 0002 ruled them out as options. Mass flow rate is defined as the rate of change of mass over time. Thus if the change in mass of the IV bag could be measured over a set period of time, mass flow rate could be determined. Mass measurement can be used to provide accurate flow rate as well as perform level sensing, if the initial mass of the bag is known. Thus this method provides solutions to both measurement requirements. Mass measurement is non-invasive and can be implemented in a variety of cost effect ways, thus making it an ideal solution. However, usage of a mass measurement system would provide flow rate in mass units such as Kg/second. Research revealed that drug delivery was prescribed in volumetric units such as litres/min. Thus in order for the measurement data to be useful to medical staff a conversion of units would be essential. In order to convert mass flow rate to volumetric flow rate, the density of the liquid is required. Equation 1 on the following page describes the conversion from mass to volume.

2

Cost based on verbal quotation provided by Honeywell South Africa.

3

Q=
Where: m = mass flow rate ρ = density Q= volume flow-rate

m

ρ

(1)

The requirement of density for the measurement process creates a minor hurdle. Whilst online density measurement systems exist, their starting cost is in the region of R20 0003. Further these devices are invasive thus ruling them out. The only solution is to provide density in an offline manner, thus it must be programmed into the system. 2.3.2 Intelligence

A secondary goal of the project is to provide the system with a prior knowledge, in an attempt to prevent human error. The American Institute of Medicine reported that in 2003 incorrect dosage attributed to between 840 000 and 1.2 million injuries and 60 000 fatalities. 4 Thus the system is designed such that in has the ability to warn staff in the event that an incorrect dosage has been detected. In order to achieve this, the system will require a database containing information on all medication delivered via IV. This information will include dosage specifications, medication specific warnings as well as the medication density as discussed in section 2.3.1. Further, since dosage is dependant on the age, weight and sex of the patient, this information will have to be provided for each patient being monitored. Since a database system will exist it was decided that as an added feature the system would provide a historical database for record purposes. This will contain previously recorded measurement data, thereby allowing for trend analysis and will provide an effective patient record system. Figure 2 illustrates the functionality of the database.

Figure 2: Block Diagram illustrating functionality of the Database

3

Source: ISSYS - Drug Infusion & Flow Products. Cost based on silicon micro tube specific gravity sensor. Quoted price converted from US$ to ZAR at exchange rate of 7 ZAR to 1 US$.
4

Source: Centre for Drug Safety(USA) – Adverse Drug Event Statistics

4

Whilst the system is designed as a standalone system, it is easy to envisage such a system integrated into the hospitals computer network. For example the recently opened Albert Luthuli Hospital in Durban, South Africa has been labelled a “paperless hospital”, since the patients records are tracked electronically from admission to release. Thus patient information would already exist in the hospitals database. Further, doctors could check on and monitor patient dosages from their offices or any other networked computer. However, due to time constraints this aspect of the project will not be covered in this report. 2.3.3 Remote Monitoring

Due to the requirement of remote monitoring, the system will be divided into 2 distinct units known as the remote device and the host. In order to link the two devices a communication network will be required. There are two major types of communications networks, cable based and wireless. Until recently cabled based systems have been the only viable solution. Developments in wireless technology have resulted in robust systems, with reduced costs, which allow the technology to rival cable based systems. Wireless technologies have virtually no installation costs and provide greater system flexibility, thus allowing hospital wards to be reconfigured as required. Further, implementation of a wireless solution will improve patient freedom thus giving them an improved quality of life. Thus a wireless network was chosen for the project. Whilst the prototype which will be created will consist of only a single remote device, the design is such that a number of these devices can be monitored by the host. 2.3.3.1 Remote Device The remote device is the device placed at the patient’s bedside which interfaces with the IV set. Its objective is to obtain measurement data and transmit it to the host. Since the device is intended to interface with existing gravity infusion sets, it must be small and lightweight. Interviews with medical practitioners revealed that a basic information display system would increase the practicality of the system and thus its viability. In accordance with hospital regulations the device must provide a 1 hour battery backup. Due to the small and light weight nature of the device, the capacity of the battery will be limited. Thus in order to limit power consumption, it will have limited functionality and will not perform any data processing, merely transmit measurement data to the host. 2.3.3.2 Host Due to the limitations on the remote device, the host will be the primary means of interaction between the system and its users. Thus the interface must be of a suitable nature to allow for the required information regarding the patient and medication type to be entered. Further requirements include sufficient memory to store the required databases as well as the processing ability to process the raw measurement data. The processed measurement data must then be transmitted back to the remote device for its display functionality. 2.4 Interaction between Devices

The wireless network is tasked with providing communication between devices. The block diagram in Figure 3 illustrates the required data which must be exchanged.

5

Figure 3: Diagram Describing the Exchange of Data between Host and Remote Device

The remote device transmits raw mass measurement data for processing by the host. As an added feature the device also provides and indication of it power mode. This is done in order to prevent accidental entry into the battery mode. Since, the host will be used to enter all the patient data a method of confirming this data is required. In order to achieve this, the host will transmit critical data to the remote device in order for medical staff to validate that the setup is for the correct patient. Thus the host will send setup information to the remote device. Medical staff will confirm this data at the remote device, which will send a confirmation back to the host. In order to allow for data to be displayed at the remote device, processed flow rate and level data will be transmitted form the host to the remote device. 2.5 Proposed System Operation

The proposed operation of the system is best understood by use of an example of how a potential client would make use of the system. The medical practitioner will proceed to the host where they will be provided with a list of the available remote devices on the network. The user will then select a device for setup and enter patient and medical information. If necessary, warnings regarding the dosage or medication will be issued. The associated remote device will then indicate that it has been setup by displaying the patients name and the medication prescribed. Once the infusion of the patient has begun a user will press an acknowledge key and the process of monitoring flow rate and level will commence. This data can be viewed at the remote device or in greater detail at the host. Further, both the host and remote device would provide an alarm notification in the event that the level or flow rate enters into undesirable values. 2.6 Unit Design

Evaluation of the functionality highlights clear differences between the two units. The remote device has limited I/O requirements and is constrained by size and power consumption. Thus this unit is designed as a microcontroller based system. The block diagram below highlights its major functional units.

6

Power Supply

User Input Mechanism

Measurement System

Transceiver

Microcontroller

Basic Information Display

Figure 4: Block Diagram Representation of the Remote Device

The host unit will be designed as a PC based system. Whilst PC’s are costly, they are common even in the most remote locations and can carry out a variety of tasks. Further designing an embedded system which could replicate the functionality provided by the PC is not feasible given the time constraints and the NRE costs of such a design. The usage of a PC would allow for a greater level of interaction between the system and users as detailed and intuitive graphical user interfaces (GUI) can be created. The diagram in Figure 5 illustrates the design of the host. The power supply for the PC has not been included in the diagram as commercial Uninterruptible Power Supplies (UPS) provide a cost effective battery back up solution.

Figure 5: Block Diagram Representation of the Remote Device

7

3 Implementation
3.1 Hardware Wireless Communication

3.1.1

The selection of the wireless network has a critical role in the hardware design and thus its selection in the early phase of the design was crucial. Three network technologies namely Wi-Fi, Bluetooth and ZigBee were evaluated based on the following criteria: power consumption, cost and the number of devices supported by the network. Due to the limitations on power consumption and the high costs of implementation, Wi-Fi technology was deemed unsuitable for the project. Thus the two remaining technologies of Bluetooth and ZigBee were evaluated in further detail. The table below highlights the comparison.
Table 1: Comparison of ZigBee and Bluetooth Technologies Market Name ZigBee Bluetooth Battery Life (Days) 1001000+ 1 -7 Network Size 65536 7 Bandwidth (KB/s) 250 720 Range (Meters) 500 10

Standard 802.15.4 802.15.1

Clearly both network options are suitable for the project as they meet the project requirements. However, the two technologies are very different and are suited to different applications. ZigBee technology has clear advantages for this project as it allows for the monitoring of a higher number of devices and provides a greater coverage range. These factors would increase the viability of the project substantially. Further, the lower power consumption provided by ZigBee would allow for increased functionality in other areas of the design. The major disadvantage of ZigBee is related to data transfer rates. However, given the application that the system is intended for, the limitation will not affect the systems overall performance. 3.1.1.1 ZigBee Implementation Two methods of implementation were evaluated. The Aerocomm ZB340 provides a complete ZigBee solution in a small 25.4mm x 34.3mm x 5.5mm device. Apart from its small size, the device features sleep mode currents of less than 1uA and active mode currents of 25mA. Communication with the device is via the RS-232 protocol which makes it ideally suited for microcontroller applications. The cost of the device is R240. The second option was provided by Microchip and is supplied in the form of an evaluation kit known as Picdem Z. The kit comprises of a set of Microchip microcontrollers, RF transceivers as well as software templates in order to implement the ZigBee protocol. Whilst the cost of the kit is expensive at R1250, the actual hardware required for implementation, namely the microcontroller and transceiver, cost a mere R45 and 5R25 respectively. Furthermore, the kit is provided with application notes and reference material which are significantly more substantial then that available for the Aerocomm product, which was only launched in August 2006. The major advantage of the Microchip solution is with regard to development time, as the kit provides an entire prototyping solution. Considering the time constraints on a project of this nature, Picdem Z was the best solution.

5

Price based on order quantity of 1000 units. Quoted price converted from US$ to ZAR at exchange rate of 7 ZAR to 1 US$.

8

3.1.1.1.1 Microchip ZigBee Hardware The hardware required for the implementation of the Microchip ZigBee solution comprises of a PIC18f4620 microcontroller and the Chipcon CC2420 RF transceiver produced by Texas Instruments. The PIC18F4620 is a multi-purpose 8-bit microcontroller providing an 11-Channel ADC, USART, 35 I/O pins as well as other standard microcontroller functions. The device offers 64Kbytes of program flash memory which allow for a variety of applications to be developed. The CC2420 is an IEEE ZigBee compliant RF transceiver designed for low power wireless applications. The device boasts a standby current of 426uA whilst the current required to receive and transmit is 18.8mA and 17.4mA respectively. Whilst the receive and transmit currents are high, they are only required for the short period that the device is communicating on the network. The device is capable of achieving an outdoor range of 150m6 and interfaces to the microcontroller via SPI and 8 I/O pins. Whilst the PIC18F4620 can operate between voltages of 2.2V - 5V, it will be powered at 3.3V since the CC2420 is a 3.3V device. The PIC18F4620 is well suited for low power applications as it features Microchip’s Nanowatt technology. This allows the microcontroller to operate in sleep mode with a maximum current consumption of 2uA whilst active mode currents vary between 7mA15mA. Thus effective use of the microcontrollers operating mode is essential in order to achieve a power efficient design. The following Circuit Diagram in Figure 6 illustrates the required hardware configuration of the CC2420. The configuration was obtained from the following Microchip reference material, “Picdem Z Demonstration Kit User Guide – DS5152A pg 25-32”. Due to time limitations and the lack of availability of precision surface mount resistors and capacitors, the daughter card consisting of the CC2420 and its associated hardware provided in the PICDEM-Z kit was used.

6

Exact range is dependant on many factors including but not limited to obstacles, PCB design and antenna.

9

Figure 6: Hardware Configuration of the CC2420 RF Transceiver

3.1.2

Host

The I/O functions of the host are handled entirely using standard PC peripherals i.e. keyboard, mouse and monitor. Thus the only hardware design requirement was that of an interface module which would allow the PC to interface with the ZigBee Hardware. The figure below provides a block diagram representation of the host.

Figure 7: Block Diagram Representation of the Host

The communication between the PC and the microcontroller will be accomplished using the microcontrollers USART (Universal Synchronous Asynchronous Receiver Transmitter) serial communication functionality. Thus communication between the PC and the microcontroller will be handled by the RS-232 protocol. However, there are two major disadvantages of using the PC’s serial port for communication. Firstly, the device is being phased out and is no longer available on most laptops, as almost all peripherals now interface to the PC via the USB (Universal Serial Bus). Secondly, the serial port cannot be used to power peripheral devices via the PC’s Bus. The ideal solution would be to interface the microcontroller to the PC via the USB. The USB common to all PC’s after 1999 allows peripheral devices to be powered via the bus. The USB standard provides 5V and peak currents of 500mA when the PC is in active mode.

10

Evaluation of the active mode currents of the microcontroller and RF transceiver revealed that together, the peak current requirement is 40mA. Further, the RF transceiver and microcontroller will be powered at 3.3V. The ZigBee hardware’s power requirements are clearly within the power limitations of the USB standard. However, the disadvantage of implementing the USB is the complex nature of the protocol which requires significant software development for the peripheral device as well as driver development for the PC. In order to exploit the benefits of the USB and the simplicity of the serial port a compromise which included both solutions was found. The compromise revolves around the use of the USB – UART device produced by FTDI. The device known as the FT232R acts a bridge between a USB host and a USART device. The FT232R is supplied with PC drivers known as VCP (Virtual Communication Port) drivers. The driver effectively adds a serial port to the PC which can be accessed by software as if it were a physical device. In order to provide a 3.3V supply from the 5V PC bus the Max 884 regulator was used. The device was selected due to its low dropout characteristics as well as its availability through local suppliers.

Figure 8: Block Diagram Representation of the Finalised Host Design

The complete hardware schematic of the host is described in Figure 9 on the following page. The hardware configuration of the FT232R was obtained from the manufacturer’s datasheet, “FT232R USB UART I.C. Datasheet Version 1.04, pg 26”.

11

Figure 9: Final Circuit Diagram of the Host

3.1.3

Remote Device

The hardware design of the remote device is a crucial element in the successful implementation of the system. The block diagram in Figure 10 illustrates the major functional units. The constraints on the unit are size and power consumption.

12

Power Supply

User Input Mechanism

Measurement System

ZigBee Hardware CC2420 PIC18F4620

Basic Information Display

Figure 10: Block Diagram of Remote Device

3.1.3.1 The Measurement System As determined in the functionality overview, the measurement of flow rate and level will be accomplished by mass measurement. In order to determine the requirements of the mass measurement system, research was carried out at the 7St. Augustine’s Hospital, Durban, South Africa. The aim of the research was to determine the range and resolution that would be required by the device. Range would be determined by the maximum mass of an IV bag which the system would be required to monitor, whilst resolution will be determined by dosage and monitoring requirements. The maximum volume of an IV bag used in hospitals is 1 litre, with common dosages being between 1 litre per hour (1L / hour) to 1 litre per 12 hours (83mL / hour). In order to determine the mass of an IV bag from volume, density is required. The conversion is illustrated by the following equation:

ρ=
Where m = mass ρ = density V = volume

m V

(2)

7

Research was supervised by Dr. Parag M.B. Ch.B. (Natal) F.C.P. (S.A)

13

Obtaining the density of the medication proved difficult as the pharmaceutical companies were reluctant to provide this information. However, research revealed that there are only five different drugs commonly prescribed for intravenous drug delivery. Based on this information it was decided that these five drugs would be used to model the system. In order to obtain the density of these drugs, samples were obtained and analysed using an Anton Paar DMA 5000. The device commonly found in laboratories can determine the density of a sample with 5 digit accuracy. The results of the analysis are tabulated in Appendix A1 - 9.3. The maximum mass of the IV bag was thus calculated at 1.1082 Kg, obtained using the medication with greatest density. In order to increase the flexibility of the system and allow it to operate with a variety of drugs, it was determined that a range of 1.5 Kg would be required. Resolution was determined through analysis of the user’s needs and the dosage being delivered. Thus a scenario was created in order understand the effects of resolution. Assuming the lowest dosage of 83mL/hour with the system measuring mass every minute. The system would be required to measure 1.38ml/min. Converting this to mass units using the lowest density of 1.0016 translates to 1.38g/min. However, consultation with medical practitioners revealed that measurement provided over a 5 min period would be adequate. Further if a dosage of 1L/hour (16ml/min) was prescribed, the required resolution would be 16g. Thus it was decided that the sampling rate would be varied depending on the dosage prescribed and a resolution of between 2g and 5g would be adequate. 3.1.3.1.1 The Measurement Device Three measurement devices were explored, namely force sensors, spring balances and load cells. The spring balance whilst being the cheapest of all three options required a significant amount of mechanical engineering design. These devices exploit the spring constant K in order to determine the force applied and thus the mass of the load. However, the limitation of such a measurement system is that resolution and range are interdependent, due to the properties of a spring. Thus the system was ruled out, as it was unable to achieve both the range and resolution requirements. The second device investigated is known as a force sensor and is produced by Honeywell. The FSS1500 provides the required range of 1.5Kg as well as providing a cost effect solution with a unit cost of R160. The device provides measurement with an accuracy of 1.5% and resolution of 10g. The final system evaluated was the load cell. The device is used in a variety of applications from precision laboratory scales to vehicle weighbridges. Further, the wide variety of specifications available, allow load cells to be chosen for specific applications. Two load cells were evaluated, the Vishay 1002 which has a range of 1.5Kg, resolution of 0.75 g and accuracy of 0.01%. The device is well suited for the application and provides resolution well in excess of the requirements. However, the cost of the load cell was quoted at 8R660. The second load cell investigated was the BCL – 300 produced by NMB. The device has a range of 3Kg, accuracy of 0.02% and resolution of 1.5g. Whilst, the range of the device is in excess of the requirement it is still suitable for implementation, with a price of 9R320.

8

Load cell quotation provided by United Scales South Africa Load cell quotation provided by United Scales South Africa

9

14

Table 2 below highlights the specifications and costs of the force sensor and load cells. The BCL – 300 was chosen for implementation as it provided a balance between cost, resolution and accuracy whilst still meeting the range requirements of the system. The measurement device is a critical element of the system thus validating the expenditure. Further, since load cells are resistive devices, their power consumption is low. The only disadvantage of implementing the device is that the measurement is susceptible to error if the IV bag is subjected to an external force. However, these errors can be limited if a suitable housing is designed and will be discussed in section 6.2.
Table 2: Comparison of measurement devices Vishay 1002 Price (R) Range (Kg) Accuracy (%) Resolution (g) 660 1.5 0.01 0.75 BCL- 300 320 3 0.02 1.5 FSS1500 160 1.5 1.5 10

3.1.3.1.1.1 BCL – 300 Load Cell A load cell is a device which converts force into an electrical signal. The sensing element of a load cell is known as a strain gauge. The strain gauge consists of a pattern of resistive foil which is mounted on a backing material. Strain is defined as the amount of deformation of a body due to an applied force. Thus as force is exerted on the foil, it deforms and its electrical resistance changes. However, in order to prevent permanent deformation of the resistive foil, it cannot be subjected to forces greater than a few millistrain (the actual value is determined by the materials elastic limit). Thus the change in resistance is typically in the region of 0.2 – 0.5 . In order to measure this small change in resistance, strain gauges are configured in a Wheatstone bridge. The figure below shows the bridge and its equation.

Figure 11: Illustration of Wheatstone bridge and its equation

The voltage Vx is known as the excitation voltage and is specified by the manufacturer of the Load Cell. In order to ensure accurate readings this voltage must be stable. The recommended excitation voltage of the BCL-300 is 5V which results in a current consumption of 11mA. The major advantage of the load cell is that it provides a linear output over its designed range and thus conversion to mass is a simple task. The analogue output of the load cell must be digitized by an ADC in order to interface the load cell to the microcontroller. However, the differential output voltage of the Wheatstone bridge is a maximum of 2.5mV when a 1.5Kg load is applied. Thus the signal level must be boosted in order to reduce the resolution requirements of the ADC as well as increase the signal – to – noise ratio.

15

3.1.3.1.2 Signal Conditioning Circuitry The task of the signal conditioning circuitry is to provide amplification whilst maintaining the integrity of the signal. In order to aid in the selection of the amplifier, the major amplifier specifications were prioritised as in the table below.
Table 3: Key Amplifier Specifications and their Priority Amplifier Specification CMRR Offset - Voltage Drift Offset - Voltage Gain - Bandwidth - Product Priority High High Medium Low

In order to ensure that only the differential voltage is measured, high CMMR is required in order to eliminate the common mode voltage. Whilst offset voltage does effect the calibration it can be rectified in software. However, offset drift is more problematic and thus has a higher priority. Gain bandwidth product is a low priority since the sensor only operates at low frequencies. Operational amplifiers (op - amps) can be configured to amplify differential voltages and provides a cost effective solution. However, the decision factor with highest priority CMRR is dependant on the matching of resistors. Furthermore, the low input resistance characteristics of op-amps results in a loading of the signal source. Instrumentation Amplifiers (in - amp) are designed specifically to amplify differential signals and reject the common mode voltage. They provide high CMRR, high input resistance, low offset voltage and low offset drift, thus making the device ideal for the application. Due to the wide variety of in-amps available on the market the required CMRR was calculated. The calculation is provided in appendix A1 - 9.1 and revealed a required CMRR of 126dB. Since the device would be used in a low power application, it must operate of a low voltage single rail supply and provide rail to rail outputs. Two in-amps were selected for implementation, both meeting the above requirements. The AD623 produced by Analogue Devices which is low cost device and the INA126 produced by Texas Instruments which sells at 4 times the price of the AD623. In order to evaluate the devices, an error budget analysis as described in the Analogue Devices application note AN-539, “Errors and Error Budget Analysis in Instrumentation Amplifiers” was carried out. The results of the analysis are tabulated in Appendix A1 - 9.2. The application note describes a method of determining the overall error in an in-amp application. The analysis revealed that for the given application the total error of the AD623 was 40% less than that of the INA126. Thus not only does the AD623 provide a more cost effective solution, it also produces less error and was thus selected. 3.1.3.1.3 Analogue to Digital Converter (ADC) The ADC is responsible for converting the analogue output of the signal conditioning circuitry into a digital representation in order to allow for transmission by the microcontroller. The criterion evaluated in the selection of the ADC is resolution. Resolution is determined using the full scale voltage and the number of bits of the ADC as described by the equation below.

Re solution =

FullScaleVoltage 2 numberofbitsofADC − 1

(3)

Two options of implementation, an external 12-bit ADC and the internal 10-bit ADC of the PIC18F4620 were considered. Table 4 on the following page illustrates the comparison. 16

Table 4: Comparison of 10-bit and 12-bit ADC's 10 bit ADC ADC Resolution (mV) Transducer output per bit (uV) Output (mg) per bit Volume (ml) per bit - solution density = 1.1082 Volume (ml) per bit - solution density = 1 3.226 3.2258 1.4663 1.6249 1.4663 12 bit ADC 0.8057 0.8059 0.4835 0.436 0.483

Whilst the 12-bit ADC does provide greater resolution, it is well beyond the requirements of the system as well as the resolution of the load cell. The selection of the 10-bit ADC reduces the component count of the system as well as the total cost and power consumption. The block diagram below illustrates the final component selection of all the devices required to accomplish the measurement task.

Figure 12: Block Diagram Illustrating the Components of the Measurement System

3.1.3.2 Human Input Mechanism In order to satisfy the requirements of a human input mechanism in order to start the monitoring process, a system activation button is included in the design. The button is in the form of a push-tomake switch which is connected to an I/O pin of the microcontroller. The required hardware configuration is shown below. The switch has been designed such that the internal pull up resistor of the microcontroller is used in order reduce power consumption. Resistor R1 limits the current drawn from the microcontroller to 7mA when the switch is activated.

Figure 13: Circuit Diagram Illustrating the Hardware Configuration of Human Input Mechanism

3.1.3.3 Basic Information Display System The goal of the system is to provide system information in an effective manner. However, the functionality provided is not critical to the successful operation of the system and is thus under restrictive power consumption limitations.

17

The design focused on providing information in a useful manner. Ideally, the data should be displayed in a manner which allows it to be viewed at a distance. However, this would require greater luminescence and thus more power. In order to provide an optimal solution, the devices operation was divided into two power operating modes, namely mains and back up. This allowed for optimal functionality in mains mode where there are no restrictions on power consumption. In backup mode the system will operate with reduced functionality in order to conserve power. The display system uses a combination of two technologies i.e. LED and LCD. LED’s are employed for their ability to provide high luminescence and thus display information at a distance whilst LCD technology will be employed in order to display detailed information. There are two sets of data which must be displayed i.e. flow rate and the level of the bag. The LED’s will be used in order to indicate level by arranging them in a ladder formation as illustrated in the diagram below. Eight LED’s will be employed, but in order to limit I/O usage they will be grouped into sets of two. This will allow for four levels to be indicated with boundaries at 75%, 50% and 25.

Figure 14: LED Ladder Configuration

The system will use a generic 16x2 LCD display which will provide flow rate and level in a numerical format. The LCD will also provide functionality during the system setup procedure and will be discussed in further detail in the software design. In order to limit the I/O requirements of the LCD it will be operated in 4 wire mode thus reducing its I/O requirement to 6 pins. Analysis of the current requirements of the two display technologies clearly indicates which power mode category they fall in. The LCD requires 2mA and thus will operate in both mains and back up mode whilst each LED will be supplied with 10mA and thus will only be used when mains power is available. The circuit diagram below illustrates the hardware configuration of the LED’s and LCD. The LED’s will be driven by transistors such that they can only draw power of a non-backed up supply. This will be explained further in the following section.

18

PD5 PD6

PE0 N/C PD4

Figure 15: Circuit Diagram of Display Hardware

3.1.3.4 Power Supply The power supply is required to supply the 3.3V and 5V logic in such a manner that these devices can still function in the event of loss of mains power. The unit must also supply 5V only if the mains power is available in order to drive the LED’s. A further requirement is that the unit must provide the microcontroller with an indication of the power mode it is in i.e. mains or backup. Critical to the design of the power supply is the battery which will provide power in the event of the mains power being interrupted. In order to determine the required battery capacity specified in mA hours, the average current of each device was calculated. The LCD, instrumentation amplifier and load cell have constant current requirements, whilst the requirements of the microcontroller and RF transceiver vary depending on the power mode in which the device is in i.e. active or standby. In order to determine the current requirement of these devices the average current consumption is calculated using the following equation.

I avg =

(I

stdby

× t stdby ) + (I active × tactive ) ttotal

PD7

PE1

5V

N/C

(4)

Figure 16: Figure Describing Average Current Equation

19

However, this calculation is dependent on the sampling rate and functionality of the system and thus a worse case estimate was used. The estimate assumed that the microcontroller and transceiver would be in active mode for 15% of the operating time. The table below summarises the voltage and current requirements of the system.
Device Load Cell In_amp LCD Microcontroller Transceiver 8xLED's Voltage Required 5V 5V 5V 3.3V 3.3V 5V Backed Up Yes Yes Yes Yes Yes No Peak Current 11.9mA 480uA 2mA 9mA 19mA 160mA AVG Current 11.9mA 480uA 2mA 2.2mA 3.1mA 160mA

Summing the average current requirement of each device requiring backup power, yielded a total requirement of 19.68mA per hour. The block diagram below shows the requirements of each unit in the power supply.

Figure 17: Block Diagram Illustrating the Requirements of the Power Supply

There are two major design decisions which affect the design of the power supply: regulator topology and battery chemistry. 3.1.3.4.1 Regulator Topology There are three different topologies available, namely charge pumps, switching and linear regulators. Charge pumps are suitable for supplying loads with peak currents less than 100mA and thus the evaluation focussed on linear and switching regulators. Table 5 on the following page summarises the differences between these topologies.

20

Table 5: Comparison between Linear and Switching Regulators Linear Function Complexity Size Total Cost Ripple/Noise Only steps down- input voltage must be higher than output Low Small Low Low - no ripple, low noise Switching Steps up, steps down or inverts High - requires large number of external components Medium to High Medium to High - requires external components Medium to high - due to ripple at switching frequency

The major advantage of switching regulators is their ability to step-up voltage, which reduces the number of cells required in battery powered applications. This is a major motivating factor in handheld devices, as battery size is critical to the overall size of the device. However, in this application there are less stringent limitations on size and thus housing extra cells is not a major issue. Further, PCB design and component layout are critical in the design of switching power supplies. The major deciding factor was based on the requirement of a low noise and low ripple excitation voltage for the load cell as discussed in section 3.1.3.1.1.1. Since accurate measurement is essential to the success of the design, linear regulators were selected. 3.1.3.4.2 Battery Chemistry In order to reduce maintenance requirements and increase the viability of the product it was decided that a rechargeable chemistry would be implemented. Four chemistries were explored, NiMh (Nickel Hydride), Ni-Cad (Nickel Cadmium), SLA (Sealed Lead-Acid) and Li-Ion (Lithium Ion). Nickel Based batteries are suited to application where they are discharged completely before being recharged. Repeated charge before complete discharge results in permanent damage to the battery and is known in the industry as the “memory effect”. In this application the charge and discharge cycles are sporadic and complete discharge is never guaranteed. Thus if Nickel based batteries were to be used they would require constant maintenance in order to prevent permanent damage. This requirement ruled out the use of Ni-Cad and Ni-Mh chemistries. The two remaining chemistries are compared in the Table 6 below.
Table 6: Comparison of SLA and Li-ion Batteries SLA Energy Density (Wh/Kg) Cycle Life (to 80% of initial capacity) Charge Time (hours) Cost (R) 30-50 300-500 8-16 50 (6V) Li-ion 110-160 5001000 2-4 350 (7.2V)

21

The Li-Ion battery provides the ideal solution in terms of cycle lifetime, energy and size. However, its high cost, lack of availability and complex charge requirements are major disadvantages. The SLA battery was initially ruled out of the evaluation as its limited number of charge cycles would seriously limit the functionality of the system and increase maintenance. However, closer evaluation of the specifications revealed that the above mentioned life cycle limitations were valid only if the battery was discharge completely. Evaluation of a 6V 1.3Ah SLA battery revealed that it could provide 200mA for 4 hours whilst only using 35% of the batteries capacity. Over this discharge pattern, the battery would provide 1500-2000 charge cycles. Further, its availability and simple charge circuitry made it the chemistry of choice for this application. 3.1.3.4.3 Power Supply Circuit The aim of the circuit is to charge the SLA battery and power the system when mains power is available and in the event of loss of mains power, switch to battery power in a manner which allows the circuitry to continue normal operation. The circuit design is influenced primarily by the charge requirements of the SLA battery. These batteries are charged using a constant voltage known as the float voltage which is specified by the manufacturer. The battery can be held at this voltage for years with no effect on the battery. In the case of the 6V 1.3Ah battery chosen for implementation the float voltage is 6.75V – 6.90V. The only limitation on the charge process is that the charge current must not exceed 150mA. Further, these batteries can rupture if short circuited and thus require short circuit protection. The understanding of the circuit is best understood with reference to the circuit diagram in Figure 18. 1. 2. 3. 4. The output of the transformer is rectified by diodes D111 and D112 and smoothed by capacitor C1. C1 was calculated at 1100uF which results in a ripple of 600mV at 200mA. The LM7805 voltage regulator provides a 5 V volt output with maximum current of 1 A. The output of this device is used to power the LED’s and is thus not backed up. The ADP667 is low dropout linear regulator which can be configured to provide outputs between 2V and 15V. Using resistors R2 and R3 the devices output is configured at 7.4V. Resistors R1 and R4 form a voltage divider such that the voltage between the resistors is 3.1 V. Since this voltage will fall to 0V during power failures, this point is connected to the microcontroller in order to provide the power mode. Diode D2 prevents current from the battery reaching the regulator output during periods of mains failure. There is a forward volt drop across the diode which reduces the voltage to 6.8V. The terminal voltage of a fully charged 6V battery is between 6.75V and 6.90V. When the battery voltage reaches 6.8V, the charge voltage equals the voltage at D2. Since there is no longer a difference in potential, current will not flow into the battery. In order to limit the maximum charge current resistor R9 was added. These batteries can explode if short circuited thus protection circuitry was included. If the output of the supply were to be shorted, fuse F2 is designed to blow. If the battery is connected incorrectly, diode D3 will conduct causing F1 to blow. Since the batteries can tolerate discharge currents of 20A, the fuses have a rating of 1 A.

5.

22

6.

The ADP667 is used as a fixed 5V regulator and the Max884 is a fixed 3.3V regulator. If the mains were to fail, the battery automatically takes over and the supply to these regulators will not be interrupted. However, resistor R9 would result in unwanted power wastage. The BUK445 is P-Mos power mosfet with RDS of 0.117 was implemented in order to alleviate the problem. The gate of the mosfet is connected to the 5V non-backed up power provided by the LM7805. Thus when mains power is available the mosfet will not conduct and the charging current is limited by R9. In the event of a loss of mains power the gate voltage will fall to 0V and the mosfet will turn on effectively shorting out R9.
2

1 3 4

6 5

Figure 18: Power Supply Circuit Diagram

23

3.1.3.5 Complete Circuit Diagram

Figure 19: Final Circuit Diagram of the Host

3.2

Software Overview

3.2.1

Using the proposed system operation discussed in Section 2.5 a detailed timeline illustrated in Figure 20 was created which separates the operation into phases. During the setup phase the host software will prompt the user to enter the required setup data and medication specific warnings are issued if required. Once the process is complete the setup data is transmitted to the remote device where it is displayed on the LCD. The user will then press the acknowledge button to indicate that the setup data is valid and that the patients has been prepared for infusion. Once the acknowledgement has been received the system enters in to the monitoring phase. During this phase the remote device obtains and transmits measurement data at the desired sampling rate. The host will process this data, display it on the GUI and transmit the processed data back to the remote device for display on the LCD and LED’s.

24

Host
Patient ID

Remote Device

Store to Database

Age ,Sex

Store to Database

Medication Type

Store to Database

Dosage

Store to Database

Warning

Determine Medication Warnings

Send Setup complete confirmation

Setup Data

Display Setup Complete

Setup Complete

Acknowledge Data

Send ACK confirmation

ACK

Obtain Measurement Data

Raw Measurement Data

Send Measurement Data

Process and Display Measurement Data

Send Display Data

Processed Measurement Data

Display Data

Figure 20: Timeline Diagram Illustrating the System Operation

3.2.1.1 Data Transfer Analysis of the timeline revealed that there were 4 sets of data which must be transmitted between devices.

25

3.2.1.1.1 Raw Measurement Data Two sets of data must be transmitted, namely ADC data and power mode data. The ADC data is 10 bits whilst the power mode is represented in a single bit. In order to increase the system efficiency the single bit power mode data will be combined with the upper byte of the ADC data. 3.2.1.1.2 Processed Measurement Data Flow rate must be displayed on the LCD whilst level is displayed on the LCD and using LED’s. Level will be expressed as a percentage and thus a single byte provides the desired range (0-100). Flow rate data can range from 16ml/min to 1.6ml/min. The data will be transmitted in a single BCD byte. The desired dosage entered during the setup phase will be used to set where the decimal point if any would be placed. If the actual flow rate were to differ significantly from the desired set point, data would not be able to be displayed. However, this scenario should never occur as the display would issue an alarm notification and thus data will not be displayed until the alarm condition has lifted. The alarm set points will be discussed in further detail in the following chapter. The alarm condition will be sent as 0xFF for the relevant data set. For example, if a level alarm were to exist, the level display data would be 0xFF. Since this value is not represented in BCD or in the percentage range there is no chance of conflict. 3.2.1.1.3 Acknowledge Data The “acknowledge” is sent from the remote device once medical staff have confirmed the setup data and the administration of the drugs has commenced. The “acknowledge” will be sent as a single byte with the value 0xFF. 3.2.1.1.4 Setup Data The purpose of this data is to enable hospital staff to confirm that the system as been setup correctly for the patient. Since the data will be displayed on a 16 x 2 LCD, the amount of data which can be displayed is limited. Thus only the patient’s surname, truncated to the first eight letters and the medication type truncated to the first 12 letters will be sent. The data will be transmitted in the ASCII format. A further byte containing the desired dosage in litres/hour will also be transmitted. This data is used to set the sampling rate of the remote device and is used in order to correctly display flow rate data as described in section 3.2.1.1.2. Figure 21 summarises the data transferred between the host and remote device.

Figure 21: Summary of the Data Transferred between Host and Remote Device

26

3.2.2

ZigBee Wireless Protocol

The protocol is a crucial element in the design as it governs the transfer of data between the host and remote device. The ZigBee Wireless Protocol has been specifically designed for low data rate sensors and control networks. It is layered on top of the IEEE 802.15.4 standard. The Protocol defines 3 types of devices as listed in the table below.
Table 7: Device types of the ZigBee Protocol ZigBee Protocol Device Co-ordinator Power Source Mains Receiver Configuration On when idle

Typical Function One must Exist for every network. Forms the network and allocates addresses This is an optional device with the primary task of extending the range of the network. Can also perform monitoring and/or control functions. Performs monitoring and/or control functions.

Router

Mains

On when idle

End

Battery

Of when idle

Clearly in this system the device known as the host performs the tasks of the co-ordinator and the remote device is an end device. The terminology will be used when discussing the ZigBee Protocol. The ZigBee stack architecture is based on the standard OSI (Open Systems Interconnection) model, but defines only those layers required to achieve the desired functionality. The IEEE 802.15.4 standard governs the physical and MAC (Medium Access Control) layers of the protocol. The ZigBee Alliance, a non – profit consortium manages the network layer as well as a section of the application layer known as the application support sub-layer. The application framework layer is designed by the system user. Since the Microchip stack provides a complete solution, it is only this layer which must be designed. The diagram in Figure 22 illustrates the layers of the protocol.

Figure 22: Diagram Illustrating Layers and their Associated Policy Makers for the ZigBee Protocol

27

The ZigBee network is a multi-access network i.e. all nodes on the network have equal access to the communication medium. There are 2 types of multi-access mechanisms, beacon and nonbeacon. At present the Microchip ZigBee stack only supports non-beacon networks where all nodes on the network are allowed to transmit at any time as long as the channel is idle. However, in order to reduce the power consumption of end devices their receivers must be powered down for the majority of the time. Whilst in this state messages would not be received. In order to solve this problem all messages are buffered by the co-ordinator. This allows end devices to intermittently turn on their receivers and check for messages. Since all messages will be sent directly to the co-ordinator from end devices (Star Network Configuration), a process known as direct messaging is employed. In this form of messaging the co-ordinator can communicate with all the end points if the network address of all devices is known. In order to initiate communications in the ZigBee network, the sequence of events described in Figure 23 are followed. The process is handled entirely by the stack and will not be discussed in further detail.

Co-ordinator Tasks

End Device Tasks

Initialise and create network

Search for available networks

Time

Join Request

Request to join network once found

Accept Device and assign it a node ID

Assign node ID

Communications Establised

Communications Establised

Figure 23: Time Line Diagram Illustrating the Sequence of Events Required to Establish Communication

3.2.3

Implementation

3.2.3.1 Host The software design of the host requires the integration of PC and microcontroller hardware. The microcontroller is tasked with implementing the ZigBee protocol whilst the application framework layer is implemented on the PC. Data is transferred between PC and microcontroller and vice versa via the USB protocol. The Diagram below illustrates the interaction between PC and microcontroller.

28

Figure 24: Figure Illustrating the Interaction between PC and Microcontroller

3.2.3.1.1

USB Protocol

In order to allow PC software to access the USB port, driver software is required. The driver employed is known as VCP as discussed in section 3.1.2 is supplied by the manufacturer as freeware. This software will be supplied to the client as part of a complete software solution. The drivers are available for a variety of operating systems, thus increasing the viability of the product. 3.2.3.1.2 Microcontroller Software As mentioned the microcontroller is tasked with implementing the ZigBee Protocol. Thus the microcontroller is programmed with the Microchip ZigBee stack which is provided as part of the Microchip ZigBee solution. The microcontroller must carry out four tasks: 1. Data received via the USART must be passed on to the lower layers of the ZigBee protocol for transmission. 2. Data received via the CC2420 must be passed up through the ZigBee protocol layers and then transmitted to the PC via the USART. Further, the node ID of the device which transmitted the data must also be passed to the PC. 3. Immediately after initialization, the device must establish a network and provide the application framework layer with a confirmation by transmitting the newly formed network address to the PC via the USART. 4. If a new device is added on the network, its node ID must be passed to the PC via the USART as a confirmation that a new device is available for setup. The flow chart in Figure 25 illustrates the implementation of the above tasks.

USB Protocol

29

Figure 25: Flow Chart Depicting the Software of the Microcontroller

3.2.3.1.3 PC Software The goal of the PC software design is to implement a user friendly graphical user interface (GUI) which provides information in an intuitive manner. There are two distinct phases which each device on the network will be in i.e. setup and monitoring. These phases will then be implemented into the design of the forms used to create the GUI.

30

3.2.3.1.3.1 Setup Phase In this phase the user is prompted to enter the patients personal data which consists of five fields namely, first name, surname, age, weight and sex. Once this data has been entered, a data base for the patient will be created. The user is then prompted to enter the medication information which consists of the desired dosage, full volume of the IV bag as well as the medication type. Once the tasks have been accomplished the database will be updated with the medication specifications. The entered data will then be used to determine if any warnings regarding the desired dosage or any special considerations regarding the medication type exist. In order to determine these warnings a medication database will be used to store warning conditions. This data is tabulated in Appendix A1 - 9.3. If a warning condition were to arise the system will enter an into alarm mode which will only cease once the user has acknowledged the warning. Furthermore, the medication database provides the density of the medication which will be removed and stored in a local variable. The medication data will then be pre-processed for effective use in the measurement process. The full mass of the bag will be computed using the full volume of the IV bag and the density of the medication it holds. An estimate of the mass of the empty IV bag will also be added to this value. The estimate of the mass of the empty IV bag is based on the following equation:
10

Mass _ Empty _ Bag =

Volume _ of _ IVBag × 25 grams 1litre

(5)

The system will then determine the alarm set points for the flow rate. Research revealed that flow rates within 30% of the desired dosage were acceptable. Thus alarm set points will be created depending on the desired dosage. The level alarm will also be configured at 25% of the full mass. The final task in the setup phase is to transmit the setup data as described in section 3.2.1.1.4. The user is then informed that the setup is complete and that the patient must be prepared for infusion. Figure 26 provides a flow chart representation of the setup phase.

10

The Equation to estimate the mass of an empty IV bag is based on the mass of empty 1 litre IV bags which were weighed.

31

Start

Prompt user to enter patient and medication data Store entered data in patient database

Provide medication alarm

Yes

Dosage Warnings
No

No

User ACK

Yes

Compute mass of full IV bag Calculate flow rate alarm set points

Calculate level alarm set points

Send setup data via USB

End

Figure 26: Flow Chart Illustrating the Setup Phase

3.2.3.1.3.2 Monitoring Phase The system will enter this phase only once setup is complete and the “acknowledge” from the remote device has been received. The objective in this state is to process the received measurement data and display it to the user. The host will receive two bytes of data as describes is section 0. The data must then be separated and converted into a 10 bit value representing the ADC data and a 1 bit value indicating the power mode. The ADC data is then converted to a mass using the following equation:

Mass(mg ) = [

ADC _ Data × 1500 ] − Tare 11 1024

(6)

11

The tare weight is dependent on the offset voltage of the in-amp as well as the nature of the housing

32

The mass is then stored in a circular buffer along with a time stamp indicating the time it was received. Using the full mass of the bag as determined in the setup phase, the percentage level in the bag will be computed. The data will then be transmitted to the remote device. If a level alarm condition were to be entered the system will transmit an alarm indication instead. If the circular buffer contains more than one value, mass flow rate will be computed using the following equation.

mass _ flow _ rate =

masst − masst −1 t − (t − 1)

(7)

In order to prevent errors which are can result from the remote device not transmitting a measurement, a timer is initiated after each set of data is received. If the timer value exceeds a preset value the buffer is cleared and any new data will be placed in the first buffer location. The timer value used to determine if an error exists is set at 1.5 of the sampling rate. The mass flow rate is then converted to volumetric flow rate using the density of the medication. The value is then truncated to a 2 digit value and converted to BCD before being transmitted to the remote device. If a high or low flow rate alarm is detected, an alarm indication will be sent instead. The processed flow rate data is also stored in the database with its associated time stamp. The system will remain in this phase until the monitoring process is terminated by the user. The flow diagram in Figure 27 illustrates the process.

33

Start

No

Acknowledge received from remote
Yes

No

Measurement data received

Yes

Separate measurement data Convert ADC data to mass

Compute % Level

Provide Level alarm

Yes

Level Alarm

Send Level Alarm via USB

Send Level via USB

1st sample
No

Yes

Compute flow rate

Provide flow alarm

Yes

Flow Alarm
No

Send flow Alarm via USB

Send Level via USB

Figure 27: Flow Chart Depicting the Software of the Measurement Phase

34

3.2.3.1.3.3 Database Design The aim of the database is to provide historical data in an effort to improve the efficiency of patient record keeping. Thus the database contains patient and medication data as well as time stamped flow rate data. The system employs a relational database using the Microsoft Visual Basic feature known as Microsoft ActiveX Data object. The feature allows for data to be written and read from a database. The database consists of 2 tables named client and data. The client table consists of six fields and stores the patient and medication data as illustrated in the figure below. The patients surname is used as the primary key. Use of this field is not ideal as uniqueness is not guaranteed and has implemented for demonstration purposes only. Ideally a unique field such as a patients ID number should be implemented. The second table named data holds the time stamped flow rate data.

Figure 28: Diagram illustrating Structure of Client and Data Tables

The relationship between the tables is illustrated by Figure 29. The 1 and ∞ symbols indicate that for every surname in the client table there can exist an infinite number of entries for that surname in the data table.

Figure 29: Table Relationships of the Database

The key advantage of implementing such a database is the ease at which it can be modified in order to meet the user’s needs. For example a “doctor ID” field can be created and a relationship between doctors and patients created. This would allow for easy access to the data of patients treated by a specific doctor. The database is accessed by the user through the GUI and will be discussed in further detail in the following section.

35

3.2.3.1.3.4 Graphical User Interface (GUI) The GUI provides the primary means of access into the system. The form is divided into five sections as indicated in Figure 30. 1. This area of the GUI aims to provide basic information of all the devices available for monitoring. Once a remote device joins the network, its ID is added to the list. Once a patient has been assigned to a device, the patients surname will be added to the reference in order to increase usability. The checkbox labelled ZDO indicates the communication link is operational whilst the checkbox labelled ACK indicates that the system has received confirmation from the remote device that setup has been complete. The power indicator indicates if the system is in mains or battery mode and the alarm summary is used to indicate a flow or level alarm condition. 2. Sections 2, 3 and 4 are dedicated to the device selected from the list of available devices. Section 2 is used to enter the setup data where drop down menus have been employed in order to speed up the process. The user can create a new data base entry by clicking the “New Patient” button. This will create a database entry based on the data which has been entered in the setup frame. If a database already exists for a specific patient the system will automatically use the setup data to add to the existing entry. The user clicks the “Confirm” button once the setup data has been entered. This will send the setup data to the remote device. 3. This section of the display is used to indicate the flow rate. The graph displays the last six flow rate measurements as well as indicating the alarm set points. The value of the current flow rate as well as alarm indicators are also displayed. 4. Level data is displayed using a level bar which changes colour from green to red as the level falls. The level value is also displayed. 5. The status bar is used to display error and communication messages of the host.

36

1

2

3

4

5
Figure 30: GUI of IV Monitor

Historical data can be viewed by clicking on the history menu option which brings up a secondary window illustrated in Figure 31. The list box in the top right corner is populated with all the patients who have an existing database. A user can select a patient from the list which results in the flow rate, medication and patient data being displayed.

37

Figure 31: Historical Database Window

3.2.3.2 Remote Device The microcontroller will be programmed with the ZigBee protocol stack as well as the software required to implement the application framework layer of the device. The ZigBee stack processes all received data and passes it to the application framework layer. Data which must be transmitted is simply passed to the lower layers of the stack. The Microchip ZigBee stack handles all tasks from this point on. Thus this discussion focuses on the design solely of the application framework layer. The remote device has two states of operation namely, initialisation and measurement. In the initialisation phase the device searches for an available network and then joins. The system will then wait until it receives the setup data. Once received, the setup data is then converted from ASCII into the format required for the LCD module and the data is displayed. The device also receives and stores the desired dosage value. Once the setup data has been displayed the system activates the acknowledge switch. The setup data on the LCD indicates that setup has been successfully completed and the infusion of the patient can commence. The measurement state is entered once the “acknowledge” has been detected. The acknowledge switch is then deactivated. The system uses the desired dosage to determine the required sampling rate as indicated in Table 8.
Table 8: Sampling Rate vs. Dosage Dosage (ml/hour) 1000 500 250 125 62.5 Sampling Rate (seconds) 20 40 80 120 240

38

Using the data a timer interrupt will be initiated and the device will enter a power down mode. The device will return to active mode once the timer has elapsed. The timer is then reset and restarted. A sample from the ADC is then requested and the ADC complete flag is polled whilst the process is taking place. This ensures that no RF operations take place during the sampling period and aims to limit the effects of RF interference. Once the ADC data is available the power mode bit is sampled and combined with the upper byte of the ADC data as described in section 0. The device then transmits this data. Once complete the device activates its receiver and checks if the coordinator has any messages for it. If so, these messages, which are the processed level and flow rate data are received and displayed and the receiver is deactivated. The flow rate data is then separated and converted into the format required by the LCD. If the data contains the alarm indication, the LCD will display “Flow Rate Alarm”. If no alarm indication was found the flow rate will be displayed and the desired dosage indication used to set the decimal point if required. The level data will similarly be checked for an alarm indication. If one exists, the LCD will display “Level Alarm”. If no alarm condition exists the data will be processed and displayed on the LCD. The level data will also be tested to determine its range in order setup the LED’s as required. Once all tasks have been completed the device will then re-enter power down mode until the next interrupt. The flow chart in Figure 32 aims to summarise the software requirements of the remote device.

39

Figure 32: Flow Chart Representation of Remote Device Software

4 Costing
Device PIC18F4620 CC2420 BCL - 300 LCD (162D) AD623 FT2323R Housing Miscellaneous Manufacturer Microchip Texas Instruments NMB Clover Analogue Devices FTDI Supplier Avnett Kopp TI Direct United Scales Mantech Farnell MB Silicon PCI Quantity 2 2 1 1 1 1 2 Unit Price ZAR 45.00 ZAR 25.00 ZAR 320.00 ZAR 80.00 ZAR 18.00 ZAR 55.00 ZAR 20.00 Total Net Price ZAR 90.00 ZAR 50.00 ZAR 320.00 ZAR 80.00 ZAR 18.00 ZAR 55.00 ZAR 40.00 ZAR 50.00 ZAR 703.00

40

5 Housing
The housing requirement of the host was simply to provide protection to the circuitry during transportation and normal usage and thus a simple PVC box was used. The design of the remote device housing had 3 major goals: • • • To allow for simple integration into existing IV stands protection of the load cell from overload protection of the load cell from external forces

The standard IV stand consists of a three legged pole structure with a height adjustable arm. The ends of the arm have hooks from which the IV bag hangs. Since the housing must hold the load cell, battery, circuitry as well as the LCD and LED’s, its size would not permit it to be mounted to the moveable arm. Thus two separate housings were designed, one to hold the load cell which could be mounted to the arm and a unit to hold the remainder of the equipment mounted to the tripod. The disadvantage of such a design decision is that the load cells output cable has to be lengthened thereby increasing the susceptibility of the data to interference. The load cell’s housing provides overload protection through a simple adjustable mechanism described in the Figure 33. The adjustable screw labelled overload protector limits the maximum force which can be exerted on the load cell’s mounting point. During calibration the screw is adjusted such that the maximum measurable load is 1.5Kg.
Moveable Arm

Load Cell Load Cell

Load Point

Steel Housing

Overload Protector IV Bag Hook

Figure 33: Diagram Illustrating the Load Cell Housing

The final requirement of the housing, the protection against external forces was not implemented due to time constraints. Possible solutions will be discussed in the following section.

41

6
6.1

Analysis of the Design
Testing

The main task of the testing procedure was the evaluation of the measurement system. The fist test was to evaluate the systems mass measuring capabilities. The test procedure involved attaching a fixed mass to the load cell and obtaining data. The mass was then measured using a precision scale and the results compared. The system was found to exhibit a maximum error of ±1.6g. However, it was found that after prolonged measurement, sporadic poor readings were obtained with errors in excess of 25%. Consultation with the manufacturer of the in-amp revealed that the problem was the result of the gain which had been set to 1440. A gain of 1000 was recommended which once implemented removed the sporadic readings entirely. However, the implementation of the lower gain increased the system resolution to 2g and the maximum error to ±2g. The computation of the mass flow rate is accomplished by subtracting successive mass values and dividing by the time interval between measurements. Due to the inaccuracy in the mass measurement an error of 4g can exist between samples, which significantly affects the flow rate. Assuming a sampling rate of 20 seconds with normal saline being delivered the error in volumetric flow rate would be as high as 14.1ml/min. Clearly, the computation of flow rate demands a level of precision which the system does not provide. In an effort to reduce the effects of the measurement error a moving average consisting of 10 flow rate samples was implemented. This significantly reduced the affects of the error, however, the averaging results in the system being less responsive to changes in flow rate. The flow rate test procedure involved attaching an IV bag to the system and monitoring flow rate over various settings of the dropper. Since the dropper settings are approximates the flow rate was measured manually by collecting and measuring the volume of fluid released over the period that the process was running. The graphs below illustrate the results.
Graph 1: Flow Rate Measurement at 2.08ml/min Dropper Setting

2.5 2.4 2.3 Flow Rate (ml/min) 2.2 2.1 2 1.93 1.9 1.8 1.7 1.6 1.5 1 3 5 7

2.45

1.57 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 Sam ple Num ber

Measurment Values

Average Measurement

42

Graph 2: Flow Rate Measurement at 4.17ml/min Dropper Setting

6 5.5 Flow Rate (ml/min) 5 4.5 4 3.5 3 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 Sam ple Num ber

5.45

4.28

3.38

Measurment Values

Average Measured

Graph 3: Flow Rate Measurement at 12ml/min Dropper Setting

11.5 11 Flow Rate (ml/min) 10.5 10 9.5 9.31 9 8.5 8 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Sam ple Num ber Measured Value Average Measured 10.05 10.96

Over the entire measurement period the worse case error in the average reading was 0.54ml/min at the dropper setting of 12ml/min. The maximum deviation from the measured average was 1.17ml/min at a dropper setting of 4.17ml/min. The deviation can be attributed to measurement error as well as the inaccuracies of the dripper which results in the flow rate varying over time. Furthermore the process of obtaining a manual measurement also has potential inaccuracies but does provide the best available method of evaluating the system.

43

6.2

Problems and Solutions

The major problem in the design relates to the measurement system which demonstrated a maximum error of 2g which translates to an error of 0.13% over the full range of 1.5Kg. The error is insignificant in determining the level of the IV bag but significantly reduces the accuracy of the flow rate measurement. In order to reduce the error, each component in the measurement system was re-evaluated. The major cause of the error is the low system resolution, thus use of a 12-bit ADC and higher performance in-amp could be implemented with only minor effects on the overall cost. However, the resolution of the load cell is limited to 1,5g and is thus the weak point in the design. Clearly, the precision required to accurately measure the flow rate was not understood at the beginning of the design. In order to achieve the goal of 5 % flow rate accuracy, all the components of the measurement system would have to be replaced with higher performance devices. However, this would result in a total cost in excess of R1300. Grounding problems and RF interference are also possible reasons for the error in the measurement system. Grounding problems can be significantly reduced through the use of ground planes which minimise the impedance of ground returns and hence the size of DC errors. Further improvements can also be achieved by isolating the low level analogue signals of the load cell and in-amp from the noisy digital environment created by the microcontroller and LCD. This can be achieved through the usage of separate analogue and digital power supplies or separate analogue and digital ground returns. RF interference can be rectified by the in-amp resulting in DC offset errors. Whilst the transceiver of the remote device is disabled during measurement, there are a variety of other sources of RF interference. The solution to this is to provide RF attenuation at the input of the in-amp by implementing a differential low pass filter. Such circuitry was not implemented as the precision silver mica capacitors and precision resistors were not available in small quantities. These components are essential as a mismatch will unbalance the input of the in-amp thereby reducing the CMRR. The current system design exposes the load cell to external forces such as patient movement which significantly degrades the measurement data. In order to alleviate the problem two solutions are proposed. The feed tube could be coiled in order to absorb the shock of patient movement. However, this would provide only limited protection and the coiling may adversely affect the flow rate. The second solution requires the complete redesign of the load cell’s housing such that the load cell would operate in compression, with the IV bag supported above the load cell. The feed tube could be secured to the side of the housing thereby eliminating the effects of external forces. The diagram in Figure 34 provides an illustration of the design.

44

Figure 34: Modified Load Cell Housing Design

The usage of lead-acid batteries is controversial as lead is being phased out due to its harmful effects on the environment. Li-ion batteries provide a suitable replacement but the cost limitations prevent such an implementation. However, there exist lead disposal methods which significantly reduce the environmental risks of lead. Whilst these methods are costly, they are still lower than the cost of implementing the Li-ion batteries. Whilst the GUI has been designed to be user friendly, there exists room for improvement. The best solution would be to integrate the software into an existing hospital patient management system. This would significantly reduce the setup time required. The alarm notification could also be improved through the use of audible warnings. The capability of the artificial intelligence system is limited to the data it holds. Thus as research into the system continues and more drugs are added, the systems capabilities will increase. The usage of the setup data and the requirement of an acknowledge request were included in the system design in order to reduce the risk of incorrect setup. However, it does complicate the usage of the system as staff must proceed between the two terminals in order to complete the setup. Ideally the process should be handled entirely at the remote device. In order to achieve this, further user-input mechanisms will have to be introduced. The most effective solution would be the use of a barcode scanner at the remote device. The medical staff would then scan the IV bag, the patients file which will contain a barcode relating to the patient ID as well as enter the desired dosage possibly through the use of selectable menu options presented via the LCD.

45

The ZigBee wireless protocol provides robust communication with built in error handling functionality. However, the specifications of the protocol are such that if the co-ordinator were to be reset a new network ID would be created which would prevent the remote devices from communicating as they would still be using the previous network ID. If the situation were to occur all the remote devices would have to be reset. A possible solution is to fix the network ID which the co-ordinator creates. However, this would be in breach of the ZigBee protocol and may result in conflicts if two separate networks were in range of one another. Another solution would be to force the remote device to scan for a new network if it can not communicate with the host for a set period of time. Whilst this solution is more robust it would require certain data to be stored to non-volatile memory and thus requires significant modifications to the current system.

46

7

Conclusion

The design process has resulted in a system which allows for the remote monitoring of the intravenous drug delivery process. The two units known as the host and the remote device have been successfully designed, constructed and tested. The wireless protocol known as ZigBee has been implemented and provides robust communication between the remote device and host. However, since ZigBee is a new technology, there are limited resources available which made development difficult and significantly increased the development time of this section of the design. A user–friendly graphical user interface has also been successfully designed and implemented. It provides historical data through the use of a relational database. Through extensive research a medication warning database has also been created. This gives the system a degree of artificial intelligence in order to provide medication specific warnings. The remote device has been implemented in a manner such that it can interface with existing IV stands which would significantly reduces the costs of implementing the system in a real world situation. The remote device features battery back-up functionality as well as basic information display through the use of LED and LCD technology. The measurement system which provides the monitoring data exhibited a maximum error of 2g. This allows for the accurate measurement of the level of the IV bag, but this error does inhibit accurate flow rate measurement. The use of a moving average reduced the effects of the error but also slowed the response of the system to changes in flow rate. In order to increase the accuracy of the flow rate measurement, all the devices in measurement system would have to be upgraded to parts which provide a higher degree of precision. However this would significantly increase the overall cost of the project by at least 25%. Thus this design achieves a balance between cost and performance. The design has been thoroughly evaluated and areas of possible improvement have been highlighted. In order for the system to move from a prototype in to full production ZigBee licensing must be obtained at a cost of approximately R10000. Furthermore, the entire system will have to be evaluated for compliance with the IEC 60601 standard. The projects design requirements have been established through extensive research in the medical field. Thus, the needs of the user have been considered throughout the design process resulting in a system which provides solutions to real problems.

47

8 Reference
1. 2. 3. 4. Bentley , JP, “Principle of Measurement Systems”, 3rd Edition, pg 47 – 63 Kitchen C, “A Designers Guide to Instrumentation Amplifiers”, 2nd Edition, Analogue Devices Microchip Application Note, DS5124A, “Picdem Z Demonstration Kit User’s Guide” American Centre for Drug Safety – “Deadly Statistics ” http://www.centerfordrugsafety.org/Pro_adestat.asp/ , accessed 15 – 30 August 2006 Anton Parr – “Specification of the DMA 5000 ” http://www.centerfordrugsafety.org/Pro_adestat.asp, accessed 20 – 22 October 2006 ZigBee Alliance , “ZigBee Specifications” , Version 1.0 Microchip Application Note, AN965, “Microchip Stack for the ZigBee Protocol” Microchip Application Note, DS41200B, “PICmicro Power Management Tips ‘n Tricks” Dallas Maxim Application Note, “Match the Battery to the Application to Avoid Disappointment” Heftman G, “Sensor Interfacing – the Key to Successful Signal Conditioning” , A supplement of Electronic Design March 29 2004 Kester W, Editor, System Applications Guide, Section 1, 6, Analog Devices, Inc., 1993. Sheingold D, Transducer Interfacing Handbook, Analog Devices, 1980. Baisa N, “Designing Wireless Interfaces for Patient Monitoring Equipment”, Medical Electronics, April 2005 Dataforth Application Note, AN114, Accuracy versus Resolution Dallas Maxim Application Note, “Choosing the Right Power-Supply IC for your Application”, March 19 2001 Dallas Maxim Application Note, 3501, “Rechargeable Batteries: Basics, Pitfalls, and Safe Recharging Practices”, March 21 2005 Dallas Maxim Application Note, 1083, “Life with Batteries - Don't Ignore Typical Specs”, March 31 2002 Dallas Maxim Application Note, 751, “Linear Regulators in Portable Applications”, March 24 2001 Dallas Maxim Application Note, 660, “Linear Regulator Topologies for Battery Powered Systems”, January 31 2001 PCM Load Cells, “Definition of Load Cell Specification http://www.loadcell.uk.net/, accessed July – August 2006 48 Terms” ,

5.

6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20.

9 Appendix A1
9.1 Calculation of the Required CMRR of the Instrumentation Amplifier

Desired Error = 0.1% Full Scale Output of Load Cell (1.5 Kg Load) = 2.5mV Common Mode Signal = 5000mV CMRR Required =

5000 (0.001)(2.5)

= 126dB 9.2 Comparison of AD623 and INA126 using Error Budget Analysis

All errors are referred to the input i.e. are compared to the full scale input voltage (1.5Kg load) of 2.5mV. The errors are then converted to parts per million (ppm) by multiplying the percentage errors by 1x104.
Table 9: Error Budget Comparison of AD623 and INA126 Instrumentation Amplifiers Total Error AD623 (ppm) Total Error INA126 (ppm)

Error Source Absolute Accuracy at 25° C Input Offset Voltage, mV Input Offset Current, nA CMRR, ppm

AD623

INA126

100uV / 2.5mv 2nA x 350 /2.5mV 5.6ppm x 2.5V/2.5mV 0.35 % + 0.1 %

250uV/2.5mV 2nA x /2.5mV

40000

100000

350

280

280

71ppm x 2.5V/2.5mV 0.5% + 0.1%

448

5680

Gain

4500

6000

Drift to 85 °C

Input Offset Voltage, mV/° C Input Offset Current, pA

1uV/° x C 60° /2.5mV 5pA/° x 350 C 60° /2.5mV x

3uV/° x C 60° /2.5mV 10pA/° x 350 C x 60° /2.5mV

24000

72000

42

84

Resolution

49

Gain Nonlinearity, ppm of full scale 0.1Hz - 10Hz Voltage Noise, mv p-p

50 ppm 1.5uV p-p / 2.5 mV

20 ppm 0.7uV p-p / 2.5mV

50

20

600

280

Total Error

69920

184344

9.3

Medication Database

Table 10: Illustration of the data contained in the medication database

Medication

Density

Warning

Dosage Restrictions

Ringers Lactate

1.0105

Patients under age of 12 must not receive more than 250ml/ hour. The maximum dosage of an adult male is 1l/hour and of adult female is 500ml/hour Potassium levels of patients with kidney problems must be monitored

Plas-L

1.0063

Patients under age of 12 must not receive more than 1l/ hour

Maintelyte

1.0342

Potassium levels of patients with kidney problems must be monitored

Patients under age of 12 must not receive more than 250ml/ hour. The maximum dosage of an adult male is 1l/hour and of adult female is 500ml/hour

Normal Saline

1.0016

Patients under age of 12 must not receive more than 1l/ hour

Dextrose Saline

1.1082

Cannot be delivered to diabetic patients

Patients under age of 12 must not receive more than 1l/ hour

50