1. Trang chủ
  2. » Luận Văn - Báo Cáo

Design of a gel card reader for blood grouping tests

80 3 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 80
Dung lượng 3,37 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Schematic of noise filter and primary voltage rectifier circuit ...20 Figure 3.. The result after image cutting in Gel Card Reader ...31 Figure 3.. Flowchart of blood type determination

Trang 1

x

TABLE OF CONTENTS

Cover i

Mission ii

Schedule iii

Guarante ix

Acknowledgments ixi

Table of contents ixii

List of figures x

List of tables xii

Abstract xiiii

Chapter 1 INTRODUCTION 1

1.1 PROBLEM STATEMENT 1

1.2 OBJECTIVE 2

1.3 THESIS CONTENTS 2

1.4 LIMITATIONS 2

1.5 BRIEF SUMMARY OF THESIS 2

Chapter 2 LITERATURE REVIEW 4

2.1 TYPES OF HUMAN BLOOD 4

2.2 GEL CARD METHOD AND TYPE OF GEL CARDS 5

2.2.1 Gel Card method 5

2.2.2 Type of Gel Cards 6

2.3 IMAGE PROCESSING ALGORITHM .8

2.3.1 Dilation method 8

2.3.2 Edge detection method 8

2.4 IMAGE CAPTURING DEVICES 9

2.4.1 Microprocessor introduction 9

2.4.2 Description of power supply 12

Chapter 3 DESIGN AND CALCULATION 13

3.1 INTRODUCTION 13

3.2 CALCULATION AND DESIGN 13

3.2.1 Block Diagram Of An Capturing Device 13

3.2.2 Image Capturing Device 14

Trang 2

viii

3.2.3 Central Processing Unit 14

3.2.4 Image Display and Peripherals 15

3.2.5 Calculation of Power Supply 15

3.2.6 Case designs for the Gel Card Reader 25

3.3 DEVICE CONNECTION 27

3.4 FLOWCHART AND PROGRAM ALGORITHM 28

3.4.1 Functional summary of Gel Card Reader 28

3.4.2 Flowchart 28

3.4.3 A flowchart of agglutination level and blood type 29

3.5 PRINCIPLE OF OPERATION 36

Chapter 4 CONNECTION OF SYSYTEM PARTS 37

4.1 INTRODUCTION 37

4.2 POWER SUPPLY 37

4.2.1 Assembly of the Power Supply 37

4.2.2 Execution of The Power Supply 37

4.2.3 Inspection of The Power Supply 40

4.3 EXECUTION THE CASE OF GEL CARD READER 41

4.4 SYSTEM CONSTRUCTION 41

4.4.1 User Interfere Design 41

4.4.2 Model Construction 42

4.5 PROGRAMMING SOFTWARE 42

4.5.1 Python Programming Software 42

4.5.2 Image processing program 43

4.5.3 QT Designer 44

Chapter 5 RESULTS AND DISCUSSION 46

5.1 GENERAL RESULTS 46

5.2 ACHIEVEMENT RESULTS 46

5.2.1 Power Supply 46

5.2.2 GUI 49

5.2.3 System modelling result 50

5.2.4 Test results 50

5.2.5 Result of Gel Card Reader 51

5.2.6 Actual Results 54

5.3 INSTRUCTION 55

Trang 3

ix

5.4 DISCUSSIONS 56

5.4.1 Advantages 56

5.4.2 Disadvantages 56

Chapter 6 FUTURE WORKS AND CONCLUSION 57

6.1 CONCLUSION 57

6.2 FUTURE WORKS 57

REFERENCES

APPENDIX

Trang 4

x

LIST OF FIGURES

Figure 2 1 The ABO blood grouping system (Source: Wikipedia) 4

Figure 2 2 Gel Card and parts inside the Gel Card tube 5

Figure 2 3 Interpretation of results 6

Figure 2 4 Sample of Forward grouping Gel Card 7

Figure 2 5 Dilation in image processing (Source: www.cs.auckland.nz) 8

Figure 2 6 Raspberry Pi 4B (Source: www.deskmodder.de) 11

Figure 3 1 Block diagram of the system 13

Figure 3 2 Webcam Hoco D101 14

Figure 3 3 Block diagram of the switching power supply 16

Figure 3 4 Schematic of noise filter and primary voltage rectifier circuit 20

Figure 3 5 Schematic of pulse generator circuit 22

Figure 3 6 Schematic of secondary voltage rectifier circuit 23

Figure 3 7 Schematic of secondary voltage feedback circuit 24

Figure 3 8 Schematic of switching power supply circuit 25

Figure 3 9 Frontside (a) and backside (b) of the base holder 26

Figure 3 10 The frontside (a) and backside (b) of the Gel Card Reader case 27

Figure 3 11 The connection of the entire project Interpret connection diagrams 27

Figure 3 12 Flowchart of Gel Card Reader system 29

Figure 3 13 A flowchart of agglutination level and blood type 30

Figure 3 14 Image area is cropped in Gel Card (red border) 31

Figure 3 15 The result after image cutting in Gel Card Reader 31

Figure 3 16 RGB to HSV diagram 32

