Close

6. Inflation of the Cuff

A project log for Digital Blood Pressure Monitor

Application For Detecting Blood Pressure Using Korotkoff Sounds

guillermo-perez-guillenGuillermo Perez Guillen 05/29/2023 at 06:290 Comments

Aneroid gauge

Aneroid gauge

Flowchart

Flowchart

if STM32.User_Button.Has_Been_Pressed then -- Btn pressed then go to 170 mmHg
         Start_Conversion (Converter);
         Poll_For_Status (Converter, Regular_Channel_Conversion_Complete, Successful);
         Solenoid_valve.Set;   -- solenoid valve is ON
         Motor.Set;   -- air pump is ON
         Enable_a.Set;
         Enable_b.Set;
         Raw := UInt32 (Conversion_Value (Converter));
         Volts := UInt32  ((Float (Raw) / 4096.0) * 3000.0);   -- 4096 ADC = 3000 mV
         Pressure := UInt32 ((Float (Volts) / 3000.0) * 255.0);   -- 3000 mV = 255 mmHg
         Pressure_total := UInt32 (float (Pressure) - 8.0);   -- 3000 mV = 255 mmHg
         Print (0, 0, Pressure_total, " mmHg"); -- print blood pressure

         while Pressure_total <= 170 loop
            Start_Conversion (Converter);
            Poll_For_Status (Converter, Regular_Channel_Conversion_Complete, Successful);
            Raw := UInt32 (Conversion_Value (Converter));
            Volts := UInt32  ((Float (Raw) / 4096.0) * 3000.0);   -- 4096 ADC = 3000 mV
            Pressure := UInt32 ((Float (Volts) / 3000.0) * 255.0);   -- 3000 mV = 255 mmHg
            Pressure_total := UInt32 (float (Pressure) - 8.0);   -- 3000 mV = 255 mmHg
            Print (0, 0, Pressure_total, " mmHg"); -- print blood pressure
            delay until Clock + Milliseconds (75); 
         end loop;

         Solenoid_valve.Set;   -- solenoid valve is ON
         Motor.Clear;   -- air pump is OFF
         Enable_a.Set;
         Enable_b.Clear;

Discussions