drip bag monitoring system

58
Final Report Drip Bag Monitoring System Muhammad Simjee ([email protected] ) 203503366

Upload: muhammad-simjee

Post on 11-Apr-2015

1.667 views

Category:

Documents


1 download

DESCRIPTION

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.

TRANSCRIPT

Page 1: Drip Bag Monitoring System

Final Report

Drip Bag Monitoring System

Muhammad Simjee ([email protected])

203503366

Page 2: Drip Bag Monitoring System

ii

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.

Page 3: Drip Bag Monitoring System

iii

Contents

Abstract ...........................................................................................................................................ii

List of Figures ................................................................................................................................. v

List of Tables .................................................................................................................................vii

List of Tables .................................................................................................................................vii

List of Abbreviations...................................................................................................................... viii

1 Introduction ............................................................................................................................. 1

2 Overview................................................................................................................................. 2

2.1 Problems and Constraints ............................................................................................... 2

2.2 Solutions ......................................................................................................................... 2

2.3 Tasks............................................................................................................................... 3

2.3.1 Measurement........................................................................................................... 3

2.3.2 Intelligence .............................................................................................................. 4

2.3.3 Remote Monitoring................................................................................................... 5

2.4 Interaction between Devices............................................................................................ 5

2.5 Proposed System Operation............................................................................................ 6

2.6 Unit Design...................................................................................................................... 6

3 Implementation ....................................................................................................................... 8

3.1 Hardware......................................................................................................................... 8

3.1.1 Wireless Communication ......................................................................................... 8

3.1.2 Host ....................................................................................................................... 10

3.1.3 Remote Device ...................................................................................................... 12

3.2 Software ........................................................................................................................ 24

3.2.1 Overview................................................................................................................ 24

3.2.2 ZigBee Wireless Protocol....................................................................................... 27

3.2.3 Implementation ...................................................................................................... 28

4 Costing.................................................................................................................................. 40

5 Housing................................................................................................................................. 41

6 Analysis of the Design........................................................................................................... 42

Page 4: Drip Bag Monitoring System

iv

6.1 Testing .......................................................................................................................... 42

6.2 Problems and Solutions................................................................................................. 44

7 Conclusion ............................................................................................................................ 47

8 Reference ............................................................................................................................. 48

9 Appendix A1.......................................................................................................................... 49

9.1 Calculation of the Required CMRR of the Instrumentation Amplifier .............................. 49

9.2 Comparison of AD623 and INA126 using Error Budget Analysis ................................... 49

9.3 Medication Database..................................................................................................... 50

Page 5: Drip Bag Monitoring System

v

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

Page 6: Drip Bag Monitoring System

vi

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

Page 7: Drip Bag Monitoring System

vii

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

Page 8: Drip Bag Monitoring System

viii

List of Abbreviations

NRE - Non – Recurring Engineering

GUI - Graphical User Interface

UPS - Uninterruptible Power Supple

PC - Personal Computer

I/O - Input or Output

USART - Universal Synchronous Asynchronous Receiver Transmitter

USB - Universal Serial Bus

VCP - Virtual Communication Port

LED - Light Emitting Diode

LCD - Liquid Crystal Display

RF - Radio Frequency

Op-Amp - Operational Amplifier

In – Amp - Instrumentation Amplifier

ADC - Analogue to Digital Converter

Wi-Fi - Wireless Fidelity

CMRR - Common Mode Rejection Ratio

SLA - Sealed Led Acid

Ni-Cad - Nickel Cadmium

Ni-Mh - Nickel Hydride

PPM - Parts Per Million

MAC - Medium Access Control

OSI - Open Systems Interconnection

BCD - Binary Coded Decimal

Ω - Ohms

Page 9: Drip Bag Monitoring System

1

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

IV Needle Feed Tube

Patient

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.

Page 10: Drip Bag Monitoring System

2

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

Page 11: Drip Bag Monitoring System

3

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

2.3.1 Measurement

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

Page 12: Drip Bag Monitoring System

4

ρ

mQ = (1)

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

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

Page 13: Drip Bag Monitoring System

5

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.

Page 14: Drip Bag Monitoring System

6

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.