Figure 3 17 Results after converted image from RGB to HSV 32

Figure 3 18 The selectable color threshold for filtering 32

Figure 3 19 Image after processed with threshold 33

Figure 3 20 Determine binary image area and draw contour .34

Figure 3 21 The value belong x and y axis of center point in binary image 34

Figure 3 22 Flowchart of blood type determination in Gel Card Reader 35

Figure 4 1 The top side (a) and bottom side (b) of PCB 39

Figure 4 2 The 5 Volt switching power supply 39

Trang 5

xi

Figure 4 3 The inspection output voltage of power supply board 40

Figure 4 4 Base holder (a) and case (b) of Gel Card Reader 41

Figure 4 5 Graphic User Interface of Gel Card Reader 42

Figure 4 6 PyCharm IDE for python programming 43

Figure 4 7 Gel Card GUI is built on QT Designer 45

Figure 5 1 Input, output jacks of the switching power supply .47

Figure 5 2 Measure output voltage when the load is connected .48

Figure 5 3 GUI of a Gel Card Reader 49

Figure 5 4 Gel Card Reader system 50

Figure 5 5 Sample is put into Gel Card Reader 51

Figure 5 6 The Result interpretation 52

Figure 5 7 Wrong Gel Card recognition 52

Figure 5 8 The result interpretation (Sample 1: O- ; Sample 2: B+) 53

Figure 5 9 The result interpretation (Sample 1: A+ ; Sample 2: B-) 53

Figure 5 10 DG Reader of GRIFOLS 54

Figure 5 11 Gel Card Reader and GRIFOLS’s DG Reader Comparison 55

Trang 6

xii

LIST OF TABLES

Table 2 1 Raspberry Pi all generations comparison .11

Table 3 1 The consumption power of the circuit 15

Table 3 2 Electronic component of the input filter and rectifier circuit 20

Table 3 3 Electronic component of pulse generating circuit 21

Table 3 4 Electronic component of secondary voltage rectifier circuit 23

Table 3 5 Electronic component of secondary voltage feedback circuits 24

Table 4 1 Electronic component of the switching power supply board 37

Table 5 1 Outputs/Inputs voltage of power supply testing 48

Table 5 2 The Accuracy and Efficiency of Gel Card Reader ……….…54

Trang 7

xiii

ABSTRACT

Subject "Design of a Gel Card Reader for blood grouping tests." will have the function of reading Gel Card in the blood group test, identifying faulty Card and managing patient information Here use a unique feature, agglutination of the gel columns, to calculate the results Results of the project have identified Gel Card in different blood types and have high accuracy First, the Gel Card image will be captured by the camera after manipulating the user interface The data is then transferred to the Raspberry Pi 4B for image processing for input processing and result computation The results will be displayed on the user interface Also, the system has the function of saving results to manage patient information

Trang 8

In the last century, the blood grouping test consisted of two main methods: testing on enamel slabs and in vitro These methods have the advantage of being simple, easy to manipulate, cheap in price but have the disadvantage of easy technical errors and confusion in administrative procedures, depending on the user's skills and qualifications In 1988, Dr Yves Lapierre developed Gel technology in blood grouping to minimize the problems occurring compared with the old method The Gel Card is considered the most popular form to be the most effective in blood grouping in hospitals, clinics and laboratories [2]

A Gel Card Reader was invented and used to determine the blood grouping Currently, hospitals in Vietnam and around the world are using this device However,

A Gel Card Reader presently is distributed in Vietnam is not less than 5000 USD Therefore, the idea of researching and manufacturing a Gel Card Reader with a similar blood group determination function but with a much lower price will significantly contribute to the field of medical tests For the above reasons, the group decided to implement the graduation thesis “Design of a Gel Card Reader for blood

grouping tests.” The Gel Card Reader uses a camera to take pictures of the Gel Card

containing the treated blood The camera will send a Gel Card image to a central

Trang 9

processing unit The central processor will use an image processing algorithm programmed to process the Gel Card image and produce the defined blood group results

1.2 OBJECTIVE

This project aims to create a system that can read the Gel Card for classifying blood group In particular, this system consists of a Raspberry Pi 4B, a camera, a screen and algorithms of image processing

1.3 THESIS CONTENTS

● CONTENT 1: Research on blood group system, Gel Card method

● CONTENT 2: Research the functions of Gel Card Reader

● CONTENT 3: Design flowchart, write the code for image processing

● CONTENT 4: Designing a power supply for Gel Card Reader

● CONTENT 5: Designing a case for Gel Card Reader

● CONTENT 6: Design a graphical user interface (GUI) for the system

● CONTENT 7: Execute the system, evaluate the results, compare with similar equipment, re-evaluate the advantages and disadvantages

● CONTENT 8: Write a thesis report

1.4 LIMITATIONS

● No results will be saved in the event of a power failure

● Card Reader only reads with popular Cel Cards as Forward, Forward and Reverse, CrossMatch, Coombs

● The instrument does not recognize the type of Gel Cards through the barc1.5

BRIEF SUMMARY OF THESIS

Chapter 1: Introduction

