+ Post New Thread
Results 1 to 14 of 14
  1. #1
    Advanced Member level 2
    Points: 3,257, Level: 13
    baileychic's Avatar
    Join Date
    Aug 2017
    Posts
    646
    Helped
    50 / 50
    Points
    3,257
    Level
    13

    Invasive blood pressure monitoring. How to?

    Invasive blood pressure monitoring. How to?

    My previous BPM related thread here

    https://www.edaboard.com/showthread....ucer-to-PIC18F

    got all messed up with wrong information provided by Client.

    She was telling that she was using a hand pump and a Syringe method.

    So, now I have opened this new thread. Please do not merge this thread with above one.

    I have attached the datasheets of the BP Transducer (BP Sensor), BP AMP and BP STIMULATOR used in the lab.

    The excitation voltage used for the sensor is 5V DC.

    Operating range: –50 to +300 mmHg
    Excitation voltage: 2 to 10 V DC
    Sensitivity (full range): 5 µV/V/mmHg

    5uV * 5 = 25uV for 5V and it is equal to 1 mmHg?

    If yes, then range is -50 to 300 mmHg = 350

    So, 25uV * 350 = 8750 uV = 8.75mV?


    But the client is already using the above BP AMP apparatus to get 0 to 2.5V for 0 to 250 mmHg pressure.

    I found these two articles related to IBPM.

    I can use a PIC16F or Atmega2560.

    So, how should I design the ADC interface circuit and what additional circuits are needed to get the sensor reading and in the coding part how to find the below.

    1. MAP (Mean Arterial Pressure
    2. SBP (Systolic Blood Pressure)
    3. DBP (Distolic Blood Pressure)

    ?

    What I have top do is,

    Find MAP, SBP and DBP and then if MAP is less than 60 mmHg then I have to run the Stimulator (Not BP Stimulas lab device but DAC and OPAMP based Stimulator).

  2. #2
    Super Moderator
    Points: 261,889, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    45,769
    Helped
    13912 / 13912
    Points
    261,889
    Level
    100

    Re: Invasive blood pressure monitoring. How to?

    I don't particularly like the idea of starting a new thread with all the documents that have been already posted in the previous thread. I wonder if the confusion about the experiment setup shall start anew?

    Reviewing the previous thread, I see that it was basically on topic before you brought in the TI application note in post #18, describing a standard (non-invasive) BP monitor, neither considering the differences nor commons of both methods. I foresee future failure of your project due to not understanding the experiment purpose and implementation details.

    But the thread is discussing analog circuits and microcontroller hard- and software and in so far instructive to others, don't want to hinder it.


    1 members found this post helpful.

  3. #3
    Advanced Member level 2
    Points: 3,257, Level: 13
    baileychic's Avatar
    Join Date
    Aug 2017
    Posts
    646
    Helped
    50 / 50
    Points
    3,257
    Level
    13

    Re: Invasive blood pressure monitoring. How to?

    @FvM

    Okay, So, now how should I interface the BP AMP output which gives 0 to 2.5V = 0 to 250 mmHg pressure to PIC16F or ATmega2560 ADC input?
    Do I need any other additional circuit? If yes, what?
    What should be the coding method for the new Intrusive method of continuous blood pressure monitoring?

    I need to do it with PIC16F or AVR 8-bit microcontroller.

    MAP is the average value of one pressure wave. Is it true? If yes,

    If it is assumed that pulse rate is 1 Hz so, I get 1 wave in 1 sec?

    If yes, then if I take 500 samples in 1 second using ADC in a loop adding current value to previous and after loop dividing the result by 500 will I get MAP value?

    If I have MAP then how to find out SBP and DBP values?
    Last edited by baileychic; 12th June 2019 at 14:01.



    •   AltAdvertisement

        
       

  4. #4
    Advanced Member level 2
    Points: 3,257, Level: 13
    baileychic's Avatar
    Join Date
    Aug 2017
    Posts
    646
    Helped
    50 / 50
    Points
    3,257
    Level
    13

    Re: Invasive blood pressure monitoring. How to?

    If this is the Pressure wave then how to read and find out SBP and DBP?


    Click image for larger version. 

Name:	110830428_cnap-co-pulsewave-analysis.png 
Views:	2 
Size:	67.4 KB 
ID:	153659

    http://pixhost.to/show/140/110830428...e-analysis.png
    Last edited by BradtheRad; 12th June 2019 at 23:16. Reason: Converted image link to attachment



  5. #5
    Super Moderator
    Points: 261,889, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    45,769
    Helped
    13912 / 13912
    Points
    261,889
    Level
    100

    Re: Invasive blood pressure monitoring. How to?

    How can you read DBP if the wave is cut before reaching the minimum?



  6. #6
    Advanced Member level 2
    Points: 3,257, Level: 13
    baileychic's Avatar
    Join Date
    Aug 2017
    Posts
    646
    Helped
    50 / 50
    Points
    3,257
    Level
    13

    Re: Invasive blood pressure monitoring. How to?

    Then what is the easiest method to get SBP, DBP, and MAP?

    How can wave cut before reaching the minimum? What reasons for it?

    Edit:

    Should I take say 500 to 1000 samples in 1 second and then parse the data and find out SBP and DBP values and then find out MAP from the formula

    MAP = (1 / 3) * SBP + (2 / 3) * DBP

    Right now, I am taking 500 samples in 1 second and then finding max value in it as SBP. Is this correct?
    The min value in the sample will give the DBP?

    - - - Updated - - -

    This is my current code. I am taking 500 samples in ADC Interrupt with Timer3 to set GO_DONE_bit. Timer3 interrupt period is for 2 ms. 500 samples are taken in a second and then processed.

    Code C - [expand]
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    
    if(displayBpReading) {
                LATD5_bit = 1;
                
                bpMonitor.adc.sbp = 0;
                bpMonitor.adc.dbp = 1024;
                for(bpMonitor.adc.adcSampleCount = 0; bpMonitor.adc.adcSampleCount < 500; bpMonitor.adc.adcSampleCount++) {
                    if(bpMonitor.adc.sbp < bpMonitor.adc.samples[bpMonitor.adc.adcSampleCount]) {
                         bpMonitor.adc.sbp = bpMonitor.adc.samples[bpMonitor.adc.adcSampleCount];
                    }
                    
                    if(bpMonitor.adc.dbp > bpMonitor.adc.samples[bpMonitor.adc.adcSampleCount]) {
                         bpMonitor.adc.dbp = bpMonitor.adc.samples[bpMonitor.adc.adcSampleCount];
                    }
                }
                
                bpMonitor.adc.map = (unsigned int)(((0.333333 * (double)bpMonitor.adc.sbp) + (0.67 * (double)bpMonitor.adc.dbp)) * 0.244379);
                memset(bpMonitor.adc.samples, 0, sizeof(bpMonitor.adc.samples));
                bpMonitor.adc.adcSampleCount = 0;
                
                if(bpMonitor.adc.map <= 60) {
                   enableStimulator = 1;
                }
                else {
                   enableStimulator = 0;
                }
     
                DAC2REFH = bpMonitor.adc.map >> 8;
                DAC2REFL = bpMonitor.adc.map;
                DAC2LD_bit = 1;
     
                displayReading();
                displayBpReading = 0;
                TMR3ON_bit = 1;
            }
    Last edited by baileychic; 12th June 2019 at 19:09.



    •   AltAdvertisement

        
       

  7. #7
    Advanced Member level 2
    Points: 3,257, Level: 13
    baileychic's Avatar
    Join Date
    Aug 2017
    Posts
    646
    Helped
    50 / 50
    Points
    3,257
    Level
    13

    Re: Invasive blood pressure monitoring. How to?

    I changed the code and used ADC interrupt to read sensor data continuously to get SBP and DBP but they are not working as required. How to get the correct SBP and DBP readings?

    MAP = (1/3)SBP + (2/3)DBP

    Here is the latest code.

    Code C - [expand]
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    
    typedef struct {
        unsigned long rawAdcValue;
        double bpTransducerOutputVoltage;
        unsigned int sbp;
        unsigned int dbp;
        unsigned int map;
    }ADC_TYPE;
     
    if((ADIE_bit) && (ADIF_bit)) {
            static unsigned int adc_max = 0;
            static unsigned int adc_min = 1024;
            unsigned int adc_raw;
            static char state = 0;
            
            ADIF_bit = 0;
            LATD6_bit = ~LATD6_bit;
     
            bpMonitor.adc.rawAdcValue = adc_raw = ((unsigned int)(ADRESH << 8) + ADRESL);
     
            if((adc_min > adc_raw) && (state == 0)) {
                adc_min = adc_raw;
            }
            else if((adc_max < adc_raw) && (state < 2)) {
                adc_max = adc_raw;
                state = 1;
            }
            else if((adc_raw < adc_max) && (state == 1)) {
                bpMonitor.adc.sbp = adc_max;
                bpMonitor.adc.dbp = adc_min;
                adc_max = 0;
                adc_min = 1024;
                state = 0;
                displayBpReading = 1;
            }
            
            GO_DONE_bit = 1;        
    }


    Code:
    bpMonitor.adc.map = (unsigned int)(((0.333333 * (double)bpMonitor.adc.sbp) + (0.67 * (double)bpMonitor.adc.dbp)) * 0.244379);



  8. #8
    Advanced Member level 2
    Points: 3,257, Level: 13
    baileychic's Avatar
    Join Date
    Aug 2017
    Posts
    646
    Helped
    50 / 50
    Points
    3,257
    Level
    13

    Re: Invasive blood pressure monitoring. How to?

    Got correct SBP, DBP, and MAP. I messed up the variables inside ADC ISR but got it working. MAP signal in simulation is also okay. I used 1 Hz half sine wave (+ve) to test in Proteus.

    Have to get it tested on actual hardware by the client. Will do that tonight.

    See this video file.

    https://mega.nz/#!6cJgEQhC!Myv5U5DEp...9Y4O0e9S5VCIWc

    I will clean up the code and get the code tested on hardware by client and then I will post the code here.

    - - - Updated - - -

    The code will be tested tonight.

    Here I attach a program which I made using VC#.Net to find MAP from SBP and DBP.

    Another video of Proteus simulation.

    Please check them and tell me if the values are correct according to the half sine wave signal.

    https://mega.nz/#!2JIQxQhC!d-N0Aylgi...f3BaOjZGwIVVcQ

    - - - Updated - - -

    Edit 2:

    It works fine for 0.8 Hz to 2 Hz half-sine wave signals.

    Use 1.1 test file.

    Will post the code once it is tested on hardware.
    Last edited by baileychic; 13th June 2019 at 11:21.



  9. #9
    Advanced Member level 2
    Points: 3,257, Level: 13
    baileychic's Avatar
    Join Date
    Aug 2017
    Posts
    646
    Helped
    50 / 50
    Points
    3,257
    Level
    13

    Re: Invasive blood pressure monitoring. How to?

    It was a lot of work to get the SBP, DBP and MAP readings on LCD and also the MAP signal on DAC. Finally the project is finished.
    The subject was actually a rat.

    After the student provided the actual rat heart pressure pulse signal data file with help from my friend I got it ported to Proteus File Generator data file and made the code. All is working fine now.
    Have to get the student do one final testing on hardware.

    I will post the complete project once the student gets the grades for the project after project submission.

    Actual project is done with PIC16F1779 but as Proteus doesn't have that model I have used PIC18F45K22 to do the simulation.

    Here is the simulation file.



    •   AltAdvertisement

        
       

  10. #10
    Advanced Member level 2
    Points: 3,257, Level: 13
    baileychic's Avatar
    Join Date
    Aug 2017
    Posts
    646
    Helped
    50 / 50
    Points
    3,257
    Level
    13

    Re: Invasive blood pressure monitoring. How to?

    Just an update for the thread. Adding a simulation screenshot showing the signals on the graph.

    Edit:

    I need to post an image and forum is not showing the image after it is uploaded in file upload tool. Can admin fix it so that I can post an image related to the simulation? I am trying since 30 minutes to upload the file.



  11. #11
    Super Moderator
    Points: 53,205, Level: 56

    Join Date
    Apr 2011
    Location
    Minneapolis, Minnesota, USA
    Posts
    13,008
    Helped
    2587 / 2587
    Points
    53,205
    Level
    56

    Re: Invasive blood pressure monitoring. How to?

    Nowadays the 'Insert Image' icon seems to be the reliable method.

    Click image for larger version. 

Name:	Insert image icon Edaboard.png 
Views:	20 
Size:	5.6 KB 
ID:	153743

    Once your image uploads successfully, submit your message within a minute or two, lest it expire unused.



  12. #12
    Advanced Member level 2
    Points: 3,257, Level: 13
    baileychic's Avatar
    Join Date
    Aug 2017
    Posts
    646
    Helped
    50 / 50
    Points
    3,257
    Level
    13

    Re: Invasive blood pressure monitoring. How to?

    Quote Originally Posted by BradtheRad View Post
    Nowadays the 'Insert Image' icon seems to be the reliable method.

    Once your image uploads successfully, submit your message within a minute or two, lest it expire unused.
    Okay, thank you. Will do it.

    Just an update for the thread. Adding a simulation screenshot showing the signals on the graph.

    Edit:

    Also tried that (Inserting Image) but after uploading the < 900 KB .PNG file the link doesn't coming.



  13. #13
    Super Moderator
    Points: 53,205, Level: 56

    Join Date
    Apr 2011
    Location
    Minneapolis, Minnesota, USA
    Posts
    13,008
    Helped
    2587 / 2587
    Points
    53,205
    Level
    56

    Re: Invasive blood pressure monitoring. How to?

    Files less than 500kB are more likely to get through the upload routine. This is not a rigid rule but a glitch during upload could cause the system interface to cancel.

    Further things to try:
    Reduce size of your file by reducing its pixel dimensions.

    Reduce size of your file by changing it to a jpg, using the option which selects lower image quality.



  14. #14
    Advanced Member level 2
    Points: 3,257, Level: 13
    baileychic's Avatar
    Join Date
    Aug 2017
    Posts
    646
    Helped
    50 / 50
    Points
    3,257
    Level
    13

    Re: Invasive blood pressure monitoring. How to?

    Just an update for the thread. Adding a simulation screenshot showing the signals on the graph.



    I tried again but when I save .png file as .jpg file the file size inclreased from 834 KB to 3.x MB. So, I gave up uploading the file.

    I have used external image hosting to show the image here.




--[[ ]]--