Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Invasive blood pressure monitoring. How to?

baileychic

Advanced Member level 3
Joined
Aug 2, 2017
Messages
728
Helped
54
Reputation
108
Reaction score
54
Trophy points
28
Activity points
7,033
Invasive blood pressure monitoring. How to?

My previous BPM related thread here

https://www.edaboard.com/showthread.php?383839-How-to-interface-BP-Transducer-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).
 

Attachments


FvM

Super Moderator
Joined
Jan 22, 2008
Messages
46,597
Helped
13824
Reputation
27,896
Reaction score
12,495
Trophy points
1,393
Location
Bochum, Germany
Activity points
272,144
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.
 

baileychic

Advanced Member level 3
Joined
Aug 2, 2017
Messages
728
Helped
54
Reputation
108
Reaction score
54
Trophy points
28
Activity points
7,033
@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:

baileychic

Advanced Member level 3
Joined
Aug 2, 2017
Messages
728
Helped
54
Reputation
108
Reaction score
54
Trophy points
28
Activity points
7,033
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:

baileychic

Advanced Member level 3
Joined
Aug 2, 2017
Messages
728
Helped
54
Reputation
108
Reaction score
54
Trophy points
28
Activity points
7,033
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);
 

baileychic

Advanced Member level 3
Joined
Aug 2, 2017
Messages
728
Helped
54
Reputation
108
Reaction score
54
Trophy points
28
Activity points
7,033
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!Myv5U5DEp8b4rWNRQiMPM_Rsuh4T39Y4O0e9S5VCIWc

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-N0AylgibYijHm0pMFiB87l9ZqCNf3BaOjZGwIVVcQ

- - - 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.
 

Attachments

Last edited:

baileychic

Advanced Member level 3
Joined
Aug 2, 2017
Messages
728
Helped
54
Reputation
108
Reaction score
54
Trophy points
28
Activity points
7,033
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.
 

Attachments


baileychic

Advanced Member level 3
Joined
Aug 2, 2017
Messages
728
Helped
54
Reputation
108
Reaction score
54
Trophy points
28
Activity points
7,033
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.
 

BradtheRad

Super Moderator
Joined
Apr 1, 2011
Messages
13,362
Helped
2640
Reputation
5,274
Reaction score
2,545
Trophy points
1,393
Location
Minneapolis, Minnesota, USA
Activity points
99,975
Nowadays the 'Insert Image' icon seems to be the reliable method.

Insert image icon Edaboard.png

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

baileychic

Advanced Member level 3
Joined
Aug 2, 2017
Messages
728
Helped
54
Reputation
108
Reaction score
54
Trophy points
28
Activity points
7,033
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.
 

BradtheRad

Super Moderator
Joined
Apr 1, 2011
Messages
13,362
Helped
2640
Reputation
5,274
Reaction score
2,545
Trophy points
1,393
Location
Minneapolis, Minnesota, USA
Activity points
99,975
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.
 

baileychic

Advanced Member level 3
Joined
Aug 2, 2017
Messages
728
Helped
54
Reputation
108
Reaction score
54
Trophy points
28
Activity points
7,033
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.

 

Toggle Sidebar

Welcome to EDABoard.com

Sponsor

Sponsor

Design Fast


X
Top