This chapter shows the Gel Card method's importance, point out the topic's limitations, goals, and make lists

Chapter 2: Materials and methods

This chapter describes the theoretical basis of “Design of a Gel Card Reader for blood grouping tests” and the model's working principle

Chapter 3: Design and Calculation

Trang 10

This chapter presents to choose the components and learn how to connect them, and suggest the system's design method

Chapter 4: Connection of system parts

This chapter shows how the system is executed and applied to the image processing method

Chapter 5: Result and discussion

This chapter discusses the results achieved after completing the system, commenting on the results achieved

Chapter 6: Conclusion and future works

This chapter shows the conclusion about the things that we complete, not complete and some drawbacks Present the plan of the topic in the future

Trang 11

Chapter 2 LITERATURE REVIEW

In this chapter, an overview of theories related to the Gel Card Reader implementation is presented

2.1 TYPES OF HUMAN BLOOD

Blood in humans is divided into 4 main parts: Red blood cells, white blood cells, plasma and platelets Red blood cells are the main basis in blood type determination ABO blood type system is the main blood type system that helps people identify blood types such as A, B, AB, O

Blood types are classified based on the presence or absence of a particular antigen An antigen is a foreign substance that induces an immune response in the body alone or after complex formation with larger molecules When A antigens are present on red blood cells, a person is said to have blood type A A person with B antigens on red blood cells is considered blood type B When both A and B antigens are all present on red blood cells, the person's blood type is classified as AB In the absence of antigens, A and B, the person is said to have Blood Type O

Figure 2 1 The ABO blood grouping system (Source: Wikipedia)

This is called a basic grouping system and can be classified into eight groups when considering the Rhesus factor or the ‘Rh 'factor The name Rhesus is derived from the Rhesus monkey, where the antigen was first found If Rhesus D factor is

Trang 12

found in the blood, then the person is considered Rhesus positive, and for people without Rhesus D factor, they are said to be Rhesus negative So when people are classified under both systems, they are said to have either AB blood type or negative

O blood type

The Rhesus factor plays an important role during pregnancy because the infant's life can be in danger if the baby inherits Rhesus positive from the father, while the mother's blood is Rhesus negative This will cause the mother's body to form antibodies against the child's blood

2.2 GEL CARD METHOD AND TYPE OF GEL CARDS

2.2.1 Gel Card method

In Gel Technology, the reaction is performed in a specially designed plastic card called the Gel Card This plastic card consists of six or eight micro tubes These microtubules are pre-filled with the corresponding gel and reagent (Anti A, Anti B, Anti D, AHG) depending on the card parameter Gel plates are used for different sizes and act together as a sieve that only a single normal red blood cell can pass through and show negative The agglomerated erythrocytes are trapped in the gel column The gel and gel particle size will determine the sensitivity of the system

Figure 2 2 Gel Card and parts inside the Gel Card tube

A red blood cell suspension was prepared using LISS (Low Ion Strength Solution), red blood cell suspension, and serum / plasma added to the reaction chamber of the microtubules Then the gel tag is incubated and the antigen antigen reaction takes place in the reaction chamber After incubation, the Gel Card was centrifuged for 10 minutes (Force 85g) Under these controlled conditions when the

Trang 13

card is centrifuged, only a single normal RBC can pass through the gel and settle to the bottom of the microtubule to form a knot The reacted or agglomerated cells are retained either on the gel column or in the gel column, their position in the gel will depend on the size of the agglutination and thus facilitate the classification of the reaction

Figure 2 3 Interpretation of results

4 + RBCs are agglutinated at the top of the gel column

3 + Most of the agglutination erythrocytes remain in the upper half of the gel

2.2.2 Type of Gel Cards

a) Forward grouping Gel Card

Forward grouping Gel Card has 8 micro tubes, each test uses 4 tubes A, B, D and Ctrl Tube A contains antibodies A, tube B contains antibodies B, tube D contains antibodies D, tube Ctrl is a neutral environment Figure 2.4 has shown below is an example of the Forward card

Suppose a patient has blood type A, that is, their blood has A antigens and B antibodies, after diluting the patient's erythrocyte solution and LISS solution, inject

Trang 14

the upper suspension into 3 tubes of ABD Then into a centrifuge at 880 rpm for 10 minutes, the results will be displayed on the Gel Card as follows:

 Column A contains antibodies A, so the patient's A antigen will be retained by antibody A and not pulled down by centrifugal force The result will be positive

 Column B contains antibody B, so the patient's A antigen will not be retained

by antibody A The results will be negative

 Column D is used to determine the blood group system of patients with Rh + or Rh- systems, if there is a positive agglutination present, Rh + patients, if negative, Rh- patients

 Ctrl column to check the quality of Gel Card, if the value shown in that column

is a negative value, it shows that Gel Card is still available, otherwise, Gel Card

Trang 15

2.3 IMAGE PROCESSING ALGORITHM.

2.3.1 Dilation method

The expansion operation is defined as A⊕B = ⋃Bx where x⊂A where A is an object in the image, B is an image element structure This calculation works to make the original thing in the image increase in size (expand) The image structure element (image structuring element) is a predefined cube that interacts with the image to see

