International University, Vietnam National University – HCMC School of Biomedical Engineering DESIGN 2B FINAL PROJECT REPORT ECG Monitor Name: Instructor: Dr. Tran Le Giang TA1: Nguyen Quoc Hung TA2: Truong Quoc Viet Nguyễn Trung Sơn - BEBEIU20041 Dương Trung Kiên - BEBEIU20210 Huỳnh Nguyễn Minh Trí - BEBEIU20257 Semester: 2 - 2022 International University, Vietnam National University – HCMC | 2 Contents I. Introduction ............................................................................................................................ 2 1. Problem/Issue/Motivation ................................................................................................ 3 2. Objective + Initial requirements ........................................................................................ 4 3. Related Works .................................................................................................................... 4 4. Idea introduction ............................................................................................................... 5 II. Design specifications .............................................................................................................. 6 III. Materials & Methods ............................................................................................................ 6 1. Materials ............................................................................................................................ 6 2. Block diagram..................................................................................................................... 6 3. Electrical Wiring/Schematics ............................................................................................. 7 4. Mechanical Design ............................................................................................................. 8 5. Firmware & Software ......................................................................................................... 8 IV. Testing Methodology ............................................................................................................ 9 V. Results & Discussions........................................................................................................... 10 1. Result ............................................................................................................................... 10 2. Discussion......................................................................................................................... 10 VI. Cost analysis........................................................................................................................ 11 1. Cost of product ................................................................................................................ 11 2. Existing commercial products .......................................................................................... 11 VII. Conclusion & Limitation & Future works........................................................................... 12 VIII. Task Division and Timeline ............................................................................................... 13 IX. References .......................................................................................................................... 13 Figures Figure 1: WHO data ................................................................................................................... 3 Figure 2: Different components of a typical ECG signal [2] ..................................................... 4 Figure 3: IoT Based ECG Monitoring with AD8232 Sensor and ESP32 [3] ............................... 5 Figure 4: Block diagram ............................................................................................................. 6 Figure 5: Electrical schematic .................................................................................................... 7 Figure 6: 3D design and component ......................................................................................... 8 Figure 7: Data given by ECG simulator ..................................................................................... 9 Figure 8: Data given by human body ........................................................................................ 9 Figure 9: Final product (exterior) ............................................................................................ 10 Figure 10: Final product (interior) .......................................................................................... 10 International University, Vietnam National University – HCMC | 3 I. Introduction 1. Problem/Issue/Motivation World Health Organization (WHO) data stated that heart diseases cause about 31% of deaths in Vietnam. In Vietnam, devices used to monitor the heart’s activity or electrocardiogram (ECG) are mostly owned by big hospitals. Figure 1: WHO data According to newly released research by the Asia Pacific Observatory on Public Health Systems Policies, each main Public Health Center (PHC) has more than 6000 patients - which sometimes consists of no more than three rooms with extremely basic healthcare tools and setup. There is just one hospital bed per 1000 patients in each of these PHCs [1], indicating the country's suffering healthcare system's lack of infrastructure and facilities. Nonetheless, the country's battle to deal with fatalities and illnesses continues — noncommunicable disease mortality rates remain on the increase. Cardiovascular diseases (CVDs) account for more than 26% of all fatalities in 2010 [1]. Fast-paced lives, harmful activities, and poor dietary habits are all contributing to an increase in CVDs. Although CVD is relatively common – and is especially prevalent in rural areas - present healthcare systems are unable to meet the rising demand. Electrocardiogram (ECG) devices are a vital diagnostic tool used to detect a wide range of cardiovascular disorders. Typical ECG equipment gives a graphical picture of the activity and rhythm of the heart. It captures the electrical activity of the heart to generate an electrocardiograph, which when evaluated by a clinician may lead to an accurate diagnosis of a CVD. An ECG may be used to identify diseases such as arrhythmia, myocardial infarction, or tissue damage; it can also be used to monitor the effects of medicines on the heart, pacemaker performance, or post-operative conditions. Despite its significance and frequency of usage, the device's mobility and cost remained on the upper end of the affordability scale. Despite an increase in the number of patients suffering from cardiovascular disorders in developing nations, the cost of ECG equipment has remained expensive, and their mobility has been limited. The picture below depicts the phases of the cardiac blood pumping cycle and the accompanying ECG signal components for a typical ECG signal. International University, Vietnam National University – HCMC | 4 Figure 2: Different components of a typical ECG signal [2] 2. Objective + Initial requirements This project envisions a low-cost, portable ECG monitor that gains access to any device and platform with the same Wi-Fi connection to obtain the result over a local website. The entire system is comprised of an analog circuit and a processing unit. Bioelectric-potential sensors or the more well recognized AgCl electrodes are used to detect the signal from the body. An analog circuit retrieves and amplifies the signals received from the body to enable extra processing. Furthermore, a critical component of the processing unit is the ability for users to study the signal and facilitate more precise output signal filtering through the web. Since the product is portable, the power supply source should be compact. The electrical source should be provided by a mini-USB cable directly to the gate of the ESP32 microcontroller. Besides a rechargeable battery is also considered, the battery is charged by a Type-C USB cable which is one of the most ubiquitous types of cable these days. The design employed is functional, inexpensive, and simple enough that it may be readily replicated. Besides, the display module should be excluded to cut down on the overall cost since the result is obtained via a local website on any platforms or devices with the same internet connection. 3. Related Works • IoT Based ECG Monitoring with AD8232 Sensor and ESP32: [3] This is an IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32 using an online IoT platform called Ubidots, and through parameters like API Key or Token, the data is sent to the ECG graph to the cloud using MQTT Broker. The drawbacks of this interpretation are that the Ubidots platform data presented is not as smooth as our prototype, and it does not have a quick rate response and thus does not acquire the simultaneousness criteria. International University, Vietnam National University – HCMC | 5 Figure 3: IoT Based ECG Monitoring with AD8232 Sensor and ESP32 [3] • Blue ECG with Bluetooth feature integrated with smartphone: [4] The main components of the Blue ECG device can be split into three components: (1) Arduino UNO, (2) AD8232 set, and (3) HC-05 Bluetooth module. And the HC-05 Bluetooth module will send the cardiac data collected from amplified and filtered analog signals in Arduino to Bluetooth. The restriction in detection range due to the use of Bluetooth (about 10m) in this approach has proved to be a downside compared to our prototype, which can maintain a real-time measurement in a large area as long as a Wi-Fi connection remains. 4. Idea introduction In this project, our group will design and fabricate a low-cost portable ECG monitor. Our ECG monitoring system consists of interfacing the AD8232 ECG sensor with ESP32 to show the graph over a webserver. The overview of this method is connecting the AD8232 Sensor with ESP32 Wi-Fi and Bluetooth development board to get the ECG graph in real-time over a local website. Our main hardware components should be ESP32, ECG Module (AD8232), ECG electrodes, ECG electrode connector switch, and power supply (Lipo battery 3.7V). Since the Lipo battery is rechargeable, a charging board with 5V output should be considered. About the website, we intended to use the WebSocket protocol instead of other ways such as MQTT or HTTP. As a result, the coding parts consist of the embedded code and the website code. When it comes to the testing, we perform two trials as the reference data. The first case is with the ECG simulator. The second one is the human body with three limb electrodes applied as a form of Einthoven’s triangle. International University, Vietnam National University – HCMC | 6 II. Design specifications Weight 103 grams Size 55x67x50mm Power Lipo battery 3.7V Charging method Type-C USB gate Charging time Approximately 1 hour Table 1. Design specifications III. Materials & Methods 1. Materials No. Component Quantity Purchased locations 1. ESP32 1 epcb.vn 2. ECG module (AD8232) 1 epcb.vn 3. Lipo battery 3.7V 1 Hshop.vn 4. electrodes 3 epcb.vn 5 Type-C gate charging circuit 1 epcb.vn 6. Switch 1 Nhat Tao market Table 2: Material list 2. Block diagram Figure 4: Block diagram Our project includes three main parts: the microcontroller, the ECG module and a cover. The microcontroller: Powered by the Lipo battery, received ECG signal from the ECG module and transferred it into the local website. The ESP32 should be considered since we want our system to be compact and easy to deploy, also the result is displayed on a local International University, Vietnam National University – HCMC | 7 website so the ESP32 is a good choice with faster Wi-Fi compared to other microcontrollers such as ESP8266. The ECG module: The AD8232 receives the signal and amplifies it so the ECG result could be obtained and the module also lightweight and compact. However, the AD8232 does not consist of a signal filter. The Cover: The light, small and compact cover, made by 3D printing. We intended to use PLA plastic as the material for the cover. Although 3D printing may be quite expensive, with the modest design, the cost for the cover is affordable (90k), which meets our initial requirement: cheap 3. Electrical Wiring/Schematics Figure 5: Electrical schematic • • Board label Pin function ESP32 Connection GND Ground GND 3.3V 3.3V Power Supply 3.3V OUTPUT Output Signal A0 +5V (charging board) Voltage supply VIN -5V (charging board) Voltage supply GND Charging and power supply: For the power supply, the +5V and -5V pin of the charging board are connected to the ESP32 at the VIN pin and GND pin, respectively. The charging board also connected with the Lipo 3.7V battery, with the BAT+ pin is connected to positive wire of the battery and the BAT – pin linked to the negative one that makes the battery become chargeable. Receiving and transmitting ECG signal: There are three pins of the ECG module that need connecting to work properly. Firstly, the GND of the ECG module is the ground and is connected to the GND pin of the ESP 32. Secondly, the 3.3V pin of ECG module is where it receives power, which is supplied from the ESP 32. Finally, the OUTPUT pin, which is in charge of transmitting ECG signal to the ESP, is linked to the A0 pin. International University, Vietnam National University – HCMC | 8 4. Mechanical Design Figure 6: 3D design and component Component Lid ESP32 AD8232 Cover Function Provide a canopy for the cover and shelter the components inside With delicate positioning on the inner side face of the cover to ensure compactness and efficiency, it interfaces AD8232 sensor to show the graph on the local webserver ECG module to record the ECG signal Small, light cover to ensure the compacity of the device Type-C gate charging circuit Makes the Lipo battery become chargeable Battery holder Since the Lipo battery is hot when charging, the battery holder separates it from other components. Switch Turn on/off the prototype Table 3: Mechanical design description 5. Firmware & Software In this project, the WebSocket protocol is implemented instead of other protocols such as HTTP or MQTT. It is because when you require frequent two-way communication between devices, the WebSocket protocol is an excellent alternative to HTTP. When two devices interact using WebSocket, a network connection is maintained between them, allowing for the efficient transmission of short messages such as delivering a sensor reading or an order to switch on a light. Only the client may make a request with HTTP, and the server always answers. WebSocket, on the other hand, is a peer-to-peer protocol that allows both devices to send and receive messages. It's often a suitable option for IoT items that need to deliver a large number of tiny messages. However, since it maintains a connection between two devices, it often consumes more memory than HTTP. As a result, when applying the International University, Vietnam National University – HCMC | 9 WebSocket, the local website does not require refreshment by pressing F5 to obtain the new data as the data is automatically updated. IV. Testing Methodology The prototype's weight is measured via a balance after the prototype is completed. We measure the size of the cover and the lid by adjusting the size parameters while designing in Fusion 360. The working distance of the prototype is tested and estimated through various practical measurements. In addition, the accuracy of the prototype is assessed over trials of code implementation and webserver observation. When continuous operation, the battery could last long, approximately 9 to 14 hours. • First case: Data given by the ECG simulator Figure 7: Data given by ECG simulator • Second case: electrodes placed on right and left upper chest at the Pectoralis Major area and left hip (Einthoven’s triangle). Figure 8: Data given by human body International University, Vietnam National University – HCMC | 10 V. Results & Discussions 1. Result Figure 9: Final product (exterior) Via Blynk Figure 10: Final product (interior) Via Webserver At first, we intended to use the Blynk application to display our results. However, the Chart function in Blynk is not designed for the analog signal such as the ECG signal since with a 40Hz or higher signal, the Blynk server will be flooded. Developing a web server is a good alternative as the graph settings could be adjusted, such as max data points, so everything is under control. 2. Discussion Trial with ECG Simulator as reference data, showing a healthy heart wave (Normal Sinus Rhythm). The frequency of heartbeats within 60 seconds time period. A healthy heart rate is 60 - 100 BPM while in a resting state. All the components of the signal PQRST are available and easily distinguishable. However, it is still noisy due to the DC power supply. Since the DC supply is not pure, which might have a frequency of 1.2 Hz represents the noise. Trial with the human body as the reference data, the subjects do not have any unhealthy heart conditions. The hardest hurdle was to eliminate the external noises during the implementation process. Besides the power supply noise, there are also several types of other noise signals, such as baseline wander (caused due to improper electrodes (electrode- International University, Vietnam National University – HCMC | 11 skin impedance), patient’s movement and breathing (respiration). The frequency content of the baseline wander is in the range of 0.5 Hz); muscle noise (50/60 Hz interference), Electrode Motion Artifacts (occur mainly in the range from 1 to 10 Hz). Noises occur since the hardware does not contain a high-pass filtering option, which is a limitation of the AD8232. VI. Cost analysis 1. Cost of product At the beginning of the project, we intended to use 18650 batteries as the power supply for our device. However, we switched to the Lipo battery 3.7V 500mAh as it is more efficient and smaller than the 18650 one, but the Lipo battery’s cost is higher. As a result, we could possess a product that is as compact as possible, and the price does not change much since the exterior design’s cost is reduced because of the compactness of the Lipo battery. The Lipo battery is rechargeable, so it has to be attached to a charging board, but 3.7V is not enough to supply the ESP32 microcontroller, so the charging board ought to have a 5V output that acts as the input voltage for the ESP32. Instead of using the TP4056 lithium battery charge controller and a booster circuit, applying the 5V output charging board is less complex and cheaper. The table below (Table) shows all the materials and their prices in our final product, which gives the cost of approximately 500,000 VND in total. Item Unit Required Unit Price Total ESP 32 1 180k 180k AD8232 1 150k 150k Type-C charger board 1 20k 20k Switch 1 1k 1k Lipo battery 3.7V 1 35k 35k Exterior design 1 90k 90k Total 476k Table 4: List of materials used and total cost of the final product 2. Existing commercial products Nihon Kohden Model Cyka Blyat Spandan 4.0 Portable ECG 2150 12-lead ECG device Portable ECG machine • The machine has a • Allows instant heart • Fast in setting up monochrome liquid monitoring • Users may find it crystal display with a • Comes with intelligent friendly and easy to 4.8-inch-wide back Advantages ECG technology use light designed to help • Advanced prediction • Low cost observe 12 ECG leads of heart defects • Fast charging time Features International University, Vietnam National University – HCMC | 12 at the same time easily • Classifies 12 different abnormal conditions • Monitor the ECG • Advanced graphic before recording, representation helping to reduce the • Works fast and need to repeat the efficiently recording process • Expensive • Limit the number of connected devices • Connecting to LAN is Limitations Cost Mass • Only for Android complicated and smartphones requires well-trained physicians to perform • Need a power plug to use VND 35.000.000 (USD1500) 1700g • Results could be obtained on any devices with Wi-Fi connection • Not really high resolution • Do not give prediction of heart defects • Do not save data or record VND 2.400.000 (USD103) 200g VND 476k (USD 22) 103g Currently, ECG equipment costs about VND 35.000.000 (USD 1500) for each item, which might be too expensive for most people in the underdeveloped world. As a result, the majority of the components employed in this design are low-cost yet effective. As a consequence, the prototype could be kept around VND 500 (USD 22), making it not only incredibly helpful but also simply accessible to anyone. VII. Conclusion & Limitation & Future works The device has proved to be compact, and it holds an instant rate of cardiac data transferred as a graph on the webserver, which yields the advantage of real-time measurement. Our prototype also possesses a humble production cost and can thus be sold at under 1 million VND (USD 44) for 50% profit. However, there are still some trivial signaling noises since we have not applied the additional filtering options, and the device does not save data for individuals. • • • • Applying hardware filtering options and using computational signal processing to obtain the best output for the ECG signal. The result is displayed via the internet. Data could be saved and printed out; auto-heartrate detection. Applying Machine Learning and Deep Learning to diagnosing cardiovascular diseases such as myocardial infraction Compared with other commercial products, our device shows the advantages of being compact, lightweight, easy to use, and also still gives quite distinguishable magnification and resolution that can illuminate the intervals. Its cost is much cheaper than almost all other ECG machines on the market. However, the resolution should be improved for better results as the signal is still noisy. International University, Vietnam National University – HCMC | 13 A decent and portable ECG monitor, in our opinion, is one that can be readily transported and utilized to deliver or permit fast diagnosis during an emergency. Although direct product comparison is outside the scope of this study, the quality of the T and QRS complicated graph form it creates is noticeably better than before. The ECG machine presented here would be a first step in developing a low-cost, low-maintenance healthcare module that can be quickly copied to offer service in distant places, during catastrophes, or in emergencies. VIII. Task Division and Timeline IX. References [1] Chong K.L, Holden D & Olin T, " Analogue Electronics: Heart Monitor " in IEEEXplore www.ieee.com. Retrieved March, 18, 2018. [2] PrepGenie, The graphical representation of the electrocardiogram. 2017. Available: https://prepgenie.com.au/gamsat/importance-ofgraphs-and-data-tables-in-gamsat-biologyquestions/. [Accessed: 12-Mar-2018]. [3] Admin, IoT Based ECG Monitoring with AD8232 Sensor and ESP32. 2020. Available: https://how2electronics.com/iot-ecg-monitoring-ad8232-sensoresp32/?fbclid=IwAR3qXk5YbVEcyC6YF44BD-TeT71vBR2l-9q2UBYIowinU9c474G-27dRDtU. [Accessed: 17-May-2020]. [4] William Jerrel Iskandar, Ibnu Roihan, and Raldi Artono Koestoer , "Blue electrocardiogram (ECG): ECG with bluetooth feature integrated with smartphone", AIP Conference Proceedings 2344, 050003 (2021) https://doi.org/10.1063/5.0047431 International University, Vietnam National University – HCMC | 14 DESIGN 2B FINAL REPORT RUBRIC No. Items Max pts 1 Problem & Related works 2 Objective & Initial requirements 5 (ABET) 3 Design specifications 10 (ABET) 4 Block diagram 10 5 Materials 5 6 Electrical Schematic 10 7 Mechanical Design 10 8 Firmware & Software 10 9 Testing 10 10 Cost analysis 5 11 Conclusion & Limitation & Future works 10 12 Task division & timeline Total 10 5 (ABET) 100