Cpr

Document Sample
Cpr Powered By Docstoc
					INTEGRATED CPR TRAINING SYSTEM

Final Report

TEAM #12 Wilson Yip Ryan Wallace Kristine Yan Jia Pan Warren Mok Kelly Shkuratoff Peter Siu Kei Wong

Submitted: April 4, 2006

Team 12 i

ABSTRACT
Cardio Pulmonary Resuscitation (CPR) dummies are used for the practice of CPR lifesaving techniques. Research and personal experiences indicate that the torso dummies being used are not adequate in terms of the level of feedback needed for students to learn proper CPR techniques and procedures. The Interactive CPR Training System bridges this gap by providing the necessary feedback system to help students and trainers access critical CPR technique components. Based on sensor readings and embedded software processing, the system evaluates the following criteria: checking consciousness of patient, hand placement during chest compression, compression depth, compression rate, rescue breathing, and pulse detection. Computer graphical user interface (GUI) software is also created to allow users to set lifesaving scenarios and evaluate results both in real-time and at end of CPR procedures. The goal of the project is to deliver a system with superior quality in terms of accuracy, ease of use, and robustness, yet with a unit cost that warrants mass use by mainstream first-aid training organizations.

Team 12 ii

TABLE OF CONTENTS
1.0 2.0 3.0 3.1 3.2 3.3 INTRODUCTION PROJECT BACKGROUND DESIGN REQUIREMENT AND GOALS Executive Summary Design Requirements 3.2.1 Summary of Requirements Design Approach 3.3.1 Hand Placement and Compression Depth 3.3.2 Airway and Breathing Rate 3.3.3 Determining consciousness 3.3.4 Audio Interaction 3.3.5 Simulated Pulse 3.3.6 LED Indicator Panel 3.3.7 PC Interaction and Graphical User Interface (GUI) RESULTS Hardware 4.1.1 Embedded System Implementation 4.1.2 Powering the Hardware 4.1.3 Compression Distance Sensing 4.1.4 Vibration Motor 4.1.5 Audio Detection 4.1.6 Breathing Technique Evaluation 4.1.7 Hand Placement Detection (Debouncer) 4.1.8 Hand Placement – Tactile Switches Software 4.2.1 Embedded Software Architecture 4.2.2 PC Software Design ASSESSMENT AND ANALYSIS Hardware Software Professional Consultation Parts and Cost Assessment 1 1 2 2 4 4 5 5 7 8 9 9 9 10 14 14 14 17 17 19 20 22 26 27 28 28 31 34 34 34 35 36

4.0 4.1

4.2

5.0 5.1 5.2 5.3 5.4

Team 12 iii

TABLE OF FIGURES
Figure 2-1: Laerdal CPR Doll........................................................................................................................................1 Figure 3-1: Rescuer Performing Compressions.............................................................................................................3 Figure 3-2: Block Diagram of Proposed Approach .......................................................................................................5 Figure 3-3: Chest Compression Displacement Sensor...................................................................................................6 Figure 3-4: Chest Compression Scheme........................................................................................................................7 Figure 3-5: Rescuer Opening Airway and Performing Ventilation Using Mask ...........................................................7 Figure 3-6: Airway Sensor Placement ...........................................................................................................................8 Figure 3-7: Embedded Microphone in the Ear ..............................................................................................................9 Figure 3-8: LED Panel.................................................................................................................................................10 Figure 3-9: Screen Capture of Real Time Panel ..........................................................................................................11 Figure 3-10: Screen Capture of History Panel.............................................................................................................12 Figure 3-11: Screen Capture Reports Panel.................................................................................................................13 Figure 3-12: Screen Capture of Scenario Editor Panel ................................................................................................14 Figure 4-1: Microprocessor Circuit .............................................................................................................................15 Figure 4-2: Final Microprocessor Circuit ....................................................................................................................16 Figure 4-3: Analog Output Voltage vs. Distance.........................................................................................................18 Figure 4-4: Timing Diagram of GP2D120 ..................................................................................................................18 Figure 4-5: Driving Circuit of Vibration Motor ..........................................................................................................19 Figure 4-6: Vibration Motor ........................................................................................................................................20 Figure 4-7: Schematic of the Complete Microphone Circuit.......................................................................................21 Figure 4-8: A.C. Coupled Inverting Amplifier ............................................................................................................21 Figure 4-9: Non-inverting Amplifier Circuit ...............................................................................................................21 Figure 4-10: RC Low Pass Filter .................................................................................................................................22 Figure 4-11: Voltage Comparator Circuit....................................................................................................................22 Figure 4-12: Schematic of the Air Pressure Sensor Circuit .........................................................................................23 Figure 4-13: Temperature Compensation Circuit ........................................................................................................23 Figure 4-14: Instrumentation Amplifier Circuit ..........................................................................................................24 Figure 4-15: Inverting Amplifier Circuit .....................................................................................................................24 Figure 4-16: ChipCorder Recording Circuit ................................................................................................................25 Figure 4-17: ChipCorder Playback Circuit..................................................................................................................26 Figure 4-18: Speaker Driver Circuit ............................................................................................................................26 Figure 4-19: Tactile Switch Debounce Circuit ............................................................................................................27 Figure 4-20 Hand Placement Switches........................................................................................................................28 Figure 4-21: Embedded Software Flow Diagram........................................................................................................29 Figure 4-22: Hand Mic Packet.....................................................................................................................................30 Figure 4-23: Serial Communication Flow ...................................................................................................................32

Team 12 1

1.0

INTRODUCTION
Every year, thousands of people are required to participate in first aid or CPR training and certification examinations. Usually these courses include training with a full body or torso dummy to simulate a patient and allow proper CPR technique practice. There are many different criteria for proper lifesaving and CPR techniques, such as compression depth, compression frequency, ventilation rate, hand placement, and ventilation duration. There are also many a variety of situations and scenarios, such as choking, cardiac arrest, and artificial respiration, which require different protocol and techniques. In large training sessions, it can be difficult for an instructor to properly monitor and assess each individual’s technique as they practice on the simulation mannequins. These technical details are often very important to the successful resuscitation of a victim in a real-life situation, and may lead to bodily harm and even death if performed improperly. This project addresses these training issues by developing a software and hardware CPR monitoring system. An ordinary CPR mannequin is fitted with sensors to provide data regarding a user’s technique. This data will then be transferred serially to laptop or desktop PC running a real-time analysis program to generate visual feedback and reports. There are also hardware elements that provide feedback to the rescuer in the form of lights, sounds, and feel. Few similar products exist, but they will be described in the following section. The rest of the report will outline the hardware components and software interface associated with our computerized CPR training system. The software interface will have a combination of four different panels that will provide the necessary precision analysis and real-time feedback for the system.

2.0

PROJECT BACKGROUND
Mechanical CPR training dolls exist, such as the most commonly used “Anne” pictured below (Figure 2-1). These dolls provide a realistic feel while practicing CPR and provide tactile feedback, but do not provide precision feedback on accuracy of technique. In conventional CPR training, this feedback is usually provided the instructor through observation.

Figure 2-1: Laerdal CPR Doll

This lack of feedback can lead to improper technique and undermine a person’s confidence in their lifesaving abilities, leaving them unsure and concerned about the effectiveness of their actions, or worse, the possibility of causing further harm to the patient. A doll that provides visual or audio feedback on physical status would help correct these deficiencies, and could also

Team 12 2