if it is available Some common element structures are squares and cross-shaped facilities

Figure 2 5 Dilation in image processing (Source: www.cs.auckland.nz)

In some practical applications, the image expansion algorithm is used in product classification, detecting license plates, in the graduation project of Phan Thanh Phong, Nguyen Hien Minh with the topic "ỨNG DỤNG XỬ LÝ ẢNH TRONG HỆ THỐNG PHÂN LOẠI SẢN PHẨM " [3] using image expansion to clarify objects to increase accuracy in classifying or in the graduation project of Vo Danh Quan, Nguyen Minh Hao with the topic "ĐẾM SỐ LƯỢNG VIÊN THUỐC CÓ TRONG

VỈ THUỐC" [4] also use expansion math to clarify the image of the pill so that the microcontroller can handle it

2.3.2 Edge detection method

Canny Edge Detection is an algorithm used to extract edges from images

Trang 16

The algorithm has four stages:

First - Performs noise reduction with a Gaussian Blur

Second - Gets the gradient direction and magnitude with a Sobel kernel

Third - Applies non-maximum suppression, which removes unwanted pixels

that are not part of a contour

Fourth — Applies the Hysteresis Thresholding that uses min and max values to

filter the contours by the intensity gradient [5]

In practical applications, edge detection is used in object detection and recognition In Nguyen Thanh Huy's master's thesis, University of Da Nang, the topic

“ỨNG DỤNG PHƯƠNG PHÁP PHÁT HIỆN BIÊN TRONG NHẬN DẠNG CÁC ĐỐI TƯỢNG HÌNH HỌC [6].” Uses an edge detection method to detect objects

2.4 IMAGE CAPTURING DEVICES

One of the most important parts of the subject is the image capturing device, as they take primary responsibility for capturing images, the use of a large-resolution camera (1920x1080) along with having to capture close-up is not a small problem

We decided to use the HOCO DI01 webcam as an image recognition camera because

of its good price, high resolution, ease of use The webcam is connected to the control via a USB port The use of cameras in image processing has become prevalent from product counting and classification systems, face recognition, and license plate detection

micro-2.4.1 Microprocessor introduction

The use of microcontrollers in embedded programming is not too unfamiliar, from lines like microcontrollers PIC16F887, STM32, Arduino, Intel Galileo, Raspberry Pi Each type will have its own characteristics suitable for the purpose of use In image processing, Raspberry Pi is popularly used because its configuration far exceeds other types of microcontrollers, from simple applications like product color checking, license plate detection to complex applications like facial recognition, machine learning

The Raspberry Pi is a microcontroller that is widely used in real-world applications Specifically, the graduation project of Nguyen Phuc Bao, Nguyen Le

Trang 17

Gia Bach, HCMUTE with the topic "DESIGN OF AN IMAGE ACQUISITION SYSTEM FOR THE DETECTION OF OCCLUSAL DENTAL PROBLEMS [7]." Also using a Raspberry Pi 3B as a microcontroller or in the graduation project of Le Hoang Thanh, Ho Dinh Vuong, HCMUTE, with the topic "THIẾT KẾ VÀ THI CÔNG HỆ THỐNG BẢO MẬT ỨNG DỤNG XỬ LÝ ẢNH [8] " There is also use

of the Raspberry Pi 3B as a microcontroller

Launched in 2019, Raspberry Pi 4B is one of the most powerful embedded computers with 3 times more power than the Pi 3B, in addition, the Pi 4B also offers RAM options like 2Gb, 4Gb, 8Gb The use of raspberry Pi 4B in image processing is

no longer something too strange Compared to other embedded kits such as Arduino, Intel Galileo, NVidia Jetson Nano the Raspberry is considered the most efficient embedded Kit, in the Pi 4B version there has been a significant upgrade of RAM, as the team's image processing algorithm uses a python programming language, so it requires a micro-control that can run the language as well as have sufficient power to perform the necessary image processing operations , with the goal of this topic to create a compact Gel Card Reader, the Raspberry is considered the most suitable micro-control

Trang 18

Figure 2 6 Raspberry Pi 4B (Source: www.deskmodder.de)

Table 2 1 Raspberry Pi all generations comparison

Trang 19

RAM 1GB , 2GB,

4GB LPDDR4

512MB DDR2

1GB DDR2

512MB DDR2

512 MB

Power ratings 1.4A @5V 1.13A

@5V

1.34A

@5V

2.4.2 Description of power supply

The switching power supply has replaced the transistor linear power supply for more than 30 years The advantages over the linear power supply include compact and light size, higher efficiency, less heat, better tuning, large input voltage amplitude, and low price With those advantages, the switching power supply was used in household electrical appliances, industrial electrical equipment, and electronic medical devices [9] The linear source using the 220VAC low-voltage transformer and using the IC 7805 to stabilize the output voltage, this type of power supply only has approximately 40% efficiency In comparison, the switching power supply is equivalent to over 70% efficiency Further, the central processing unit (Raspberry) required the power supply to be stable and safe to operate in along time The switching power supply 5V was decided to execute for the system

