July 2009 How to Create a Heart Rate Monitor and One-Lead EKG Low-cost, battery-operated system Jose Fernández Villaseñor, M.D. Medical Microcontroller Product Marketing TM Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. Worldwide Morbidity 2007 600 hypertension 32 Heart attack 15 Stroke Women Ischemic Heart Disease Men Cancer cardiovascular disease Worldwide Incidence 2007 million 0.5 Colorectal Lung 0.42 Breast 1.23 Colorectal 0.59 Lung 1.03 Prostate 0.73 Diabetes 171 0 100 200 300 400 500 600 700 Source: World Health Organization Statistics 2007 Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 2 Heart Rate Monitoring Technologies Early 20th Century Today Saline-filled bucket electrodes Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 3 Heart Physiology: Cardiac Conduction System Right atrium Atrioventricular node Sinoatrial node (pacemaker) Right Ventricle Purkinje fibers Atrioventricular bundle Purkinje fibers Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. Bundle branches TM 4 Heart Physiology: Origin of the Electrocardiogram Action Potentials SA Node Atrial Muscle AV Node Common Bundle Bundle Branches Purkinje Fibers Ventricular Muscle T 0.2 U QRS 0.4 0.6 Seconds Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 5 Heart Physiology: Electrocardiogram (ECG) ► Composite of all action potentials of nodal and myocardial cells detected, amplified and recorded by electrodes on arms, legs and chest Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 6 Heart Physiology: Electrical Activity of Myocardium 1) Atria begin to depolarize 2) Atria depolarize 3) Ventricles begin to depolarize at apex; atria repolarize 4) Ventricles depolarize 5) Ventricles begin to repolarize at apex 6) Ventricles repolarize Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 7 Acquiring Heart Signals: Typical Instrumentation System Sensor Takes the signal from the body Amplifier “Conditions” the signal from the sensor Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. A/D Converter Changes the signal into a digital format Controller Processes, displays and records the signal TM 8 Acquiring Heart Signals: Electrode-Skin Interface Offset sources: Ehe Electrode Cd - Electrode - Skin - Breathing Rd Rs Gel Ese Sweat glands and ducts EP Stratum Corneum Epidermis Ce Re CP RP Dermis and subcutaneous layer Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. Ru TM 9 Acquiring Heart Signals: OPAMP array for an INA Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 10 Acquiring Heart Signals: Common Mode Rejection Ratio (CMRR) • The CMRR defines the ability of the amplifier to reject signals that are common to both inputs • This is important for 60Hz rejection • CMRR is a function of gain • CMRR is frequency-dependent • Highest CMRR between 0-100 Hz Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 11 Acquiring Heart Signals: Connections to INA + m1+n EMG Signal _ Reference Electrode Electrically Unrelated Tissue (m1+n)-(m2+n) = m1-m2 m2+n Detection Electrode Muscle m is signal from muscle, n is noise Differential Amplification Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 12 Acquiring Heart Signals: Limb Leads Bipolar limb leads: I, II, III Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 13 Acquiring Heart Signals: Chest Leads ►Additional set of six leads, placed on the chest Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 14 Low-cost Heart Rate Monitor: Importance of Measuring Heart Rate Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 15 Low-cost Heart Rate Monitor: Market Solutions Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 16 Low-cost Heart Rate Monitor Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 17 1 to 12-Lead ECG Solution BKGD ECG USB Heart Rate JTAG MC9S08JM60CFGE SCI_1 MC56F8013VFAE SPI SPI USB ADC MAC Process ADC SCI_2 R Foot AvF Zero Drift Amp AvR AvL Bluetooth Tx/Rx INA on Chip (( )) D[1:6] Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 18 ►48MHz S08 or ColdFire® V1 ►24MHz bus frequency ►2.7 – 5.0V operating range The Flexis™ USB Family core S08JM60 and MCF51JM128 ►Memory ►S08 ►Up to 4KBytes SRAM; up to 60KB flash ►ColdFire V1 ►Up to 16KBytes SRAM; up to 128KB flash ►Features ►2x SCI, I2C, 2x SPI ►8 channel KBI ►16-bit timers: 1 x 2-ch, 1 x 6-ch ►12-bit 12 channel A-to-D converter ►Analog comparator ►Up to 51 general purpose I/O ►Multiple purpose clock generation ►PLL ►On-chip oscillator ►External crystal support ►Integrated CAN module (ColdFire V1 only) ►Cryptographic acceleration unit (ColdFire V1 ►Complete USB solution ►Integrated USB device (S08) S08JM60 Packages 64LQFP, 64QFP 48QFN, 44LQFP only) ColdFire JM128 Packages 80LQFP, 64LQFP, 64QFP, 44LQFP Temperature Range -40C to 85C or USB on-the-go (ColdFire V1) ►Complimentary USB software stack ►CodeWarrior® for Microcontrollers ►Processor Expert Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 19 Complete Solution Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 20 Complete Solution Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 21 Complete Solution Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 22 Low-cost Heart Rate Monitor Lab0. Get familiar with the HRM Connect the chest electrodes Like this! Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 23 Low-cost Heart Rate Monitor Lab0. Get familiar with the HRM Connect the board to the laptop (USB). 2. Make sure the buzzer is beeping at the same rate as your heart beats. 3. If your heart rate is greater than 100, the alarm indicator (red LED) will turn ON. 4. Go to the HRM_KA folder in the desktop and open the CodeWarrior project (HRM_KA.mcp). 1. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 24 Low-cost Heart Rate Monitor Lab0. Get familiar with the HRM 5. Download the code to the board (Connect the BDM to the closest header from the KA2) Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 25 Low-cost Heart Rate Monitor Lab0. Get familiar with the HRM 6. Go to Component Open Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 26 Low-cost Heart Rate Monitor Lab0. Get familiar with the HRM 7. Open the visualization tool Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 27 Low-cost Heart Rate Monitor Lab0. Get familiar with the HRM 7. Open the HRM.vtl file Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 28 Low-cost Heart Rate Monitor Lab0. Get familiar with the HRM 8. Run the code Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 29 Low-cost Heart Rate Monitor Lab0. Get familiar with the HRM 9. If you never reach the value of 100 to set the alarm, change the maximum value for the alarm in the code Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 30 Low-cost Heart Rate Monitor Lab1. Your ECG Signal in the Computer Open the JM60 GUI (the shortcut is on the desktop) Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 31 Low-cost Heart Rate Monitor Lab1. Your ECG Signal in the Computer Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 32 Low-cost Heart Rate Monitor Lab1. Your ECG Signal in the Computer Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 33 Low-cost Heart Rate Monitor Lab1. Your ECG Signal in the Computer Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 34 Low-cost Heart Rate Monitor Lab1. Your ECG Signal in the Computer Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 35 Freescale Introduces Product Longevity Program ► The embedded market needs long-term product support, which allows OEMs to provide assurance to their customers. ► Freescale has a longstanding track record of providing long-term production support for our products. ► Freescale is pleased to introduce a formal product longevity program for the market segments we serve. • • For the automotive and medical segments, Freescale will manufacture select devices for a minimum period of 15 years. For all other market segments in which Freescale participates, Freescale will manufacture select devices for a minimum period of 10 years. ►A list of applicable Freescale products is available at www.freescale.com. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 36 Q&A ► Thank you for attending this presentation. We’ll now take a few moments for the audience’s questions and then we’ll begin the question and answer session. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2009. TM 37 TM