MiniProject Real-Time Microcontroller Based ECG Monitor Report A: Design Aspects COURSE: MODULE: BY: DATE: BEng (HONS) Electronic Systems EEE512J2 - Electronic Product Design Colin K McCord Thursday, 17 July 2003
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord TABLE OF CONTENTS 1.0. Introduction 2.0. Fundamentals 2.1. Electrocardiography (ECG, EKG) 2.2. Electrodes 2.3. ECG Amplifier 2.4. The Cathode Ray Tube (CRT) 2.5. Digital Sampling 2.6. Aliasing 2.7. The PIC Microcontroller 3.7.1. Summary of the PICs Built-in Peripherals 2.8. RS232 Serial Interface 3.0. Feasibility / Initial Design Approach 3.1. Market Research and Information Analysis 3.2. Concept Designs 3.3.
Thursday, 17 July 2003 A. Appendixes A1.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord 1.0 INTRODUCTION The heart’s strong pumping action is driven by powerful waves of electrical activity in which the muscle fibres contract and relax in an orchestrated sequence. These waves cause weak currents to flow in the body, changing the relative electric potential between different points on the skin.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord 2.0. FUNDAMENTALS 2.1. Electrocardiography (ECG, EKG) The heart is a muscular pump made up of four chambers. The two upper chambers are called atria, and the two lower chambers are called ventricles. The purpose of the atria is to act as ‘filling chambers’ for the ventricles; the right side of the heart is the pulmonary pump, i.e. it pumps blood between the heart and the lungs, and the left side of the heart is the systemic pump, i.e.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord body, only a dipole changing in both space and time. According to cardiac theory, in order to detect the strongest difference in potential (the peak signal); the optimum electrode placement is to have one on the right shoulder, and one on the left hip.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord Ag-AgCl electrodes are the current standard for use in medical applications related to biophysical instrumentation and measurements. The gel provides impedance matching at the interface between the electrode and the surface of the skin, which means that noise effects are reduced, increasing the signal-tonoise ratio, allowing for a clear signal to be detected.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord than about 50 hertz. A 3 lead cable connects the circuit to the electrodes and two wires are required to connect the output to an ADC for sampling. +9V 1uF Electrode 1 1 8 47k Electrode 2 10k 2 Electrode 3 Simple Low Pass Filter 4 47k 3 5 AD624AD 11 9 6 10M To ADC 4.7k 13 47k 1uF 1uF 10 12 7 16 1uF -9V Figure 2.3a. Simple ECG Amplifier 2.4.
Thursday, 17 July 2003 Y Input MiniProject: Design Aspects Frequency-compensated attenuator AC Colin K McCord CRT Y Deflection Stage Y Amplifier CRT Y Deflection plates DC CRT X Deflection plates Trigger pickoff amp Y Shift X Deflection Stage int Trigger Selector Trigger Input Sweep (time base) generator Sweep gate logic ext Trigger Level X Shift Trigger +/Polarity X Input To CRT Grid 1 Auto Brightline Circuit Blanking Amplifier Sweep Speed Setting Figure 2.4b.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord 2.6. Aliasing Aliasing is an undesirable effect that can occur when digital sampling analogue voltages. This is the display of an apparent signal which does not actually exist, usually caused by under-sampling. Many samples should be taken per cycle (Nyquist theorem states that “to define a sine wave, a sampling system must take more than two samples per cycle”.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord “All the elements of the von Neumann computer are wired together with the one common data highway or bus. With the CPU acting as the master controller, all information flow is back and forward along these shared wires. Although this is efficient, it does mean that only one thing can happen at any time. This phenomenon is sometimes known as the von Neumann bottleneck.” [B3] CPU 8-Bit Memory (Program & Data) Figure 2.7a.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord 2.8. RS232 Serial Interface RS232 is simple, universal, well understood and supported, but it has some serious shortcomings as a data interface. Its origins predate modern computers and it contains many features that are not relevant to the modern user. It can control very old primitive modems and has many control signals to do this in hardware, but often it is used without these old control and status lines.
Thursday, 17 July 2003 MiniProject: Design Aspects Baud Rate 110 bps 300 bps 1200 bps 2400 bps 4800 bps 9600 bps Colin K McCord Max Distance Shielded Cable 5000 feet 5000 feet 3000 feet 1000 feet 1000 feet 250 feet Max Distance Unshielded Cable 3000 feet 3000 feet 3000 feet 500 feet 250 feet 250 feet Figure 2.8c. Typical maximum distance modern line driver/receivers can manage before errors occur.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord 3.0. FEASIBILITY / INITIAL DESIGN APPROACH The NHS (National Health Service) is in crisis, mainly due to years of severe under-funding, but partly because of the extremely high cost of modern medical equipment, drugs and overpaid doctors. Medical electronic equipment is expensive because they are low volume products that must be guaranteed to work at all times as peoples lives depend on them.
Thursday, 17 July 2003 MiniProject: Design Aspects ECG-120B, [W6] Colin K McCord ECG-310B, [W6] • • • • • • • • • • • • 1 Channel ECG Thermal array printer Compact design Audible alarm sound LCD message Digital filter 3 Channel ECG Thermal array printer Compact design Audible alarm sound LCD message Digital filter £798.263 IQMark (Brentwood by Midmark) Digital ECG, [W14] Cardio Perfect LITE Resting ECG, [W6] • • • £1,093.27 • Digital ECG using PC for display ECG.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord Clearly there are many compact portable ECG products on the market; most are easy-to-use with pleasing shape, form, aesthetics, and styling. The key aspect to note is the price (very expensive), if a low-cost solution is possible, there is a good change of commercial success as long as the product is technically suitable of medical use (e.g. must comply with all the relative international standards). 3.2.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord visually displays the ECG. 7-segment displays display the beats per minute of the ECG, and a buzzer is used to beep for each heart beat. Oscilloscope Differential Amplifier (ECG Amp) Microboard Surface Electrodes Buzzer Figure 3.2c. Concept design 3, using a CRT and/or a PC to display ECG. It was decide to developed concept 3, because it offered more features than 1&2, with only a small increase in product cost.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord RS232 Output: Allows for transmission of ECG to PC via the RS232 serial interface. Battery Operation: Four hours monitoring with fully charged battery pack. Four hours of recharge required for each hour of use. Power Module: Compact convenient and independent unit with cable connection to AC outlet and monitor rear panel. Recharges batteries and permits continuous AC operation.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord Amendment 11: 1995 Amendment 12: 1996 Amendment 13: 1996 1995 1996 1996 EN 60601-1-2:1993 Medical Electrical Equipment Part 1: General requirements for safety. Section 2: Collateral standard: Electromagnetic compatibilityrequirements and tests.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord 4.0. PROJECT PLANNING AND MANAGEMENT 4.1. Planning / Development Costs A detailed plan addressing all aspects of the project from initial brief through to manufacture, sales and distribution was made. The Microsoft Project software application was used: network, Gantt chart, resources, castings, timescale, financial planning and management planning.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord The resource sheet is important as it allows Microsoft Project to calculate development costs; this is achieved by selecting who is working on each task and what percentage of their time is spent on the task. Resource usage (auto generated): - The resource usage section in MS Project summarises how many hours each employee is working on each task and the cost for their services.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord Task usage (auto generated): - EEE512J2 – Electronic Product Design Page 19 Chapter 4: Project Planning and Management
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord Gantt chart (auto generate): - PERT chart with fields hidden (red path is the critical path): - EEE512J2 – Electronic Product Design Page 20 Chapter 4: Project Planning and Management
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord Development costs: - 4.2. Pareto Concept The Pareto principle states that there are a ‘critical few and trivial many.’ This concept can be applied to inventory management using ABC analysis and cost estimating (a small number of elements have a large effect on the total cost of project). 100% 60% Class C Class B Class A % Product Cost 90% 20% 60% 100% % No. of Components Figure 4.2a.
Thursday, 17 July 2003 • • MiniProject: Design Aspects Colin K McCord Give tighter physical control of A items. Forecast A items more carefully. Class B (say the next 40% of items): • A reorder cycle system could control this class. Class C (Next 40% of items): • A two-bin or annual demand system could manage the final 40%. The analysis requires items to be listed with their unit costs and annual volume.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord Ball Park Assessment Method: 1. List all components/assemblies in the product. 2. Assess most expensive and least expensive items and determine probable cost order. E.g. ECG Amplifier = 0.2, Batter pack and charger = 0.15, etc… 3. Rearrange components / assemblies in descending order of cost. E.g. ECG Amplifier (0.2) most expensive, 9-way PCB D-type plug (0.003) least expensive 4. Apply Pareto rating, first general then detailed. E.g.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord diagram is a diagrammatical representation of the sequence of work elements as defined by the precedence constraints. The following list of work elements could describe the production of the ECG monitor for a line with a production rate of 60 units/hr. At a line efficiency of 100%, the value of the cycle rate is 1.0 min (i.e. the ideal cycle time is 1 min).
Thursday, 17 July 2003 5 6 7 8 9 10 11 12 MiniProject: Design Aspects 1.41 1.11 1.51 1.11 1.3 1 0.62 0.12 0.3 0.11 0.4 0.11 0.3 0.38 0.5 0.12 Colin K McCord 0.3 + 0.11 + 0.38 + 0.5 + 0.12 0.11 + 0.38 + 0.5 + 0.12 0.4 + 0.11 + 0.38 + 0.5 + 0.12 0.11 + 0.38 + 0.5 + 0.12 0.3 + 0.38 + 0.5 + 0.12 0.38 + 0.5 + 0.12 0.5 + 0.12 0.12 Step 2: Make a table with the largest RPN at the top. RPM 2.71 2.51 1.81 1.51 1.51 1.41 1.4 1.11 1.11 1 0.62 0.12 We 1 3 4 2 7 5 9 6 8 10 11 12 Te 0.2 0.7 0.1 0.4 0,4 0.3 0.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord 5.0. SYSTEM ARCHITECTURE 5.1. System Block Diagram The proposed design is shown in block diagram form in figure 5.1a, it is clear that there are two main features: displaying the ECG on a CRT display (e.g. use an oscilloscope) and transmitting the data to a PC in real-time to display and log ECG data.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord words of FLASH program memory, 256 data memory bytes, and 368 bytes of user RAM, PIC16F877 also features an integrated 8-channel 10-bit Analogue-to-Digital converter. Peripherals include two 8-bit timers, one 16-bit timer, a Watchdog timer, Brown-Out-Reset (BOR), In-Circuit-Serial Programming™, RS-485 type UART for multi-drop data acquisition applications, and I2C™ or SPI™ communications capability for peripheral expansion.
Thursday, 17 July 2003 MiniProject: Design Aspects Communication Protocol ¾ Concept design. ¾ Design of frame structure. ¾ Error checking, e.g. CRC. ¾ Test Program. ¾ Functional Testing. PCB Design ¾ Top layer. ¾ Bottom layer. ¾ Ground plane. ¾ Separation of analogue and digital circuit to reduce noise. Colin K McCord Windows Application ¾ RS232 object. ¾ ECG Graphical Display. ¾ User Interface. ¾ Internet communications. ¾ Streaming ECG to disk (data logging).
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord aliasing filter. One engineer will design the PCB, a design engineer will design the packaging after some feedback from the electronic engineers, and an engineer will work on the digital circuit. Analogue Circuit Power Supply Digital Circuit ECG Amplifier Low-pass Filter PCB Design Top Layer BPM Display Beeper Circuit RS232 Comms. Colour, symbols POS of controls Packaging Bottom Layer Ground Plane Size and shape Figure 5.2d.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord 6.0. PHYSICAL DESIGN The shape, form, aesthetics, styling, tactile qualities / human interaction surfaces and visual interaction of the ECG monitor could determine if the product is a commercial success or a failure. Figure 6.0a shows the shape of traditional ECG monitor; clearly it’s a square box.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord The first stage in manufacturing plastic is polymerisation. The two basic polymerisation methods are condensation and addition reactions. These methods may be carried out in various ways. In bulk polymerisation, the pure monomer alone is polymerised, generally either in gaseous or liquid phase, although a few solid-state polymerisation’s are also used. In solution polymerisation, an emulsion is formed and then coagulated.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord Compression moulding uses heat and pressure to shape plastics. The process is commonly used to mould thermosetting plastics. Injection moulding shoots molten plastic material under pressure into a mould. It is the most widely used method of moulding thermoplastics. Blow moulding produces hollow objects. It uses air or steam to expand a tube of molten resin, forcing the material against a mould’s walls.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord 7.0. ELECTRONIC / SOFTWARE DESIGN 7.1. Design Considerations Accuracy, dependability, and precision are an absolute must if the device were to be used for diagnostic, or other medical purposes. Any small fluctuation in the waveform generated could carry critical diagnostic value, thus it is extremely important that the clinician can confidently and fully rely on the equipment.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord 7.3. Digital Circuitry Figure 7.3a shows the circuit diagram; it is important to note that this is a first draft (prototype) designed to test the concept of an ECG monitor, this version is not a valid commercial medial product as it does not comply with all the relative medial standards, for example RS232 communications is not isolated (A isolated DC to DC converter could be used for this task) and the design has no noise immunity.
Thursday, 17 July 2003 S2 0 0 0 0 1 1 1 1 S1 0 0 1 1 0 0 1 1 S0 0 1 0 1 0 1 0 1 Baud Rate 115,200 bps 57,600 bps 38,400 bps 32,768 bps 19,200 bps 14,400 bps 9,600 bps 4,800 bps MiniProject: Design Aspects Colin K McCord The dip-switches are used to select RS232 baud rate, table shown on the left. The push button has three functions, if the user holds down the button during power up, it will put the ECG into test mode, e.g.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord comply with all the relative medial standards. This design is extremely simple, but the chosen amplifier is analogue devices AD624AD, this amplifier is an “Instrumentation amplifier” with a CMRR (Common Mode Rejection Ration) of 110dB and a gain of 1,000. Note the AD624AD chip is the most expensive chip in the design, costing £22.50 (retail price); hence perhaps a lower cost solution is possible.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord Figure 7.5a shows a simplified block diagram of the main routine, this routines first setups the ports (configure as input / output), sets the baud rate as specified by the DIP switches, and the ADC. Timer 2 is setup to interrupt the main routine 128-times a second, and then the main routine is stuck in a loop forever contentiously scanning through the array refreshing the CRT display. Figure 7.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord 8.0. CONCLUSIONS Clearly the heart’s strong pumping action is driven by powerful waves of electrical activity, which are detected by attaching electrodes to the skin. It is clear that these electrical signals are extremely small and must be amplified considerably (about 1000 times) to be of any use.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord commercial ECG monitors as the cheapest was £798 and it only had a printer for ECG output, no visual display, no PC communications, very basic. Clearly line balancing is very important, as this ensures that the production line is almost optimal, keeping production costs to a minimum. There are powerful software applications designed specially for this task, and there are many good manual methods that managers can use.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord 9.0. REFERENCES / BIBLIOGRAPHY Text Books [B1] The Essences of Microprocessor Engineering [B2] By Barry Ross Publisher: McGraw – Hill ISBN: 0-07-707818-7 UUJLIB:621.3815483ROS 1994 By Sid Katzen Publisher: Prentice Hall ISBN: 0-13-244708-8 1998 [B3] The Quintessential PIC Microcontroller Hands-On Guide to Oscilloscopes [B4] Microelectronic Circuits – Fourth Edition. By S. Sedra and Kenneth C.
Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord [W13] http://www.numed.co.uk/prices.html (Medial Equipment price list by Numed Cardiac Diagnostics © Numed 2001) [W14] http://physicianequipment.com/electrocardiographs.html (Online Medical Supply Store) [W15] http://www.microchip.com - Microchip Website (PIC datasheets and application notes).