Trang 20

Chapter 3 DESIGN AND CALCULATION

3.1 INTRODUCTION

In this chapter, the design calculations and selection of components for Gel Card Reader include power circuit, image capturing device, device cover, and how to connect the components together

3.2 CALCULATION AND DESIGN

3.2.1 Block Diagram Of An Capturing Device

Figure 3 1 Block diagram of the system

Figure 3.1 shows the block diagram of the system In detail, the Power Supply

is designed to power 5VDC for the Central Processing Unit, the Light Environment and the Cooling Fan The Light Environment consists of 1 small led bar that illuminates the Gel Card so that the camera can capture clearly and send data to The

Trang 21

Central Processing Unit Then, the Central Processing Unit with a Raspberry will process the input image data by some image processing method Next, the Cooling Fan will dissipate heat for the power block and the processor block while operating The Peripheral Devices such as a keyboard, mouse, used to operate the system and input the patient’s data Finally, the blood group results will be displayed on the screen

3.2.2 Image Capturing Device

In the topic, the system uses the Hoco D101 webcam because it is cheap (about

$ 15) but with good quality Video quality is bright and clear, with up to Full HD resolution, good refresh rate and virtually no stutter even in low-light environments

Figure 3 2 Webcam Hoco D101

Image capturing device has 4 pins, including: GND, 5V DC, DATA+, DATA- The camera has a built-in ADC converter and offers 2 outputs: DATA + and DATA-

3.2.3 Central Processing Unit

The function of Raspberry Pi 4B is to receive images obtained from the camera, then process the images, output the results and display them on the user interface, in addition, the Pi 4B is also connected to the 5V 5A power circuit USB Type C port, micro HDMI output connected to 14 inch LCD screen Raspberry Pi 4B is the latest model produced in 2019 and also the version with the most powerful configuration Better means better processing speed, in order to maximize the number of samples measured in 1 hour

Trang 22

3.2.4 Image Display and Peripherals

For the purpose of using the Raspberry Pi 4B as a computer, it is necessary to connect monitors and peripherals for the user to manipulate and observe easily Here the group uses Samsung's LCD screen with a size of 13 inches with HD resolution

HD resolution is the best resolution for the Raspberry because it does not affect the device's performance and processing speed

3.2.5 Calculation of Power Supply

a) Calculation of Power Requirement

Table 3 1 The consumption power of the circuit

The sum of consumption power is described in the formula (3.1):

P = ΣP = P1 + P2 + P3 + P4 = U1.I1 + U2.I2 + U3.I3 + U4.I4 (3.1) = 5.1,4 + 5.0,9 + 5.0,2 + 5.0,24 ≈ 13,7 (W)

Where:

P1 = consumption power of Raspberry mainboard

P2 = consumption power of Webcam USB

P3 = consumption power of DC Fan

P4 = consumption power of Led bar

Trang 23

This is a minimum of power that our project requires As a result, we decided to make

a switching power supply 5V-5A (25W)

b) Circuit Composition of Switching Power Supply

The block diagram of most switching power supplies is shown in Figure 3.3

Figure 3 3 Block diagram of the switching power supply

First, AC input voltage is rectified and filtered into DC voltage The power transistor is controlled by a high-frequency PWM (pulse width modulation) signal or another transistor, and applies DC to the primary of the switching transformer The secondary of the switching transformer induces a high-frequency voltage, which supplies to the load through rectification and filtering The output part feeds back to the control circuit through a certain circuit to control the PWM duty ratio to achieve stable output To facilitate the calculation and design process, the switching power circuit is divided into smaller component circuits to analysis

Power supply parameter calculation

• Total output power is calculated as the formula (3.2):

• Power supply input with an efficiency of 75% is calculated as the formula (3.3):

Pi = Po / n = 25 / 0.75 = 33W (3.3) Where:

Trang 24

Pi = power of input

Po = power of output

n = efficiency of input power supply

• DC voltage input after rectifier is calculated as the formula (3.4):

V2 = V1 * √2 = 220 *√2 = 311 (V) (3.4) Where:

• Primary inductance is calculated as the formula (3.7):

Lpri = (V1 * Dmax) / (Ipk * f) = (220 * 0.45) / (0.625 * 300000) = 528 (uH) (3.7) Where:

Dmax = maximum duty cycle when flyback circuit is in interrupt mode, choose Dmax = 0.45

f = switching frequency

• Number of primary winding is calculated as the formula (3.8):

Npri = √(𝐿𝑝𝑟𝑖/ 𝐴𝐿) = √(528 ∗ 1000/360)= 38 (winding) (3.8)

Trang 25

Ipri-rms = Ipk * √(𝐷𝑚𝑎𝑥 / 3) = 0.625 * √(0.45 / 3) = 0.24 (A) (3.9) The switching transistor use a 0.7mm winding for the primary coil, this wire has a cross-section of S = 0.384 (mm2), taking the current density on the plain wire J = 5A/mm2 Each 0.7mm winding leads to S * J = 0.384 * 5 = 1.9 (A) So we need 38 turns of 0.7mm winding for the primary coil