Page 15: Drip Bag Monitoring System

7

Power Supply

User Input Mechanism

Basic Information

Display

Measurement System

Transceiver Microcontroller

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

Page 16: Drip Bag Monitoring System

8

3 Implementation

3.1 Hardware

3.1.1 Wireless Communication

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

Standard Battery

Life (Days)

Network Size

Bandwidth (KB/s)

Range (Meters)

ZigBee 802.15.4 100-

1000+ 65536 250 500

Bluetooth 802.15.1 1 -7 7 720 10

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

Page 17: Drip Bag Monitoring System

9

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

Page 18: Drip Bag Monitoring System

10

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.

Page 19: Drip Bag Monitoring System

11

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

Page 20: Drip Bag Monitoring System

12

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.

Page 21: Drip Bag Monitoring System

13

PIC18F4620CC2420

ZigBee Hardware

Power Supply

User Input Mechanism

Basic Information

Display

Measurement System

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:

V

m=ρ (2)

Where m = mass ρ = density

V = volume

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

Page 22: Drip Bag Monitoring System

14

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

9 Load cell quotation provided by United Scales South Africa

Page 23: Drip Bag Monitoring System

15

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 BCL- 300 FSS1500

Price (R) 660 320 160

Range (Kg) 1.5 3 1.5

Accuracy (%) 0.01 0.02 1.5

Resolution (g)

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

Page 24: Drip Bag Monitoring System

16

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 Priority

CMRR High

Offset - Voltage Drift High

Offset - Voltage Medium

Gain - Bandwidth - Product 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.

12Re

−=

tsofADCnumberofbi

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

Page 25: Drip Bag Monitoring System

17

Table 4: Comparison of 10-bit and 12-bit ADC's

10 bit ADC 12 bit ADC

ADC Resolution (mV) 3.226 0.8057

Transducer output per bit (uV) 3.2258 0.8059

Output (mg) per bit 1.4663 0.4835

Volume (ml) per bit - solution density = 1.1082

1.6249 0.436

Volume (ml) per bit - solution density = 1

1.4663 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-to-make 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.

Page 26: Drip Bag Monitoring System

18

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.

Page 27: Drip Bag Monitoring System

19

5V

PE1

PE0

PD4

PD5

PD6

PD7

N/C N/C

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.

( ) ( )

total

activeactivestdbystdby

avgt

tItII

×+×= (4)

Figure 16: Figure Describing Average Current Equation

Page 28: Drip Bag Monitoring System

20

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 Voltage Required Backed Up Peak Current AVG Current

Load Cell 5V Yes 11.9mA 11.9mA

In_amp 5V Yes 480uA 480uA

LCD 5V Yes 2mA 2mA

Microcontroller 3.3V Yes 9mA 2.2mA

Transceiver 3.3V Yes 19mA 3.1mA

8xLED's 5V No 160mA 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.

Page 29: Drip Bag Monitoring System

21

Table 5: Comparison between Linear and Switching Regulators

Linear Switching

Function Only steps down- input voltage

must be higher than output Steps up, steps down or inverts

Complexity Low High - requires large number of

external components

Size Small Medium to High

Total Cost Low Medium to High - requires

external components