facilitate practice when no instructor is present. These dolls could be used in self-study CPR courses, in first-aid training facilities, in schools or community centers to promote lifesaving knowledge and proper technique. There are a few dolls with electronic feedback capabilities, but these dolls have major drawbacks which prevent them from being used in mainstream CPR training. They are also prohibitively expensive for most potential customers. Sim Man (http://www.laerdal.ca/document.asp?subnodeid=7909814) is an advanced electronic patient simulator for healthcare professionals and provides feedback via a simulated patient monitor. While the mannequin does provide CPR feedback functionality, the major focus of the doll is advanced life support simulation, such as simulated defibrillation and intravenous injections. These features make the doll far too advanced, in terms of features and cost, for mainstream CPR training. Resusci Anne (http://www.laerdal.ca/document.asp?subnodeid=13697545) is a scaled down version of Sim Man, suitable for basic emergency training. Anne can provide feedback either via a remote control or using additionally purchased SkillReporter software and a standard PC. The major barrier of keeping this doll out of the mainstream CPR training market is still cost, with each doll costing close to $7,000 USD. This doll is also not appropriate for mouth-to-mouth training or for use with a one way mask because of electronics in the airway. This eliminates a very important aspect of CPR training, making it unsuitable for basic training, regardless of cost.

3.0
3.1

DESIGN REQUIREMENT AND GOALS
Executive Summary Conventional training is performed under high student versus instructor ratios, with basic mechanical mannequins. There are several fundamental problems with this approach. First of all, it is very difficult, and costly, for each student to receive an adequate amount of instruction and feedback from rescue professionals regarding their techniques and procedures. In fact, many students have reported being unconfident regarding their actions, hence, undermining the effectiveness of the training. Secondly, instructors find it difficult to monitor important factors, such as compression depth and ventilation duration, especially when they can only spend a minimal amount of time with each student. Lastly, since an instructor’s focus is spread among so many students, he or she requires a graphical tool to keep track of a student’s progress during practice runs and adequately evaluate a student’s performance for examinations.

Team 12 3

Figure 3-1: Rescuer Performing Compressions

The main design goal of the Interactive CPR Training System is to create an advanced CPR training tool for mainstream, low cost training applications. Although there are similar products on the market, they are far too advanced, complicated, and above all, costly, for these purposes. Hence, this project is designed with the help of St. John Ambulance instructors and CPR certified individuals to create a cost effective training tool containing a set of functionality and features tailored for mainstream CPR training. The platform will also give rise to training situations where a small number of trainers can efficiently train and monitor a vast group of CPR students, and provide an evaluation platform to speed up the CPR certificate examination process, all at a low unit cost which can warrant mass purchases. If successful, the training system will revolutionize the way CPR training is conducted by major organizations such as St. John Ambulance or the Canadian Red Cross. In fact, every element of the system is designed with a customer focused approach, from the visual and mechanical feedback elements, down to the look and functionality of the PC software. The Interactive Training System monitors criteria such as compression rate and compression depth, which is very important to the proper pumping of a real victim’s heart during CPR. It monitors the placement of the rescuer’s hands during each compression; improper placement can lead to ineffective compressions, and in certain cases, severe injury or death. The system also monitors ventilation duration and volume to ensure that the rescuer provides the victim’s lungs with proper amounts of air during rescue breathing. The CPR doll also detects a rescuer’s claps and shouts. From a feedback standpoint, the system provides a wide range of feedback features for both the rescuer and instructor. An artificial pulse and speaker transform the otherwise inanimate mannequin into a simulated victim. For example, a rescuer may be rewarded with a pulse and audible breathing signs if he or she successfully resuscitates the “victim”. More importantly, this feature is used to create initial conditions for the rescuer, from which he or she decides his or her course of actions. Visual feedback is provided through a detachable indicator panel with a multi-LED display reporting on patient status, compression depth, hand placement, among others. In summary, the main purpose of this LED indication unit is to provide simple and easy-to-interpret feedback for a student during the learning stage.

Team 12 4

The PC software of the system is perhaps the most important element. The GUI is designed with the customer’s needs and interests in mind. The visual outputs and features in the software are also easy-to-interpret, with strong emphasis on providing only information that instructors need. Overall, there are 4 panels providing information for an instructor to effectively study and evaluate a student’s performance. These include the Real-Time page, History page, Reports page, and Scenarios page. Together, the four pages provide a comprehensive view of a student’s performance, using features such as real-time monitoring of compression and ventilation stats, automatic analysis of the a students performance based on the monitored criteria, and custom selection and modification of training scenarios. Overall, the CPR Training System can be used in all situations. Preliminary versions require one PC each in order to record data, with possible expansion versions linked to a single PC via wireless connection, with software that can capture and analyze data from multiple mannequins simultaneously. Each doll may be used with limited functionality when a PC connection is absent. However, in such a mode, few technique criteria are monitored and feedback through the indicator panel. Artificial pulse and breathing sounds will also not be generated. 3.2 Design Requirements The Interactive CPR Training System monitors up to seven possible CPR criteria: hand placement, compression depth, compression rate, sound detection, ventilation duration, and ventilation volume, and provide feedback elements such as mechanical pulse in the carotid artery, a sound system providing breathing and choking sounds, and LED panel for visual indication of technique accuracy. These criteria have been indicated by CPR training professionals as the most important points in CPR procedures and techniques and thus, most require real-time feedback. Software on a personal computer or laptop provides more detailed visual feedback as well as a log of the student’s actions. The most important element is real-time feedback for the user through indicator icons and time-sweeping graphs. For simplicity purposes, only the criteria most important to the instructor area displayed. The user may also view the history of a single simulation; essentially, this will be a scrollable output of the real-time readings displayed chronologically. The software also analyzes the data and outputs a student’s performance in bar graphs and percentages. Finally, there is a scenario modification function where the instructor may vary the initial conditions and create varied simulation scenarios for the student. 3.2.1 Summary of Requirements These requirements represent the essence of the proposed design and are explained further within this document. • Real-time monitoring of compression depth • Real-time monitoring of compression rate • Real-time monitoring of airflow magnitude into and out of CPR doll’s lungs • Real-time monitoring of duration of each ventilation cycle • Real-time analysis of hand placement • Capability for rudimentary voice sensing • Capability for rudimentary voice feedback • Carotid pulse generation • RS-232 Serial Connection between PC and Doll

Team 12 5

• • • • • 3.3

LED indicator panel for basic and easy-to-read feedback PC software that displays real-time information and evaluates a rescuer’s performance Real-time GUI display showing compression and airflow data, among other signs Real-time change of state of “victim” based on selected scenario and rescuer’s performance Powered by 9V AC/DC adapter

Design Approach The design of the system follows a methodical approach. The microcontroller is the center of all activity and is essentially an interpreter between the PC and hardware peripherals. All hardware sensors send data into the microprocessor and all hardware feedback elements, such as the pulse motor, voice recording chip, and LED panel, are directly controlled by the microprocessor. The microprocessor communicates sensor data back to the PC and the PC communicates feedback commands back to the microprocessor. The compression distance and airflow sensors output analog voltages and thus need to be fed into the microprocessor through ADC. The other sensors, notably the microphones and hand placement switches, are fed into the general purpose I/O (GPIO) ports. A predetermined protocol is used to communicate with the PC, with each type of sensor identified with its own unique packet ID. A largely similar protocol is employed with data flowing from the PC to the MPU.

Figure 3-2: Block Diagram of Proposed Approach 3.3.1 Hand Placement and Compression Depth

Location of the correct compression point is crucial to the safety of the victim being resuscitated.

Team 12 6

Correct chest compressions are applied at the sternum notch while applying chest compressions at the wrong locations can be life-threatening as it increases the odds of breaking the victim’s sternum or rib cage, thereby puncturing his/her lungs. The CPR simulation system takes into account this crucial aspect by checking the trainee’s hand placement during the chest compression procedure. To achieve this, four button switches are used to detect hand placement during the chest compression phase (Figure 4-20). Three are placed at the correct compression point, while the other is placed at the Xyphoid process, the most dangerous compression point on the chest. All other incorrect compression points can be deduced in software, by noting that compressions are taking place while none of the switches are being pressed.

Figure 3-3: Chest Compression Displacement Sensor

Once the position of the hands is validated, the CPR simulation system checks for the correct compression depth and compression rate. Both parameters need to fall within strict standards to ensure the effectiveness of the CPR procedure, as well as to ensure the safety of the patient. A set of optical displacement sensors mounted inside the CPR doll are used to determine if compression depth falls within an acceptable range. As compressions are performed, the PC software calculates the real-time rate of compression and presents it to the user on the LED panel.

Team 12 7

Figure 3-4: Chest Compression Scheme

3.3.2

Airway and Breathing Rate

Opening of the victim’s airway is an important and mandatory step preceding the mouth-tomouth resuscitation phase. During the mouth-to-mouth resuscitation phase, the airway has to be maintained open. To open the airway, the victim’s head is to be tilted backwards while the jaw is lifted. Because of the mechanical design of the doll, the dummy’s airway remains blocked until the head is tilted into the correct position, making the need for the detection of this motion redundant. As such, no button switch was mounted to detect the opening of the airway, while still preserving the accuracy of the simulation.

Figure 3-5: Rescuer Opening Airway and Performing Ventilation Using Mask

The duration of the ventilations is most important because it constitutes the amount of air that’s entering the lungs. Inadequately short breaths would render ventilation ineffective, while breaths that are too long may cause complications. Ventilation pressure is also a very important

Team 12 8

parameter to monitor as pressure and volume need to be enough to make the chest rise, yet low enough such that it does not cause gastric distention.

Figure 3-6: Airway Sensor Placement

3.3.3

Determining consciousness

Prior to applying any CPR procedures to a victim, the victim must be checked for consciousness. This is usually done by the “pinch and shout” procedure whereby the CPR performer pinches both shoulders of the victim and shouts into both ears a simple command such as, “Squeeze my hand”. An alternative to pinching is to stomp the ground near the person’s head, but either way, vocal cues are the most important. A person who does not respond to shouts into both ears is considered unconscious. To check if the “pinch and shout” procedure is performed by the trainee, microphones with BJT amplifiers/filters are embedded into both ears of the CPR doll to pick up the human voices that represent the “shout”. Prior plans to embed touch sensors in the shoulder to sense “pinching” have been reworked due to recent changes in training procedures.

Team 12 9

Figure 3-7: Embedded Microphone in the Ear

3.3.4

Audio Interaction

A speaker is placed inside the dummy to mimic a patient’s breathing sounds and voice. This provides audio feedback for many different scenarios, such as subtle breathing sounds to simulate an unconscious patient in stable condition, or choking sounds to simulate a patient choking on his/her tongue. These sounds are played by sending commands from the PC, through the microcontroller, to a Windbond ISD-series chip, which was selected over the other proposed options due to its robustness and ease of implementation.
3.3.5 Simulated Pulse

The carotid (neck) pulse is generated via a small DC motor which is pulsed according to data sent from the PC software. Much like in a human patient, a chest compression will generate a single weak pulse, which is displayed both visually on the PC screen and mechanically through the pulsing of the motor. A revived patient will also begin to emit a regular pulse indicating that the student’s resuscitation efforts were successful. Although the realism of the simulation is increased by correlating compressions to pulses, this subsystem’s primary purpose is to facilitate the experience of locating and measuring a patient’s pulse.
3.3.6 LED Indicator Panel

Connected to the doll, a panel of LEDs is used to provide straightforward and concise feedback to students, complimenting the PC based interface. This panel also provides rudimentary feedback when a full PC-based simulation is not available or desired. Initially, an alternate indicator panel design using an LCD screen instead of LED’s was considered, but it was reworked into the current solution for multiple reasons. Firstly, the practicality of the LED panel exceeds that which could be achieved using an LCD display. Because the indicator panel’s sole purpose is to provide basic feedback to the student while in the process of performing CPR, panel readability is paramount. It is here that an LED panel with a few bright and easy to interpret LED’s provides a clear advantage over an LCD. Additionally, the cost advantage which is apparent with the choice

Team 12 10

of an LED panel provides a further reason for the choice. Overall, the final panel design provides an effective feedback tool for a student in the process of performing CPR.

Figure 3-8: LED Panel

3.3.7

PC Interaction and Graphical User Interface (GUI)

One of the major focuses of this project was to create a clean, usable graphical interface design which will convey maximum information to the user. To this end we have selected a tabbed design with each tab conveying a different set of information clearly and concisely (Figure 3-5 and 3-6). Because of its easy portability, widespread usage, and large component library, the Java Swing library was used to implement the user interface. Many groups have used this method successfully in the past, and in the process have shown this method to be both robust and learnable in a 12 week period, building on existing Java skills sets.
3.3.7.1 Real-Time Analysis

This Real Time display tab is the default view when the CPR doll is in its simulation phase. It provides all feedback statistics in real time for easy viewing by the instructor or student. The two vital components of effective CPR, chest compression and mouth to mouth resuscitation (artificial respiration), are represented to the user as two line graphs which update in real time, giving instantaneous values for compression depth and airflow rate. The compression depth graph also indicates the acceptable depth range to ensure an effective compression, while keeping the

Team 12 11

patient as safe as possible. A third graph displays the pulse of the doll, either its natural pulse rate, or if absent, the pulse generated by a compression during CPR. Also present on the screen, a rendering of the side view of the doll is used to be used to display pre-rendered animations corresponding to the current activity being performed on the doll. A three state visual indicator similar to a traffic light indicates where the rescuer’s hand pressure is being applied relative to the correct placement. There are also visual indicators for the microphones placed in each ear, indicating per side if the mandatory audio check of consciousness was performed. This panel also displays which scenario is run for the current simulation.

Figure 3-9: Screen Capture of Real Time Panel

3.3.7.2 History Presentation

Upon completion of a simulation, a detailed graphical analysis of performance data can be accessed through this tab. Full length graphs, from the start of the simulation run to the end are produced in order to isolate particularly problematic sequences of time. As in the Real-Time Analysis tab, graphs of compression and respiration are shown, as well as bar graphs indicating hand placement and voice detection during “shout” procedure. Data from previous simulation runs a student has performed can also be accessed through this tab, allowing the student or instructor to review problem areas during a run, or review performance over many simulations.

Team 12 12

Figure 3-10: Screen Capture of History Panel

3.3.7.3 Reports and Analysis

As the PC software receives the actions of the CPR student and displays it in real-time manner on the GUI, it logs the data for subsequent review. The results will be presented to the user using a mixture of graphical and text formats. During a simulation, the user will be unable to access the report unless the simulation is halted or runs to completion. This panel summarizes performance in four main areas: compression rate, compression depth, hand placement during compressions, and ventilation. The data is summarized using horizontal bar graphs, appropriately color coded, to provide a glance review of performance. For example, compression depth is represented by a bar graphs to show the percentage of compressions that hit target depth(shown in Green), as well as the percentage of those that were too shallow (shown in Yellow, as ineffective) or too deep (shown in Red, as harmful to patient). The report will also analyze the order of the actions taken by the student and compare it with the correct set of actions given the particular scenario under execution. This panel also displays an ordered outline of actions that should have been performed, for the user’s reference.

Team 12 13

Figure 3-11: Screen Capture Reports Panel

3.3.7.4 Scenario Editor

There are a variety of different real world scenarios that a rescuer could be faced with, such as a drowning scenario, where artificial respiration must be performed, or choking, where chest compressions may be performed, or where the patient is unconscious but breathing, and only requires monitoring until help arrives. The pre-loaded scenarios have been developed in conjunction with personal First Aid experience, the Saint Johns Ambulance Standard First Aid course book, and information from First Aid professionals, to be a comprehensive set of test conditions that allow students to practice their skills with practical test cases. An instructor or adjudicator may want to simulate difficult situations where CPR and respiration is required, down to simulating a mildly unconscious patient who does not require resuscitation, and merely wants the student to recognize the proper situations to carry out rescue breathing and CPR. By running scenarios in order from least difficult to most difficult, the instructor can allow a student to develop their confidence and practice their skills. By running them in random order, the student can demonstrate their ability to recognize and handle a situation as it arises. Recognizing the continuing changes in First Aid Standards, this panel also provides configurability options for standards that are anticipated to change, such as number of compressions in a set (or ventilations), or the time taken to complete those compressions, as well as the depth for compressions that is considered safe or harmful. These values are then saved in a configuration file and will be saved and loaded each time the user runs the program. In addition, there are differences between CPR and AR performed on adults versus children, and often the

Team 12 14

same doll is used to practice both techniques, as having to sets of dolls can be expensive for First Aid Training organizations. This program allows the practices of both techniques, with separate scenarios and configurability for children and adults, allowing different analysis and reporting.

Figure 3-12: Screen Capture of Scenario Editor Panel

4.0
4.1 4.1.1

RESULTS
Hardware Embedded System Implementation The microprocessor circuit is constructed from raw components. The microprocessor used for this project is the AVR ATMEGA32. It is a general purpose microcontroller with a variety of peripheral ports such as analog-to-digital converters (ADC), bidirectional TTL input/output ports, and a USART interface to allow RS232 serial communication. The original design goal of the embedded system hardware was to create a piece of hardware similar to a development board or kit. All of the basic oscillator, power, and programming components were implemented, and all output ports were connected to header connectors for ease of use during experiments and testing. Optional LED paths were connected to the MPU through jumper dongles or disconnect them for alternative uses.

Team 12 15

However, the PCB for this implementation was never successfully made. A veroboard prototype circuit was created as the final embedded software hardware and included many changes.

Figure 4-1: Microprocessor Circuit

The circuit diagram below depicts the final embedded system configuration. As previously described, the microprocessor is the hub of all peripheral activity, and hence, all peripherals, including the RS-232 connection to the PC, are mapped directly to the MPU.

Team 12 16

Figure 4-2: Final Microprocessor Circuit

The microprocessor used is the AVR Atmega32. It was primarily chosen due to the several reasons. • • • • The development and programming interface of AVR Studio is simple and easy to use. Atmega32 is a very mainstream processor and is compatible with many 3rd party programmers on the market Contains an adequate 32Kbytes of flash memory Recommended by many due to ease-of-use compared to Freescale microcontrollers

The only drawback regarding the Atmega is the relatively low number of I/O ports. In particular, the Atmega32 only has 32 I/O pins, compared to the Freescale HC12, which has 74 I/O pins. The lack of I/O pins on this device put constraints on the number of peripherals used, especially in terms of LEDs. Future revisions of this hardware may include multiplexer ICs to provide a larger number of outputs for the indicator panel’s LEDs, thus freeing up valuable GPIO ports for further expansion. A MAX-232 component is used to handle voltage conversion for the USART. This chip produced very little complications during implementation and was fairly easy to use. There was a bit of a discrepancy when connecting the DB-9 RS-232 connector to the MAX chip. Online references and websites indicated that on the microcontroller end of the connection, pins 2 and 3 are connected to RX and TX respectively. However, it was found that the PC serial port was

Team 12 17

connected in the same manner, so the pin connections were swapped. Another minor future design change is to place switch the outputs to the Windbond sound recording chip to another port other than PORTB. During programming, the same pins are utilized by the ISP programmer and flash memory, causing the chip’s control signals to pulse at high frequency. As a result, the sound module outputs strange buzzing noise during every programming cycle. It is not certain whether or not this is harmful to the chip, but since its operation mode is hardwired to “playback”, there is little chance that the pre-recorded sound clips will be affected. 4.1.2 Powering the Hardware The original plan to power the hardware was to use the 5V DC output from the USB port of a PC or laptop computer, since the microcontroller is to be connected to either through RS-232 connection and USB-Serial converter. However, several problems come to mind. First of all, the USB-Serial converter won’t output the 5V voltage line, since there is no power line in RS-232 connectors. Therefore, a cumbersome wiring job would be needed to extract the 5V voltage line from the USB port on the host side, and wired along the RS-232 cable to the doll. Another problem arises in the use of the LM7805 voltage regulator; if the input of the voltage regulator is 5V, the output is measured at approximately 3.7V. However, the microprocessor and other amplifier circuitry require at least 5V supply. The final solution is to use a 9V rated AC/DC wall-plug adaptor, and allows the hardware to run off a 5V output from the voltage regulator. However, tests showed that the adapter outputs an unloaded voltage of approximately 12.5V. When loaded with the hardware, the output remains above 11V. After conferring with the TAs, this was found to be merely a consequence of using a low cost AC/DC adapter. However, the significantly higher voltage causes the voltage regulator to heat up considerably during operation, and hence, should require a heat sink. 4.1.3 Compression Distance Sensing A low-cost optical distance sensor is used to measure the displacement of every compression. The CPR Training System uses a Sharp GP2D120 distance sensor with 4 – 30 cm detection range. The output voltage vs. distance relationship is show in the figure below.

Team 12 18

Figure 4-3: Analog Output Voltage vs. Distance

The sensor is mounted to the bottom of the mannequin’s chest cavity and aimed upwards at the plastic chest plate approximately 16cm above. As evident in the graph above, the resolution of the device at this bias distance value is reasonably shallow. To provide better resolution, 4cm high wood blocks are used to elevate the optical sensor such that it operates in the steepest region of the graph. The bottom of the chest plate is also painted white to provide the best reflectivity for the sensor. Another advantage of using this sensor is its ability to work without an amplifier due to the relatively high output voltage range and absolute voltage output. In fact, the maximum distance value utilized is just above 4cm because the sensor is fed into the input of an ADC with a 2.56V reference voltage. The only noticeable drawback with this sensor is its inherent measurement delays. The figure below presents a timing graph taken from the sensor’s datasheet.

Figure 4-4: Timing Diagram of GP2D120

To summarize, there is a maximum delay of 52.9ms between measurement and output. It is visually apparent when the sensor is connected to the oscilloscope and contributes to the overall response delay of the system.

Team 12 19

Another problem with this sensor is its need for a special JST connector, which requires crimped wire leads and pins. During assembly and installation, it was found to be very difficult to insert the connector into the sensor’s socket. An easier solution was found by trimming the plastic housing of the socket and directly soldering wires to the three pins. Hot glue should also be used to coat and stabilize the connection. 4.1.4 Vibration Motor Many ideas were explored when designing the pulse generation hardware. Among these was a rather complicated idea of attaching a spring loaded bearing or piston to the inside of a solenoid and mounted underneath the skin of the mannequin. Period pulses in the solenoid would cause the piston to strike the surface of the skin, thus generating a pulse. This solution would have produced an authentic carotid pulse because, like a real human pulse, the solenoid assembly produces a displacement on the skin surface. However, due to the lack of time and development resources, this idea was passed over in favor of a vibration motor.

Figure 4-5: Driving Circuit of Vibration Motor

A disc shaped pager motor was ordered for the application, but has yet to arrive from Digi-key, so a rotating vibration motor salvaged from a Nokia mobile phone was used instead. The motor is pulsed high by the microcontroller for approximately 35ms, with the aid of an open-collector transistor implementation to drive it. The motor is encased with a small piece of ½ inch plastic tubing to shield its rotating weight from everything around it. The entire assembly is mounted directly to the right side of the mannequin’s neck, under the skin below the chin. However, there were severe mounting problems, mostly due to the slipperiness and elasticity of the skin’s silicone rubber material. Attempts to mount it using hot glue, marine epoxy, and duct tape were all unsuccessful. In the end, the motor’s long wires were solidly glued to the plastic skull of the mannequin, with the motor enclosure resting on the target spot underneath the skin, as shown below.

Team 12 20

Figure 4-6: Vibration Motor

The motor’s small electrodes also caused a problem because they were not big enough to support a solid soldered connection to external wires. Therefore, hot glue is used to coat the connections and provide rock-solid stability. 4.1.5 Audio Detection Audio detection was achieved using microphones. The microphone model selected for the project was MD6052USZ-1 which satisfied the following selection criteria: • • • • • Its size is small enough to be embedded into the ears of the CPR doll. Its frequency range covers the human vocal range of 300Hz to 3400Hz. It can be operated at 5V. It is of the unidirectional type which only detects on-axis or almost on-axis sound. Its price is relatively low.

As the output signal from the microphone is very small, additional circuitry is required to amplify the microphone output. The complete schematic of the microphone circuit is shown in the figure below.
V1 5V +V

V2 5V +V Mic J1 R11 1k C1 3.3uF + R1 11k + R4 110k C2 10uF + R3 110k

R2 220k U1 LM324 C3 4.7uF + R5 1k R6 1k R7 110k R8 56k U2 LM324

R9 11k + R10 11k C4 100nF D1 1N4148 U3 LM324

+

Team 12 21 Figure 4-7: Schematic of the Complete Microphone Circuit

The circuit consists of four stages. The first stage shown in figure 2 constitutes an A.C. coupled inverting amplifier configuration which eliminates the D.C. offset incurred by the internal construction of the microphone. D.C. components are blocked by the coupling capacitors C1 and C3 in the circuit. The voltage gain |Av| of the stage is equal to R2/R1 = 220k/11k = 20.
V1 5V +V

R2 220k C1 3.3uF + R1 11k + R4 110k C2 10uF + R3 110k U1 LM324 A C3 4.7uF + R5 1k R6 1k

Vin

Vout

Figure 4-8: A.C. Coupled Inverting Amplifier

According to the datasheet, the output from the A.C. coupled inverting amplifier is limited to 3V peak-to-peak, which translates to a voltage range of -1.5V to 1.5V. In order to achieve signal level beyond this range, a second amplification stage is added. The non-inverting configuration is chosen for this purpose and the circuit is shown in the figure below. The voltage gain |Av| of this stage is equal to 1 + R7/R8 = 3.
V1 5V +V

Vin

+

U2 LM324

Vout
R7 110k R8 56k

Figure 4-9: Non-inverting Amplifier Circuit

During testing of the circuit, it was found that phase inversion occurs when the input is driven above a certain threshold voltage. This is likely to be inherent in the internal construction of the amplifier and is induced whenever the output is driven too negative. Interestingly, this side effect is desirable for this particular application as it eliminates the need for extra rectification circuitry otherwise needed. The third stage of the microphone circuit shown in the figure below constitutes a RC low pass filter which acts as an integrator to filter out any sudden, short-duration noise that would otherwise be picked up as a proper “shout”. The resistor and capacitor values are chosen to achieve a time constant value of around 1ms.

Team 12 22
R10 11k

Vin
C4 100nF

Vout

Figure 4-10: RC Low Pass Filter

The fourth stage digitizes the signal so that the output signal represents either “sound” or “no sound”. This is achieved using a voltage comparator circuit as shown in the figure below. The voltage at the inverting input of the amplifier is around 0.7V due to the presence of the diode D1. Whenever the voltage at the non-inverting input is above this value, the output swings to VCC and once the input voltage falls below this value, the output swings back to 0V. From experimentation, it was found that the output voltage reaches 0.7V after about 0.5ms which is long enough to filter out any unwanted signal.
V1 5V +V

R9 11k U3 LM324

+

Vin

Vout

D1 1N4148

Figure 4-11: Voltage Comparator Circuit

4.1.6

Breathing Technique Evaluation The evaluation of breathing technique is achieved using an air pressure sensor. The SenSym SX01D4 differential air pressure sensor is chosen for this purpose because of its relatively low price, relevant differential pressure range (0 to 1 psi), low power requirement and low noise. The SX01 sensor has two pressure ports. When the first port P1 is exposed to the reference pressure (e.g. atmospheric pressure) and the second port P2 is exposed to the variable pressure of interest, the difference in pressure between P1 and P2 gives rise to a differential voltage at the outputs of the sensor. The complete schematic of the air pressure sensor circuit is shown in the figure below.

Team 12 23
Vcc 5V C1 100nF + C2 10uF

R1 3.32k Q1 2N2222 R2 1.43k U1 LM324 R8 10k R11 1M Vcc 5V

Vo-

+

Vs Sensor
R3 1k

R4 10k R5 10k

R6 10k R7 10k + R9 10k U3 LM324 Vcc 5V R10 200k 90% +

U4 LM324 MPU AD2 Vcc 5V

Vo+

+

R14 2k U2 LM324 Vcc 5V R15 2k 40%

R12 2.2k R13 1k

Figure 4-12: Schematic of the Air Pressure Sensor Circuit

In the above circuit diagram, SX01D4 is represented as a Wheatstone bridge with supply voltage vs and output voltages vo- and vo+. The transistor network, shown in figure below, is used to provide temperature compensation. The values of the resistors R1 and R2 are specified on the datasheet for VCC = 5V.
Vcc 5V

R1 3.32k Q1 2N2222 R2 1.43k

Vs

Figure 4-13: Temperature Compensation Circuit

The difference in output voltages vo- and vo+ is proportional to the differential air pressure. To measure this difference in voltage, the instrumentation amplifier circuit shown in the figure below is used.

Team 12 24
Vcc 5V

Vo-

+

U1 LM324 R8 10k R4 10k R6 10k Vdiff R7 10k + R9 10k U3 LM324 Vcc 5V

R3 1k R5 10k

Vo+

+

U2 LM324 Vcc 5V

R12 2.2k R13 1k

Figure 4-14: Instrumentation Amplifier Circuit

The differential voltage vdiff can be calculated using the following formula:

vdiff = −(1 +

R4 )(vo+ − vo− ) R3

The gain of the circuit can be adjusted by changing the value of resistor R3. As the voltage outputs of the sensor are very low at typically 20mV, and the differential voltage between the two outputs is even smaller, the gain at the instrumentation amplifier stage is not enough. A second pure amplification stage is required. The circuit is shown in the figure below. The variable resistor R15 is adjusted so that the voltage at the positive input matches the DC offset at the negative input. The gain of this amplification circuit is given by (-R11/R10). To conveniently adjust the gain, a variable resistor is used for R10. The final voltage output of the circuit varies positively with the increase in air pressure relative to the reference pressure.
R11 1M

U4 LM324 Vdiff R10 200k 90% + Vcc 5V MPU AD2

R14 2k R15 2k 40%

Figure 4-15: Inverting Amplifier Circuit

Team 12 25 4.1.6.1 Voice Recording and Playback

The ChipCorder ISD2548 Single-chip voice record/playback device is used to implement the prerecording of breathing and choking sound as well as the playback of these sounds during appropriate scenarios. For recording, the circuit shown in Figure 10 was constructed in accordance with the recommendation from the datasheet. The ISD2548 was configured to the push button mode by pulling pins A6, A7 and A8 high.
Vcc 5V ISD2500 U1
1 A0 VCCD 28 2 A1 VCCA 16 3 A2 VSSD 12 4 A3 VSSA 13 5 A4 SP+ 14 6 A5 SP- 15 7 A6 AUXIN 11 8 NC ANAIN 20 9 A7 21 10 A8 ANAOUT 18 MICREF 23 CEb MIC 17 24 PD AGC 19 27 P/Rb OVFb 22 26 XCLK EOMb 25

SPK1 8

Vcc 5V

+

+

R6 100k Start/Pause S1

C6 0.1uF R6 5.1k C3 0.1uF Vcc 5V MIC + +

C7 0.1uF

Stop/Reset S2

C1 0.1uF + C5 0.1uF

Playback/Record S3 R7 100k

R2 470k

R1 C2 1k 4.7uF +

R3 10k

C4 220uF

R5 10k

Figure 4-16: ChipCorder Recording Circuit

The following steps described how recording of messages was performed. 1. Set S3 to Gnd to enter the record mode. 2. Press S1 to start recording. 3. Press S1 again to pause recording and internally mark the end of a message. 4. Repeat steps 2 and 3 until all messages are recorded. 5. Press S3 to reset the address pointer. For playback of the stored messages, the circuit shown in Figure 11 is constructed. This circuit is similar to that used for recording except that push button mode is disabled by setting pin A6 low. The mode pins A0, A3, A4, and the control pins CEb and PD are controlled by signals from the microprocessor. When the pins A0, A3 and A4 are set high, the chip enters the message cueing, message looping and continued addressing mode respectively. In addition, the EOMb pin is feed to the interrupt pin of the microcprocessor. Pin P/Rb was set permanently to high since no recording was required. Pin 14 and pin 15 are connected to the speaker driver circuit.

+ C8 22uF

Team 12 26
Vcc 5V ISD2500 U1 MPU PB0 MPU PB3 MPU PB4
1 A0 VCCD 28 2 A1 VCCA 16 3 A2 VSSD 12 4 A3 VSSA 13 5 A4 SP+ 14 6 A5 SP- 15 7 A6 AUXIN 11 8 NC ANAIN 20 9 A7 ANAOUT 21 10 A8 MICREF 18 23 CEb MIC 17 24 PD AGC 19 27 P/Rb OVFb 22 26 XCLK EOMb 25

SP+ SP-

Vcc 5V

+

+

C6 0.1uF R6 5.1k C3 0.1uF Vcc 5V MIC + +

C7 0.1uF

MPU PB7 MPU PB1

C1 0.1uF + C5 0.1uF

MPU INT0

R2 470k

R1 C2 1k 4.7uF +

R3 10k

C4 220uF

R5 10k

Figure 4-17: ChipCorder Playback Circuit

As the current from the ISD2548 was too low to drive the speaker loud enough, a speaker driver circuit is required to boost the volume of the speaker. The LM386 Low Voltage Audio Power Amplifier was used for this purpose. According to the datasheet, the circuit shown in Figure 12 was constructed to provide a gain of up to 50.
V1 5V +V C2 330nF C5 330nF SP+ SPR3 2k 50% R4 1k
7 2 3

LM386
5

C4 250uF +

4 1 8

6

R2 10 R1 1.2k C1 10uF C3 0.05uF

SPK1

Figure 4-18: Speaker Driver Circuit

The volume of the speaker can be adjusted by varying the resistance of the variable resistor R3. The input is capacitively coupled by C5 to eliminate any offset problem. At the output, the speaker was connected via capacitive coupling through C4 which acts as a high pass filter. 4.1.7 Hand Placement Detection (Debouncer) Tactile switches are used to detect if hand placement is correct during chest compression. The debouncing circuit for the tactile switches is shown in figure 13. The transistor is added to provide enough current to drive the LED.

+ C8 22uF

Team 12 27
V1 5V +V

D1 LED0 R4 100 S1 R3 100k Q1 2N2222

C1 1uF

R1 1k Vo_switc

R2 5.1k

Figure 4-19: Tactile Switch Debounce Circuit

The time constant of the circuit is deliberately chosen to exceed the bounce time of <1ms specified for the particular type of tactile switch used. Calculation of the time constant is shown below. Time constant, = R1C1 = 1μF x 1k = 1ms 4.1.8 Hand Placement – Tactile Switches There were a lot of problems associated with mounting the hand placement switches. Early design called for a set of large, thick tactile switches embedded inside small wood surfaces to be mounted on the mannequin’s rib shell. The rib shell is a hard, thick layer of rubber wedged between the plastic chest plate and the mannequin’s skin. This layer gives the rescuer the feel of a ribcage beneath the skin, and provides a firm structure to absorb pressure from compressions. After several attempts and subsequent testing, it was found that there was not enough room between the skin and the rib shell to accommodate the buttons. In fact, the switches are activated even in idle state, when the mannequin is fully assembled, with its skin latched securely to its body. The final solution for mounting the hand placement switches resulted in using much smaller, flatter push buttons for the middle of the chest (otherwise defined as the “good” area), and a think tactile switch placed at the tip of the sternum (otherwise known as the “bad” area). This is shown in the picture below.

Team 12 28

Figure 4-20 Hand Placement Switches

The flat switches are embedded into the rib shell. The holes are cut using an scalpel knife and the buttons are secured using hot glue. The need for three parallel buttons instead of a single one in the middle was realized during testing when slightly staggered hand placement was found to be inadequate in activating a single button in the middle. The black tactile switch in the “bad” area sits in a cavity in the shell and is triggered whenever a considerable amount of force is applied to the area around the tip of the sternum. This switch is also chosen because of its inherent 1.5N force threshold. 4.2
4.2.1

Software
Embedded Software Architecture

Initially, the project’s firmware designers opted to proceed with a polling based scheme to constantly retrieve data from the various sensors. Interrupts were deemed unnecessary because the main function of the microcontroller is to funnel data from the sensors to the PC, essentially acting as an intelligent bridge or bus. would be unnecessary because the main purpose of the microprocessor is to retrieve information from sensors such as hand-placement detection switches, optical distance sensor, air pressure sensor, etc, and send it off to the PC through RS232. However, since then, the firmware has rapidly proceeded and it was found that it is much easier to keep track of the timing of the ADC and GPIO samples by using interrupts for reading, transmitting, and receiving. In fact, the USART receive function introduces significant timing complexities in a polling implementation.

Team 12 29

Shown below are the main program flow of the embedded software, as well the as flow diagrams of the most important interrupt service routines.

Figure 4-21: Embedded Software Flow Diagram

As evident from the figure above, the final embedded system is mainly interrupt driven, with both USART transmit and receive operations occurring within their respective interrupts.
4.2.1.1 Data Retrieval and Transmission

Data from the ADC and GPIO ports are read within the Timer1 Overflow Interrupt Service Routine (ISR). In the early stages of firmware development, the I/O ports were read inside the infinite ‘while’ loop within the main function. However, there existed a need for a constant, measurable time between every sample, which is used for calculating important criteria such as compression rate and ventilation duration. Therefore, a timer overflow interrupt is used to begin kick-start an ISR for every sample. This offers several advantages: • • • Easy tweaking of time between samples Reliable timing response Modular design

Team 12 30

Once inside the Timer1 Overflow ISR, the program calls functions to begin ADC conversions and read the result into global variables. In all, three sensors require ADC – one airflow sensor and two compression displacement sensors (or optical distance sensors). The ADC’s reference voltage is conveniently set to 2.56V internally; this value is prime for working with the output voltage range of the GP2D120 optical distance sensors. As a result of this, the airflow sensor’s amplifiers are tuned to output a voltage which is also suitable for this reference voltage. Within the same ISR, there are functions calls to processes which read the GPIO pins that the microphone and hand placement buttons are connected to. The compression displacement data, airflow data, and microphone and hand placement data are put into their respective 8-bit packets and sent off to the USART transmitter. The figure bellow shows the microphone and hand placement packet. Note that each microphone or button only occupies one bit. MSB 1 0 LSB EMPTY

0

LEFT MIC

RIGHT MIC

MIDDLE HAND

LOW HAND

Figure 4-22: Hand Mic Packet

The last thing performed in the Timer1 Overflow ISR is to make changes to the lights on the LED indicator panel based on the latest readings
4.2.1.2 Data Transmission Backlog

The time between each Timer Overflow ISR call could be modified simply by changing the initial value of the timer counter; a lower counter value results in a longer time between each overflow and, hence, a longer time between each ISR call. Incidentally, this value was subject to a lot of tweaking and optimizing during the implementation process, as more functionality was added to the firmware. There is an inherent delay in transmission of data from the USART. This firmware uses a transmit algorithm which waits in a loop while the send buffer of the USART is still full and loads the data in question onto the buffer when the status register indicates that the buffer is empty. This looping is the main cause of inherent delay in the transmission of data from the MPU to the PC. As a result, if the firmware reads from a certain port faster than the rate at which the USART transmit becomes cleared, there will be a growing backlog of data waiting for the USART, thus introducing tremendous delays into the system. Hence, by reducing the rate at which the I/O ports are read, the number of USART send requests per set time frame is low enough to sufficiently eliminate the occurrence of backlogs. In the end, the amount of time between ISR’s is set at 95ms; or in other words, every two points of data from any sensor is 95ms apart. The firmware can be further improved by incorporating interrupts for USART transmission. A However, one must keep in mind that the more interrupts in a system, the harder it becomes to debug
4.2.1.3 Data Reception

The reception of every data packet over the USART triggers an interrupt. The USART RX ISR has only one job: to read and interpret an incoming packet. The packet structure of incoming

Team 12 31

packets from the PC is virtually identical to that of outgoing packets. The only difference is that these packets contain instructions from the PC; these include changing the lights on the LED panel, generating a pulse with the vibration motor, play certain sound clips over the speaker, or synchronizing the MPU’s calibration values with those of the PC software.
4.2.1.4 Sound Recordings

PORTB on the microprocessor is connected to control pins on the Windbond Sound recorder chip. The functions for performing basic operations, such as looping the first sound clip or skipping the next clip, are coded into the firmware. Upon receiving a play sound command from the PC, the firmware assesses which clip needs to be played and whether or not it has to be looped. Once these criteria are know, the Windbond chip’s operations are performed in a particular fashion or protocol and the desired sound is played over the speaker.
4.2.1.5 LED Panel Control

The biggest drawback to this firmware’s design is the lack of calculations. With the current design, the MPU performs very minimal calculations and hence, is unable to output feedback on the LED Panel such as ventilation during and compression rate. The MPU also lacks the ability to run complex scenarios without the help of the PC, for example, it is unable to indicate a patient’s status (there is only one: no pulse, no breathing, no consciousness). Future versions of this project should include this feature and should, above all, include more functionalities to allow it to operate with more features when disconnected from the PC. 4.2.2 PC Software Design

4.2.2.1 Serial Communication Layer

One of the key issues of this project is the communication between the microcontroller and the PC, and as such it was one of the first design areas which were given attention. Because of the delays involved in getting the microcontroller programmer, the PC side of serial communication became the primary focus of initial software design. Java Libraries for serial communication come in two separate implementations, the java.comm library which is made by Sun, and the RXTX libraries, an open source alternative. Recently, Sun has stopped supporting the Windows version of the java.comm library leaving only one viable option for Java based serial communication. Even before the discontinuation of support it was well known by the Java community that the java.comm library was not well supported for any platform, while RXTX offers an active, open source alternative. The basic flow for the serial communication layer is shown below in Figure 4-16:

Team 12 32

Figure 4-23: Serial Communication Flow

In addition to the design of the PC serial communication layer, an additional piece of software, the software based microcontroller emulation tool, was created in order to thoroughly test the PC serial communication before the design of the embedded software was completed. Using a program known as VSPXP, two COM ports were linked together in software, allowing the virtual microcontroller software to perform integration testing of the RXTX libraries and the initial design. This approach enabled not only a thorough test of the design, but also the ability to experiment with different protocols which were being considered to allow the PC software to identify data from specific sensors, while also testing the ability of the software to plot the data on graphs in real time. In short, the ability to start the integration process early through the use of software based emulation proved to be invaluable in the successful completion of the project. Though our initial design proposed a five byte packet size for sensor data transmission, further engineering and experimentation has lead to a much more elegant and efficient solution. The final design now only requires two bytes to send all the data which was originally sent using five. This drastic increase in performance was enabled by the realization that the conversion from the raw 10 bit value, the output from the analog to digital converter, to a four byte floating point number, is much more efficiently performed by the PC side software. The current packet structure consists of two bytes, where the most significant three bits of each byte identify the sensor and the packet number (one or two). The remaining five bytes then constitute half of the raw 10 bit value generated by the analog to digital conversion. The PC then combines the two packets generated for each sensor data point before converting them into a floating point number. For further illustration, a sample packet is explained in the table below: 000 10101 Break 001 00100

Team 12 33

Optical Sensor Packet #1

Most significant five bits of raw optical sensor data

Optical Sensor Packet #2

Least significant five bits of raw optical sensor data

Table 4-1: Sensor Packet Structure Breakdown

4.2.2.2 Scenario Organization and Data Storage

Each different scenario is created as an instance of the OneScenario class (refer to Design Requirements – Software for UML Diagram). This class instance contains the status of the doll upon scenario start, as well as a list of actions to be performed by the user to demonstrate proper lifesaving techniques. Associated with creating the scenarios was implementation of a configuration file, chosen to be located it in the same directory as the program, for simplicity. When loading, if the program detects that the configuration file is not present, one will be created. This allowed the addition of text fields in the Scenario Panel that allow the user to modify the configuration file to save desired variables such as compression depth, or number of ventilations. The configuration file is rewritten by clicking "Save Settings", or can be reset by clicking "Restore Defaults", which restores it to current CPR standards. Associated with each scenario is an instance of the DataStorage class, which will be used to store data as it is collected from the Serial port while running a scenario. Originally, the serial data was polled by the graph when the graph updated, and then those polled values were saved. This resulted in “lost” values that were not sampled, and provided inadequate data for analysis. Also tested was alerting the graphs to update whenever a new values arrived from serial into DataStorage, however this resulted in slow graph that would not meet our real time needs. The Real Time Panel now samples data from the DataStorage class each time the graphs are refreshed. This allows The Real Time Panel to maintain the speed required to give visual real time feedback to the viewer, but keeps the full data set for analysis.
4.2.2.3 Real-Time Graphing Capabilities

Because of the short time frame of the project, it was decided that there was insufficient time to develop a ground up graphing solution that would be both robust and responsive enough to satisfy the requirements. Research was undertaken to find a mature solution which would meet all of the imposed conditions, namely, the ability to easily create multiple dynamically updating plots, as well as static plots. Initially, the open source package JSci was evaluated, which was found to be very well supported and easy to implement. Unfortunately, the axes of the graph updated along with the data lines of the graph, making it unsuitable for a fast sampling rate. A further search led to a package called Ptolemy, which is maintained by UC Berkeley. Ptolemy proved to be a perfect fit, with easy to implement dynamic plots that produced superior results at high refresh rates. For this prototype, the use of this very extensible pre-made graphing library has allowed additional attention to be given to more crucial aspects of the project, such as integration, while still giving very clean and customizable graphs.
4.2.2.4 Animation of CPR Doll

The CPR doll animation in the real time panel of the GUI provides a graphical representation of the victim’s status. Since the animation is not the main focus of the project, an easy-to-use 3D graphic design tool is chosen to construct the animations. After some research, Poser 6 is known as one of the best software programs for creating human animations. The main reason is that

Team 12 34

Poser contains a large library of content (i.e. poses, hair, accessories, etc.). Another famous feature of Poser is that it has a user-friendly interface that allows us to create animations for our doll easily and quickly. The CPR doll animation was first approached using the idea of looping through a set of images. However, the number of image files involved will become massive when there is a large number of a possible victim actions included in the program. In addition, it is very time consuming to draw a set of images for a smooth looking animation. After seeking advices from several forums in the graphic design society, constructing animations using Poser gives much better results. Several anticipated motions are made in Poser and saved as mpg files. The video files are displayed in our Java UI window using Java Media Framework, and the CPR doll animation is done by switching between different player objects. Java Media Framework provides a large library of tools that permit audio and video to be added into Java applications. Sound effects may be added to the future version of the CPR Doll Animation. A shortcoming for the video file approach is that there is a time delay between each video file in an animation. This time delay may be shortened by decreasing the size of the video files or frequency of clip switching.

5.0
5.1

ASSESSMENT AND ANALYSIS
Hardware

Overall, hardware implementations satisfied the design requirements. The microphone circuit is able to give a high voltage output when sound is detected. However, one setback is that it does not fully filter out noise as expected. For instance, clapping sound can sometimes be picked up as false positives. One possible explanation for this behaviour is that the time constant of the RC low pass filter of the circuit is not large enough. Currently, the value is set to about 1ms. The problem might be alleviated if the time constant is significantly increased. The problem with hardware noise filtering, however, is not significant as it is compensated by software filtering. The air pressure sensor circuit is fully functional. By experimental means, it is found that the variable resistor at the last amplification stage of the circuit should be set to 180kΩ to give the desirable output voltage range of 0-3V without saturation. In terms of hand placement detection, the debouncer circuit is not used in the final implementation as the sampling of the hand placement is done at a rate that is slow enough to ignore the effect of switch bouncing. The PCBs designed for the microphones, airflow sensor amplifier, and Windbond sound recording chip were far too large and resulted in increased parts cost, as well as wasted amounts of space inside the mannequin.
5.2 Software

Overall, the project team feels quite confident with the final PC software product. Many of the key areas, both in terms of difficulty and importance, have been identified and implemented. Real-Time graphing is perhaps the most important feature and was implemented successfully with reasonable performance, despite trade-offs in sampling rate versus updating speed. While speed is a primary objective, it comes at the expensive of sampling resolution.

Team 12 35

The user interfaces were implemented at the early stages of project development, and as such allowed time for thorough testing, and refinement for usability. User interface reviews by First Aid professional have produced positive result; they were very impressed with our software. They did not feel that any key information was missing from the display, and were pleased with the amount of information displayed and the form or presentation. The amount of configurability provided by the Scenario Panel is fairly extensive, however there is always room for expansion. Currently the scenarios are fixed with regards to actions required, and only the specifiers on the actions can be changed, which translates to a different data analysis per action. This could be a point for future development, creating more of a pick-and-choose type actions list, however we do feel that our list covers the main cases facing current rescuers. The user feedback panel, currently a panel with LED indicators, is a practical, reliable, and cost effective method of direct visual feedback while performing CPR. A small display screen was considered, but would not have been practical under these conditions – reading small text while trying to ventilate a patient, although it would have been more “high tech” and would have had the capability to convey more detailed information. Potentially an animated panel, even with audio feedback or audio help, could prove beneficial, provided it could be done in a cost effective way. From the firmware point of view, the initial goal was to create a modular system which would allow the LED panel to work in conjunction with the mannequin without the PC connected. This is not accomplished on a full scale due to lack of calculations performed on the microcontroller. With the current design, the MPU performs very minimal calculations and hence, is unable to output feedback on the LED Panel such as ventilation during and compression rate. The MPU also lacks the ability to run complex scenarios without the help of the PC, for example, it is unable to indicate a patient’s status. Future versions of this project should allow the microprocessor to run as a more powerful, independent unit and operate as less of a slave device to the PC host.
5.3 Professional Consultation

As mentioned earlier in this report, the Interactive CPR Training System is designed using a customer-focused approach. Therefore, the project team has been in constant communication with several first-aid instructors. These professionals have been extremely helpful to the design process, from providing in-depth knowledge regarding CPR procedures and technique, periodic analysis of the project’s results and progress, and constructive review of the design specifications. The chief first-aid consultant for this project is Wilson Young of St. John Ambulance (csc.y0881@bc.sja.ca). His credentials include: • • • • • St. John Ambulance Brigade Member (Volunteer): September 1996 – Present Division 881, Title: Community Service Coordinator St. John Ambulance Instructor (Association): May 2001 – Present ICP – Instructor’s Certification Program Qualified to teach and examine: • CPR (all 3 levels) • Standard First-Aid (all levels) • Emergency First-Aid (all levels) • WCB Level 1

Team 12 36

• •

Save That Child Early Childhood Care

Wilson Young has provided in-depth analysis of the training tool through periodic evaluation of system’s features and overall design. The following are specifications achieved by the project’s designers, as well as important criteria which have been addressed by the Interactive CPR Training Tool: • • Displays a student’s compression performance: students tend to forget or become confused with other ratios. Displays a student’s ventilation performance: students tend to either blow too hard or soft into the doll. The student needs to blow enough to make the chest rise. For example, blowing too hard would lead to gastric distension. This doll monitors this situation and provides appropriate feedback and evaluation. Displays compression depth: it is extremely difficult for a rescuer to judge how deep they are compressing. With the help of the doll’s displacement sensors, students can get a feel of how deep to push during each compression. Most students do not practice first-aid regularly, so it is extremely beneficial for them to get the ‘feel’ of compression depth and speed from a system such as this one. Equal compression and equal release phase is a very important aspect of CPR. Under a real-life situation, the compression and release phases need to be equal so blood can be refilled in the heart before next compression. Failure to do so will yield ineffective compressions. Providing breathing sounds and a pulse gives some interactive feedback to the students. It will help them remember the procedures if they are actually looking, listening, and feeling for something instead of simulating with a completely unresponsive doll. Monitors exact hand positioning: this is a very important aspect of chest compressions. Compressing with hands in the wrong spot can be harmful to the patient’s body. Especially if the hand is placed near the Xyphoid process (base of the sternum)

• • •

• •

The following are either features the instructor would like to see incorporated or elements of the system which require improvement or redesign: • • • • Modifying breathing and heart rates to help students train in their patient assessment skills. Emit vomiting sounds when the student blows too hard several times. Generate a pulse if CPR is done correctly (usually within the 1st minute) A mechanism that will determine if the rescuer is performing jaw-thrust without the patient’s head tilted correctly. This is important in situations such as if the patient has head or neck injury, where the head-tilt-chin-lift procedure should not be performed.

5.4

Parts and Cost Assessment

One of the main goals of this project is to design a multifunctional product at a low cost and budget. From the budget sheet shown below, it is evident that the CPR Training System cost less than $400 to prototype. However, please take note that the mannequin is a donation. Please also note that many of these parts are ordered more than one at a time and most do not factor into the final cost of the product.

Team 12 37
Part Name Tactile Switch Air Pressure Sensor Condenser Microphone Optical Distance Sensor Atmel Mega32 MPU Dudley Lock MPU Programmer USB A-to-B cable MAX232 RX TX D-SUB Recepticle DB9 D-SUB Recepticle DB25 PH Connection 3-pos 24-30AWG Crimp Contact Oscillator Crystal 16MHz Oscillator Crystal 8MHz Windbond Voice IC Vinyl Tubing 10' x 1/2" Marine Epoxy Scrap Particle Board Cable DB9M-DB9F 2M Vibrating Pager Motor 2.1 x 5.5mm Chassis Jack AC/DC Adapter - 9VDC 500mA IC AMP LM386 SPEAKER 8ohm .5W 57MM POT 2.0K OHM SWITCH TACT 12MM BOX ALUM CHASSIS 12X8X2" CHASSIS COVER SIP Header 1x36 FM SIP Header 1x36 M Veroboard Black Heat Shrink 0.093" x 4' Safety Glasses 28-pin DIP Socket DB-25 Connector DB-25 Parallel Cable 3-ft Expected PCB cost Supplier Number Digi-Key 401-1157-ND Digi-Key 287-1065-ND Digi-Key 423-1022-ND Digi-Key 425-1162-ND Digi-Key ATMEGA32-16PC-ND N/A ISPAVR U1 N/A Digi-Key AE1020-ND Digi-Key A23303-ND Digi-Key A23312-ND Digi-Key 455-1126-ND Digi-Key 455-1127-1-ND Digi-Key CTX414-ND Digi-Key CTX406-ND Digi-Key SD2548P-ND Home Depot Home Depot Home Depot Digi-Key Part #: AE1020-ND RP Electronics Part #: VPM RP Electronics Part #: 31-133-2 RP Electronics Part #: RP-9500-P Digi-Key Part #: LM386N-3-ND Digi-Key Part #: 102-1187-ND Digi-Key Part #: CT94EY202-ND Digi-Key Part #: SW421-ND Digi-Key Part #: HM267-ND Digi-Key Part #: HM283-ND N/A N/A N/A N/A N/A N/A N/A N/A N/A Unit Cost 3.07 28.99 2.27 15.12 10.14 4.50 55.02 4.34 5.20 2.40 2.42 0.05 0.04 1.63 1.63 11.37 4.43 7.17 0.58 6.64 4.75 1.69 8.20 1.18 4.41 1.69 0.53 23.92 10.25 4.00 4.00 8.00 2.59 5.00 1.00 0.91 4.50 20.00 Quant. 3 1 3 3 3 2 1 1 2 2 0 10 100 1 2 1 1 1 1 1 1 1 1 2 1 3 5 1 1 2 2 1 1 2 1 2 1 1 Total Cost 9.21 28.99 6.81 45.36 30.42 9 55.02 4.34 10.4 4.8 0 0.52 4.26 1.63 3.26 11.37 4.43 7.17 0.58 6.64 4.75 1.69 8.2 2.36 4.41 5.07 2.65 23.92 10.25 8.00 8.00 8.00 2.59 10.00 1.00 1.82 4.50 20.00

Total Cost: $371.43