• Number of secondary winding is calculated as the formula (3.10):

Ns = Npri * (Vo + Vd) * (1 - Dmax) / (V1 * Dmax)

= 38 * (5 + 0.8) * (1 - 0.45) / (220 * 0.45) = 1.2 (winding) (3.10) Where:

Vo = output voltage

Vd = voltage drop of the secondary rectifier diode

• The maximum peak current through Transistor Q2 is calculated as the formula (3.11):

I trans = (Dmax * V1) / (f * Lpri) = 5.67 (A) (3.11) Where:

Dmax = maximum duty cycle when flyback circuit is in interrupt mode

V1 = AC input voltage

f = switching frequency

Lpri = primary inductance

• Transistor Q2 working mode saturation in pulse generating circuit is calculated as the formula (3.12):

Ib = Ic / β

Ic = (V2 - Vcesat)/ Zlpri (3.12) Zlpri = 2π * f * Lpri = 995 (Ω)

Rb = ( V2 - Vbe )/Ib Where:

Trang 26

V2 = DC rectified voltage

β = BJT's current amplification coefficient

Vcesat = Vce saturation of transistor Q2

Vbe = threshold voltage Vbe of transistor Q2 (~ 0.7V)

Ib = bias current pin B of transistor Q2

Zlpri = secondary winding impedance when operating at frequency f = 300kHz Lpri = primary inductance

• Resistor values in the voltage divider bridge for TL431 and PC817 in the feedback circuit is calculated as the formula (3.13):

Vo = Vref *(1 + R9 / (R8 + RV1)) (3.13)

5 = 2.5 * (1 + R9/ (R8 + RV1))

→ R9 = R8 + RV1 Where:

Vref = Reference voltage of TL431

Input filter and rectifier circuit

The 220AC voltage passes through a fuse F1 and a varistor VR1 that protects overcurrent and overvoltage for the subsequent circuit Then, the power is passed through a high-frequency noise filter circuit consisting of capacitor CX1 and inductor LF1 to eliminate the high-frequency noise then rectified through the diode bridge to convert into DC voltage After the diode bridge, DC voltage is passed through a NTC resistor to prevent the charge current from rising suddenly causing shortening of life

or even failure of capacitor C1 The DC voltage is flattened by primary filter capacitors C1 The primary power filter capacitor is responsible for storing DC energy for the primary winding of the switching transformer T1 Based on the calculated voltage values, suitable components to use for input filter and rectifier circuit are listed in Table 3.2 Figure 3.4 demonstrates a schematic of noise filter and voltage rectifier circuit

Trang 27

Table 3 2 Electronic component of the input filter and rectifier circuit

Figure 3 4 Schematic of noise filter and primary voltage rectifier circuit

Pulse generating circuit

The 310 DC voltage is passed through the priming resistor R5 and the switching transformer T1 then supplies the power to the pulse generating circuit composed of

Trang 28

two main components: transistor Q1 and Q2 The most important feature of the flyback power circuit is the primary and secondary 2-coil polarity If the output intends to make a positive voltage, the two windings' polarity must be opposite Conversely, if the output intends to make a negative voltage, you're going the two windings' polarity must be in the same direction Based on the calculated values, suitable components to use for pulse generating circuit are listed in Table 3.3 The pulse generating circuit is shown in Figure 3.5

Table 3 3 Electronic component of pulse generating circuit

Trang 29

Figure 3 5 Schematic of pulse generator circuit

Secondary voltage rectifier circuits

When transistor Q2 works in open/ close mode to generate a variable primary field on the primary side of switching transformer T1, voltage induced on the secondary side is generated The induced voltage of the secondary will be rectified to

DC voltage by the Schottky diode D3 and flattened by two filter capacitors C7 and C8 to produce the output 5V power Suitable components to use for secondary voltage rectifier circuit are listed in Table 3.4 Figure 3.6 demonstrates a schematic of secondary voltage rectifier circuits

Trang 30

Table 3 4 Electronic component of secondary voltage rectifier circuit

No

1 D3 Diode MBR10100 1 10A; 100V Diode

Schottky

2 C7; C8 Capacitor 2 1000uF; 10V Electrolytic

capacitor

3 J2; J3 Male header 2 pin 2 - -

Figure 3 6 Schematic of secondary voltage rectifier circuit

Trang 31

Secondary voltage feedback circuits

The secondary output voltage will be connected to the sampling circuit and the fault voltage detection circuit composed of two main components are optocoupler U1 and voltage regulator U2 to control the operation of the pulse generator So that the output voltage is always stable Based on the calculated values, suitable components

to use for secondary voltage feedback circuits are listed in Table 3.5 Figure 3.7 demonstrates a schematic of secondary voltage feedback circuits

Table 3 5 Electronic component of secondary voltage feedback circuits

Figure 3 7 Schematic of secondary voltage feedback circuit

Trang 32

Combining above circuits, we have a complete switching power circuit with input voltage of 220VAC, output voltage of 5VDC with functions of overcurrent and overvoltage protection, filter noise, stabilize the output voltage and completely isolate the secondary output voltage from the primary high voltage for improved safety Figure 3.8 shows a schematic of switching power circuits