Ripple/Noise Low - no ripple, low noise 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 hand-held 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, Ni-Mh (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 Li-ion

Energy Density (Wh/Kg)

30-50 110-160

Cycle Life (to 80% of initial capacity)

300-500 500-1000

Charge Time (hours) 8-16 2-4

Cost (R) 50

(6V) 350

(7.2V)

Page 30: Drip Bag Monitoring System

22

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

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

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

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

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

Page 31: Drip Bag Monitoring System

23

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.

1

2

3 4

5

6

Figure 18: Power Supply Circuit Diagram

Page 32: Drip Bag Monitoring System

24

3.1.3.5 Complete Circuit Diagram

Figure 19: Final Circuit Diagram of the Host

3.2 Software

3.2.1 Overview

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.

Page 33: Drip Bag Monitoring System

25

Host Remote Device

Store to DatabasePatient ID

Store to DatabaseAge ,Sex

Store to DatabaseMedication Type

Store to DatabaseDosage

Determine Medication

WarningsWarning

Send Setup complete

confirmationSetup Data

Display Setup

CompleteSetup

Complete

ACKSend ACK

confirmationAcknowledge Data

Obtain Measurement

Data

Send Measurement

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

Page 34: Drip Bag Monitoring System

26

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

Page 35: Drip Bag Monitoring System

27

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

Typical Function Power Source

Receiver Configuration

Co-ordinator One must Exist for every network. Forms the

network and allocates addresses Mains On when idle

Router

This is an optional device with the primary task of extending the range of the network. Can also perform monitoring and/or control

functions.

Mains On when idle

End Performs monitoring and/or control functions. 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

Page 36: Drip Bag Monitoring System

28

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

Time

Initialise and create

network

Search for available

networks

Request to join

network once found

Accept Device and

assign it a node ID

Communications

Establised

Communications

Establised

End Device Tasks

Join Request

Assign node ID

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.

Page 37: Drip Bag Monitoring System

29

USB

Protocol

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.

Page 38: Drip Bag Monitoring System

30

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.

Page 39: Drip Bag Monitoring System

31

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 gramslitre

IVBagofVolumeBagEmptyMass 25

1

____ ×= (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.

Page 40: Drip Bag Monitoring System

32

Start

Prompt user to enter patient

and medication data

Store entered data in

patient database

Dosage

Warnings

Provide medication

alarm

User ACK

Yes

No Compute mass of full IV

bagYes

No

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:

[ ] TareDataADC

mgMass −×= 15001024

_)( 11 (6)

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

Page 41: Drip Bag Monitoring System

33

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.

)1(__ 1

−−

−= −

tt

massmassrateflowmass tt (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.

Page 42: Drip Bag Monitoring System

34

Acknowledge

received from

remote

Start

Separate measurement data

Yes

No

Convert ADC data to

mass

Compute % Level

Level AlarmProvide Level alarm Yes

Send Level Alarm via

USB Send Level via USB

1st sample

Compute flow rate

Flow AlarmProvide flow alarm

Send flow Alarm via

USB Send Level via USB

Yes

Measurement data

received

Yes

No

No

No

Yes

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

Page 43: Drip Bag Monitoring System

35

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.

Page 44: Drip Bag Monitoring System

36

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.

Page 45: Drip Bag Monitoring System

37

12

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.

Page 46: Drip Bag Monitoring System

38

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) Sampling Rate (seconds)

1000 20

500 40

250 80

125 120

62.5 240

Page 47: Drip Bag Monitoring System

39

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

Page 48: Drip Bag Monitoring System

40

Figure 32: Flow Chart Representation of Remote Device Software

4 Costing

Device Manufacturer Supplier Quantity Unit Price Net Price

PIC18F4620 Microchip Avnett Kopp 2 ZAR 45.00 ZAR 90.00

CC2420 Texas Instruments TI Direct 2 ZAR 25.00 ZAR 50.00

BCL - 300 NMB United Scales 1 ZAR 320.00 ZAR 320.00

LCD (162D) Clover Mantech 1 ZAR 80.00 ZAR 80.00

AD623 Analogue Devices Farnell 1 ZAR 18.00 ZAR 18.00

FT2323R FTDI MB Silicon 1 ZAR 55.00 ZAR 55.00

Housing PCI 2 ZAR 20.00 ZAR 40.00

Miscellaneous ZAR 50.00

Total ZAR 703.00

Page 49: Drip Bag Monitoring System

41

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.

Load CellLoad Cell

Moveable Arm

Steel Housing

IV Bag Hook

Overload Protector

Load Point

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.

Page 50: Drip Bag Monitoring System

42

6 Analysis of the Design

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

1.57

1.93

1.5

1.6

1.7

1.8

1.9

2

2.1

2.2

2.3

2.4

2.5

1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43

Sample Number

Flo

w R

ate

(m

l/m

in)

Measurment Values Average Measurement

Page 51: Drip Bag Monitoring System

43

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

3.38

5.45

4.28

3

3.5

4

4.5

5

5.5

6

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

Sample Number

Flo

w R

ate

(m

l/m

in)

Measurment Values Average Measured

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

10.96

9.31

10.05

8

8.5

9

9.5

10

10.5

11

11.5

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Sample Number

Flo

w R

ate

(m

l/m

in)

Measured Value Average Measured

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.

Page 52: Drip Bag Monitoring System

44

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.

Page 53: Drip Bag Monitoring System

45

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.

Page 54: Drip Bag Monitoring System

46

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.

Page 55: Drip Bag Monitoring System

47

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.

Page 56: Drip Bag Monitoring System

48

8 Reference

1. Bentley , JP, “Principle of Measurement Systems”, 3rd Edition, pg 47 – 63

2. Kitchen C, “A Designers Guide to Instrumentation Amplifiers”, 2nd Edition, Analogue Devices

3. Microchip Application Note, DS5124A, “Picdem Z Demonstration Kit User’s Guide”

4. American Centre for Drug Safety – “Deadly Statistics ” http://www.centerfordrugsafety.org/Pro_adestat.asp/ , accessed 15 – 30 August 2006

5. Anton Parr – “Specification of the DMA 5000 ” http://www.centerfordrugsafety.org/Pro_adestat.asp, accessed 20 – 22 October 2006

6. ZigBee Alliance , “ZigBee Specifications” , Version 1.0

7. Microchip Application Note, AN965, “Microchip Stack for the ZigBee Protocol”

8. Microchip Application Note, DS41200B, “PICmicro Power Management Tips ‘n Tricks”

9. Dallas Maxim Application Note, “Match the Battery to the Application to Avoid Disappointment”

10. Heftman G, “Sensor Interfacing – the Key to Successful Signal Conditioning” , A supplement of Electronic Design March 29 2004

11. Kester W, Editor, System Applications Guide, Section 1, 6, Analog Devices, Inc., 1993.

12. Sheingold D, Transducer Interfacing Handbook, Analog Devices, 1980.

13. Baisa N, “Designing Wireless Interfaces for Patient Monitoring Equipment”, Medical Electronics, April 2005

14. Dataforth Application Note, AN114, Accuracy versus Resolution

15. Dallas Maxim Application Note, “Choosing the Right Power-Supply IC for your Application”, March 19 2001

16. Dallas Maxim Application Note, 3501, “Rechargeable Batteries: Basics, Pitfalls, and Safe Recharging Practices”, March 21 2005

17. Dallas Maxim Application Note, 1083, “Life with Batteries - Don't Ignore Typical Specs”, March 31 2002

18. Dallas Maxim Application Note, 751, “Linear Regulators in Portable Applications”, March 24 2001

19. Dallas Maxim Application Note, 660, “Linear Regulator Topologies for Battery Powered Systems”, January 31 2001

20. PCM Load Cells, “Definition of Load Cell Specification Terms” , http://www.loadcell.uk.net/, accessed July – August 2006

Page 57: Drip Bag Monitoring System

49

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 = ( )( )5.2001.0

5000

= 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

Error Source AD623 INA126 Total Error

AD623 (ppm) Total Error

INA126 (ppm)

Absolute Accuracy at

25°C

Input Offset Voltage, mV

100uV / 2.5mv 250uV/2.5mV 40000 100000

Input Offset Current, nA

2nA x 350Ω/2.5mV

2nA x 350 Ω /2.5mV

280 280

CMRR, ppm 5.6ppm x

2.5V/2.5mV 71ppm x

2.5V/2.5mV 448 5680

Gain 0.35 % + 0.1 % 0.5% + 0.1% 4500 6000

Drift to 85 °C

Input Offset Voltage, mV/° C

1uV/°C x 60°/2.5mV

3uV/°C x 60°/2.5mV

24000 72000

Input Offset Current, pA

5pA/°C x 350 Ω x 60°/2.5mV

10pA/°C x 350 Ω x 60°/2.5mV

42 84

Resolution

Page 58: Drip Bag Monitoring System

50

Gain Nonlinearity,

ppm of full scale 50 ppm 20 ppm 50 20

0.1Hz - 10Hz Voltage Noise,

mv p-p

1.5uV p-p / 2.5 mV

0.7uV p-p / 2.5mV

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

Plas-L 1.0063 Potassium levels of patients with

kidney problems must be monitored

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