Figure 3 8 Schematic of switching power supply circuit

3.2.6 Case designs for the Gel Card Reader

To increase the reliability of the device and ensure the device's image capturing process is stable, we designed the model on Solidworks and used 3D printing technology to fabricate our divide The design contains three different parts:

Trang 33

- The base holder

- The device case

a) Base holder

The primary purpose of this base holder is to fix the Gel Card tray holder, camera holder, and the back cover of the device Besides, we designed a space under two holders that is enough for the power circuit, raspberry pi, led lights and connection cables On the back cover, we create some holes for the cooling fan, power switch, power cord and Raspberry Pi's connectors such as USB, LAN, HDMI, Micro 3.5mm ports Figure 3.9 describes the shape of the base holder

Figure 3 9 Frontside (a) and backside (b) of the base holder

b) Device case

Next, we designed the case for the device to protect the internal components and most importantly it creates the right lighting environment inside so that the image capturing unit can operate stably, This makes the resulting image quality consistent

in all cases On the top of the case, we have created a well-shaped hole for Gel Card easy insertion and removal Figure 3.10 describes the shape of the device case

Trang 34

Figure 3 10 The frontside (a) and backside (b) of the Gel Card Reader case

3.3 DEVICE CONNECTION

The design calculation is an indispensable job when doing any topic, it is this work that will largely determine the results of the topic All equipment, components need to be carefully selected to bring good results for the topic Therefore, it is necessary to have a detailed description of the connection of the entire system as shown in Figure 3.11

Figure 3 11 The connection of the entire project Interpret connection diagrams

Trang 35

Raspberry Pi 4B is powered by a 5V 5A power supply via USB Type C port The power circuit also provides power for USB LEDs, a heatsink fan D1O1 Hoco Webcam is connected to Raspberry via a USB 3.0 port The computer monitor is connected to the Raspberry by the Micro HDMI port through a Micro HDMI - VGA converter cable Peripherals such as the mouse and keyboard are connected to the Raspberry through the USB port

3.4 FLOWCHART AND PROGRAM ALGORITHM

3.4.1 Functional summary of Gel Card Reader

To proceed with the construction of flowcharts and programming, it is necessary

to summarize the Gel Card Reader's functions Project “Designing a Gel Card Reader for blood grouping tests.” perform the following procedures:

 Gel Card Reader function: For the Gel Card Reader function, the system can read two Gel Card types: Forward and Forward Reverse For example, the user wants to read the Card Forward type, select the Forward Grouping item on the user interface, then put the Card in the holder on the Gel Card Reader and press the View Result button The results will display on the interface, including the agglutination level in each microtube, the results of both samples (for the Forward Card), and the final result (forward and Reverse Card)

 Defective Gel Card detection function: This function is used to check the Gel Card's quality when testing through the Ctrl column on the Gel Card When detecting a faulty card, the interface will report on the result box

 The function of entering and managing patient information: After the test is completed, the user can enter patient details to store, including: Full name, ID, date of birth, gender, measurement results OK All will be saved to the Program Database

3.4.2 Flowchart

Trang 36

Figure 3 12 Flowchart of Gel Card Reader system

Flowchart explanation:

Figure 3.12 depicts the control process of the Gel Card Reader system Based

on the above flowchart, we can see that after booting the system start the program, the image of the Gel Card is captured by the camera and transferred to the Raspberry

Pi 4B, then through the pre-processing steps, the image will be obtained Aggregation image, based on the height of the column of condensation, the algorithm will infer the results and display it on the user interface

3.4.3 A flowchart of agglutination level and blood type

Trang 37

Figure 3 13 A flowchart of agglutination level and blood type

a) Image pre-processing

The process included cropping the image, convert RGB image to HSV Determining red threshold in HSV to get only red color then convert the red area to gray Use threshold to convert gray area to binary After that, dilate binary area with

a kernel 5x5 then compute the midpoint of the dilated image area Based on the vertical axis coordinates of the midpoint, we determine the agglutinate level of the gel column This process is divided into 4 steps

Step 1: Image cutting

The image obtained from the camera will be cut into 8 images containing Gel Card, each with a size of 255x75 pixels We use Paint software on Windows to detect the coordinates of the image that need to be cut Figure 3.14 shows the area to be cut

in each micro tube

Trang 38

Figure 3 14 Image area is cropped in Gel Card (red border)

roi1 = img1[274:274+255,423:423+75]

roi2 = img1[274:274+255,583:653]

roi3 = img1[274:274+255,708:708+75]

roi4 = img1[274:274+255,855:855+75] (4.1) roi5 = img1[274:274+255,1002:1002+75]

roi6 = img1[274:274+255,1145:1145+75]

roi7 = img1[274:274+255,1289:1289+75]

roi8 = img1[274:274+255,1427:1427+75]

Figure 3 15 The result after image cutting in Gel Card Reader

Step 2: Convert RGB to HSV image

The resulting image is usually an image with standard RGB space, but the RGB color space is not suitable for color recognition To overcome the above, we use a HSV space (Hue, Saturation and Value), this color space obtained from RGB space The function converts RGB images to HSV using the OpenCV library in the Python programming language:

hsv1 = cv2.cvtColor(roi1, cv2.COLOR_BGR2HSV)

Trang 39

Note:

hsv1: HSV image after convert from RGB image

roi1: RGB image

Figure 3 16 RGB to HSV diagram

Figure 3 17 Results after converted image from RGB to HSV

Step 3: Color threshold classification

Based on the collection of data samples from many Gel Cards with the degree

of agglutination In reality, we classified the Hue, Saturation, and Value values of the agglutination region These values are used to demarcate defined thresholds and filter out red areas for further processing

Figure 3 18 The selectable color threshold for filtering

Trang 40

After you have demarcated and filtered the area of the color you want to define, the next step is to convert the color to the grayscale image using the threshold method

to convert the gray image to a binary image

G(x,y) = {1; 𝑓(𝑥, 𝑦) ≥ 𝑇

The function converts a gray image to a binary image using the threshold method:

gray1 = cv2.cvtColor(output1, cv2.COLOR_RGB2GRAY)

ret, threshold1 = cv2.threshold(gray1, 10, 255, 0)

Note:

output1: The Image after processed with red filter

For a grayscale image with a gray level from 0 to 255, we use threshold method, select a threshold (T = 10), with a pixel has a gray level below 10 will have value of

1, pixel has a gray level higher than 10 will be worth 0

Figure 3 19 Image after processed with threshold

Step 4: Find the midpoint of the binary image area

The cv2.findContour function is used to find the border of the image area to be determined Figure 3.20 is an example of the cv2.findContour function, after the microtube image has been processed, we proceed to find the border of the white binary image area and draw the border

Ngày đăng: 01/11/2022, 12:49

Nguồn tham khảo

Tài liệu tham khảo Loại Chi tiết
[1] Salama Yusuf, “How Were Blood Types Discovered ?”, scienceabc.com, access on 26/10/2020 Sách, tạp chí
Tiêu đề: How Were Blood Types Discovered
[2] Dr Jadhad M. V. “Gel tech”, slideshare.net , Apr 18, 2017 Sách, tạp chí
Tiêu đề: “Gel tech”
[3] Nguyễn Hiền Minh, Phan Thanh Phong, “ỨNG DỤNG XỬ LÝ ẢNH TRONG HỆ THỐNG PHÂN LOẠI SẢN PHẨM”, Graduation thesis in HCMUTE, 6/2019 Sách, tạp chí
Tiêu đề: “ỨNG DỤNG XỬ LÝ ẢNH TRONG HỆ THỐNG PHÂN LOẠI SẢN PHẨM”
[4] Võ Danh Quân, Nguyễn Minh Hảo, “ĐẾM SỐ LƯỢNG VIÊN THUỐC CÓ TRONG VỈ THUỐC”, Graduation thesis in HCMUTE, 12/2019 Sách, tạp chí
Tiêu đề: “ĐẾM SỐ LƯỢNG VIÊN THUỐC CÓ TRONG VỈ THUỐC”
[5] Thiago Carvalho, “Edges and Contours Basics with OpenCV”, pyimagesearch.com , Jul 20, 2020 Sách, tạp chí
Tiêu đề: “Edges and Contours Basics with OpenCV”
[6] Nguyen Thanh Huy, “ỨNG DỤNG PHƯƠNG PHÁP PHÁT HIỆN BIÊN TRONG NHẬN DẠNG CÁC ĐỐI TƯỢNG HÌNH HỌC”, Master thesis in Universiy of Da Nang, 2018 Sách, tạp chí
Tiêu đề: “ỨNG DỤNG PHƯƠNG PHÁP PHÁT HIỆN BIÊN TRONG NHẬN DẠNG CÁC ĐỐI TƯỢNG HÌNH HỌC”
[7] Nguyen Phuc Bao, Nguyen Le Gia Bach , “DESIGN OF AN ACQUISITION IMAGE SYSTEM FOR THE DETECTION OF OCCLUSAL DENTAL PROBLEMS”, Graduation thesis in HCMUTE, 8/2020 Sách, tạp chí
Tiêu đề: “DESIGN OF AN ACQUISITION IMAGE SYSTEM FOR THE DETECTION OF OCCLUSAL DENTAL PROBLEMS”
[8] Lê Hoàng Thành, Hồ Đình Vương, “THIẾT KẾ VÀ THI CÔNG HỆ THỐNG BẢO MẬT ỨNG DỤNG XỬ LÝ ẢNH”, Graduation thesis in HCMUTE, 7/2019 Sách, tạp chí
Tiêu đề: “THIẾT KẾ VÀ THI CÔNG HỆ THỐNG BẢO MẬT ỨNG DỤNG XỬ LÝ ẢNH”
[9] Apogeeweb, “Switching Power Supply Circuit Diagram with Explanation”, apogeeweb.net, 13 Jul 2019 Sách, tạp chí
Tiêu đề: Switching Power Supply Circuit Diagram with Explanation

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

🧩 Sản phẩm bạn có thể quan tâm

w